From owner-svn-src-all@freebsd.org Sun Sep 6 03:07:15 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F39693DE7FA; Sun, 6 Sep 2020 03:07:15 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BkbtW53MYz4MH9; Sun, 6 Sep 2020 03:07:15 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-274.local (unknown [IPv6:2601:648:8681:1cb0:7877:c3fe:a816:7afd]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 1AB622A58E; Sun, 6 Sep 2020 03:07:15 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r365371 - in head: . contrib/jemalloc contrib/jemalloc/doc lib/libc/stdlib/jemalloc share/man/man5 share/mk tools/build/options To: Dimitry Andric , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202009052330.085NUIwH085545@repo.freebsd.org> From: John Baldwin Autocrypt: addr=jhb@FreeBSD.org; keydata= mQGiBETQ+XcRBADMFybiq69u+fJRy/0wzqTNS8jFfWaBTs5/OfcV7wWezVmf9sgwn8TW0Dk0 c9MBl0pz+H01dA2ZSGZ5fXlmFIsee1WEzqeJzpiwd/pejPgSzXB9ijbLHZ2/E0jhGBcVy5Yo /Tw5+U/+laeYKu2xb0XPvM0zMNls1ah5OnP9a6Ql6wCgupaoMySb7DXm2LHD1Z9jTsHcAQMD /1jzh2BoHriy/Q2s4KzzjVp/mQO5DSm2z14BvbQRcXU48oAosHA1u3Wrov6LfPY+0U1tG47X 1BGfnQH+rNAaH0livoSBQ0IPI/8WfIW7ub4qV6HYwWKVqkDkqwcpmGNDbz3gfaDht6nsie5Z pcuCcul4M9CW7Md6zzyvktjnbz61BADGDCopfZC4of0Z3Ka0u8Wik6UJOuqShBt1WcFS8ya1 oB4rc4tXfSHyMF63aPUBMxHR5DXeH+EO2edoSwViDMqWk1jTnYza51rbGY+pebLQOVOxAY7k do5Ordl3wklBPMVEPWoZ61SdbcjhHVwaC5zfiskcxj5wwXd2E9qYlBqRg7QeSm9obiBCYWxk d2luIDxqaGJARnJlZUJTRC5vcmc+iGAEExECACAFAkTQ+awCGwMGCwkIBwMCBBUCCAMEFgID AQIeAQIXgAAKCRBy3lIGd+N/BI6RAJ9S97fvbME+3hxzE3JUyUZ6vTewDACdE1stFuSfqMvM jomvZdYxIYyTUpC5Ag0ERND5ghAIAPwsO0B7BL+bz8sLlLoQktGxXwXQfS5cInvL17Dsgnr3 1AKa94j9EnXQyPEj7u0d+LmEe6CGEGDh1OcGFTMVrof2ZzkSy4+FkZwMKJpTiqeaShMh+Goj XlwIMDxyADYvBIg3eN5YdFKaPQpfgSqhT+7El7w+wSZZD8pPQuLAnie5iz9C8iKy4/cMSOrH YUK/tO+Nhw8Jjlw94Ik0T80iEhI2t+XBVjwdfjbq3HrJ0ehqdBwukyeJRYKmbn298KOFQVHO EVbHA4rF/37jzaMadK43FgJ0SAhPPF5l4l89z5oPu0b/+5e2inA3b8J3iGZxywjM+Csq1tqz hltEc7Q+E08AAwUIAL+15XH8bPbjNJdVyg2CMl10JNW2wWg2Q6qdljeaRqeR6zFus7EZTwtX sNzs5bP8y51PSUDJbeiy2RNCNKWFMndM22TZnk3GNG45nQd4OwYK0RZVrikalmJY5Q6m7Z16 4yrZgIXFdKj2t8F+x613/SJW1lIr9/bDp4U9tw0V1g3l2dFtD3p3ZrQ3hpoDtoK70ioIAjjH aIXIAcm3FGZFXy503DOA0KaTWwvOVdYCFLm3zWuSOmrX/GsEc7ovasOWwjPn878qVjbUKWwx Q4QkF4OhUV9zPtf9tDSAZ3x7QSwoKbCoRCZ/xbyTUPyQ1VvNy/mYrBcYlzHodsaqUDjHuW+I SQQYEQIACQUCRND5ggIbDAAKCRBy3lIGd+N/BCO8AJ9j1dWVQWxw/YdTbEyrRKOY8YZNwwCf afMAg8QvmOWnHx3wl8WslCaXaE8= Message-ID: <9eb351d4-9bc9-1b9b-5c80-5be2093cd85b@FreeBSD.org> Date: Sat, 5 Sep 2020 20:07:13 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: <202009052330.085NUIwH085545@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 06 Sep 2020 03:07:16 -0000 On 9/5/20 4:30 PM, Dimitry Andric wrote: > Author: dim > Date: Sat Sep 5 23:30:17 2020 > New Revision: 365371 > URL: https://svnweb.freebsd.org/changeset/base/365371 > > Log: > Turn MALLOC_PRODUCTION into a regular src.conf(5) option > > Added: head/tools/build/options/WITHOUT_MALLOC_PRODUCTION > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/tools/build/options/WITHOUT_MALLOC_PRODUCTION Sat Sep 5 23:30:17 2020 (r365371) > @@ -0,0 +1,5 @@ > +.\" $FreeBSD$ > +Set to enable assertions and statistics gathering in > +.Xr malloc 3 . > +It also defaults the A and J runtime options to on. > +Enabled by default on -CURRENT. > > Added: head/tools/build/options/WITH_MALLOC_PRODUCTION > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/tools/build/options/WITH_MALLOC_PRODUCTION Sat Sep 5 23:30:17 2020 (r365371) > @@ -0,0 +1,5 @@ > +.\" $FreeBSD$ > +Set to disable assertions and statistics gathering in > +.Xr malloc 3 . > +It also defaults the A and J runtime options to off. > +Disabled by default on -CURRENT. I think this last sentence doesn't quite read correctly. That is, I read it as saying that "assertions and statistics gathering" is disabled by default on -CURRENT, which isn't correct. It also won't be very meaningful to someone reading src.conf.5 on a stable branch if this is MFC'd (or when it ends up in stable/13). I think it would be best to just leave the last sentence off completely. The result would be that on head src.conf(5) would say: WITH_MALLOC_PRODUCTION Set to disable assertions... And on stable src.conf(5) would say: WITHOUT_MALLOC_PRODUCTION Set to enable assertions... Just as when other defaults change across branches, the current vs stable different is handled by the contents of src.conf.5 on each branch. -- John Baldwin From owner-svn-src-all@freebsd.org Sat Sep 5 19:43:00 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 996733D4247; Sat, 5 Sep 2020 19:43:00 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-io1-f65.google.com (mail-io1-f65.google.com [209.85.166.65]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BkQ1v5cnsz3YF2; Sat, 5 Sep 2020 19:42:59 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-io1-f65.google.com with SMTP id z13so6339395iom.8; Sat, 05 Sep 2020 12:42:59 -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=1fXy94wJ5ENXdnKvw8vW2o4cZCOAnce8XDHOyW5dO4A=; b=oB/qlvoK/oWcXJlBrosmWNRtXc1Kods2tH7ou4RqzckAyH0HdW+HY0zA0LxvsqZMs0 XIJ+6g6BTp/DlF2uygSNBhSE4Mcl8nDAO0X0eYCpFY+y9axXojO3R4LecrG5R16xGSwy eQONJXCfVYuiNEPGwbWXiwgAgttPBk6UyYGhUhhxKSgv/zKgsPV1sAVnilSRm3OjsU+X ej6yDn5hm1zuq6TGVKcI7FRlBdIkhZKDssNw0BS6nnJ6boqkiD5mPs/u6mj/Lk9QqaEn WNuT84iFgzNyVvdMHyOP//OAtVbEz7cAcScjpCph/Q97W7HS3fNO+0YUAxh3Yp+YaBtt St6Q== X-Gm-Message-State: AOAM530H9sohWY02tcoCHkVlL1ggI8FfF/aHK9dun2TOiocKhMnZpj4w qZZkjveFTby7qUg4OsdyiE5hLBz6TvWWSiSrDJEdzdUSx0o= X-Google-Smtp-Source: ABdhPJy3LF0pNN6jo/hudOSMGItCsAaP0sQFeGf4h/3UOg3YLx8X70OZ7iZE44aJObJHz697RbhIqCq+0IogF2hNESM= X-Received: by 2002:a02:605c:: with SMTP id d28mr13045720jaf.12.1599334978498; Sat, 05 Sep 2020 12:42:58 -0700 (PDT) MIME-Version: 1.0 References: <202009012119.081LJERb018106@repo.freebsd.org> <95844C00-D10A-456D-AD29-DF572043074F@fh-muenster.de> <20200902020507.GA38274@FreeBSD.org> <20200902180626.GA88595@FreeBSD.org> <6124a908-25a5-e023-16da-7963ba229b7f@FreeBSD.org> <08636D5E-AA07-4AE7-B5AC-656B08CF564B@fh-muenster.de> <20200903024226.GA54078@FreeBSD.org> <60ea593f-8258-e30d-b897-f162168b44d3@cs.duke.edu> <20200905010510.GA26297@lonesome.com> In-Reply-To: From: Ed Maste Date: Sat, 5 Sep 2020 15:42:46 -0400 Message-ID: Subject: Re: svn commit: r365071 - in head/sys: net net/altq net/route net80211 netgraph netgraph/atm netgraph/atm/ccatm netgraph/atm/sscfu netgraph/atm/sscop netgraph/atm/uni netgraph/bluetooth/common netgraph... To: Kevin Bowling Cc: Warner Losh , Mark Linimon , Andrew Gallatin , Alexey Dokuchaev , Michael Tuexen , Pedro Giffuni , Mateusz Guzik , src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4BkQ1v5cnsz3YF2 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of carpeddiem@gmail.com designates 209.85.166.65 as permitted sender) smtp.mailfrom=carpeddiem@gmail.com X-Spamd-Result: default: False [-2.60 / 15.00]; RCVD_TLS_ALL(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; FREEFALL_USER(0.00)[carpeddiem]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[freebsd.org]; ARC_NA(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; NEURAL_HAM_SHORT(-0.55)[-0.554]; RCPT_COUNT_SEVEN(0.00)[11]; RCVD_IN_DNSWL_NONE(0.00)[209.85.166.65:from]; NEURAL_HAM_MEDIUM(-1.05)[-1.047]; FORGED_SENDER(0.30)[emaste@freebsd.org,carpeddiem@gmail.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.166.65:from]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_COUNT_TWO(0.00)[2]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[emaste@freebsd.org,carpeddiem@gmail.com]; MAILMAN_DEST(0.00)[svn-src-all,svn-src-head] X-Mailman-Approved-At: Sun, 06 Sep 2020 09:05:56 +0000 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 05 Sep 2020 19:43:00 -0000 On Fri, 4 Sep 2020 at 23:11, Kevin Bowling wrote: > > An arbitrary formater may leave a > little bit of annoyance to each person's taste, but that is a tiny > drop in the bucket compared to never having to discuss and especially > correct (which may /seem/ helpful but is pretty offputting to > newcomers). As an experiment I ran clang-format over an arbitrary file (vtfontcvt.c) and put the results in https://reviews.freebsd.org/D26340 Relative to the original file there are a few style(9) items that have been fixed, a few that have been broken, and some that are arguably worse but really indifferent. Fixed: - *_FOREACH now has a space before (, equivalent to for (;;) - header sorting - space between sizeof and ( removed - indentation of an if body - unwrapped function call that fits on one line Broken: - indentation of if / for conditions that span 2 or more lines Indifferent: - lose lined-up struct members or comments - space vs tab after #define - newlines before quoted function arguments - function argument wrapping (see write_glyph_buf) - leading indentation and args-per-line (print_font_info) From owner-svn-src-all@freebsd.org Sat Sep 5 20:41:42 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0EADB3D594C for ; Sat, 5 Sep 2020 20:41:42 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qv1-xf30.google.com (mail-qv1-xf30.google.com [IPv6:2607:f8b0:4864:20::f30]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BkRKd0Yy2z3bxW for ; Sat, 5 Sep 2020 20:41:40 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qv1-xf30.google.com with SMTP id h1so4774539qvo.9 for ; Sat, 05 Sep 2020 13:41:40 -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=JZE92QXsfHSBVgFF0ALH5l3ei1BuZTXSJasdEfdau68=; b=i1ZAmdaN98aNaRLbX9Ap1Sp6px1YbbEJFevq1eSuvFk0CF/5t7SLIs4ObGyNlVkPZz gBleBu+EpqkCGBbUvT44Jt1pO42Dkm7jwdjtYcrqC50rW/fcriynW+Imi6aDa7d95pD4 mutdQom68jZwAEkSYMdzHIYGFWVQ8ktmmounOI7hqRjWfnhX+WVzK0C/SrdzlCy8CejY RHg2zX05K3dvufOLZ5b8uYK+nAeMp221kcrP2/aurxZLfUTHsptBSO0MSeP1jAOVh8/8 iqGCKda8/UZ2qccyAjRcD1guHWEJV8NJ9x0wTX5Z4RmLDza81c5YSA00NsUxF6IhBxP/ 9EWA== 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=JZE92QXsfHSBVgFF0ALH5l3ei1BuZTXSJasdEfdau68=; b=XlAK8OJoxnM89HsQRYiifwfdP0vgpuozGtpfdhMDHtb1a5SjQw3npFd28DeSL0bCSY qwYAQtl+an/BWaIctc2rx0d2h/z41NhNQolwortID6z66RhsedtmxdObqSQ4IWWG5PP4 1vrZWawh5AyNFNCm+zP1l28h/rgBLW2VAdKyzVJgsJbvNifYka4TBuW/yhv/kSGdrRZO jkJMkNWXL5pNsLxke/WT3+9eL6xBKDfnYdSasXGqJhJkY1oyfHAVMjcExa3iRffW5vVR jw5t9L3vgqPHFwtS+TXkG0yfkfM0rSyTc2fEv/7mHYZ+BeAH7zZltCvULmJtY+BL1WCz DKUg== X-Gm-Message-State: AOAM532c6jz+Pe2J3Egms4BHb8mPs60BXCKOs5XL6m0KQrKCtTEaz9tE 109L2sYvsV+NDyybvKyMeRINtVwN2IRYhYaCIjKy1g== X-Google-Smtp-Source: ABdhPJwz25y2ISHnZ7k/T3ZGVdyoNlpqoJXbXV6Pq4BFB5T8clFjAwWGy1mO/NRF2M3A+va6Q24pKW3NnDfmO0jyRqg= X-Received: by 2002:a0c:e602:: with SMTP id z2mr14264021qvm.69.1599338499880; Sat, 05 Sep 2020 13:41:39 -0700 (PDT) MIME-Version: 1.0 References: <202009012119.081LJERb018106@repo.freebsd.org> <95844C00-D10A-456D-AD29-DF572043074F@fh-muenster.de> <20200902020507.GA38274@FreeBSD.org> <20200902180626.GA88595@FreeBSD.org> <6124a908-25a5-e023-16da-7963ba229b7f@FreeBSD.org> <08636D5E-AA07-4AE7-B5AC-656B08CF564B@fh-muenster.de> <20200903024226.GA54078@FreeBSD.org> <60ea593f-8258-e30d-b897-f162168b44d3@cs.duke.edu> <20200905010510.GA26297@lonesome.com> In-Reply-To: From: Warner Losh Date: Sat, 5 Sep 2020 14:41:28 -0600 Message-ID: Subject: Re: svn commit: r365071 - in head/sys: net net/altq net/route net80211 netgraph netgraph/atm netgraph/atm/ccatm netgraph/atm/sscfu netgraph/atm/sscop netgraph/atm/uni netgraph/bluetooth/common netgraph... To: Ed Maste Cc: Kevin Bowling , Mark Linimon , Andrew Gallatin , Alexey Dokuchaev , Michael Tuexen , Pedro Giffuni , Mateusz Guzik , src-committers , svn-src-all , svn-src-head X-Rspamd-Queue-Id: 4BkRKd0Yy2z3bxW X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=bsdimp-com.20150623.gappssmtp.com header.s=20150623 header.b=i1ZAmdaN; dmarc=none; spf=none (mx1.freebsd.org: domain of wlosh@bsdimp.com has no SPF policy when checking 2607:f8b0:4864:20::f30) smtp.mailfrom=wlosh@bsdimp.com X-Spamd-Result: default: False [-2.60 / 15.00]; ARC_NA(0.00)[]; MAILMAN_DEST(0.00)[svn-src-all]; R_DKIM_ALLOW(-0.20)[bsdimp-com.20150623.gappssmtp.com:s=20150623]; NEURAL_HAM_MEDIUM(-1.07)[-1.068]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.01)[-1.007]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-all@freebsd.org]; DMARC_NA(0.00)[bsdimp.com]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[bsdimp-com.20150623.gappssmtp.com:+]; NEURAL_HAM_SHORT(-0.53)[-0.527]; RCPT_COUNT_SEVEN(0.00)[11]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::f30:from]; R_SPF_NA(0.00)[no SPF record]; FORGED_SENDER(0.30)[imp@bsdimp.com,wlosh@bsdimp.com]; MIME_TRACE(0.00)[0:+,1:+,2:~]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] X-Mailman-Approved-At: Sun, 06 Sep 2020 09:06:15 +0000 Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.33 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 05 Sep 2020 20:41:42 -0000 On Sat, Sep 5, 2020 at 1:42 PM Ed Maste wrote: > On Fri, 4 Sep 2020 at 23:11, Kevin Bowling > wrote: > > > > An arbitrary formater may leave a > > little bit of annoyance to each person's taste, but that is a tiny > > drop in the bucket compared to never having to discuss and especially > > correct (which may /seem/ helpful but is pretty offputting to > > newcomers). > > As an experiment I ran clang-format over an arbitrary file > (vtfontcvt.c) and put the results in > https://reviews.freebsd.org/D26340 > > Relative to the original file there are a few style(9) items that have > been fixed, a few that have been broken, and some that are arguably > worse but really indifferent. > > Fixed: > - *_FOREACH now has a space before (, equivalent to for (;;) > Except pretty much everywhere we don't have a space there... > - header sorting > - space between sizeof and ( removed > - indentation of an if body > - unwrapped function call that fits on one line > > Broken: > - indentation of if / for conditions that span 2 or more lines > broke all alignment of variables and comments that were done. broke all err() calls to wrap too much broke purposely outdented code in statistics function extra headers still included. > > Indifferent: > - lose lined-up struct members or comments > This will cause a huge amount of churn, and is a needless change. It makes things harder to read. Though this alignment style has been slowly waining after being popular early on... The comments moving is a bigger problem for the worse. > - space vs tab after #define > - newlines before quoted function arguments > Also a problem since it introduces more verticality. > - function argument wrapping (see write_glyph_buf) > - leading indentation and args-per-line (print_font_info) > An interesting experiment, but there's far more worse after than before. The rearranging of carefully aligned elements is an especially galling change for some people (myself included). Warner From owner-svn-src-all@freebsd.org Sun Sep 6 09:08:08 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 431B73CB6A7; Sun, 6 Sep 2020 09:08:08 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bkltw11PDz4f4t; Sun, 6 Sep 2020 09:08:08 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 05F4CC051; Sun, 6 Sep 2020 09:08:08 +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 086987EZ041582; Sun, 6 Sep 2020 09:08:07 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 086987wo041579; Sun, 6 Sep 2020 09:08:07 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202009060908.086987wo041579@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sun, 6 Sep 2020 09:08:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365373 - in head: lib/libc/stdlib/jemalloc tools/build/options X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in head: lib/libc/stdlib/jemalloc tools/build/options X-SVN-Commit-Revision: 365373 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.33 Precedence: list List-Id: "SVN commit messages 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, 06 Sep 2020 09:08:08 -0000 Author: dim Date: Sun Sep 6 09:08:06 2020 New Revision: 365373 URL: https://svnweb.freebsd.org/changeset/base/365373 Log: Follow-up r365371 by removing sentences which indicate the state of the MK_MALLOC_PRODUCTION option on -CURRENT. Also, for the sake of backwards compatibility, support the old way of enabling 'production malloc', e.g. by adding a define in make.conf(5). MFC after: 1 week X-MFC-With: r365371 Modified: head/lib/libc/stdlib/jemalloc/Makefile.inc head/tools/build/options/WITHOUT_MALLOC_PRODUCTION head/tools/build/options/WITH_MALLOC_PRODUCTION Modified: head/lib/libc/stdlib/jemalloc/Makefile.inc ============================================================================== --- head/lib/libc/stdlib/jemalloc/Makefile.inc Sun Sep 6 00:36:51 2020 (r365372) +++ head/lib/libc/stdlib/jemalloc/Makefile.inc Sun Sep 6 09:08:06 2020 (r365373) @@ -45,6 +45,6 @@ MLINKS+= \ jemalloc.3 nallocx.3 \ jemalloc.3 malloc.conf.5 -.if ${MK_MALLOC_PRODUCTION} != "no" +.if ${MK_MALLOC_PRODUCTION} != "no" || defined(MALLOC_PRODUCTION) CFLAGS+= -DMALLOC_PRODUCTION .endif Modified: head/tools/build/options/WITHOUT_MALLOC_PRODUCTION ============================================================================== --- head/tools/build/options/WITHOUT_MALLOC_PRODUCTION Sun Sep 6 00:36:51 2020 (r365372) +++ head/tools/build/options/WITHOUT_MALLOC_PRODUCTION Sun Sep 6 09:08:06 2020 (r365373) @@ -2,4 +2,3 @@ Set to enable assertions and statistics gathering in .Xr malloc 3 . It also defaults the A and J runtime options to on. -Enabled by default on -CURRENT. Modified: head/tools/build/options/WITH_MALLOC_PRODUCTION ============================================================================== --- head/tools/build/options/WITH_MALLOC_PRODUCTION Sun Sep 6 00:36:51 2020 (r365372) +++ head/tools/build/options/WITH_MALLOC_PRODUCTION Sun Sep 6 09:08:06 2020 (r365373) @@ -2,4 +2,3 @@ Set to disable assertions and statistics gathering in .Xr malloc 3 . It also defaults the A and J runtime options to off. -Disabled by default on -CURRENT. From owner-svn-src-all@freebsd.org Sun Sep 6 10:19:00 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CB1AD3CD002; Sun, 6 Sep 2020 10:19:00 +0000 (UTC) (envelope-from zec@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BknSh4h2Xz3Srd; Sun, 6 Sep 2020 10:19:00 +0000 (UTC) (envelope-from zec@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 7FC2DCC61; Sun, 6 Sep 2020 10:19:00 +0000 (UTC) (envelope-from zec@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 086AJ0b0083979; Sun, 6 Sep 2020 10:19:00 GMT (envelope-from zec@FreeBSD.org) Received: (from zec@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 086AIxPd083971; Sun, 6 Sep 2020 10:18:59 GMT (envelope-from zec@FreeBSD.org) Message-Id: <202009061018.086AIxPd083971@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zec set sender to zec@FreeBSD.org using -f From: Marko Zec Date: Sun, 6 Sep 2020 10:18:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365374 - in stable/12: share/man/man4 sys/conf sys/dev/sume sys/modules sys/modules/sume X-SVN-Group: stable-12 X-SVN-Commit-Author: zec X-SVN-Commit-Paths: in stable/12: share/man/man4 sys/conf sys/dev/sume sys/modules sys/modules/sume X-SVN-Commit-Revision: 365374 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.33 Precedence: list List-Id: "SVN commit messages 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, 06 Sep 2020 10:19:00 -0000 Author: zec Date: Sun Sep 6 10:18:59 2020 New Revision: 365374 URL: https://svnweb.freebsd.org/changeset/base/365374 Log: MFC r364973: Driver for 4x10Gb Ethernet reference NIC FPGA design for NetFPGA SUME development board. Submitted by: Denis Salopek Reviewed by: zec, bz (src); rgrimes, bcr (manpages) Sponsored by: Google Summer of Code 2020 Differential Revision: https://reviews.freebsd.org/D26074 Added: stable/12/share/man/man4/sume.4 - copied unchanged from r364973, head/share/man/man4/sume.4 stable/12/sys/dev/sume/ - copied from r364973, head/sys/dev/sume/ stable/12/sys/modules/sume/ - copied from r364973, head/sys/modules/sume/ Modified: stable/12/share/man/man4/Makefile stable/12/sys/conf/files.amd64 stable/12/sys/modules/Makefile Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man4/Makefile ============================================================================== --- stable/12/share/man/man4/Makefile Sun Sep 6 09:08:06 2020 (r365373) +++ stable/12/share/man/man4/Makefile Sun Sep 6 10:18:59 2020 (r365374) @@ -532,6 +532,7 @@ MAN= aac.4 \ stf.4 \ stg.4 \ stge.4 \ + ${_sume.4} \ ${_superio.4} \ sym.4 \ syncache.4 \ @@ -881,12 +882,14 @@ _qlxgbe.4= qlxgbe.4 _qlnxe.4= qlnxe.4 _sfxge.4= sfxge.4 _smartpqi.4= smartpqi.4 +_sume.4= sume.4 MLINKS+=qlxge.4 if_qlxge.4 MLINKS+=qlxgb.4 if_qlxgb.4 MLINKS+=qlxgbe.4 if_qlxgbe.4 MLINKS+=qlnxe.4 if_qlnxe.4 MLINKS+=sfxge.4 if_sfxge.4 +MLINKS+=sume.4 if_sume.4 .if ${MK_BHYVE} != "no" _bhyve.4= bhyve.4 Copied: stable/12/share/man/man4/sume.4 (from r364973, head/share/man/man4/sume.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/share/man/man4/sume.4 Sun Sep 6 10:18:59 2020 (r365374, copy of r364973, head/share/man/man4/sume.4) @@ -0,0 +1,98 @@ +.\"- +.\" SPDX-License-Identifier: BSD-2-Clause-FreeBSD +.\" +.\" Copyright (c) 2020 Denis Salopek +.\" +.\" 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 COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +.\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +.\" LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +.\" POSSIBILITY OF SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd August 30, 2020 +.Dt SUME 4 +.Os +.Sh NAME +.Nm sume +.Nd "NetFPGA SUME 4x10Gb Ethernet driver" +.Sh SYNOPSIS +To compile this driver into the kernel, place the following lines +in your kernel configuration file: +.Bd -ragged -offset indent +.Cd "device sume" +.Ed +.Pp +Alternatively, to load the driver as a module at boot time, place +the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +if_sume_load="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +driver provides support for NetFPGA SUME Virtex-7 FPGA Development Board +with the reference NIC bitstream loaded onto it. +The HDL design for the reference NIC project uses the RIFFA based DMA +engine to communicate with the host machine over PCIe. +Every packet is transmitted to / from the board via a single DMA +transaction, taking up to two or three interrupts per one transaction +which yields low performance. +.Pp +There is no support for Jumbo frames as the hardware is capable of +dealing only with frames with maximum size of 1514 bytes. +The hardware does not support multicast filtering, provides no checksums, +and offers no other offloading. +.Sh SEE ALSO +.Xr arp 4 , +.Xr netgraph 4 , +.Xr netintro 4 , +.Xr ng_ether 4 , +.Xr vlan 4 , +.Xr ifconfig 8 +.Sh AUTHORS +The Linux +.Nm +driver was originally written by +.An -nosplit +.An Bjoern A. Zeeb . +The +.Fx version and this manual page were written by +.An Denis Salopek +as a GSoC project. +More information about the project can be found here: +.Pa https://wiki.freebsd.org/SummerOfCode2020Projects/NetFPGA_SUME_Driver +.Sh BUGS +The reference NIC hardware design provides no mechanism for quiescing +inbound traffic from interfaces configured as DOWN. +All packets from administratively disabled interfaces are transferred to +main memory, leaving the driver with the task of dropping such packets, +thus consuming PCI bandwidth, interrupts and CPU cycles in vain. +.Pp +Pre-built FPGA bitstream from the NetFPGA project may not work correctly. +At higher RX packet rates, the newly incoming packets can overwrite the +ones in an internal FIFO so the packets would arrive in main memory +corrupted, until a physical reset of the board. +.Pp +Occasionally, the driver can get stuck in a non-IDLE TX state due to +a missed interrupt. +The driver includes a watchdog function which monitors for such a +condition and resets the board automatically. +For more details, visit the NetFPGA SUME project site. Modified: stable/12/sys/conf/files.amd64 ============================================================================== --- stable/12/sys/conf/files.amd64 Sun Sep 6 09:08:06 2020 (r365373) +++ stable/12/sys/conf/files.amd64 Sun Sep 6 10:18:59 2020 (r365374) @@ -493,6 +493,7 @@ dev/smartpqi/smartpqi_response.c optional smartpqi dev/smartpqi/smartpqi_sis.c optional smartpqi dev/smartpqi/smartpqi_tag.c optional smartpqi dev/speaker/spkr.c optional speaker +dev/sume/if_sume.c optional sume dev/superio/superio.c optional superio isa dev/syscons/apm/apm_saver.c optional apm_saver apm dev/syscons/scterm-teken.c optional sc Modified: stable/12/sys/modules/Makefile ============================================================================== --- stable/12/sys/modules/Makefile Sun Sep 6 09:08:06 2020 (r365373) +++ stable/12/sys/modules/Makefile Sun Sep 6 10:18:59 2020 (r365374) @@ -372,6 +372,7 @@ SUBDIR= \ ste \ ${_stg} \ stge \ + ${_sume} \ ${_superio} \ ${_sym} \ ${_syscons} \ @@ -752,6 +753,7 @@ _nvdimm= nvdimm _pms= pms _qlxge= qlxge _qlxgb= qlxgb +_sume= sume .if ${MK_SOURCELESS_UCODE} != "no" _qlxgbe= qlxgbe _qlnx= qlnx From owner-svn-src-all@freebsd.org Sun Sep 6 10:23:14 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9647C3CD0A5; Sun, 6 Sep 2020 10:23:14 +0000 (UTC) (envelope-from zec@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BknYZ3W2sz3TGc; Sun, 6 Sep 2020 10:23:14 +0000 (UTC) (envelope-from zec@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 43FFBD3A5; Sun, 6 Sep 2020 10:23:14 +0000 (UTC) (envelope-from zec@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 086ANEpf090127; Sun, 6 Sep 2020 10:23:14 GMT (envelope-from zec@FreeBSD.org) Received: (from zec@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 086ANDIU090124; Sun, 6 Sep 2020 10:23:13 GMT (envelope-from zec@FreeBSD.org) Message-Id: <202009061023.086ANDIU090124@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zec set sender to zec@FreeBSD.org using -f From: Marko Zec Date: Sun, 6 Sep 2020 10:23: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: r365375 - in stable/11: share/man/man4 sys/conf sys/dev/sume sys/modules sys/modules/sume X-SVN-Group: stable-11 X-SVN-Commit-Author: zec X-SVN-Commit-Paths: in stable/11: share/man/man4 sys/conf sys/dev/sume sys/modules sys/modules/sume X-SVN-Commit-Revision: 365375 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.33 Precedence: list List-Id: "SVN commit messages 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, 06 Sep 2020 10:23:14 -0000 Author: zec Date: Sun Sep 6 10:23:13 2020 New Revision: 365375 URL: https://svnweb.freebsd.org/changeset/base/365375 Log: MFC r364973: Driver for 4x10Gb Ethernet reference NIC FPGA design for NetFPGA SUME development board. Submitted by: Denis Salopek Reviewed by: zec, bz (src); rgrimes, bcr (manpages) Sponsored by: Google Summer of Code 2020 Differential Revision: https://reviews.freebsd.org/D26074 Added: stable/11/share/man/man4/sume.4 - copied unchanged from r364973, head/share/man/man4/sume.4 stable/11/sys/dev/sume/ - copied from r364973, head/sys/dev/sume/ stable/11/sys/modules/sume/ - copied from r364973, head/sys/modules/sume/ Modified: stable/11/share/man/man4/Makefile stable/11/sys/conf/files.amd64 stable/11/sys/modules/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man4/Makefile ============================================================================== --- stable/11/share/man/man4/Makefile Sun Sep 6 10:18:59 2020 (r365374) +++ stable/11/share/man/man4/Makefile Sun Sep 6 10:23:13 2020 (r365375) @@ -533,6 +533,7 @@ MAN= aac.4 \ stf.4 \ stg.4 \ stge.4 \ + ${_sume.4} \ sym.4 \ syncache.4 \ syncer.4 \ @@ -884,12 +885,14 @@ _qlxgbe.4= qlxgbe.4 _qlnxe.4= qlnxe.4 _sfxge.4= sfxge.4 _smartpqi.4= smartpqi.4 +_sume.4= sume.4 MLINKS+=qlxge.4 if_qlxge.4 MLINKS+=qlxgb.4 if_qlxgb.4 MLINKS+=qlxgbe.4 if_qlxgbe.4 MLINKS+=qlnxe.4 if_qlnxe.4 MLINKS+=sfxge.4 if_sfxge.4 +MLINKS+=sume.4 if_sume.4 .if ${MK_BHYVE} != "no" _bhyve.4= bhyve.4 Copied: stable/11/share/man/man4/sume.4 (from r364973, head/share/man/man4/sume.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/share/man/man4/sume.4 Sun Sep 6 10:23:13 2020 (r365375, copy of r364973, head/share/man/man4/sume.4) @@ -0,0 +1,98 @@ +.\"- +.\" SPDX-License-Identifier: BSD-2-Clause-FreeBSD +.\" +.\" Copyright (c) 2020 Denis Salopek +.\" +.\" 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 COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +.\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +.\" LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +.\" POSSIBILITY OF SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd August 30, 2020 +.Dt SUME 4 +.Os +.Sh NAME +.Nm sume +.Nd "NetFPGA SUME 4x10Gb Ethernet driver" +.Sh SYNOPSIS +To compile this driver into the kernel, place the following lines +in your kernel configuration file: +.Bd -ragged -offset indent +.Cd "device sume" +.Ed +.Pp +Alternatively, to load the driver as a module at boot time, place +the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +if_sume_load="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +driver provides support for NetFPGA SUME Virtex-7 FPGA Development Board +with the reference NIC bitstream loaded onto it. +The HDL design for the reference NIC project uses the RIFFA based DMA +engine to communicate with the host machine over PCIe. +Every packet is transmitted to / from the board via a single DMA +transaction, taking up to two or three interrupts per one transaction +which yields low performance. +.Pp +There is no support for Jumbo frames as the hardware is capable of +dealing only with frames with maximum size of 1514 bytes. +The hardware does not support multicast filtering, provides no checksums, +and offers no other offloading. +.Sh SEE ALSO +.Xr arp 4 , +.Xr netgraph 4 , +.Xr netintro 4 , +.Xr ng_ether 4 , +.Xr vlan 4 , +.Xr ifconfig 8 +.Sh AUTHORS +The Linux +.Nm +driver was originally written by +.An -nosplit +.An Bjoern A. Zeeb . +The +.Fx version and this manual page were written by +.An Denis Salopek +as a GSoC project. +More information about the project can be found here: +.Pa https://wiki.freebsd.org/SummerOfCode2020Projects/NetFPGA_SUME_Driver +.Sh BUGS +The reference NIC hardware design provides no mechanism for quiescing +inbound traffic from interfaces configured as DOWN. +All packets from administratively disabled interfaces are transferred to +main memory, leaving the driver with the task of dropping such packets, +thus consuming PCI bandwidth, interrupts and CPU cycles in vain. +.Pp +Pre-built FPGA bitstream from the NetFPGA project may not work correctly. +At higher RX packet rates, the newly incoming packets can overwrite the +ones in an internal FIFO so the packets would arrive in main memory +corrupted, until a physical reset of the board. +.Pp +Occasionally, the driver can get stuck in a non-IDLE TX state due to +a missed interrupt. +The driver includes a watchdog function which monitors for such a +condition and resets the board automatically. +For more details, visit the NetFPGA SUME project site. Modified: stable/11/sys/conf/files.amd64 ============================================================================== --- stable/11/sys/conf/files.amd64 Sun Sep 6 10:18:59 2020 (r365374) +++ stable/11/sys/conf/files.amd64 Sun Sep 6 10:23:13 2020 (r365375) @@ -467,6 +467,7 @@ dev/smartpqi/smartpqi_response.c optional smartpqi dev/smartpqi/smartpqi_sis.c optional smartpqi dev/smartpqi/smartpqi_tag.c optional smartpqi dev/speaker/spkr.c optional speaker +dev/sume/if_sume.c optional sume dev/syscons/apm/apm_saver.c optional apm_saver apm dev/syscons/scterm-teken.c optional sc dev/syscons/scvesactl.c optional sc vga vesa Modified: stable/11/sys/modules/Makefile ============================================================================== --- stable/11/sys/modules/Makefile Sun Sep 6 10:18:59 2020 (r365374) +++ stable/11/sys/modules/Makefile Sun Sep 6 10:23:13 2020 (r365375) @@ -374,6 +374,7 @@ SUBDIR= \ ${_stg} \ stge \ ${_streams} \ + ${_sume} \ ${_svr4} \ ${_sym} \ ${_syscons} \ @@ -735,6 +736,7 @@ _ntb= ntb _pms= pms _qlxge= qlxge _qlxgb= qlxgb +_sume= sume .if ${MK_SOURCELESS_UCODE} != "no" _qlxgbe= qlxgbe _qlnx= qlnx From owner-svn-src-all@freebsd.org Sun Sep 6 11:23:59 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 74DB93CE1A7; Sun, 6 Sep 2020 11:23:59 +0000 (UTC) (envelope-from zeising@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bkpvg2V1Gz3WTJ; Sun, 6 Sep 2020 11:23:59 +0000 (UTC) (envelope-from zeising@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 38FE5D97D; Sun, 6 Sep 2020 11:23:59 +0000 (UTC) (envelope-from zeising@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 086BNx8p026879; Sun, 6 Sep 2020 11:23:59 GMT (envelope-from zeising@FreeBSD.org) Received: (from zeising@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 086BNx6T026878; Sun, 6 Sep 2020 11:23:59 GMT (envelope-from zeising@FreeBSD.org) Message-Id: <202009061123.086BNx6T026878@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zeising set sender to zeising@FreeBSD.org using -f From: Niclas Zeising Date: Sun, 6 Sep 2020 11:23:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365376 - stable/12/sys/dev/drm X-SVN-Group: stable-12 X-SVN-Commit-Author: zeising X-SVN-Commit-Paths: stable/12/sys/dev/drm X-SVN-Commit-Revision: 365376 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.33 Precedence: list List-Id: "SVN commit messages 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, 06 Sep 2020 11:23:59 -0000 Author: zeising (doc,ports committer) Date: Sun Sep 6 11:23:58 2020 New Revision: 365376 URL: https://svnweb.freebsd.org/changeset/base/365376 Log: drm: Update deprecation message Update the deprecation message in the drm1 (aka legacy drm or drm-legacy) drivers to not point towards the drm-legacy-kmod port, as that is being deprecated. This is a direct commit to stable/12 since the drm1 code has been removed from 13 already. Reviewed by: imp Approved by: imp Differential Revision: https://reviews.freebsd.org/D26175 Modified: stable/12/sys/dev/drm/drm.h Modified: stable/12/sys/dev/drm/drm.h ============================================================================== --- stable/12/sys/dev/drm/drm.h Sun Sep 6 10:23:13 2020 (r365375) +++ stable/12/sys/dev/drm/drm.h Sun Sep 6 11:23:58 2020 (r365376) @@ -1145,12 +1145,10 @@ typedef struct drm_mm_init_arg drm_mm_init_arg_t; typedef enum drm_bo_type drm_bo_type_t; #endif -#define DRM_PORT "graphics/drm-legacy-kmod" - #define DRM_OBSOLETE(dev) \ do { \ device_printf(dev, "=======================================================\n"); \ - device_printf(dev, "This code is obsolete abandonware. Install the " DRM_PORT " pkg\n"); \ + device_printf(dev, "This code is deprecated.\n"); \ device_printf(dev, "=======================================================\n"); \ gone_in_dev(dev, 13, "drm drivers"); \ } while (0) From owner-svn-src-all@freebsd.org Sun Sep 6 11:29:07 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 954F33CE148; Sun, 6 Sep 2020 11:29:07 +0000 (UTC) (envelope-from zeising@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bkq1b3Q86z3WZm; Sun, 6 Sep 2020 11:29:07 +0000 (UTC) (envelope-from zeising@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 5828FDF04; Sun, 6 Sep 2020 11:29:07 +0000 (UTC) (envelope-from zeising@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 086BT7x3027154; Sun, 6 Sep 2020 11:29:07 GMT (envelope-from zeising@FreeBSD.org) Received: (from zeising@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 086BT6jh027152; Sun, 6 Sep 2020 11:29:06 GMT (envelope-from zeising@FreeBSD.org) Message-Id: <202009061129.086BT6jh027152@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zeising set sender to zeising@FreeBSD.org using -f From: Niclas Zeising Date: Sun, 6 Sep 2020 11:29:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365377 - stable/12/sys/dev/drm2 X-SVN-Group: stable-12 X-SVN-Commit-Author: zeising X-SVN-Commit-Paths: stable/12/sys/dev/drm2 X-SVN-Commit-Revision: 365377 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.33 Precedence: list List-Id: "SVN commit messages 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, 06 Sep 2020 11:29:07 -0000 Author: zeising (doc,ports committer) Date: Sun Sep 6 11:29:06 2020 New Revision: 365377 URL: https://svnweb.freebsd.org/changeset/base/365377 Log: MFC: r364737, r365264 and r365287 Together, these three revisions improve the drm2 (aka legacy drm or drm-legacy) drivers to point towards graphics/drm-kmod where relevant, and to remove references to graphics/drm-legacy-kmd as that is being deprecated. Since part of the drm2 drivers are still used on arm, arm is currently excluded from the deprecation message. Approved by: imp, manu (implicit, MFC) Modified: stable/12/sys/dev/drm2/drm_os_freebsd.c stable/12/sys/dev/drm2/drm_os_freebsd.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/drm2/drm_os_freebsd.c ============================================================================== --- stable/12/sys/dev/drm2/drm_os_freebsd.c Sun Sep 6 11:23:58 2020 (r365376) +++ stable/12/sys/dev/drm2/drm_os_freebsd.c Sun Sep 6 11:29:06 2020 (r365377) @@ -126,7 +126,9 @@ drm_probe_helper(device_t kdev, const drm_pci_id_list_ device_get_nameunit(kdev), id_entry->name); device_set_desc(kdev, id_entry->name); } +#if !defined(__arm__) DRM_OBSOLETE(kdev); +#endif return (-BUS_PROBE_GENERIC); } Modified: stable/12/sys/dev/drm2/drm_os_freebsd.h ============================================================================== --- stable/12/sys/dev/drm2/drm_os_freebsd.h Sun Sep 6 11:23:58 2020 (r365376) +++ stable/12/sys/dev/drm2/drm_os_freebsd.h Sun Sep 6 11:29:06 2020 (r365377) @@ -154,19 +154,21 @@ typedef void irqreturn_t; *(volatile u_int64_t *)(((vm_offset_t)(map)->handle) + \ (vm_offset_t)(offset)) = htole64(val) -#ifdef amd64 -#define DRM_PORT "graphics/drm-kmod" +#if !defined(__arm__) +#if defined(__i386__) || defined(__amd64__) || defined(__powerpc__) || defined(__aarch64__) +#define DRM_MSG "This code is deprecated. Install the graphics/drm-kmod pkg\n" #else -#define DRM_PORT "graphics/drm-legacy-kmod" +#define DRM_MSG "This code is deprecated." #endif #define DRM_OBSOLETE(dev) \ do { \ device_printf(dev, "=======================================================\n"); \ - device_printf(dev, "This code is obsolete abandonware. Install the " DRM_PORT " pkg\n"); \ + device_printf(dev, DRM_MSG); \ device_printf(dev, "=======================================================\n"); \ gone_in_dev(dev, 13, "drm2 drivers"); \ } while (0) +#endif /* __arm__ */ /* DRM_READMEMORYBARRIER() prevents reordering of reads. * DRM_WRITEMEMORYBARRIER() prevents reordering of writes. From owner-svn-src-all@freebsd.org Sun Sep 6 14:04:04 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 031CD3D1E47; Sun, 6 Sep 2020 14:04:04 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BktSM5gYnz3f4C; Sun, 6 Sep 2020 14:04:03 +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 7ACCEF773; Sun, 6 Sep 2020 14:04:03 +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 086E437x024714; Sun, 6 Sep 2020 14:04:03 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 086E43HH024712; Sun, 6 Sep 2020 14:04:03 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <202009061404.086E43HH024712@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Sun, 6 Sep 2020 14:04:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365378 - head/usr.sbin/traceroute6 X-SVN-Group: head X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: head/usr.sbin/traceroute6 X-SVN-Commit-Revision: 365378 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.33 Precedence: list List-Id: "SVN commit messages 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, 06 Sep 2020 14:04:04 -0000 Author: oshogbo Date: Sun Sep 6 14:04:02 2020 New Revision: 365378 URL: https://svnweb.freebsd.org/changeset/base/365378 Log: traceroute6: capsicumize it Submitted by: Shubh Gupta Sponsored by: Google (GSOC 2020) Differential Revision: https://reviews.freebsd.org/D25604 Modified: head/usr.sbin/traceroute6/Makefile head/usr.sbin/traceroute6/traceroute6.c Modified: head/usr.sbin/traceroute6/Makefile ============================================================================== --- head/usr.sbin/traceroute6/Makefile Sun Sep 6 11:29:06 2020 (r365377) +++ head/usr.sbin/traceroute6/Makefile Sun Sep 6 14:04:02 2020 (r365378) @@ -13,6 +13,10 @@ # A PARTICULAR PURPOSE. # $FreeBSD$ +.include + +.include + TRACEROUTE_DISTDIR?= ${SRCTOP}/contrib/traceroute .PATH: ${TRACEROUTE_DISTDIR} @@ -26,7 +30,13 @@ BINMODE= 4555 CFLAGS+= -DIPSEC -DHAVE_POLL CFLAGS+= -I${.CURDIR} -I${TRACEROUTE_DISTDIR} -I. -LIBADD= ipsec +.if ${MK_CASPER} != "no" +LIBADD+= casper +LIBADD+= cap_dns +CFLAGS+= -DWITH_CASPER +.endif + +LIBADD+= ipsec .include Modified: head/usr.sbin/traceroute6/traceroute6.c ============================================================================== --- head/usr.sbin/traceroute6/traceroute6.c Sun Sep 6 11:29:06 2020 (r365377) +++ head/usr.sbin/traceroute6/traceroute6.c Sun Sep 6 14:04:02 2020 (r365378) @@ -249,6 +249,7 @@ static const char rcsid[] = */ #include +#include #include #include #include @@ -260,6 +261,10 @@ static const char rcsid[] = #include +#include +#include +#include + #include #include #include @@ -289,11 +294,6 @@ static const char rcsid[] = #define MAXPACKET 65535 /* max ip packet size */ -#ifndef HAVE_GETIPNODEBYNAME -#define getipnodebyname(x, y, z, u) gethostbyname2((x), (y)) -#define freehostent(x) -#endif - static u_char packet[512]; /* last inbound (icmp) packet */ static char *outpacket; /* last output packet */ @@ -304,6 +304,7 @@ int setpolicy(int so, char *policy); #endif void send_probe(int, u_long); void *get_uphdr(struct ip6_hdr *, u_char *); +void capdns_open(void); int get_hoplim(struct msghdr *); double deltaT(struct timeval *, struct timeval *); const char *pr_type(int); @@ -312,6 +313,8 @@ void print(struct msghdr *, int); const char *inetname(struct sockaddr *); u_int32_t sctp_crc32c(void *, u_int32_t); u_int16_t in_cksum(u_int16_t *addr, int); +u_int16_t udp_cksum(struct sockaddr_in6 *, struct sockaddr_in6 *, + void *, u_int32_t); u_int16_t tcp_chksum(struct sockaddr_in6 *, struct sockaddr_in6 *, void *, u_int32_t); void usage(void); @@ -335,6 +338,8 @@ static struct cmsghdr *cmsg; static char *source = NULL; static char *hostname; +static cap_channel_t *capdns; + static u_long nprobes = 3; static u_long first_hop = 1; static u_long max_hops = 30; @@ -368,7 +373,10 @@ main(int argc, char *argv[]) char ipsec_inpolicy[] = "in bypass"; char ipsec_outpolicy[] = "out bypass"; #endif + cap_rights_t rights; + capdns_open(); + /* * Receive ICMP */ @@ -429,6 +437,7 @@ main(int argc, char *argv[]) } break; case 'g': + /* XXX use after capability mode is entered */ hp = getipnodebyname(optarg, AF_INET6, 0, &h_errno); if (hp == NULL) { fprintf(stderr, @@ -560,8 +569,8 @@ main(int argc, char *argv[]) sndsock = rcvsock; break; case IPPROTO_UDP: - if ((sndsock = socket(AF_INET6, SOCK_DGRAM, 0)) < 0) { - perror("socket(SOCK_DGRAM)"); + if ((sndsock = socket(AF_INET6, SOCK_RAW, IPPROTO_UDP)) < 0) { + perror("socket(SOCK_RAW)"); exit(5); } break; @@ -606,7 +615,9 @@ main(int argc, char *argv[]) hints.ai_socktype = SOCK_RAW; hints.ai_protocol = IPPROTO_ICMPV6; hints.ai_flags = AI_CANONNAME; - error = getaddrinfo(*argv, NULL, &hints, &res); + + error = cap_getaddrinfo(capdns, *argv, NULL, &hints, &res); + if (error) { fprintf(stderr, "traceroute6: %s\n", gai_strerror(error)); @@ -624,7 +635,7 @@ main(int argc, char *argv[]) exit(1); } if (res->ai_next) { - if (getnameinfo(res->ai_addr, res->ai_addrlen, hbuf, + if (cap_getnameinfo(capdns, res->ai_addr, res->ai_addrlen, hbuf, sizeof(hbuf), NULL, 0, NI_NUMERICHOST) != 0) strlcpy(hbuf, "?", sizeof(hbuf)); fprintf(stderr, "traceroute6: Warning: %s has multiple " @@ -803,7 +814,7 @@ main(int argc, char *argv[]) hints.ai_family = AF_INET6; hints.ai_socktype = SOCK_DGRAM; /*dummy*/ hints.ai_flags = AI_NUMERICHOST; - error = getaddrinfo(source, "0", &hints, &res); + error = cap_getaddrinfo(capdns, source, "0", &hints, &res); if (error) { printf("traceroute6: %s: %s\n", source, gai_strerror(error)); @@ -839,7 +850,7 @@ main(int argc, char *argv[]) perror("getsockname"); exit(1); } - if (getnameinfo((struct sockaddr *)&Src, Src.sin6_len, + if (cap_getnameinfo(capdns, (struct sockaddr *)&Src, Src.sin6_len, src0, sizeof(src0), NULL, 0, NI_NUMERICHOST)) { fprintf(stderr, "getnameinfo failed for source\n"); exit(1); @@ -879,7 +890,7 @@ main(int argc, char *argv[]) /* * Message to users */ - if (getnameinfo((struct sockaddr *)&Dst, Dst.sin6_len, hbuf, + if (cap_getnameinfo(capdns, (struct sockaddr *)&Dst, Dst.sin6_len, hbuf, sizeof(hbuf), NULL, 0, NI_NUMERICHOST)) strlcpy(hbuf, "(invalid)", sizeof(hbuf)); fprintf(stderr, "traceroute6"); @@ -894,7 +905,31 @@ main(int argc, char *argv[]) if (first_hop > 1) printf("Skipping %lu intermediate hops\n", first_hop - 1); + if (connect(sndsock, (struct sockaddr *)&Dst, + sizeof(Dst)) != 0) { + fprintf(stderr, "connect: %s\n", strerror(errno)); + exit(1); + } + /* + * Here we enter capability mode. Further down access to global + * namespaces (e.g filesystem) is restricted (see capsicum(4)). + * We must connect(2) our socket before this point. + */ + + if (caph_enter_casper() < 0) { + fprintf(stderr, "caph_enter_casper: %s\n", strerror(errno)); + exit(1); + } + + cap_rights_init(&rights, CAP_SEND, CAP_SETSOCKOPT); + if (caph_rights_limit(sndsock, &rights) < 0) { + fprintf(stderr, "caph_rights_limit sndsock: %s\n", + strerror(errno)); + exit(1); + } + + /* * Main loop */ for (hops = first_hop; hops <= max_hops; ++hops) { @@ -1038,6 +1073,7 @@ send_probe(int seq, u_long hops) { struct icmp6_hdr *icp; struct sctphdr *sctp; + struct udphdr *outudp; struct sctp_chunkhdr *chk; struct sctp_init_chunk *init; struct sctp_paramhdr *param; @@ -1063,6 +1099,11 @@ send_probe(int seq, u_long hops) icp->icmp6_seq = htons(seq); break; case IPPROTO_UDP: + outudp = (struct udphdr *) outpacket; + outudp->uh_sport = htons(ident); + outudp->uh_dport = htons(port+seq); + outudp->uh_ulen = htons(datalen); + outudp->uh_sum = udp_cksum(&Src, &Dst, outpacket, datalen); break; case IPPROTO_NONE: /* No space for anything. No harm as seq/tv32 are decorative. */ @@ -1149,12 +1190,11 @@ send_probe(int seq, u_long hops) fprintf(stderr, "Unknown probe protocol %d.\n", useproto); exit(1); } - - i = sendto(sndsock, (char *)outpacket, datalen, 0, - (struct sockaddr *)&Dst, Dst.sin6_len); + + i = send(sndsock, (char *)outpacket, datalen, 0); if (i < 0 || (u_long)i != datalen) { if (i < 0) - perror("sendto"); + perror("send"); printf("traceroute6: wrote %s %lu chars, ret=%d\n", hostname, datalen, i); (void) fflush(stdout); @@ -1266,7 +1306,7 @@ packet_ok(struct msghdr *mhdr, int cc, int seq, u_char hlen = sizeof(struct ip6_hdr); if (cc < hlen + sizeof(struct icmp6_hdr)) { if (verbose) { - if (getnameinfo((struct sockaddr *)from, from->sin6_len, + if (cap_getnameinfo(capdns, (struct sockaddr *)from, from->sin6_len, hbuf, sizeof(hbuf), NULL, 0, NI_NUMERICHOST) != 0) strlcpy(hbuf, "invalid", sizeof(hbuf)); printf("packet too short (%d bytes) from %s\n", cc, @@ -1279,7 +1319,7 @@ packet_ok(struct msghdr *mhdr, int cc, int seq, u_char #else if (cc < (int)sizeof(struct icmp6_hdr)) { if (verbose) { - if (getnameinfo((struct sockaddr *)from, from->sin6_len, + if (cap_getnameinfo(capdns, (struct sockaddr *)from, from->sin6_len, hbuf, sizeof(hbuf), NULL, 0, NI_NUMERICHOST) != 0) strlcpy(hbuf, "invalid", sizeof(hbuf)); printf("data too short (%d bytes) from %s\n", cc, hbuf); @@ -1345,7 +1385,7 @@ packet_ok(struct msghdr *mhdr, int cc, int seq, u_char break; case IPPROTO_UDP: udp = (struct udphdr *)up; - if (udp->uh_sport == htons(srcport) && + if (udp->uh_sport == htons(ident) && udp->uh_dport == htons(port + seq)) return (1); break; @@ -1401,7 +1441,7 @@ packet_ok(struct msghdr *mhdr, int cc, int seq, u_char u_int8_t *p; int i; - if (getnameinfo((struct sockaddr *)from, from->sin6_len, + if (cap_getnameinfo(capdns, (struct sockaddr *)from, from->sin6_len, sbuf, sizeof(sbuf), NULL, 0, NI_NUMERICHOST) != 0) strlcpy(sbuf, "invalid", sizeof(sbuf)); printf("\n%d bytes from %s to %s", cc, sbuf, @@ -1475,12 +1515,33 @@ get_uphdr(struct ip6_hdr *ip6, u_char *lim) } void +capdns_open() +{ + const char *types[] = { "NAME", "ADDR" }; + int families[1]; + cap_channel_t *casper; + + casper = cap_init(); + if (casper == NULL) + errx(1, "unable to create casper process"); + capdns = cap_service_open(casper, "system.dns"); + if (capdns == NULL) + errx(1, "unable to open system.dns service"); + if (cap_dns_type_limit(capdns, types, nitems(types)) < 0) + errx(1, "unable to limit access to system.dns service"); + families[0] = AF_INET6; + if (cap_dns_family_limit(capdns, families, nitems(families)) < 0) + errx(1, "unable to limit access to system.dns service"); + cap_close(casper); +} + +void print(struct msghdr *mhdr, int cc) { struct sockaddr_in6 *from = (struct sockaddr_in6 *)mhdr->msg_name; char hbuf[NI_MAXHOST]; - if (getnameinfo((struct sockaddr *)from, from->sin6_len, + if (cap_getnameinfo(capdns, (struct sockaddr *)from, from->sin6_len, hbuf, sizeof(hbuf), NULL, 0, NI_NUMERICHOST) != 0) strlcpy(hbuf, "invalid", sizeof(hbuf)); if (as_path) @@ -1527,7 +1588,7 @@ inetname(struct sockaddr *sa) } cp = NULL; if (!nflag) { - if (getnameinfo(sa, sa->sa_len, line, sizeof(line), NULL, 0, + if (cap_getnameinfo(capdns, sa, sa->sa_len, line, sizeof(line), NULL, 0, NI_NAMEREQD) == 0) { if ((cp = strchr(line, '.')) && !strcmp(cp + 1, domain)) @@ -1538,7 +1599,7 @@ inetname(struct sockaddr *sa) if (cp) return cp; - if (getnameinfo(sa, sa->sa_len, line, sizeof(line), NULL, 0, + if (cap_getnameinfo(capdns, sa, sa->sa_len, line, sizeof(line), NULL, 0, NI_NUMERICHOST) != 0) strlcpy(line, "invalid", sizeof(line)); return line; @@ -1666,6 +1727,33 @@ in_cksum(u_int16_t *addr, int len) sum += (sum >> 16); /* add carry */ answer = ~sum; /* truncate to 16 bits */ return (answer); +} + +u_int16_t +udp_cksum(struct sockaddr_in6 *src, struct sockaddr_in6 *dst, + void *payload, u_int32_t len) +{ + struct { + struct in6_addr src; + struct in6_addr dst; + u_int32_t len; + u_int8_t zero[3]; + u_int8_t next; + } pseudo_hdr; + u_int16_t sum[2]; + + pseudo_hdr.src = src->sin6_addr; + pseudo_hdr.dst = dst->sin6_addr; + pseudo_hdr.len = htonl(len); + pseudo_hdr.zero[0] = 0; + pseudo_hdr.zero[1] = 0; + pseudo_hdr.zero[2] = 0; + pseudo_hdr.next = IPPROTO_UDP; + + sum[1] = in_cksum((u_int16_t *)&pseudo_hdr, sizeof(pseudo_hdr)); + sum[0] = in_cksum(payload, len); + + return (~in_cksum(sum, sizeof(sum))); } u_int16_t From owner-svn-src-all@freebsd.org Sun Sep 6 14:13:52 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9CE313D2482; Sun, 6 Sep 2020 14:13:52 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bktgh40C9z3fWq; Sun, 6 Sep 2020 14:13:52 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 545EDFAB9; Sun, 6 Sep 2020 14:13:52 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 086EDqdI030869; Sun, 6 Sep 2020 14:13:52 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 086EDqQ4030866; Sun, 6 Sep 2020 14:13:52 GMT (envelope-from mw@FreeBSD.org) Message-Id: <202009061413.086EDqQ4030866@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Sun, 6 Sep 2020 14:13:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365379 - in stable/12: share/man/man4 sys/contrib/ena-com sys/contrib/ena-com/ena_defs sys/dev/ena sys/modules/ena X-SVN-Group: stable-12 X-SVN-Commit-Author: mw X-SVN-Commit-Paths: in stable/12: share/man/man4 sys/contrib/ena-com sys/contrib/ena-com/ena_defs sys/dev/ena sys/modules/ena X-SVN-Commit-Revision: 365379 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.33 Precedence: list List-Id: "SVN commit messages 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, 06 Sep 2020 14:13:52 -0000 Author: mw Date: Sun Sep 6 14:13:51 2020 New Revision: 365379 URL: https://svnweb.freebsd.org/changeset/base/365379 Log: MFC: Merge ENA v2.0.0 driver r348416 Update ENA version to v2.0.0 r348414 Fix ENA manual issues r348413 Improve ENA reset handling r348412 Fix NULL pointer dereference in ena_up() r348411 Unify new line characters in the ENA driver r348410 Fix Tx offloads for fragmented pkt headers in ENA r348409 Split ENA reset routine into restore and destroy stages r348408 Use bitfield for storing global ENA device states r348407 Fix error handling when ENA reset fails r348406 Fill bdf field of the host_info structure in ENA r348405 Add additional doorbells on ENA Tx path r348404 Limit maximum size of Rx refill threshold in ENA r348403 Add support for the LLQv2 and WC in ENA r348402 Lock optimization in ENA r348401 Add tuneable drbr ring size and hw queues depth for ENA r348400 Fix error in validate_tx_req_id() in ENA r348399 Change attach order to prevent crash upon failure in ENA r348398 Change order of ifp release on ENA detach r348397 Check for number of MSI-x upon partial allocation in ENA r348396 Set error value when allocation of IO irq fails in ENA r348395 Set vaddr and paddr as NULL when DMA alloc fails in ENA r348394 Fix DMA synchronization in the ENA driver Tx and Rx paths r348393 Check for missing MSI-x and Tx completions in ENA r348392 Fill number of CPUs field on ENA host_info structure r348391 Print ENA Tx error conditionally r348390 Trigger reset in ENA if there are too many Rx descriptors r348389 Remove RSS support in ENA r348388 Add notification AENQ handler for ENA r348387 Print information when ENA admin error occurs r348386 Do not specify active media type in ENA r348385 Adjust ENA driver to the new ena-com Obtained from: Semihalf Sponsored by: Amazon, Inc. Modified: stable/12/share/man/man4/ena.4 stable/12/sys/contrib/ena-com/ena_com.c stable/12/sys/contrib/ena-com/ena_com.h stable/12/sys/contrib/ena-com/ena_defs/ena_admin_defs.h stable/12/sys/contrib/ena-com/ena_defs/ena_common_defs.h stable/12/sys/contrib/ena-com/ena_defs/ena_eth_io_defs.h stable/12/sys/contrib/ena-com/ena_defs/ena_gen_info.h stable/12/sys/contrib/ena-com/ena_defs/ena_regs_defs.h stable/12/sys/contrib/ena-com/ena_eth_com.c stable/12/sys/contrib/ena-com/ena_eth_com.h stable/12/sys/contrib/ena-com/ena_plat.h stable/12/sys/dev/ena/ena.c stable/12/sys/dev/ena/ena.h stable/12/sys/dev/ena/ena_sysctl.c stable/12/sys/dev/ena/ena_sysctl.h stable/12/sys/modules/ena/Makefile Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man4/ena.4 ============================================================================== --- stable/12/share/man/man4/ena.4 Sun Sep 6 14:04:02 2020 (r365378) +++ stable/12/share/man/man4/ena.4 Sun Sep 6 14:13:51 2020 (r365379) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 04, 2017 +.Dd August 16, 2017 .Dt ENA 4 .Os .Sh NAME @@ -35,7 +35,7 @@ .Nd "FreeBSD kernel driver for Elastic Network Adapter (ENA) family" .Sh SYNOPSIS To compile this driver into the kernel, -place the following line in your +place the following line in the kernel configuration file: .Bd -ragged -offset indent .Cd "device ena" @@ -59,8 +59,9 @@ The driver supports a range of ENA devices, is link-sp (i.e., the same driver is used for 10GbE, 25GbE, 40GbE, etc.), and has a negotiated and extendable feature set. .Pp -Some ENA devices support SR-IOV. This driver is used for both the -SR-IOV Physical Function (PF) and Virtual Function (VF) devices. +Some ENA devices support SR-IOV. +This driver is used for both the SR-IOV Physical Function (PF) and Virtual +Function (VF) devices. .Pp The ENA devices enable high speed and low overhead network traffic processing by providing multiple Tx/Rx queue pairs (the maximum number @@ -82,8 +83,8 @@ to recover in a manner transparent to the application, debug logs. .Pp Some of the ENA devices support a working mode called Low-latency -Queue (LLQ), which saves several more microseconds. This feature will -be implemented for driver in future releases. +Queue (LLQ), which saves several more microseconds. +This feature will be implemented for driver in future releases. .Sh HARDWARE Supported PCI vendor ID/device IDs: .Pp @@ -105,19 +106,23 @@ Supported PCI vendor ID/device IDs: Error occurred during initialization of the mmio register read request. .It ena%d: Can not reset device .Pp -Device could not be reset; device may not be responding or is already -during reset. +Device could not be reset. +.br +Device may not be responding or is already during reset. .It ena%d: device version is too low .Pp -Version of the controller is too low and it is not supported by the driver. +Version of the controller is too old and it is not supported by the driver. .It ena%d: Invalid dma width value %d .Pp -The controller is able to request dma transcation width. Device stopped -responding or it demanded invalid value. +The controller is able to request dma transaction width. +.br +Device stopped responding or it demanded invalid value. .It ena%d: Can not initialize ena admin queue with device .Pp -Initialization of the Admin Queue failed; device may not be responding or there -was a problem with initialization of the resources. +Initialization of the Admin Queue failed. +.br +Device may not be responding or there was a problem with initialization of +the resources. .It ena%d: Cannot get attribute for ena device rc: %d .Pp Failed to get attributes of the device from the controller. @@ -141,11 +146,14 @@ Errors occurred when trying to configure AENQ groups. .It ena%d: could not allocate irq vector: %d .It ena%d: Unable to allocate bus resource: registers .Pp -Resource allocation failed when initializing the device; driver will not -be attached. +Resource allocation failed when initializing the device. +.br +Driver will not be attached. .It ena%d: ENA device init failed (err: %d) .Pp -Device initialization failed; driver will not be attached. +Device initialization failed. +.br +Driver will not be attached. .It ena%d: could not activate irq vector: %d .Pp Error occurred when trying to activate interrupt vectors for Admin Queue. @@ -157,13 +165,16 @@ Error occurred when trying to register Admin Queue int Error occurred during configuration of the Admin Queue interrupts. .It ena%d: Enable MSI-X failed .Pp -Configuration of the MSI-X for Admin Queue failed; there could be lack -of resources or interrupts could not have been configured; driver will -not be attached. +Configuration of the MSI-X for Admin Queue failed. +.br +There could be lack of resources or interrupts could not have been configured. +.br +Driver will not be attached. .It ena%d: VLAN is in use, detach first .Pp -VLANs are being used when trying to detach the driver; VLANs should be detached -first and then detach routine should be called again. +VLANs are being used when trying to detach the driver. +.br +VLANs must be detached first and then detach routine have to be called again. .It ena%d: Unmapped RX DMA tag associations .It ena%d: Unmapped TX DMA tag associations .Pp @@ -175,8 +186,9 @@ Error occurred when trying to destroy RX/TX DMA tag. .It ena%d: Cannot fill hash control .It ena%d: WARNING: RSS was not properly initialized, it will affect bandwidth .Pp -Error occurred during initialization of one of RSS resources; device is still -going to work but it will affect performance because all RX packets will be +Error occurred during initialization of one of RSS resources. +.br +The device will work with reduced performance because all RX packets will be passed to queue 0 and there will be no hash information. .It ena%d: failed to tear down irq: %d .It ena%d: dev has no parent while releasing res for irq: %d @@ -196,16 +208,20 @@ Requested MTU value is not supported and will not be s Device stopped responding and will be reset. .It ena%d: Found a Tx that wasn't completed on time, qid %d, index %d. .Pp -Packet was pushed to the NIC but not sent within given time limit; it may -be caused by hang of the IO queue. +Packet was pushed to the NIC but not sent within given time limit. +.br +It may be caused by hang of the IO queue. .It ena%d: The number of lost tx completion is aboce the threshold (%d > %d). Reset the device .Pp -If too many Tx wasn't completed on time the device is going to be reset; it may -be caused by hanged queue or device. +If too many Tx wasn't completed on time the device is going to be reset. +.br +It may be caused by hanged queue or device. .It ena%d: trigger reset is on .Pp -Device will be reset; reset is triggered either by watchdog or if too many TX -packets were not completed on time. +Device will be reset. +.br +Reset is triggered either by watchdog or if too many TX packets were not +completed on time. .It ena%d: invalid value recvd .Pp Link status received from the device in the AENQ handler is invalid. @@ -220,7 +236,9 @@ Link status received from the device in the AENQ handl .It ena%d: could not allocate irq vector: %d .It ena%d: failed to register interrupt handler for irq %ju: %d .Pp -IO resources initialization failed. Interface will not be brought up. +IO resources initialization failed. +.br +Interface will not be brought up. .It ena%d: LRO[%d] Initialization failed! .Pp Initialization of the LRO for the RX ring failed. @@ -228,20 +246,26 @@ Initialization of the LRO for the RX ring failed. .It ena%d: failed to add buffer for rx queue %d .It ena%d: refilled rx queue %d with %d pages only .Pp -Allocation of resources used on RX path failed; if happened during -initialization of the IO queue, the interface will not be brought up. +Allocation of resources used on RX path failed. +.br +If happened during initialization of the IO queue, the interface will not be +brought up. .It ena%d: ioctl promisc/allmulti .Pp -IOCTL request for the device to work in promiscuous/allmulti mode; see +IOCTL request for the device to work in promiscuous/allmulti mode. +.br +See .Xr ifconfig 8 for more details. .It ena%d: too many fragments. Last fragment: %d! .Pp Packet with unsupported number of segments was queued for sending to the -device; packet will be dropped. +device. +.br +Packet will be dropped. .Sh SUPPORT -If an issue is identified with the released source code with a supported adapter -email the specific information related to the issue to +If an issue is identified with the released source code with a supported +adapter, please email the specific information related to the issue to .Aq Mt mk@semihalf.com and .Aq Mt mw@semihalf.com . Modified: stable/12/sys/contrib/ena-com/ena_com.c ============================================================================== --- stable/12/sys/contrib/ena-com/ena_com.c Sun Sep 6 14:04:02 2020 (r365378) +++ stable/12/sys/contrib/ena-com/ena_com.c Sun Sep 6 14:13:51 2020 (r365379) @@ -1,7 +1,7 @@ /*- * BSD LICENSE * - * Copyright (c) 2015-2017 Amazon.com, Inc. or its affiliates. + * Copyright (c) 2015-2019 Amazon.com, Inc. or its affiliates. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -32,9 +32,6 @@ */ #include "ena_com.h" -#ifdef ENA_INTERNAL -#include "ena_gen_info.h" -#endif /*****************************************************************************/ /*****************************************************************************/ @@ -52,9 +49,6 @@ #define ENA_EXTENDED_STAT_GET_QUEUE(_funct_queue) (_funct_queue >> 16) #endif /* ENA_EXTENDED_STATS */ -#define MIN_ENA_VER (((ENA_COMMON_SPEC_VERSION_MAJOR) << \ - ENA_REGS_VERSION_MAJOR_VERSION_SHIFT) \ - | (ENA_COMMON_SPEC_VERSION_MINOR)) #define ENA_CTRL_MAJOR 0 #define ENA_CTRL_MINOR 0 @@ -76,6 +70,8 @@ #define ENA_REGS_ADMIN_INTR_MASK 1 +#define ENA_POLL_MS 5 + /*****************************************************************************/ /*****************************************************************************/ /*****************************************************************************/ @@ -112,8 +108,8 @@ static inline int ena_com_mem_addr_set(struct ena_com_ return ENA_COM_INVAL; } - ena_addr->mem_addr_low = (u32)addr; - ena_addr->mem_addr_high = (u16)((u64)addr >> 32); + ena_addr->mem_addr_low = lower_32_bits(addr); + ena_addr->mem_addr_high = (u16)upper_32_bits(addr); return 0; } @@ -127,7 +123,7 @@ static int ena_com_admin_init_sq(struct ena_com_admin_ sq->mem_handle); if (!sq->entries) { - ena_trc_err("memory allocation failed"); + ena_trc_err("memory allocation failed\n"); return ENA_COM_NO_MEM; } @@ -149,7 +145,7 @@ static int ena_com_admin_init_cq(struct ena_com_admin_ cq->mem_handle); if (!cq->entries) { - ena_trc_err("memory allocation failed"); + ena_trc_err("memory allocation failed\n"); return ENA_COM_NO_MEM; } @@ -174,7 +170,7 @@ static int ena_com_admin_init_aenq(struct ena_com_dev aenq->mem_handle); if (!aenq->entries) { - ena_trc_err("memory allocation failed"); + ena_trc_err("memory allocation failed\n"); return ENA_COM_NO_MEM; } @@ -249,7 +245,7 @@ static struct ena_comp_ctx *__ena_com_submit_admin_cmd tail_masked = admin_queue->sq.tail & queue_size_mask; /* In case of queue FULL */ - cnt = ATOMIC32_READ(&admin_queue->outstanding_cmds); + cnt = (u16)ATOMIC32_READ(&admin_queue->outstanding_cmds); if (cnt >= admin_queue->q_depth) { ena_trc_dbg("admin queue is full.\n"); admin_queue->stats.out_of_space++; @@ -301,7 +297,7 @@ static inline int ena_com_init_comp_ctxt(struct ena_co queue->comp_ctx = ENA_MEM_ALLOC(queue->q_dmadev, size); if (unlikely(!queue->comp_ctx)) { - ena_trc_err("memory allocation failed"); + ena_trc_err("memory allocation failed\n"); return ENA_COM_NO_MEM; } @@ -320,7 +316,7 @@ static struct ena_comp_ctx *ena_com_submit_admin_cmd(s struct ena_admin_acq_entry *comp, size_t comp_size_in_bytes) { - unsigned long flags; + unsigned long flags = 0; struct ena_comp_ctx *comp_ctx; ENA_SPINLOCK_LOCK(admin_queue->q_lock, flags); @@ -332,7 +328,7 @@ static struct ena_comp_ctx *ena_com_submit_admin_cmd(s cmd_size_in_bytes, comp, comp_size_in_bytes); - if (unlikely(IS_ERR(comp_ctx))) + if (IS_ERR(comp_ctx)) admin_queue->running_state = false; ENA_SPINLOCK_UNLOCK(admin_queue->q_lock, flags); @@ -348,6 +344,7 @@ static int ena_com_init_io_sq(struct ena_com_dev *ena_ memset(&io_sq->desc_addr, 0x0, sizeof(io_sq->desc_addr)); + io_sq->dma_addr_bits = (u8)ena_dev->dma_addr_bits; io_sq->desc_entry_size = (io_sq->direction == ENA_COM_IO_QUEUE_DIRECTION_TX) ? sizeof(struct ena_eth_io_tx_desc) : @@ -373,18 +370,21 @@ static int ena_com_init_io_sq(struct ena_com_dev *ena_ } if (!io_sq->desc_addr.virt_addr) { - ena_trc_err("memory allocation failed"); + ena_trc_err("memory allocation failed\n"); return ENA_COM_NO_MEM; } } if (io_sq->mem_queue_type == ENA_ADMIN_PLACEMENT_POLICY_DEV) { /* Allocate bounce buffers */ - io_sq->bounce_buf_ctrl.buffer_size = ena_dev->llq_info.desc_list_entry_size; - io_sq->bounce_buf_ctrl.buffers_num = ENA_COM_BOUNCE_BUFFER_CNTRL_CNT; + io_sq->bounce_buf_ctrl.buffer_size = + ena_dev->llq_info.desc_list_entry_size; + io_sq->bounce_buf_ctrl.buffers_num = + ENA_COM_BOUNCE_BUFFER_CNTRL_CNT; io_sq->bounce_buf_ctrl.next_to_use = 0; - size = io_sq->bounce_buf_ctrl.buffer_size * io_sq->bounce_buf_ctrl.buffers_num; + size = io_sq->bounce_buf_ctrl.buffer_size * + io_sq->bounce_buf_ctrl.buffers_num; ENA_MEM_ALLOC_NODE(ena_dev->dmadev, size, @@ -395,11 +395,12 @@ static int ena_com_init_io_sq(struct ena_com_dev *ena_ io_sq->bounce_buf_ctrl.base_buffer = ENA_MEM_ALLOC(ena_dev->dmadev, size); if (!io_sq->bounce_buf_ctrl.base_buffer) { - ena_trc_err("bounce buffer memory allocation failed"); + ena_trc_err("bounce buffer memory allocation failed\n"); return ENA_COM_NO_MEM; } - memcpy(&io_sq->llq_info, &ena_dev->llq_info, sizeof(io_sq->llq_info)); + memcpy(&io_sq->llq_info, &ena_dev->llq_info, + sizeof(io_sq->llq_info)); /* Initiate the first bounce buffer */ io_sq->llq_buf_ctrl.curr_bounce_buf = @@ -408,6 +409,10 @@ static int ena_com_init_io_sq(struct ena_com_dev *ena_ 0x0, io_sq->llq_info.desc_list_entry_size); io_sq->llq_buf_ctrl.descs_left_in_line = io_sq->llq_info.descs_num_before_header; + + if (io_sq->llq_info.max_entries_in_tx_burst > 0) + io_sq->entries_in_tx_burst_left = + io_sq->llq_info.max_entries_in_tx_burst; } io_sq->tail = 0; @@ -451,7 +456,7 @@ static int ena_com_init_io_cq(struct ena_com_dev *ena_ } if (!io_cq->cdesc_addr.virt_addr) { - ena_trc_err("memory allocation failed"); + ena_trc_err("memory allocation failed\n"); return ENA_COM_NO_MEM; } @@ -500,12 +505,12 @@ static void ena_com_handle_admin_completion(struct ena cqe = &admin_queue->cq.entries[head_masked]; /* Go over all the completions */ - while ((cqe->acq_common_descriptor.flags & + while ((READ_ONCE8(cqe->acq_common_descriptor.flags) & ENA_ADMIN_ACQ_COMMON_DESC_PHASE_MASK) == phase) { /* Do not read the rest of the completion entry before the * phase bit was validated */ - rmb(); + dma_rmb(); ena_com_handle_single_admin_completion(admin_queue, cqe); head_masked++; @@ -552,7 +557,8 @@ static int ena_com_comp_status_to_errno(u8 comp_status static int ena_com_wait_and_process_admin_cq_polling(struct ena_comp_ctx *comp_ctx, struct ena_com_admin_queue *admin_queue) { - unsigned long flags, timeout; + unsigned long flags = 0; + unsigned long timeout; int ret; timeout = ENA_GET_SYSTEM_TIMEOUT(admin_queue->completion_timeout); @@ -577,7 +583,7 @@ static int ena_com_wait_and_process_admin_cq_polling(s goto err; } - ENA_MSLEEP(100); + ENA_MSLEEP(ENA_POLL_MS); } if (unlikely(comp_ctx->status == ENA_CMD_ABORTED)) { @@ -598,42 +604,113 @@ err: return ret; } +/** + * Set the LLQ configurations of the firmware + * + * The driver provides only the enabled feature values to the device, + * which in turn, checks if they are supported. + */ +static int ena_com_set_llq(struct ena_com_dev *ena_dev) +{ + struct ena_com_admin_queue *admin_queue; + struct ena_admin_set_feat_cmd cmd; + struct ena_admin_set_feat_resp resp; + struct ena_com_llq_info *llq_info = &ena_dev->llq_info; + int ret; + + memset(&cmd, 0x0, sizeof(cmd)); + admin_queue = &ena_dev->admin_queue; + + cmd.aq_common_descriptor.opcode = ENA_ADMIN_SET_FEATURE; + cmd.feat_common.feature_id = ENA_ADMIN_LLQ; + + cmd.u.llq.header_location_ctrl_enabled = llq_info->header_location_ctrl; + cmd.u.llq.entry_size_ctrl_enabled = llq_info->desc_list_entry_size_ctrl; + cmd.u.llq.desc_num_before_header_enabled = llq_info->descs_num_before_header; + cmd.u.llq.descriptors_stride_ctrl_enabled = llq_info->desc_stride_ctrl; + + ret = ena_com_execute_admin_command(admin_queue, + (struct ena_admin_aq_entry *)&cmd, + sizeof(cmd), + (struct ena_admin_acq_entry *)&resp, + sizeof(resp)); + + if (unlikely(ret)) + ena_trc_err("Failed to set LLQ configurations: %d\n", ret); + + return ret; +} + static int ena_com_config_llq_info(struct ena_com_dev *ena_dev, - struct ena_admin_feature_llq_desc *llq_desc) + struct ena_admin_feature_llq_desc *llq_features, + struct ena_llq_configurations *llq_default_cfg) { struct ena_com_llq_info *llq_info = &ena_dev->llq_info; + u16 supported_feat; + int rc; memset(llq_info, 0, sizeof(*llq_info)); - switch (llq_desc->header_location_ctrl) { - case ENA_ADMIN_INLINE_HEADER: - llq_info->inline_header = true; - break; - case ENA_ADMIN_HEADER_RING: - llq_info->inline_header = false; - break; - default: - ena_trc_err("Invalid header location control\n"); + supported_feat = llq_features->header_location_ctrl_supported; + + if (likely(supported_feat & llq_default_cfg->llq_header_location)) { + llq_info->header_location_ctrl = + llq_default_cfg->llq_header_location; + } else { + ena_trc_err("Invalid header location control, supported: 0x%x\n", + supported_feat); return -EINVAL; } - switch (llq_desc->entry_size_ctrl) { - case ENA_ADMIN_LIST_ENTRY_SIZE_128B: - llq_info->desc_list_entry_size = 128; - break; - case ENA_ADMIN_LIST_ENTRY_SIZE_192B: - llq_info->desc_list_entry_size = 192; - break; - case ENA_ADMIN_LIST_ENTRY_SIZE_256B: - llq_info->desc_list_entry_size = 256; - break; - default: - ena_trc_err("Invalid entry_size_ctrl %d\n", - llq_desc->entry_size_ctrl); - return -EINVAL; + if (likely(llq_info->header_location_ctrl == ENA_ADMIN_INLINE_HEADER)) { + supported_feat = llq_features->descriptors_stride_ctrl_supported; + if (likely(supported_feat & llq_default_cfg->llq_stride_ctrl)) { + llq_info->desc_stride_ctrl = llq_default_cfg->llq_stride_ctrl; + } else { + if (supported_feat & ENA_ADMIN_MULTIPLE_DESCS_PER_ENTRY) { + llq_info->desc_stride_ctrl = ENA_ADMIN_MULTIPLE_DESCS_PER_ENTRY; + } else if (supported_feat & ENA_ADMIN_SINGLE_DESC_PER_ENTRY) { + llq_info->desc_stride_ctrl = ENA_ADMIN_SINGLE_DESC_PER_ENTRY; + } else { + ena_trc_err("Invalid desc_stride_ctrl, supported: 0x%x\n", + supported_feat); + return -EINVAL; + } + + ena_trc_err("Default llq stride ctrl is not supported, performing fallback, default: 0x%x, supported: 0x%x, used: 0x%x\n", + llq_default_cfg->llq_stride_ctrl, + supported_feat, + llq_info->desc_stride_ctrl); + } + } else { + llq_info->desc_stride_ctrl = 0; } - if ((llq_info->desc_list_entry_size & 0x7)) { + supported_feat = llq_features->entry_size_ctrl_supported; + if (likely(supported_feat & llq_default_cfg->llq_ring_entry_size)) { + llq_info->desc_list_entry_size_ctrl = llq_default_cfg->llq_ring_entry_size; + llq_info->desc_list_entry_size = llq_default_cfg->llq_ring_entry_size_value; + } else { + if (supported_feat & ENA_ADMIN_LIST_ENTRY_SIZE_128B) { + llq_info->desc_list_entry_size_ctrl = ENA_ADMIN_LIST_ENTRY_SIZE_128B; + llq_info->desc_list_entry_size = 128; + } else if (supported_feat & ENA_ADMIN_LIST_ENTRY_SIZE_192B) { + llq_info->desc_list_entry_size_ctrl = ENA_ADMIN_LIST_ENTRY_SIZE_192B; + llq_info->desc_list_entry_size = 192; + } else if (supported_feat & ENA_ADMIN_LIST_ENTRY_SIZE_256B) { + llq_info->desc_list_entry_size_ctrl = ENA_ADMIN_LIST_ENTRY_SIZE_256B; + llq_info->desc_list_entry_size = 256; + } else { + ena_trc_err("Invalid entry_size_ctrl, supported: 0x%x\n", supported_feat); + return -EINVAL; + } + + ena_trc_err("Default llq ring entry size is not supported, performing fallback, default: 0x%x, supported: 0x%x, used: 0x%x\n", + llq_default_cfg->llq_ring_entry_size, + supported_feat, + llq_info->desc_list_entry_size); + } + if (unlikely(llq_info->desc_list_entry_size & 0x7)) { /* The desc list entry size should be whole multiply of 8 * This requirement comes from __iowrite64_copy() */ @@ -642,35 +719,50 @@ static int ena_com_config_llq_info(struct ena_com_dev return -EINVAL; } - if (llq_info->inline_header) { - llq_info->desc_stride_ctrl = llq_desc->descriptors_stride_ctrl; - if ((llq_info->desc_stride_ctrl != ENA_ADMIN_SINGLE_DESC_PER_ENTRY) && - (llq_info->desc_stride_ctrl != ENA_ADMIN_MULTIPLE_DESCS_PER_ENTRY)) { - ena_trc_err("Invalid desc_stride_ctrl %d\n", - llq_info->desc_stride_ctrl); - return -EINVAL; - } - } else { - llq_info->desc_stride_ctrl = ENA_ADMIN_SINGLE_DESC_PER_ENTRY; - } - - if (llq_info->desc_stride_ctrl == ENA_ADMIN_SINGLE_DESC_PER_ENTRY) + if (llq_info->desc_stride_ctrl == ENA_ADMIN_MULTIPLE_DESCS_PER_ENTRY) llq_info->descs_per_entry = llq_info->desc_list_entry_size / sizeof(struct ena_eth_io_tx_desc); else llq_info->descs_per_entry = 1; - llq_info->descs_num_before_header = llq_desc->desc_num_before_header_ctrl; + supported_feat = llq_features->desc_num_before_header_supported; + if (likely(supported_feat & llq_default_cfg->llq_num_decs_before_header)) { + llq_info->descs_num_before_header = llq_default_cfg->llq_num_decs_before_header; + } else { + if (supported_feat & ENA_ADMIN_LLQ_NUM_DESCS_BEFORE_HEADER_2) { + llq_info->descs_num_before_header = ENA_ADMIN_LLQ_NUM_DESCS_BEFORE_HEADER_2; + } else if (supported_feat & ENA_ADMIN_LLQ_NUM_DESCS_BEFORE_HEADER_1) { + llq_info->descs_num_before_header = ENA_ADMIN_LLQ_NUM_DESCS_BEFORE_HEADER_1; + } else if (supported_feat & ENA_ADMIN_LLQ_NUM_DESCS_BEFORE_HEADER_4) { + llq_info->descs_num_before_header = ENA_ADMIN_LLQ_NUM_DESCS_BEFORE_HEADER_4; + } else if (supported_feat & ENA_ADMIN_LLQ_NUM_DESCS_BEFORE_HEADER_8) { + llq_info->descs_num_before_header = ENA_ADMIN_LLQ_NUM_DESCS_BEFORE_HEADER_8; + } else { + ena_trc_err("Invalid descs_num_before_header, supported: 0x%x\n", + supported_feat); + return -EINVAL; + } - return 0; -} + ena_trc_err("Default llq num descs before header is not supported, performing fallback, default: 0x%x, supported: 0x%x, used: 0x%x\n", + llq_default_cfg->llq_num_decs_before_header, + supported_feat, + llq_info->descs_num_before_header); + } + llq_info->max_entries_in_tx_burst = + (u16)(llq_features->max_tx_burst_size / llq_default_cfg->llq_ring_entry_size_value); + rc = ena_com_set_llq(ena_dev); + if (rc) + ena_trc_err("Cannot set LLQ configuration: %d\n", rc); + return 0; +} + static int ena_com_wait_and_process_admin_cq_interrupts(struct ena_comp_ctx *comp_ctx, struct ena_com_admin_queue *admin_queue) { - unsigned long flags; + unsigned long flags = 0; int ret; ENA_WAIT_EVENT_WAIT(comp_ctx->wait_event, @@ -715,7 +807,7 @@ static u32 ena_com_reg_bar_read32(struct ena_com_dev * volatile struct ena_admin_ena_mmio_req_read_less_resp *read_resp = mmio_read->read_resp; u32 mmio_read_reg, ret, i; - unsigned long flags; + unsigned long flags = 0; u32 timeout = mmio_read->reg_read_to; ENA_MIGHT_SLEEP(); @@ -736,15 +828,11 @@ static u32 ena_com_reg_bar_read32(struct ena_com_dev * mmio_read_reg |= mmio_read->seq_num & ENA_REGS_MMIO_REG_READ_REQ_ID_MASK; - /* make sure read_resp->req_id get updated before the hw can write - * there - */ - wmb(); + ENA_REG_WRITE32(ena_dev->bus, mmio_read_reg, + ena_dev->reg_bar + ENA_REGS_MMIO_REG_READ_OFF); - ENA_REG_WRITE32(ena_dev->bus, mmio_read_reg, ena_dev->reg_bar + ENA_REGS_MMIO_REG_READ_OFF); - for (i = 0; i < timeout; i++) { - if (read_resp->req_id == mmio_read->seq_num) + if (READ_ONCE16(read_resp->req_id) == mmio_read->seq_num) break; ENA_UDELAY(1); @@ -761,7 +849,7 @@ static u32 ena_com_reg_bar_read32(struct ena_com_dev * } if (read_resp->reg_off != offset) { - ena_trc_err("Read failure: wrong offset provided"); + ena_trc_err("Read failure: wrong offset provided\n"); ret = ENA_MMIO_READ_TIMEOUT; } else { ret = read_resp->reg_val; @@ -856,7 +944,6 @@ static void ena_com_io_queue_free(struct ena_com_dev * } if (io_sq->bounce_buf_ctrl.base_buffer) { - size = io_sq->llq_info.desc_list_entry_size * ENA_COM_BOUNCE_BUFFER_CNTRL_CNT; ENA_MEM_FREE(ena_dev->dmadev, io_sq->bounce_buf_ctrl.base_buffer); io_sq->bounce_buf_ctrl.base_buffer = NULL; } @@ -867,6 +954,9 @@ static int wait_for_reset_state(struct ena_com_dev *en { u32 val, i; + /* Convert timeout from resolution of 100ms to ENA_POLL_MS */ + timeout = (timeout * 100) / ENA_POLL_MS; + for (i = 0; i < timeout; i++) { val = ena_com_reg_bar_read32(ena_dev, ENA_REGS_DEV_STS_OFF); @@ -879,8 +969,7 @@ static int wait_for_reset_state(struct ena_com_dev *en exp_state) return 0; - /* The resolution of the timeout is 100ms */ - ENA_MSLEEP(100); + ENA_MSLEEP(ENA_POLL_MS); } return ENA_COM_TIMER_EXPIRED; @@ -903,7 +992,8 @@ static int ena_com_get_feature_ex(struct ena_com_dev * struct ena_admin_get_feat_resp *get_resp, enum ena_admin_aq_feature_id feature_id, dma_addr_t control_buf_dma_addr, - u32 control_buff_size) + u32 control_buff_size, + u8 feature_ver) { struct ena_com_admin_queue *admin_queue; struct ena_admin_get_feat_cmd get_cmd; @@ -934,7 +1024,7 @@ static int ena_com_get_feature_ex(struct ena_com_dev * } get_cmd.control_buffer.length = control_buff_size; - + get_cmd.feat_common.feature_version = feature_ver; get_cmd.feat_common.feature_id = feature_id; ret = ena_com_execute_admin_command(admin_queue, @@ -954,13 +1044,15 @@ static int ena_com_get_feature_ex(struct ena_com_dev * static int ena_com_get_feature(struct ena_com_dev *ena_dev, struct ena_admin_get_feat_resp *get_resp, - enum ena_admin_aq_feature_id feature_id) + enum ena_admin_aq_feature_id feature_id, + u8 feature_ver) { return ena_com_get_feature_ex(ena_dev, get_resp, feature_id, 0, - 0); + 0, + feature_ver); } static int ena_com_hash_key_allocate(struct ena_com_dev *ena_dev) @@ -1030,7 +1122,7 @@ static int ena_com_indirect_table_allocate(struct ena_ int ret; ret = ena_com_get_feature(ena_dev, &get_resp, - ENA_ADMIN_RSS_REDIRECTION_TABLE_CONFIG); + ENA_ADMIN_RSS_REDIRECTION_TABLE_CONFIG, 0); if (unlikely(ret)) return ret; @@ -1269,7 +1361,7 @@ int ena_com_execute_admin_command(struct ena_com_admin comp_ctx = ena_com_submit_admin_cmd(admin_queue, cmd, cmd_size, comp, comp_size); - if (unlikely(IS_ERR(comp_ctx))) { + if (IS_ERR(comp_ctx)) { if (comp_ctx == ERR_PTR(ENA_COM_NO_DEVICE)) ena_trc_dbg("Failed to submit command [%ld]\n", PTR_ERR(comp_ctx)); @@ -1389,12 +1481,12 @@ void ena_com_abort_admin_commands(struct ena_com_dev * void ena_com_wait_for_abort_completion(struct ena_com_dev *ena_dev) { struct ena_com_admin_queue *admin_queue = &ena_dev->admin_queue; - unsigned long flags; + unsigned long flags = 0; ENA_SPINLOCK_LOCK(admin_queue->q_lock, flags); while (ATOMIC32_READ(&admin_queue->outstanding_cmds) != 0) { ENA_SPINLOCK_UNLOCK(admin_queue->q_lock, flags); - ENA_MSLEEP(20); + ENA_MSLEEP(ENA_POLL_MS); ENA_SPINLOCK_LOCK(admin_queue->q_lock, flags); } ENA_SPINLOCK_UNLOCK(admin_queue->q_lock, flags); @@ -1433,7 +1525,7 @@ bool ena_com_get_admin_running_state(struct ena_com_de void ena_com_set_admin_running_state(struct ena_com_dev *ena_dev, bool state) { struct ena_com_admin_queue *admin_queue = &ena_dev->admin_queue; - unsigned long flags; + unsigned long flags = 0; ENA_SPINLOCK_LOCK(admin_queue->q_lock, flags); ena_dev->admin_queue.running_state = state; @@ -1460,14 +1552,14 @@ int ena_com_set_aenq_config(struct ena_com_dev *ena_de struct ena_admin_get_feat_resp get_resp; int ret; - ret = ena_com_get_feature(ena_dev, &get_resp, ENA_ADMIN_AENQ_CONFIG); + ret = ena_com_get_feature(ena_dev, &get_resp, ENA_ADMIN_AENQ_CONFIG, 0); if (ret) { ena_trc_info("Can't get aenq configuration\n"); return ret; } if ((get_resp.u.aenq.supported_groups & groups_flag) != groups_flag) { - ena_trc_warn("Trying to set unsupported aenq events. supported flag: %x asked flag: %x\n", + ena_trc_warn("Trying to set unsupported aenq events. supported flag: 0x%x asked flag: 0x%x\n", get_resp.u.aenq.supported_groups, groups_flag); return ENA_COM_UNSUPPORTED; @@ -1542,11 +1634,6 @@ int ena_com_validate_version(struct ena_com_dev *ena_d ENA_REGS_VERSION_MAJOR_VERSION_SHIFT, ver & ENA_REGS_VERSION_MINOR_VERSION_MASK); - if (ver < MIN_ENA_VER) { - ena_trc_err("ENA version is lower than the minimal version the driver supports\n"); - return -1; - } - ena_trc_info("ena controller version: %d.%d.%d implementation version %d\n", (ctrl_ver & ENA_REGS_CONTROLLER_VERSION_MAJOR_VERSION_MASK) >> ENA_REGS_CONTROLLER_VERSION_MAJOR_VERSION_SHIFT, @@ -1579,9 +1666,6 @@ void ena_com_admin_destroy(struct ena_com_dev *ena_dev u16 size; ENA_WAIT_EVENT_DESTROY(admin_queue->comp_ctx->wait_event); - - ENA_SPINLOCK_DESTROY(admin_queue->q_lock); - if (admin_queue->comp_ctx) ENA_MEM_FREE(ena_dev->dmadev, admin_queue->comp_ctx); admin_queue->comp_ctx = NULL; @@ -1602,6 +1686,7 @@ void ena_com_admin_destroy(struct ena_com_dev *ena_dev ENA_MEM_FREE_COHERENT(ena_dev->dmadev, size, aenq->entries, aenq->dma_addr, aenq->mem_handle); aenq->entries = NULL; + ENA_SPINLOCK_DESTROY(admin_queue->q_lock); } void ena_com_set_admin_polling_mode(struct ena_com_dev *ena_dev, bool polling) @@ -1611,7 +1696,8 @@ void ena_com_set_admin_polling_mode(struct ena_com_dev if (polling) mask_value = ENA_REGS_ADMIN_INTR_MASK; - ENA_REG_WRITE32(ena_dev->bus, mask_value, ena_dev->reg_bar + ENA_REGS_INTR_MASK_OFF); + ENA_REG_WRITE32(ena_dev->bus, mask_value, + ena_dev->reg_bar + ENA_REGS_INTR_MASK_OFF); ena_dev->admin_queue.polling = polling; } @@ -1626,7 +1712,7 @@ int ena_com_mmio_reg_read_request_init(struct ena_com_ mmio_read->read_resp_dma_addr, mmio_read->read_resp_mem_handle); if (unlikely(!mmio_read->read_resp)) - return ENA_COM_NO_MEM; + goto err; ena_com_mmio_reg_read_request_write_dev_addr(ena_dev); @@ -1635,6 +1721,10 @@ int ena_com_mmio_reg_read_request_init(struct ena_com_ mmio_read->readless_supported = true; return 0; + +err: + ENA_SPINLOCK_DESTROY(mmio_read->lock); + return ENA_COM_NO_MEM; } void ena_com_set_mmio_read_mode(struct ena_com_dev *ena_dev, bool readless_supported) @@ -1658,7 +1748,6 @@ void ena_com_mmio_reg_read_request_destroy(struct ena_ mmio_read->read_resp_mem_handle); mmio_read->read_resp = NULL; - ENA_SPINLOCK_DESTROY(mmio_read->lock); } @@ -1675,17 +1764,12 @@ void ena_com_mmio_reg_read_request_write_dev_addr(stru } int ena_com_admin_init(struct ena_com_dev *ena_dev, - struct ena_aenq_handlers *aenq_handlers, - bool init_spinlock) + struct ena_aenq_handlers *aenq_handlers) { struct ena_com_admin_queue *admin_queue = &ena_dev->admin_queue; u32 aq_caps, acq_caps, dev_sts, addr_low, addr_high; int ret; -#ifdef ENA_INTERNAL - ena_trc_info("ena_defs : Version:[%s] Build date [%s]", - ENA_GEN_COMMIT, ENA_GEN_DATE); -#endif dev_sts = ena_com_reg_bar_read32(ena_dev, ENA_REGS_DEV_STS_OFF); if (unlikely(dev_sts == ENA_MMIO_READ_TIMEOUT)) { @@ -1707,8 +1791,7 @@ int ena_com_admin_init(struct ena_com_dev *ena_dev, ATOMIC32_SET(&admin_queue->outstanding_cmds, 0); - if (init_spinlock) - ENA_SPINLOCK_INIT(admin_queue->q_lock); + ENA_SPINLOCK_INIT(admin_queue->q_lock); ret = ena_com_init_comp_ctxt(admin_queue); if (ret) @@ -1848,9 +1931,65 @@ void ena_com_destroy_io_queue(struct ena_com_dev *ena_ int ena_com_get_link_params(struct ena_com_dev *ena_dev, struct ena_admin_get_feat_resp *resp) { - return ena_com_get_feature(ena_dev, resp, ENA_ADMIN_LINK_CONFIG); + return ena_com_get_feature(ena_dev, resp, ENA_ADMIN_LINK_CONFIG, 0); } +int ena_com_extra_properties_strings_init(struct ena_com_dev *ena_dev) +{ + struct ena_admin_get_feat_resp resp; + struct ena_extra_properties_strings *extra_properties_strings = + &ena_dev->extra_properties_strings; + u32 rc; + extra_properties_strings->size = ENA_ADMIN_EXTRA_PROPERTIES_COUNT * + ENA_ADMIN_EXTRA_PROPERTIES_STRING_LEN; + + ENA_MEM_ALLOC_COHERENT(ena_dev->dmadev, + extra_properties_strings->size, + extra_properties_strings->virt_addr, + extra_properties_strings->dma_addr, + extra_properties_strings->dma_handle); + if (unlikely(!extra_properties_strings->virt_addr)) { + ena_trc_err("Failed to allocate extra properties strings\n"); + return 0; + } + + rc = ena_com_get_feature_ex(ena_dev, &resp, + ENA_ADMIN_EXTRA_PROPERTIES_STRINGS, + extra_properties_strings->dma_addr, + extra_properties_strings->size, 0); + if (rc) { + ena_trc_dbg("Failed to get extra properties strings\n"); + goto err; + } + + return resp.u.extra_properties_strings.count; +err: + ena_com_delete_extra_properties_strings(ena_dev); + return 0; +} + +void ena_com_delete_extra_properties_strings(struct ena_com_dev *ena_dev) +{ + struct ena_extra_properties_strings *extra_properties_strings = + &ena_dev->extra_properties_strings; + + if (extra_properties_strings->virt_addr) { + ENA_MEM_FREE_COHERENT(ena_dev->dmadev, + extra_properties_strings->size, + extra_properties_strings->virt_addr, + extra_properties_strings->dma_addr, + extra_properties_strings->dma_handle); + extra_properties_strings->virt_addr = NULL; + } +} + +int ena_com_get_extra_properties_flags(struct ena_com_dev *ena_dev, + struct ena_admin_get_feat_resp *resp) +{ + return ena_com_get_feature(ena_dev, resp, + ENA_ADMIN_EXTRA_PROPERTIES_FLAGS, 0); +} + int ena_com_get_dev_attr_feat(struct ena_com_dev *ena_dev, struct ena_com_dev_get_features_ctx *get_feat_ctx) { @@ -1858,7 +1997,7 @@ int ena_com_get_dev_attr_feat(struct ena_com_dev *ena_ int rc; rc = ena_com_get_feature(ena_dev, &get_resp, - ENA_ADMIN_DEVICE_ATTRIBUTES); + ENA_ADMIN_DEVICE_ATTRIBUTES, 0); if (rc) return rc; @@ -1866,17 +2005,34 @@ int ena_com_get_dev_attr_feat(struct ena_com_dev *ena_ sizeof(get_resp.u.dev_attr)); ena_dev->supported_features = get_resp.u.dev_attr.supported_features; - rc = ena_com_get_feature(ena_dev, &get_resp, - ENA_ADMIN_MAX_QUEUES_NUM); - if (rc) - return rc; + if (ena_dev->supported_features & BIT(ENA_ADMIN_MAX_QUEUES_EXT)) { + rc = ena_com_get_feature(ena_dev, &get_resp, + ENA_ADMIN_MAX_QUEUES_EXT, + ENA_FEATURE_MAX_QUEUE_EXT_VER); + if (rc) + return rc; - memcpy(&get_feat_ctx->max_queues, &get_resp.u.max_queue, - sizeof(get_resp.u.max_queue)); - ena_dev->tx_max_header_size = get_resp.u.max_queue.max_header_size; + if (get_resp.u.max_queue_ext.version != ENA_FEATURE_MAX_QUEUE_EXT_VER) + return -EINVAL; + memcpy(&get_feat_ctx->max_queue_ext, &get_resp.u.max_queue_ext, + sizeof(get_resp.u.max_queue_ext)); + ena_dev->tx_max_header_size = + get_resp.u.max_queue_ext.max_queue_ext.max_tx_header_size; + } else { + rc = ena_com_get_feature(ena_dev, &get_resp, + ENA_ADMIN_MAX_QUEUES_NUM, 0); + memcpy(&get_feat_ctx->max_queues, &get_resp.u.max_queue, + sizeof(get_resp.u.max_queue)); + ena_dev->tx_max_header_size = + get_resp.u.max_queue.max_header_size; + + if (rc) + return rc; + } + rc = ena_com_get_feature(ena_dev, &get_resp, - ENA_ADMIN_AENQ_CONFIG); + ENA_ADMIN_AENQ_CONFIG, 0); if (rc) return rc; @@ -1884,7 +2040,7 @@ int ena_com_get_dev_attr_feat(struct ena_com_dev *ena_ sizeof(get_resp.u.aenq)); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sun Sep 6 14:23:32 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 94D433D281A; Sun, 6 Sep 2020 14:23:32 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bkttr3kKhz3gND; Sun, 6 Sep 2020 14:23:32 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 6381AFD4C; Sun, 6 Sep 2020 14:23:32 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 086ENWRH036873; Sun, 6 Sep 2020 14:23:32 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 086ENV4j036869; Sun, 6 Sep 2020 14:23:31 GMT (envelope-from mw@FreeBSD.org) Message-Id: <202009061423.086ENV4j036869@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Sun, 6 Sep 2020 14:23:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365380 - in stable/12/sys: conf contrib/ena-com dev/ena modules/ena X-SVN-Group: stable-12 X-SVN-Commit-Author: mw X-SVN-Commit-Paths: in stable/12/sys: conf contrib/ena-com dev/ena modules/ena X-SVN-Commit-Revision: 365380 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.33 Precedence: list List-Id: "SVN commit messages 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, 06 Sep 2020 14:23:32 -0000 Author: mw Date: Sun Sep 6 14:23:31 2020 New Revision: 365380 URL: https://svnweb.freebsd.org/changeset/base/365380 Log: MFC: ENA netmap support and bug fixes r363638 Fix ENA build when integrated into kernel r354242 Make valdiate_rx_req_id static inline because it uses other static r354225 Update ENA version to v2.1.0 r354224 Add support for ENA NETMAP partial initialization r354223 Add support for ENA NETMAP Tx r354222 Add support for ENA NETMAP Rx r354221 Introduce NETMAP support in ENA r354220 Split Rx/Tx from initialization code in ENA driver r354219 Fix ENA keep-alive timeout due to prolonged reset r354218 Add WC support for arm64 in the ENA driver Obtained from: Semihalf Sponsored by: Amazon, Inc. Added: stable/12/sys/dev/ena/ena_datapath.c - copied, changed from r354225, head/sys/dev/ena/ena_datapath.c stable/12/sys/dev/ena/ena_datapath.h - copied unchanged from r354225, head/sys/dev/ena/ena_datapath.h stable/12/sys/dev/ena/ena_netmap.c - copied unchanged from r354225, head/sys/dev/ena/ena_netmap.c stable/12/sys/dev/ena/ena_netmap.h - copied unchanged from r354225, head/sys/dev/ena/ena_netmap.h Modified: stable/12/sys/conf/files stable/12/sys/contrib/ena-com/ena_plat.h stable/12/sys/dev/ena/ena.c stable/12/sys/dev/ena/ena.h stable/12/sys/modules/ena/Makefile Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/conf/files ============================================================================== --- stable/12/sys/conf/files Sun Sep 6 14:13:51 2020 (r365379) +++ stable/12/sys/conf/files Sun Sep 6 14:23:31 2020 (r365380) @@ -1707,6 +1707,10 @@ dev/e1000/e1000_osdep.c optional em \ dev/et/if_et.c optional et dev/ena/ena.c optional ena \ compile-with "${NORMAL_C} -I$S/contrib" +dev/ena/ena_datapath.c optional ena \ + compile-with "${NORMAL_C} -I$S/contrib" +dev/ena/ena_netmap.c optional ena \ + compile-with "${NORMAL_C} -I$S/contrib" dev/ena/ena_sysctl.c optional ena \ compile-with "${NORMAL_C} -I$S/contrib" contrib/ena-com/ena_com.c optional ena Modified: stable/12/sys/contrib/ena-com/ena_plat.h ============================================================================== --- stable/12/sys/contrib/ena-com/ena_plat.h Sun Sep 6 14:13:51 2020 (r365379) +++ stable/12/sys/contrib/ena-com/ena_plat.h Sun Sep 6 14:23:31 2020 (r365380) @@ -103,6 +103,7 @@ extern struct ena_bus_space ebs; #define ENA_RSC (1 << 6) /* Goes with TXPTH or RXPTH, free/alloc res. */ #define ENA_IOQ (1 << 7) /* Detailed info about IO queues. */ #define ENA_ADMQ (1 << 8) /* Detailed info about admin queue. */ +#define ENA_NETMAP (1 << 9) /* Detailed info about netmap. */ extern int ena_log_level; Modified: stable/12/sys/dev/ena/ena.c ============================================================================== --- stable/12/sys/dev/ena/ena.c Sun Sep 6 14:13:51 2020 (r365379) +++ stable/12/sys/dev/ena/ena.c Sun Sep 6 14:23:31 2020 (r365380) @@ -81,9 +81,14 @@ __FBSDID("$FreeBSD$"); #include #include +#include "ena_datapath.h" #include "ena.h" #include "ena_sysctl.h" +#ifdef DEV_NETMAP +#include "ena_netmap.h" +#endif /* DEV_NETMAP */ + /********************************************************* * Function prototypes *********************************************************/ @@ -103,11 +108,11 @@ static int ena_setup_tx_dma_tag(struct ena_adapter *); static int ena_free_tx_dma_tag(struct ena_adapter *); static int ena_setup_rx_dma_tag(struct ena_adapter *); static int ena_free_rx_dma_tag(struct ena_adapter *); +static void ena_release_all_tx_dmamap(struct ena_ring *); static int ena_setup_tx_resources(struct ena_adapter *, int); static void ena_free_tx_resources(struct ena_adapter *, int); static int ena_setup_all_tx_resources(struct ena_adapter *); static void ena_free_all_tx_resources(struct ena_adapter *); -static inline int validate_rx_req_id(struct ena_ring *, uint16_t); static int ena_setup_rx_resources(struct ena_adapter *, unsigned int); static void ena_free_rx_resources(struct ena_adapter *, unsigned int); static int ena_setup_all_rx_resources(struct ena_adapter *); @@ -116,7 +121,6 @@ static inline int ena_alloc_rx_mbuf(struct ena_adapter struct ena_rx_buffer *); static void ena_free_rx_mbuf(struct ena_adapter *, struct ena_ring *, struct ena_rx_buffer *); -static int ena_refill_rx_bufs(struct ena_ring *, uint32_t); static void ena_free_rx_bufs(struct ena_adapter *, unsigned int); static void ena_refill_all_rx_bufs(struct ena_adapter *); static void ena_free_all_rx_bufs(struct ena_adapter *); @@ -126,16 +130,6 @@ static void ena_destroy_all_tx_queues(struct ena_adapt static void ena_destroy_all_rx_queues(struct ena_adapter *); static void ena_destroy_all_io_queues(struct ena_adapter *); static int ena_create_io_queues(struct ena_adapter *); -static int ena_tx_cleanup(struct ena_ring *); -static int ena_rx_cleanup(struct ena_ring *); -static inline int validate_tx_req_id(struct ena_ring *, uint16_t); -static void ena_rx_hash_mbuf(struct ena_ring *, struct ena_com_rx_ctx *, - struct mbuf *); -static struct mbuf* ena_rx_mbuf(struct ena_ring *, struct ena_com_rx_buf_info *, - struct ena_com_rx_ctx *, uint16_t *); -static inline void ena_rx_checksum(struct ena_ring *, struct ena_com_rx_ctx *, - struct mbuf *); -static void ena_cleanup(void *arg, int pending); static int ena_handle_msix(void *); static int ena_enable_msix(struct ena_adapter *); static void ena_setup_mgmnt_intr(struct ena_adapter *); @@ -149,8 +143,6 @@ static void ena_disable_msix(struct ena_adapter *); static void ena_unmask_all_io_irqs(struct ena_adapter *); static int ena_rss_configure(struct ena_adapter *); static int ena_up_complete(struct ena_adapter *); -static int ena_up(struct ena_adapter *); -static void ena_down(struct ena_adapter *); static uint64_t ena_get_counter(if_t, ift_counter); static int ena_media_change(if_t); static void ena_media_status(if_t, struct ifmediareq *); @@ -161,15 +153,6 @@ static void ena_update_host_info(struct ena_admin_host static void ena_update_hwassist(struct ena_adapter *); static int ena_setup_ifnet(device_t, struct ena_adapter *, struct ena_com_dev_get_features_ctx *); -static void ena_tx_csum(struct ena_com_tx_ctx *, struct mbuf *); -static int ena_check_and_collapse_mbuf(struct ena_ring *tx_ring, - struct mbuf **mbuf); -static void ena_dmamap_llq(void *, bus_dma_segment_t *, int, int); -static int ena_xmit_mbuf(struct ena_ring *, struct mbuf **); -static void ena_start_xmit(struct ena_ring *); -static int ena_mq_start(if_t, struct mbuf *); -static void ena_deferred_mq_start(void *, int); -static void ena_qflush(if_t); static int ena_enable_wc(struct resource *); static int ena_set_queues_placement_policy(device_t, struct ena_com_dev *, struct ena_admin_feature_llq_desc *, struct ena_llq_configurations *); @@ -555,6 +538,44 @@ ena_free_rx_dma_tag(struct ena_adapter *adapter) return (ret); } +static void +ena_release_all_tx_dmamap(struct ena_ring *tx_ring) +{ + struct ena_adapter *adapter = tx_ring->adapter; + struct ena_tx_buffer *tx_info; + bus_dma_tag_t tx_tag = adapter->tx_buf_tag;; + int i; +#ifdef DEV_NETMAP + struct ena_netmap_tx_info *nm_info; + int j; +#endif /* DEV_NETMAP */ + + for (i = 0; i < tx_ring->ring_size; ++i) { + tx_info = &tx_ring->tx_buffer_info[i]; +#ifdef DEV_NETMAP + if (adapter->ifp->if_capenable & IFCAP_NETMAP) { + nm_info = &tx_info->nm_info; + for (j = 0; j < ENA_PKT_MAX_BUFS; ++j) { + if (nm_info->map_seg[j] != NULL) { + bus_dmamap_destroy(tx_tag, + nm_info->map_seg[j]); + nm_info->map_seg[j] = NULL; + } + } + } +#endif /* DEV_NETMAP */ + if (tx_info->map_head != NULL) { + bus_dmamap_destroy(tx_tag, tx_info->map_head); + tx_info->map_head = NULL; + } + + if (tx_info->map_seg != NULL) { + bus_dmamap_destroy(tx_tag, tx_info->map_seg); + tx_info->map_seg = NULL; + } + } +} + /** * ena_setup_tx_resources - allocate Tx resources (Descriptors) * @adapter: network interface device structure @@ -568,7 +589,13 @@ ena_setup_tx_resources(struct ena_adapter *adapter, in struct ena_que *que = &adapter->que[qid]; struct ena_ring *tx_ring = que->tx_ring; int size, i, err; +#ifdef DEV_NETMAP + bus_dmamap_t *map; + int j; + ena_netmap_reset_tx_ring(adapter, qid); +#endif /* DEV_NETMAP */ + size = sizeof(struct ena_tx_buffer) * tx_ring->ring_size; tx_ring->tx_buffer_info = malloc(size, M_DEVBUF, M_NOWAIT | M_ZERO); @@ -611,7 +638,7 @@ ena_setup_tx_resources(struct ena_adapter *adapter, in ena_trace(ENA_ALERT, "Unable to create Tx DMA map_head for buffer %d\n", i); - goto err_buf_info_unmap; + goto err_map_release; } tx_ring->tx_buffer_info[i].seg_mapped = false; @@ -621,9 +648,24 @@ ena_setup_tx_resources(struct ena_adapter *adapter, in ena_trace(ENA_ALERT, "Unable to create Tx DMA map_seg for buffer %d\n", i); - goto err_buf_info_head_unmap; + goto err_map_release; } tx_ring->tx_buffer_info[i].head_mapped = false; + +#ifdef DEV_NETMAP + if (adapter->ifp->if_capenable & IFCAP_NETMAP) { + map = tx_ring->tx_buffer_info[i].nm_info.map_seg; + for (j = 0; j < ENA_PKT_MAX_BUFS; j++) { + err = bus_dmamap_create(adapter->tx_buf_tag, 0, + &map[j]); + if (unlikely(err != 0)) { + ena_trace(ENA_ALERT, "Unable to create " + "Tx DMA for buffer %d %d\n", i, j); + goto err_map_release; + } + } + } +#endif /* DEV_NETMAP */ } /* Allocate taskqueues */ @@ -634,7 +676,7 @@ ena_setup_tx_resources(struct ena_adapter *adapter, in ena_trace(ENA_ALERT, "Unable to create taskqueue for enqueue task\n"); i = tx_ring->ring_size; - goto err_buf_info_unmap; + goto err_map_release; } tx_ring->running = true; @@ -644,17 +686,8 @@ ena_setup_tx_resources(struct ena_adapter *adapter, in return (0); -err_buf_info_head_unmap: - bus_dmamap_destroy(adapter->tx_buf_tag, - tx_ring->tx_buffer_info[i].map_head); -err_buf_info_unmap: - while (i--) { - bus_dmamap_destroy(adapter->tx_buf_tag, - tx_ring->tx_buffer_info[i].map_head); - bus_dmamap_destroy(adapter->tx_buf_tag, - tx_ring->tx_buffer_info[i].map_seg); - } - free(tx_ring->push_buf_intermediate_buf, M_DEVBUF); +err_map_release: + ena_release_all_tx_dmamap(tx_ring); err_tx_ids_free: free(tx_ring->free_tx_ids, M_DEVBUF); tx_ring->free_tx_ids = NULL; @@ -676,6 +709,10 @@ static void ena_free_tx_resources(struct ena_adapter *adapter, int qid) { struct ena_ring *tx_ring = &adapter->tx_ring[qid]; +#ifdef DEV_NETMAP + struct ena_netmap_tx_info *nm_info; + int j; +#endif /* DEV_NETMAP */ while (taskqueue_cancel(tx_ring->enqueue_tq, &tx_ring->enqueue_task, NULL)) @@ -711,6 +748,24 @@ ena_free_tx_resources(struct ena_adapter *adapter, int bus_dmamap_destroy(adapter->tx_buf_tag, tx_ring->tx_buffer_info[i].map_seg); +#ifdef DEV_NETMAP + if (adapter->ifp->if_capenable & IFCAP_NETMAP) { + nm_info = &tx_ring->tx_buffer_info[i].nm_info; + for (j = 0; j < ENA_PKT_MAX_BUFS; j++) { + if (nm_info->socket_buf_idx[j] != 0) { + bus_dmamap_sync(adapter->tx_buf_tag, + nm_info->map_seg[j], + BUS_DMASYNC_POSTWRITE); + ena_netmap_unload(adapter, + nm_info->map_seg[j]); + } + bus_dmamap_destroy(adapter->tx_buf_tag, + nm_info->map_seg[j]); + nm_info->socket_buf_idx[j] = 0; + } + } +#endif /* DEV_NETMAP */ + m_freem(tx_ring->tx_buffer_info[i].mbuf); tx_ring->tx_buffer_info[i].mbuf = NULL; } @@ -772,25 +827,6 @@ ena_free_all_tx_resources(struct ena_adapter *adapter) ena_free_tx_resources(adapter, i); } -static inline int -validate_rx_req_id(struct ena_ring *rx_ring, uint16_t req_id) -{ - if (likely(req_id < rx_ring->ring_size)) - return (0); - - device_printf(rx_ring->adapter->pdev, "Invalid rx req_id: %hu\n", - req_id); - counter_u64_add(rx_ring->rx_stats.bad_req_id, 1); - - /* Trigger device reset */ - if (likely(!ENA_FLAG_ISSET(ENA_FLAG_TRIGGER_RESET, rx_ring->adapter))) { - rx_ring->adapter->reset_reason = ENA_REGS_RESET_INV_RX_REQ_ID; - ENA_FLAG_SET_ATOMIC(ENA_FLAG_TRIGGER_RESET, rx_ring->adapter); - } - - return (EFAULT); -} - /** * ena_setup_rx_resources - allocate Rx resources (Descriptors) * @adapter: network interface device structure @@ -807,6 +843,11 @@ ena_setup_rx_resources(struct ena_adapter *adapter, un size = sizeof(struct ena_rx_buffer) * rx_ring->ring_size; +#ifdef DEV_NETMAP + ena_netmap_reset_rx_ring(adapter, qid); + rx_ring->initialized = false; +#endif /* DEV_NETMAP */ + /* * Alloc extra element so in rx path * we can always prefetch rx_info + 1 @@ -1031,7 +1072,7 @@ ena_free_rx_mbuf(struct ena_adapter *adapter, struct e * @num: number of descriptors to refill * Refills the ring with newly allocated DMA-mapped mbufs for receiving **/ -static int +int ena_refill_rx_bufs(struct ena_ring *rx_ring, uint32_t num) { struct ena_adapter *adapter = rx_ring->adapter; @@ -1052,8 +1093,12 @@ ena_refill_rx_bufs(struct ena_ring *rx_ring, uint32_t req_id = rx_ring->free_rx_ids[next_to_use]; rx_info = &rx_ring->rx_buffer_info[req_id]; - - rc = ena_alloc_rx_mbuf(adapter, rx_ring, rx_info); +#ifdef DEV_NETMAP + if (ena_rx_ring_in_netmap(adapter, rx_ring->qid)) + rc = ena_netmap_alloc_rx_slot(adapter, rx_ring, rx_info); + else +#endif /* DEV_NETMAP */ + rc = ena_alloc_rx_mbuf(adapter, rx_ring, rx_info); if (unlikely(rc != 0)) { ena_trace(ENA_WARNING, "failed to alloc buffer for rx queue %d\n", @@ -1098,6 +1143,14 @@ ena_free_rx_bufs(struct ena_adapter *adapter, unsigned if (rx_info->mbuf != NULL) ena_free_rx_mbuf(adapter, rx_ring, rx_info); +#ifdef DEV_NETMAP + if (((if_getflags(adapter->ifp) & IFF_DYING) == 0) && + (adapter->ifp->if_capenable & IFCAP_NETMAP)) { + if (rx_info->netmap_buf_idx != 0) + ena_netmap_free_rx_slot(adapter, rx_ring, + rx_info); + } +#endif /* DEV_NETMAP */ } } @@ -1116,10 +1169,12 @@ ena_refill_all_rx_bufs(struct ena_adapter *adapter) rx_ring = &adapter->rx_ring[i]; bufs_num = rx_ring->ring_size - 1; rc = ena_refill_rx_bufs(rx_ring, bufs_num); - if (unlikely(rc != bufs_num)) ena_trace(ENA_WARNING, "refilling Queue %d failed. " "Allocated %d buffers from: %d\n", i, rc, bufs_num); +#ifdef DEV_NETMAP + rx_ring->initialized = true; +#endif /* DEV_NETMAP */ } } @@ -1234,30 +1289,6 @@ ena_destroy_all_io_queues(struct ena_adapter *adapter) ena_destroy_all_rx_queues(adapter); } -static inline int -validate_tx_req_id(struct ena_ring *tx_ring, uint16_t req_id) -{ - struct ena_adapter *adapter = tx_ring->adapter; - struct ena_tx_buffer *tx_info = NULL; - - if (likely(req_id < tx_ring->ring_size)) { - tx_info = &tx_ring->tx_buffer_info[req_id]; - if (tx_info->mbuf != NULL) - return (0); - device_printf(adapter->pdev, - "tx_info doesn't have valid mbuf\n"); - } - - device_printf(adapter->pdev, "Invalid req_id: %hu\n", req_id); - counter_u64_add(tx_ring->tx_stats.bad_req_id, 1); - - /* Trigger device reset */ - adapter->reset_reason = ENA_REGS_RESET_INV_TX_REQ_ID; - ENA_FLAG_SET_ATOMIC(ENA_FLAG_TRIGGER_RESET, adapter); - - return (EFAULT); -} - static int ena_create_io_queues(struct ena_adapter *adapter) { @@ -1351,488 +1382,6 @@ err_tx: return (ENXIO); } -/** - * ena_tx_cleanup - clear sent packets and corresponding descriptors - * @tx_ring: ring for which we want to clean packets - * - * Once packets are sent, we ask the device in a loop for no longer used - * descriptors. We find the related mbuf chain in a map (index in an array) - * and free it, then update ring state. - * This is performed in "endless" loop, updating ring pointers every - * TX_COMMIT. The first check of free descriptor is performed before the actual - * loop, then repeated at the loop end. - **/ -static int -ena_tx_cleanup(struct ena_ring *tx_ring) -{ - struct ena_adapter *adapter; - struct ena_com_io_cq* io_cq; - uint16_t next_to_clean; - uint16_t req_id; - uint16_t ena_qid; - unsigned int total_done = 0; - int rc; - int commit = TX_COMMIT; - int budget = TX_BUDGET; - int work_done; - bool above_thresh; - - adapter = tx_ring->que->adapter; - ena_qid = ENA_IO_TXQ_IDX(tx_ring->que->id); - io_cq = &adapter->ena_dev->io_cq_queues[ena_qid]; - next_to_clean = tx_ring->next_to_clean; - - do { - struct ena_tx_buffer *tx_info; - struct mbuf *mbuf; - - rc = ena_com_tx_comp_req_id_get(io_cq, &req_id); - if (unlikely(rc != 0)) - break; - - rc = validate_tx_req_id(tx_ring, req_id); - if (unlikely(rc != 0)) - break; - - tx_info = &tx_ring->tx_buffer_info[req_id]; - - mbuf = tx_info->mbuf; - - tx_info->mbuf = NULL; - bintime_clear(&tx_info->timestamp); - - /* Map is no longer required */ - if (tx_info->head_mapped == true) { - bus_dmamap_sync(adapter->tx_buf_tag, tx_info->map_head, - BUS_DMASYNC_POSTWRITE); - bus_dmamap_unload(adapter->tx_buf_tag, - tx_info->map_head); - tx_info->head_mapped = false; - } - if (tx_info->seg_mapped == true) { - bus_dmamap_sync(adapter->tx_buf_tag, tx_info->map_seg, - BUS_DMASYNC_POSTWRITE); - bus_dmamap_unload(adapter->tx_buf_tag, - tx_info->map_seg); - tx_info->seg_mapped = false; - } - - ena_trace(ENA_DBG | ENA_TXPTH, "tx: q %d mbuf %p completed\n", - tx_ring->qid, mbuf); - - m_freem(mbuf); - - total_done += tx_info->tx_descs; - - tx_ring->free_tx_ids[next_to_clean] = req_id; - next_to_clean = ENA_TX_RING_IDX_NEXT(next_to_clean, - tx_ring->ring_size); - - if (unlikely(--commit == 0)) { - commit = TX_COMMIT; - /* update ring state every TX_COMMIT descriptor */ - tx_ring->next_to_clean = next_to_clean; - ena_com_comp_ack( - &adapter->ena_dev->io_sq_queues[ena_qid], - total_done); - ena_com_update_dev_comp_head(io_cq); - total_done = 0; - } - } while (likely(--budget)); - - work_done = TX_BUDGET - budget; - - ena_trace(ENA_DBG | ENA_TXPTH, "tx: q %d done. total pkts: %d\n", - tx_ring->qid, work_done); - - /* If there is still something to commit update ring state */ - if (likely(commit != TX_COMMIT)) { - tx_ring->next_to_clean = next_to_clean; - ena_com_comp_ack(&adapter->ena_dev->io_sq_queues[ena_qid], - total_done); - ena_com_update_dev_comp_head(io_cq); - } - - /* - * Need to make the rings circular update visible to - * ena_xmit_mbuf() before checking for tx_ring->running. - */ - mb(); - - above_thresh = ena_com_sq_have_enough_space(tx_ring->ena_com_io_sq, - ENA_TX_RESUME_THRESH); - if (unlikely(!tx_ring->running && above_thresh)) { - ENA_RING_MTX_LOCK(tx_ring); - above_thresh = - ena_com_sq_have_enough_space(tx_ring->ena_com_io_sq, - ENA_TX_RESUME_THRESH); - if (!tx_ring->running && above_thresh) { - tx_ring->running = true; - counter_u64_add(tx_ring->tx_stats.queue_wakeup, 1); - taskqueue_enqueue(tx_ring->enqueue_tq, - &tx_ring->enqueue_task); - } - ENA_RING_MTX_UNLOCK(tx_ring); - } - - return (work_done); -} - -static void -ena_rx_hash_mbuf(struct ena_ring *rx_ring, struct ena_com_rx_ctx *ena_rx_ctx, - struct mbuf *mbuf) -{ - struct ena_adapter *adapter = rx_ring->adapter; - - if (likely(ENA_FLAG_ISSET(ENA_FLAG_RSS_ACTIVE, adapter))) { - mbuf->m_pkthdr.flowid = ena_rx_ctx->hash; - -#ifdef RSS - /* - * Hardware and software RSS are in agreement only when both are - * configured to Toeplitz algorithm. This driver configures - * that algorithm only when software RSS is enabled and uses it. - */ - if (adapter->ena_dev->rss.hash_func != ENA_ADMIN_TOEPLITZ && - ena_rx_ctx->l3_proto != ENA_ETH_IO_L3_PROTO_UNKNOWN) { - M_HASHTYPE_SET(mbuf, M_HASHTYPE_OPAQUE_HASH); - return; - } -#endif - - if (ena_rx_ctx->frag && - (ena_rx_ctx->l3_proto != ENA_ETH_IO_L3_PROTO_UNKNOWN)) { - M_HASHTYPE_SET(mbuf, M_HASHTYPE_OPAQUE_HASH); - return; - } - - switch (ena_rx_ctx->l3_proto) { - case ENA_ETH_IO_L3_PROTO_IPV4: - switch (ena_rx_ctx->l4_proto) { - case ENA_ETH_IO_L4_PROTO_TCP: - M_HASHTYPE_SET(mbuf, M_HASHTYPE_RSS_TCP_IPV4); - break; - case ENA_ETH_IO_L4_PROTO_UDP: - M_HASHTYPE_SET(mbuf, M_HASHTYPE_RSS_UDP_IPV4); - break; - default: - M_HASHTYPE_SET(mbuf, M_HASHTYPE_RSS_IPV4); - } - break; - case ENA_ETH_IO_L3_PROTO_IPV6: - switch (ena_rx_ctx->l4_proto) { - case ENA_ETH_IO_L4_PROTO_TCP: - M_HASHTYPE_SET(mbuf, M_HASHTYPE_RSS_TCP_IPV6); - break; - case ENA_ETH_IO_L4_PROTO_UDP: - M_HASHTYPE_SET(mbuf, M_HASHTYPE_RSS_UDP_IPV6); - break; - default: - M_HASHTYPE_SET(mbuf, M_HASHTYPE_RSS_IPV6); - } - break; - case ENA_ETH_IO_L3_PROTO_UNKNOWN: - M_HASHTYPE_SET(mbuf, M_HASHTYPE_NONE); - break; - default: - M_HASHTYPE_SET(mbuf, M_HASHTYPE_OPAQUE_HASH); - } - } else { - mbuf->m_pkthdr.flowid = rx_ring->qid; - M_HASHTYPE_SET(mbuf, M_HASHTYPE_NONE); - } -} - -/** - * ena_rx_mbuf - assemble mbuf from descriptors - * @rx_ring: ring for which we want to clean packets - * @ena_bufs: buffer info - * @ena_rx_ctx: metadata for this packet(s) - * @next_to_clean: ring pointer, will be updated only upon success - * - **/ -static struct mbuf* -ena_rx_mbuf(struct ena_ring *rx_ring, struct ena_com_rx_buf_info *ena_bufs, - struct ena_com_rx_ctx *ena_rx_ctx, uint16_t *next_to_clean) -{ - struct mbuf *mbuf; - struct ena_rx_buffer *rx_info; - struct ena_adapter *adapter; - unsigned int descs = ena_rx_ctx->descs; - int rc; - uint16_t ntc, len, req_id, buf = 0; - - ntc = *next_to_clean; - adapter = rx_ring->adapter; - - len = ena_bufs[buf].len; - req_id = ena_bufs[buf].req_id; - rc = validate_rx_req_id(rx_ring, req_id); - if (unlikely(rc != 0)) - return (NULL); - - rx_info = &rx_ring->rx_buffer_info[req_id]; - if (unlikely(rx_info->mbuf == NULL)) { - device_printf(adapter->pdev, "NULL mbuf in rx_info"); - return (NULL); - } - - ena_trace(ENA_DBG | ENA_RXPTH, "rx_info %p, mbuf %p, paddr %jx\n", - rx_info, rx_info->mbuf, (uintmax_t)rx_info->ena_buf.paddr); - - bus_dmamap_sync(adapter->rx_buf_tag, rx_info->map, - BUS_DMASYNC_POSTREAD); - mbuf = rx_info->mbuf; - mbuf->m_flags |= M_PKTHDR; - mbuf->m_pkthdr.len = len; - mbuf->m_len = len; - mbuf->m_pkthdr.rcvif = rx_ring->que->adapter->ifp; - - /* Fill mbuf with hash key and it's interpretation for optimization */ - ena_rx_hash_mbuf(rx_ring, ena_rx_ctx, mbuf); - - ena_trace(ENA_DBG | ENA_RXPTH, "rx mbuf 0x%p, flags=0x%x, len: %d\n", - mbuf, mbuf->m_flags, mbuf->m_pkthdr.len); - - /* DMA address is not needed anymore, unmap it */ - bus_dmamap_unload(rx_ring->adapter->rx_buf_tag, rx_info->map); - - rx_info->mbuf = NULL; - rx_ring->free_rx_ids[ntc] = req_id; - ntc = ENA_RX_RING_IDX_NEXT(ntc, rx_ring->ring_size); - - /* - * While we have more than 1 descriptors for one rcvd packet, append - * other mbufs to the main one - */ - while (--descs) { - ++buf; - len = ena_bufs[buf].len; - req_id = ena_bufs[buf].req_id; - rc = validate_rx_req_id(rx_ring, req_id); - if (unlikely(rc != 0)) { - /* - * If the req_id is invalid, then the device will be - * reset. In that case we must free all mbufs that - * were already gathered. - */ - m_freem(mbuf); - return (NULL); - } - rx_info = &rx_ring->rx_buffer_info[req_id]; - - if (unlikely(rx_info->mbuf == NULL)) { - device_printf(adapter->pdev, "NULL mbuf in rx_info"); - /* - * If one of the required mbufs was not allocated yet, - * we can break there. - * All earlier used descriptors will be reallocated - * later and not used mbufs can be reused. - * The next_to_clean pointer will not be updated in case - * of an error, so caller should advance it manually - * in error handling routine to keep it up to date - * with hw ring. - */ - m_freem(mbuf); - return (NULL); - } - - bus_dmamap_sync(adapter->rx_buf_tag, rx_info->map, - BUS_DMASYNC_POSTREAD); - if (unlikely(m_append(mbuf, len, rx_info->mbuf->m_data) == 0)) { - counter_u64_add(rx_ring->rx_stats.mbuf_alloc_fail, 1); - ena_trace(ENA_WARNING, "Failed to append Rx mbuf %p\n", - mbuf); - } - - ena_trace(ENA_DBG | ENA_RXPTH, - "rx mbuf updated. len %d\n", mbuf->m_pkthdr.len); - - /* Free already appended mbuf, it won't be useful anymore */ - bus_dmamap_unload(rx_ring->adapter->rx_buf_tag, rx_info->map); - m_freem(rx_info->mbuf); - rx_info->mbuf = NULL; - - rx_ring->free_rx_ids[ntc] = req_id; - ntc = ENA_RX_RING_IDX_NEXT(ntc, rx_ring->ring_size); - } - - *next_to_clean = ntc; - - return (mbuf); -} - -/** - * ena_rx_checksum - indicate in mbuf if hw indicated a good cksum - **/ -static inline void -ena_rx_checksum(struct ena_ring *rx_ring, struct ena_com_rx_ctx *ena_rx_ctx, - struct mbuf *mbuf) -{ - - /* if IP and error */ - if (unlikely((ena_rx_ctx->l3_proto == ENA_ETH_IO_L3_PROTO_IPV4) && - ena_rx_ctx->l3_csum_err)) { - /* ipv4 checksum error */ - mbuf->m_pkthdr.csum_flags = 0; - counter_u64_add(rx_ring->rx_stats.bad_csum, 1); - ena_trace(ENA_DBG, "RX IPv4 header checksum error\n"); - return; - } - - /* if TCP/UDP */ - if ((ena_rx_ctx->l4_proto == ENA_ETH_IO_L4_PROTO_TCP) || - (ena_rx_ctx->l4_proto == ENA_ETH_IO_L4_PROTO_UDP)) { - if (ena_rx_ctx->l4_csum_err) { - /* TCP/UDP checksum error */ - mbuf->m_pkthdr.csum_flags = 0; - counter_u64_add(rx_ring->rx_stats.bad_csum, 1); - ena_trace(ENA_DBG, "RX L4 checksum error\n"); - } else { - mbuf->m_pkthdr.csum_flags = CSUM_IP_CHECKED; - mbuf->m_pkthdr.csum_flags |= CSUM_IP_VALID; - } - } -} - -/** - * ena_rx_cleanup - handle rx irq - * @arg: ring for which irq is being handled - **/ -static int -ena_rx_cleanup(struct ena_ring *rx_ring) -{ - struct ena_adapter *adapter; - struct mbuf *mbuf; - struct ena_com_rx_ctx ena_rx_ctx; - struct ena_com_io_cq* io_cq; - struct ena_com_io_sq* io_sq; - if_t ifp; - uint16_t ena_qid; - uint16_t next_to_clean; - uint32_t refill_required; - uint32_t refill_threshold; - uint32_t do_if_input = 0; - unsigned int qid; - int rc, i; - int budget = RX_BUDGET; - - adapter = rx_ring->que->adapter; - ifp = adapter->ifp; - qid = rx_ring->que->id; - ena_qid = ENA_IO_RXQ_IDX(qid); - io_cq = &adapter->ena_dev->io_cq_queues[ena_qid]; - io_sq = &adapter->ena_dev->io_sq_queues[ena_qid]; - next_to_clean = rx_ring->next_to_clean; - - ena_trace(ENA_DBG, "rx: qid %d\n", qid); - - do { - ena_rx_ctx.ena_bufs = rx_ring->ena_bufs; - ena_rx_ctx.max_bufs = adapter->max_rx_sgl_size; - ena_rx_ctx.descs = 0; - bus_dmamap_sync(io_cq->cdesc_addr.mem_handle.tag, - io_cq->cdesc_addr.mem_handle.map, BUS_DMASYNC_POSTREAD); - rc = ena_com_rx_pkt(io_cq, io_sq, &ena_rx_ctx); - - if (unlikely(rc != 0)) - goto error; - - if (unlikely(ena_rx_ctx.descs == 0)) - break; - - ena_trace(ENA_DBG | ENA_RXPTH, "rx: q %d got packet from ena. " - "descs #: %d l3 proto %d l4 proto %d hash: %x\n", - rx_ring->qid, ena_rx_ctx.descs, ena_rx_ctx.l3_proto, - ena_rx_ctx.l4_proto, ena_rx_ctx.hash); - - /* Receive mbuf from the ring */ - mbuf = ena_rx_mbuf(rx_ring, rx_ring->ena_bufs, - &ena_rx_ctx, &next_to_clean); - bus_dmamap_sync(io_cq->cdesc_addr.mem_handle.tag, - io_cq->cdesc_addr.mem_handle.map, BUS_DMASYNC_PREREAD); - /* Exit if we failed to retrieve a buffer */ - if (unlikely(mbuf == NULL)) { - for (i = 0; i < ena_rx_ctx.descs; ++i) { - rx_ring->free_rx_ids[next_to_clean] = - rx_ring->ena_bufs[i].req_id; - next_to_clean = - ENA_RX_RING_IDX_NEXT(next_to_clean, - rx_ring->ring_size); - - } - break; - } - - if (((ifp->if_capenable & IFCAP_RXCSUM) != 0) || - ((ifp->if_capenable & IFCAP_RXCSUM_IPV6) != 0)) { - ena_rx_checksum(rx_ring, &ena_rx_ctx, mbuf); - } - - counter_enter(); - counter_u64_add_protected(rx_ring->rx_stats.bytes, - mbuf->m_pkthdr.len); - counter_u64_add_protected(adapter->hw_stats.rx_bytes, - mbuf->m_pkthdr.len); - counter_exit(); - /* - * LRO is only for IP/TCP packets and TCP checksum of the packet - * should be computed by hardware. - */ - do_if_input = 1; - if (((ifp->if_capenable & IFCAP_LRO) != 0) && - ((mbuf->m_pkthdr.csum_flags & CSUM_IP_VALID) != 0) && - (ena_rx_ctx.l4_proto == ENA_ETH_IO_L4_PROTO_TCP)) { - /* - * Send to the stack if: - * - LRO not enabled, or - * - no LRO resources, or - * - lro enqueue fails - */ - if ((rx_ring->lro.lro_cnt != 0) && - (tcp_lro_rx(&rx_ring->lro, mbuf, 0) == 0)) - do_if_input = 0; - } - if (do_if_input != 0) { - ena_trace(ENA_DBG | ENA_RXPTH, - "calling if_input() with mbuf %p\n", mbuf); - (*ifp->if_input)(ifp, mbuf); - } - - counter_enter(); - counter_u64_add_protected(rx_ring->rx_stats.cnt, 1); - counter_u64_add_protected(adapter->hw_stats.rx_packets, 1); - counter_exit(); - } while (--budget); - - rx_ring->next_to_clean = next_to_clean; - - refill_required = ena_com_free_desc(io_sq); - refill_threshold = min_t(int, - rx_ring->ring_size / ENA_RX_REFILL_THRESH_DIVIDER, - ENA_RX_REFILL_THRESH_PACKET); - - if (refill_required > refill_threshold) { - ena_com_update_dev_comp_head(rx_ring->ena_com_io_cq); - ena_refill_rx_bufs(rx_ring, refill_required); - } - - tcp_lro_flush_all(&rx_ring->lro); - - return (RX_BUDGET - budget); - -error: - counter_u64_add(rx_ring->rx_stats.bad_desc_num, 1); - - /* Too many desc from the device. Trigger reset */ - if (likely(!ENA_FLAG_ISSET(ENA_FLAG_TRIGGER_RESET, adapter))) { - adapter->reset_reason = ENA_REGS_RESET_TOO_MANY_RX_DESCS; - ENA_FLAG_SET_ATOMIC(ENA_FLAG_TRIGGER_RESET, adapter); - } - - return (0); -} - /********************************************************************* * * MSIX & Interrupt Service routine @@ -1853,52 +1402,6 @@ ena_intr_msix_mgmnt(void *arg) ena_com_aenq_intr_handler(adapter->ena_dev, arg); } -static void -ena_cleanup(void *arg, int pending) -{ - struct ena_que *que = arg; - struct ena_adapter *adapter = que->adapter; - if_t ifp = adapter->ifp; - struct ena_ring *tx_ring; - struct ena_ring *rx_ring; - struct ena_com_io_cq* io_cq; - struct ena_eth_io_intr_reg intr_reg; - int qid, ena_qid; - int txc, rxc, i; - - if (unlikely((if_getdrvflags(ifp) & IFF_DRV_RUNNING) == 0)) - return; - - ena_trace(ENA_DBG, "MSI-X TX/RX routine\n"); - - tx_ring = que->tx_ring; - rx_ring = que->rx_ring; - qid = que->id; - ena_qid = ENA_IO_TXQ_IDX(qid); - io_cq = &adapter->ena_dev->io_cq_queues[ena_qid]; - - tx_ring->first_interrupt = true; - rx_ring->first_interrupt = true; - - for (i = 0; i < CLEAN_BUDGET; ++i) { - rxc = ena_rx_cleanup(rx_ring); - txc = ena_tx_cleanup(tx_ring); - - if (unlikely((if_getdrvflags(ifp) & IFF_DRV_RUNNING) == 0)) - return; - - if ((txc != TX_BUDGET) && (rxc != RX_BUDGET)) - break; - } - - /* Signal that work is done and unmask interrupt */ - ena_com_update_intr_reg(&intr_reg, - RX_IRQ_INTERVAL, - TX_IRQ_INTERVAL, - true); - ena_com_unmask_intr(io_cq, &intr_reg); -} - /** * ena_handle_msix - MSIX Interrupt Handler for Tx/Rx * @arg: queue @@ -2309,7 +1812,7 @@ ena_up_complete(struct ena_adapter *adapter) return (0); } -static int +int ena_up(struct ena_adapter *adapter) { int rc = 0; @@ -2370,8 +1873,14 @@ ena_up(struct ena_adapter *adapter) if_setdrvflagbits(adapter->ifp, IFF_DRV_RUNNING, IFF_DRV_OACTIVE); - callout_reset_sbt(&adapter->timer_service, SBT_1S, SBT_1S, - ena_timer_service, (void *)adapter, 0); + /* Activate timer service only if the device is running. + * If this flag is not set, it means that the driver is being + * reset and timer service will be activated afterwards. + */ + if (ENA_FLAG_ISSET(ENA_FLAG_DEVICE_RUNNING, adapter)) { + callout_reset_sbt(&adapter->timer_service, SBT_1S, + SBT_1S, ena_timer_service, (void *)adapter, 0); + } ENA_FLAG_SET_ATOMIC(ENA_FLAG_DEV_UP, adapter); @@ -2680,7 +2189,7 @@ ena_setup_ifnet(device_t pdev, struct ena_adapter *ada return (0); } -static void +void ena_down(struct ena_adapter *adapter) { int rc; @@ -2715,579 +2224,7 @@ ena_down(struct ena_adapter *adapter) } } -static void -ena_tx_csum(struct ena_com_tx_ctx *ena_tx_ctx, struct mbuf *mbuf) -{ - struct ena_com_tx_meta *ena_meta; - struct ether_vlan_header *eh; - struct mbuf *mbuf_next; - u32 mss; - bool offload; - uint16_t etype; - int ehdrlen; - struct ip *ip; - int iphlen; - struct tcphdr *th; - int offset; - - offload = false; - ena_meta = &ena_tx_ctx->ena_meta; - mss = mbuf->m_pkthdr.tso_segsz; - - if (mss != 0) - offload = true; - - if ((mbuf->m_pkthdr.csum_flags & CSUM_TSO) != 0) - offload = true; - - if ((mbuf->m_pkthdr.csum_flags & CSUM_OFFLOAD) != 0) - offload = true; - - if (!offload) { - ena_tx_ctx->meta_valid = 0; - return; - } - - /* Determine where frame payload starts. */ - eh = mtod(mbuf, struct ether_vlan_header *); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sun Sep 6 14:41:36 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 128A33D3290; Sun, 6 Sep 2020 14:41:36 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BkvHg70zFz3yjd; Sun, 6 Sep 2020 14:41:35 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 BA755100B4; Sun, 6 Sep 2020 14:41:35 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 086EfZjO049740; Sun, 6 Sep 2020 14:41:35 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 086EfZbv049737; Sun, 6 Sep 2020 14:41:35 GMT (envelope-from mw@FreeBSD.org) Message-Id: <202009061441.086EfZbv049737@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Sun, 6 Sep 2020 14:41:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365381 - in stable/12/sys: contrib/ena-com contrib/ena-com/ena_defs dev/ena X-SVN-Group: stable-12 X-SVN-Commit-Author: mw X-SVN-Commit-Paths: in stable/12/sys: contrib/ena-com contrib/ena-com/ena_defs dev/ena X-SVN-Commit-Revision: 365381 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.33 Precedence: list List-Id: "SVN commit messages 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, 06 Sep 2020 14:41:36 -0000 Author: mw Date: Sun Sep 6 14:41:35 2020 New Revision: 365381 URL: https://svnweb.freebsd.org/changeset/base/365381 Log: MFC: Merge ENA v2.2.0 driver r361530 Update ENA driver version to v2.2.0 r361529 Refactor ena_tx_map_mbuf() function r361528 Fix double-free bug within ena_detach() r361527 Allow disabling meta caching for ENA Tx path r361526 Create ENA IO queues with optional backoff r361525 Add sysctl node for ENA IO queues number adjustment r361524 Fix assumptions about number of IO queues in the ENA r361523 Rework ENA Tx buffer ring size reconfiguration r361521 Rework ENA Rx queue size configuration r361518 Improve indentation in ena_up() and ena_down() r361517 Expose argument names for non static ENA driver functions r361516 Use single global lock in the ENA driver r361515 Add trigger reset function in the ENA driver r361514 Provide ENA driver version in a sysctl node r361513 Remove unused argument from static function in ena.c r361512 Enable Tx drops reporting in the ENA driver r361511 Adjust ENA driver to the new HAL r358289 Rework and simplify Tx DMA mapping in ENA Obtained from: Semihalf Sponsored by: Amazon, Inc. Modified: stable/12/sys/contrib/ena-com/ena_com.c stable/12/sys/contrib/ena-com/ena_com.h stable/12/sys/contrib/ena-com/ena_defs/ena_admin_defs.h stable/12/sys/contrib/ena-com/ena_defs/ena_common_defs.h stable/12/sys/contrib/ena-com/ena_defs/ena_eth_io_defs.h stable/12/sys/contrib/ena-com/ena_defs/ena_gen_info.h stable/12/sys/contrib/ena-com/ena_defs/ena_regs_defs.h stable/12/sys/contrib/ena-com/ena_eth_com.c stable/12/sys/contrib/ena-com/ena_eth_com.h stable/12/sys/contrib/ena-com/ena_plat.h stable/12/sys/dev/ena/ena.c stable/12/sys/dev/ena/ena.h stable/12/sys/dev/ena/ena_datapath.c stable/12/sys/dev/ena/ena_datapath.h stable/12/sys/dev/ena/ena_netmap.c stable/12/sys/dev/ena/ena_netmap.h stable/12/sys/dev/ena/ena_sysctl.c stable/12/sys/dev/ena/ena_sysctl.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/contrib/ena-com/ena_com.c ============================================================================== --- stable/12/sys/contrib/ena-com/ena_com.c Sun Sep 6 14:23:31 2020 (r365380) +++ stable/12/sys/contrib/ena-com/ena_com.c Sun Sep 6 14:41:35 2020 (r365381) @@ -1,7 +1,7 @@ /*- * BSD LICENSE * - * Copyright (c) 2015-2019 Amazon.com, Inc. or its affiliates. + * Copyright (c) 2015-2020 Amazon.com, Inc. or its affiliates. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -70,8 +70,10 @@ #define ENA_REGS_ADMIN_INTR_MASK 1 -#define ENA_POLL_MS 5 +#define ENA_MIN_POLL_US 100 +#define ENA_MAX_POLL_US 5000 + /*****************************************************************************/ /*****************************************************************************/ /*****************************************************************************/ @@ -99,7 +101,7 @@ struct ena_com_stats_ctx { struct ena_admin_acq_get_stats_resp get_resp; }; -static inline int ena_com_mem_addr_set(struct ena_com_dev *ena_dev, +static int ena_com_mem_addr_set(struct ena_com_dev *ena_dev, struct ena_common_mem_addr *ena_addr, dma_addr_t addr) { @@ -200,7 +202,7 @@ static int ena_com_admin_init_aenq(struct ena_com_dev return 0; } -static inline void comp_ctxt_release(struct ena_com_admin_queue *queue, +static void comp_ctxt_release(struct ena_com_admin_queue *queue, struct ena_comp_ctx *comp_ctx) { comp_ctx->occupied = false; @@ -216,6 +218,11 @@ static struct ena_comp_ctx *get_comp_ctxt(struct ena_c return NULL; } + if (unlikely(!queue->comp_ctx)) { + ena_trc_err("Completion context is NULL\n"); + return NULL; + } + if (unlikely(queue->comp_ctx[command_id].occupied && capture)) { ena_trc_err("Completion context is occupied\n"); return NULL; @@ -289,7 +296,7 @@ static struct ena_comp_ctx *__ena_com_submit_admin_cmd return comp_ctx; } -static inline int ena_com_init_comp_ctxt(struct ena_com_admin_queue *queue) +static int ena_com_init_comp_ctxt(struct ena_com_admin_queue *queue) { size_t size = queue->q_depth * sizeof(struct ena_comp_ctx); struct ena_comp_ctx *comp_ctx; @@ -409,6 +416,8 @@ static int ena_com_init_io_sq(struct ena_com_dev *ena_ 0x0, io_sq->llq_info.desc_list_entry_size); io_sq->llq_buf_ctrl.descs_left_in_line = io_sq->llq_info.descs_num_before_header; + io_sq->disable_meta_caching = + io_sq->llq_info.disable_meta_caching; if (io_sq->llq_info.max_entries_in_tx_burst > 0) io_sq->entries_in_tx_burst_left = @@ -534,12 +543,9 @@ static int ena_com_comp_status_to_errno(u8 comp_status if (unlikely(comp_status != 0)) ena_trc_err("admin command failed[%u]\n", comp_status); - if (unlikely(comp_status > ENA_ADMIN_UNKNOWN_ERROR)) - return ENA_COM_INVAL; - switch (comp_status) { case ENA_ADMIN_SUCCESS: - return 0; + return ENA_COM_OK; case ENA_ADMIN_RESOURCE_ALLOCATION_FAILURE: return ENA_COM_NO_MEM; case ENA_ADMIN_UNSUPPORTED_OPCODE: @@ -551,24 +557,32 @@ static int ena_com_comp_status_to_errno(u8 comp_status return ENA_COM_INVAL; } - return 0; + return ENA_COM_INVAL; } +static inline void ena_delay_exponential_backoff_us(u32 exp, u32 delay_us) +{ + delay_us = ENA_MAX32(ENA_MIN_POLL_US, delay_us); + delay_us = ENA_MIN32(delay_us * (1 << exp), ENA_MAX_POLL_US); + ENA_USLEEP(delay_us); +} + static int ena_com_wait_and_process_admin_cq_polling(struct ena_comp_ctx *comp_ctx, struct ena_com_admin_queue *admin_queue) { unsigned long flags = 0; - unsigned long timeout; + ena_time_t timeout; int ret; + u32 exp = 0; timeout = ENA_GET_SYSTEM_TIMEOUT(admin_queue->completion_timeout); while (1) { - ENA_SPINLOCK_LOCK(admin_queue->q_lock, flags); - ena_com_handle_admin_completion(admin_queue); - ENA_SPINLOCK_UNLOCK(admin_queue->q_lock, flags); + ENA_SPINLOCK_LOCK(admin_queue->q_lock, flags); + ena_com_handle_admin_completion(admin_queue); + ENA_SPINLOCK_UNLOCK(admin_queue->q_lock, flags); - if (comp_ctx->status != ENA_CMD_SUBMITTED) + if (comp_ctx->status != ENA_CMD_SUBMITTED) break; if (ENA_TIME_EXPIRE(timeout)) { @@ -583,7 +597,7 @@ static int ena_com_wait_and_process_admin_cq_polling(s goto err; } - ENA_MSLEEP(ENA_POLL_MS); + ena_delay_exponential_backoff_us(exp++, admin_queue->ena_dev->ena_min_poll_delay_us); } if (unlikely(comp_ctx->status == ENA_CMD_ABORTED)) { @@ -629,6 +643,14 @@ static int ena_com_set_llq(struct ena_com_dev *ena_dev cmd.u.llq.desc_num_before_header_enabled = llq_info->descs_num_before_header; cmd.u.llq.descriptors_stride_ctrl_enabled = llq_info->desc_stride_ctrl; + if (llq_info->disable_meta_caching) + cmd.u.llq.accel_mode.u.set.enabled_flags |= + BIT(ENA_ADMIN_DISABLE_META_CACHING); + + if (llq_info->max_entries_in_tx_burst) + cmd.u.llq.accel_mode.u.set.enabled_flags |= + BIT(ENA_ADMIN_LIMIT_TX_BURST); + ret = ena_com_execute_admin_command(admin_queue, (struct ena_admin_aq_entry *)&cmd, sizeof(cmd), @@ -748,15 +770,21 @@ static int ena_com_config_llq_info(struct ena_com_dev supported_feat, llq_info->descs_num_before_header); } + /* Check for accelerated queue supported */ + llq_info->disable_meta_caching = + llq_features->accel_mode.u.get.supported_flags & + BIT(ENA_ADMIN_DISABLE_META_CACHING); - llq_info->max_entries_in_tx_burst = - (u16)(llq_features->max_tx_burst_size / llq_default_cfg->llq_ring_entry_size_value); + if (llq_features->accel_mode.u.get.supported_flags & BIT(ENA_ADMIN_LIMIT_TX_BURST)) + llq_info->max_entries_in_tx_burst = + llq_features->accel_mode.u.get.max_tx_burst_size / + llq_default_cfg->llq_ring_entry_size_value; rc = ena_com_set_llq(ena_dev); if (rc) ena_trc_err("Cannot set LLQ configuration: %d\n", rc); - return 0; + return rc; } static int ena_com_wait_and_process_admin_cq_interrupts(struct ena_comp_ctx *comp_ctx, @@ -779,16 +807,25 @@ static int ena_com_wait_and_process_admin_cq_interrupt admin_queue->stats.no_completion++; ENA_SPINLOCK_UNLOCK(admin_queue->q_lock, flags); - if (comp_ctx->status == ENA_CMD_COMPLETED) - ena_trc_err("The ena device have completion but the driver didn't receive any MSI-X interrupt (cmd %d)\n", - comp_ctx->cmd_opcode); - else - ena_trc_err("The ena device doesn't send any completion for the admin cmd %d status %d\n", + if (comp_ctx->status == ENA_CMD_COMPLETED) { + ena_trc_err("The ena device sent a completion but the driver didn't receive a MSI-X interrupt (cmd %d), autopolling mode is %s\n", + comp_ctx->cmd_opcode, admin_queue->auto_polling ? "ON" : "OFF"); + /* Check if fallback to polling is enabled */ + if (admin_queue->auto_polling) + admin_queue->polling = true; + } else { + ena_trc_err("The ena device didn't send a completion for the admin cmd %d status %d\n", comp_ctx->cmd_opcode, comp_ctx->status); - - admin_queue->running_state = false; - ret = ENA_COM_TIMER_EXPIRED; - goto err; + } + /* Check if shifted to polling mode. + * This will happen if there is a completion without an interrupt + * and autopolling mode is enabled. Continuing normal execution in such case + */ + if (!admin_queue->polling) { + admin_queue->running_state = false; + ret = ENA_COM_TIMER_EXPIRED; + goto err; + } } ret = ena_com_comp_status_to_errno(comp_ctx->comp_status); @@ -944,7 +981,9 @@ static void ena_com_io_queue_free(struct ena_com_dev * } if (io_sq->bounce_buf_ctrl.base_buffer) { - ENA_MEM_FREE(ena_dev->dmadev, io_sq->bounce_buf_ctrl.base_buffer); + ENA_MEM_FREE(ena_dev->dmadev, + io_sq->bounce_buf_ctrl.base_buffer, + (io_sq->llq_info.desc_list_entry_size * ENA_COM_BOUNCE_BUFFER_CNTRL_CNT)); io_sq->bounce_buf_ctrl.base_buffer = NULL; } } @@ -952,12 +991,13 @@ static void ena_com_io_queue_free(struct ena_com_dev * static int wait_for_reset_state(struct ena_com_dev *ena_dev, u32 timeout, u16 exp_state) { - u32 val, i; + u32 val, exp = 0; + ena_time_t timeout_stamp; - /* Convert timeout from resolution of 100ms to ENA_POLL_MS */ - timeout = (timeout * 100) / ENA_POLL_MS; + /* Convert timeout from resolution of 100ms to us resolution. */ + timeout_stamp = ENA_GET_SYSTEM_TIMEOUT(100 * 1000 * timeout); - for (i = 0; i < timeout; i++) { + while (1) { val = ena_com_reg_bar_read32(ena_dev, ENA_REGS_DEV_STS_OFF); if (unlikely(val == ENA_MMIO_READ_TIMEOUT)) { @@ -969,10 +1009,11 @@ static int wait_for_reset_state(struct ena_com_dev *en exp_state) return 0; - ENA_MSLEEP(ENA_POLL_MS); - } + if (ENA_TIME_EXPIRE(timeout_stamp)) + return ENA_COM_TIMER_EXPIRED; - return ENA_COM_TIMER_EXPIRED; + ena_delay_exponential_backoff_us(exp++, ena_dev->ena_min_poll_delay_us); + } } static bool ena_com_check_supported_feature_id(struct ena_com_dev *ena_dev, @@ -1055,10 +1096,34 @@ static int ena_com_get_feature(struct ena_com_dev *ena feature_ver); } +int ena_com_get_current_hash_function(struct ena_com_dev *ena_dev) +{ + return ena_dev->rss.hash_func; +} + +static void ena_com_hash_key_fill_default_key(struct ena_com_dev *ena_dev) +{ + struct ena_admin_feature_rss_flow_hash_control *hash_key = + (ena_dev->rss).hash_key; + + ENA_RSS_FILL_KEY(&hash_key->key, sizeof(hash_key->key)); + /* The key buffer is stored in the device in an array of + * uint32 elements. Therefore the number of elements can be derived + * by dividing the buffer length by the size of each array element. + * In current implementation each element is sized at uint32_t + * so it's actually a division by 4 but if the element size changes, + * there is no need to rewrite this code. + */ + hash_key->keys_num = sizeof(hash_key->key) / sizeof(hash_key->key[0]); +} + static int ena_com_hash_key_allocate(struct ena_com_dev *ena_dev) { struct ena_rss *rss = &ena_dev->rss; + if (!ena_com_check_supported_feature_id(ena_dev, ENA_ADMIN_RSS_HASH_FUNCTION)) + return ENA_COM_UNSUPPORTED; + ENA_MEM_ALLOC_COHERENT(ena_dev->dmadev, sizeof(*rss->hash_key), rss->hash_key, @@ -1186,7 +1251,9 @@ static void ena_com_indirect_table_destroy(struct ena_ rss->rss_ind_tbl = NULL; if (rss->host_rss_ind_tbl) - ENA_MEM_FREE(ena_dev->dmadev, rss->host_rss_ind_tbl); + ENA_MEM_FREE(ena_dev->dmadev, + rss->host_rss_ind_tbl, + ((1ULL << rss->tbl_log_size) * sizeof(u16))); rss->host_rss_ind_tbl = NULL; } @@ -1287,63 +1354,29 @@ static int ena_com_ind_tbl_convert_to_device(struct en return 0; } -static int ena_com_ind_tbl_convert_from_device(struct ena_com_dev *ena_dev) -{ - u16 dev_idx_to_host_tbl[ENA_TOTAL_NUM_QUEUES] = { (u16)-1 }; - struct ena_rss *rss = &ena_dev->rss; - u8 idx; - u16 i; - - for (i = 0; i < ENA_TOTAL_NUM_QUEUES; i++) - dev_idx_to_host_tbl[ena_dev->io_sq_queues[i].idx] = i; - - for (i = 0; i < 1 << rss->tbl_log_size; i++) { - if (rss->rss_ind_tbl[i].cq_idx > ENA_TOTAL_NUM_QUEUES) - return ENA_COM_INVAL; - idx = (u8)rss->rss_ind_tbl[i].cq_idx; - - if (dev_idx_to_host_tbl[idx] > ENA_TOTAL_NUM_QUEUES) - return ENA_COM_INVAL; - - rss->host_rss_ind_tbl[i] = dev_idx_to_host_tbl[idx]; - } - - return 0; -} - -static int ena_com_init_interrupt_moderation_table(struct ena_com_dev *ena_dev) -{ - size_t size; - - size = sizeof(struct ena_intr_moder_entry) * ENA_INTR_MAX_NUM_OF_LEVELS; - - ena_dev->intr_moder_tbl = ENA_MEM_ALLOC(ena_dev->dmadev, size); - if (!ena_dev->intr_moder_tbl) - return ENA_COM_NO_MEM; - - ena_com_config_default_interrupt_moderation_table(ena_dev); - - return 0; -} - static void ena_com_update_intr_delay_resolution(struct ena_com_dev *ena_dev, u16 intr_delay_resolution) { - struct ena_intr_moder_entry *intr_moder_tbl = ena_dev->intr_moder_tbl; - unsigned int i; + u16 prev_intr_delay_resolution = ena_dev->intr_delay_resolution; - if (!intr_delay_resolution) { + if (unlikely(!intr_delay_resolution)) { ena_trc_err("Illegal intr_delay_resolution provided. Going to use default 1 usec resolution\n"); - intr_delay_resolution = 1; + intr_delay_resolution = ENA_DEFAULT_INTR_DELAY_RESOLUTION; } - ena_dev->intr_delay_resolution = intr_delay_resolution; /* update Rx */ - for (i = 0; i < ENA_INTR_MAX_NUM_OF_LEVELS; i++) - intr_moder_tbl[i].intr_moder_interval /= intr_delay_resolution; + ena_dev->intr_moder_rx_interval = + ena_dev->intr_moder_rx_interval * + prev_intr_delay_resolution / + intr_delay_resolution; /* update Tx */ - ena_dev->intr_moder_tx_interval /= intr_delay_resolution; + ena_dev->intr_moder_tx_interval = + ena_dev->intr_moder_tx_interval * + prev_intr_delay_resolution / + intr_delay_resolution; + + ena_dev->intr_delay_resolution = intr_delay_resolution; } /*****************************************************************************/ @@ -1482,11 +1515,12 @@ void ena_com_wait_for_abort_completion(struct ena_com_ { struct ena_com_admin_queue *admin_queue = &ena_dev->admin_queue; unsigned long flags = 0; + u32 exp = 0; ENA_SPINLOCK_LOCK(admin_queue->q_lock, flags); while (ATOMIC32_READ(&admin_queue->outstanding_cmds) != 0) { ENA_SPINLOCK_UNLOCK(admin_queue->q_lock, flags); - ENA_MSLEEP(ENA_POLL_MS); + ena_delay_exponential_backoff_us(exp++, ena_dev->ena_min_poll_delay_us); ENA_SPINLOCK_LOCK(admin_queue->q_lock, flags); } ENA_SPINLOCK_UNLOCK(admin_queue->q_lock, flags); @@ -1667,7 +1701,9 @@ void ena_com_admin_destroy(struct ena_com_dev *ena_dev ENA_WAIT_EVENT_DESTROY(admin_queue->comp_ctx->wait_event); if (admin_queue->comp_ctx) - ENA_MEM_FREE(ena_dev->dmadev, admin_queue->comp_ctx); + ENA_MEM_FREE(ena_dev->dmadev, + admin_queue->comp_ctx, + (admin_queue->q_depth * sizeof(struct ena_comp_ctx))); admin_queue->comp_ctx = NULL; size = ADMIN_SQ_SIZE(admin_queue->q_depth); if (sq->entries) @@ -1701,6 +1737,17 @@ void ena_com_set_admin_polling_mode(struct ena_com_dev ena_dev->admin_queue.polling = polling; } +bool ena_com_get_admin_polling_mode(struct ena_com_dev *ena_dev) +{ + return ena_dev->admin_queue.polling; +} + +void ena_com_set_admin_auto_polling_mode(struct ena_com_dev *ena_dev, + bool polling) +{ + ena_dev->admin_queue.auto_polling = polling; +} + int ena_com_mmio_reg_read_request_init(struct ena_com_dev *ena_dev) { struct ena_com_mmio_read *mmio_read = &ena_dev->mmio_read; @@ -1838,6 +1885,7 @@ int ena_com_admin_init(struct ena_com_dev *ena_dev, if (ret) goto error; + admin_queue->ena_dev = ena_dev; admin_queue->running_state = true; return 0; @@ -1934,62 +1982,6 @@ int ena_com_get_link_params(struct ena_com_dev *ena_de return ena_com_get_feature(ena_dev, resp, ENA_ADMIN_LINK_CONFIG, 0); } -int ena_com_extra_properties_strings_init(struct ena_com_dev *ena_dev) -{ - struct ena_admin_get_feat_resp resp; - struct ena_extra_properties_strings *extra_properties_strings = - &ena_dev->extra_properties_strings; - u32 rc; - extra_properties_strings->size = ENA_ADMIN_EXTRA_PROPERTIES_COUNT * - ENA_ADMIN_EXTRA_PROPERTIES_STRING_LEN; - - ENA_MEM_ALLOC_COHERENT(ena_dev->dmadev, - extra_properties_strings->size, - extra_properties_strings->virt_addr, - extra_properties_strings->dma_addr, - extra_properties_strings->dma_handle); - if (unlikely(!extra_properties_strings->virt_addr)) { - ena_trc_err("Failed to allocate extra properties strings\n"); - return 0; - } - - rc = ena_com_get_feature_ex(ena_dev, &resp, - ENA_ADMIN_EXTRA_PROPERTIES_STRINGS, - extra_properties_strings->dma_addr, - extra_properties_strings->size, 0); - if (rc) { - ena_trc_dbg("Failed to get extra properties strings\n"); - goto err; - } - - return resp.u.extra_properties_strings.count; -err: - ena_com_delete_extra_properties_strings(ena_dev); - return 0; -} - -void ena_com_delete_extra_properties_strings(struct ena_com_dev *ena_dev) -{ - struct ena_extra_properties_strings *extra_properties_strings = - &ena_dev->extra_properties_strings; - - if (extra_properties_strings->virt_addr) { - ENA_MEM_FREE_COHERENT(ena_dev->dmadev, - extra_properties_strings->size, - extra_properties_strings->virt_addr, - extra_properties_strings->dma_addr, - extra_properties_strings->dma_handle); - extra_properties_strings->virt_addr = NULL; - } -} - -int ena_com_get_extra_properties_flags(struct ena_com_dev *ena_dev, - struct ena_admin_get_feat_resp *resp) -{ - return ena_com_get_feature(ena_dev, resp, - ENA_ADMIN_EXTRA_PROPERTIES_FLAGS, 0); -} - int ena_com_get_dev_attr_feat(struct ena_com_dev *ena_dev, struct ena_com_dev_get_features_ctx *get_feat_ctx) { @@ -2111,7 +2103,7 @@ void ena_com_aenq_intr_handler(struct ena_com_dev *dev struct ena_admin_aenq_entry *aenq_e; struct ena_admin_aenq_common_desc *aenq_common; struct ena_com_aenq *aenq = &dev->aenq; - unsigned long long timestamp; + u64 timestamp; ena_aenq_handler handler_cb; u16 masked_head, processed = 0; u8 phase; @@ -2129,9 +2121,9 @@ void ena_com_aenq_intr_handler(struct ena_com_dev *dev */ dma_rmb(); - timestamp = (unsigned long long)aenq_common->timestamp_low | - ((unsigned long long)aenq_common->timestamp_high << 32); - ena_trc_dbg("AENQ! Group[%x] Syndrom[%x] timestamp: [%llus]\n", + timestamp = (u64)aenq_common->timestamp_low | + ((u64)aenq_common->timestamp_high << 32); + ena_trc_dbg("AENQ! Group[%x] Syndrom[%x] timestamp: [%" ENA_PRIu64 "s]\n", aenq_common->group, aenq_common->syndrom, timestamp); @@ -2452,12 +2444,14 @@ int ena_com_fill_hash_function(struct ena_com_dev *ena enum ena_admin_hash_functions func, const u8 *key, u16 key_len, u32 init_val) { - struct ena_rss *rss = &ena_dev->rss; + struct ena_admin_feature_rss_flow_hash_control *hash_key; struct ena_admin_get_feat_resp get_resp; - struct ena_admin_feature_rss_flow_hash_control *hash_key = - rss->hash_key; + enum ena_admin_hash_functions old_func; + struct ena_rss *rss = &ena_dev->rss; int rc; + hash_key = rss->hash_key; + /* Make sure size is a mult of DWs */ if (unlikely(key_len & 0x3)) return ENA_COM_INVAL; @@ -2469,22 +2463,23 @@ int ena_com_fill_hash_function(struct ena_com_dev *ena if (unlikely(rc)) return rc; - if (!((1 << func) & get_resp.u.flow_hash_func.supported_func)) { + if (!(BIT(func) & get_resp.u.flow_hash_func.supported_func)) { ena_trc_err("Flow hash function %d isn't supported\n", func); return ENA_COM_UNSUPPORTED; } switch (func) { case ENA_ADMIN_TOEPLITZ: - if (key_len > sizeof(hash_key->key)) { - ena_trc_err("key len (%hu) is bigger than the max supported (%zu)\n", - key_len, sizeof(hash_key->key)); - return ENA_COM_INVAL; + if (key) { + if (key_len != sizeof(hash_key->key)) { + ena_trc_err("key len (%hu) doesn't equal the supported size (%zu)\n", + key_len, sizeof(hash_key->key)); + return ENA_COM_INVAL; + } + memcpy(hash_key->key, key, key_len); + rss->hash_init_val = init_val; + hash_key->keys_num = key_len / sizeof(hash_key->key[0]); } - - memcpy(hash_key->key, key, key_len); - rss->hash_init_val = init_val; - hash_key->keys_num = key_len >> 2; break; case ENA_ADMIN_CRC32: rss->hash_init_val = init_val; @@ -2494,26 +2489,27 @@ int ena_com_fill_hash_function(struct ena_com_dev *ena return ENA_COM_INVAL; } + old_func = rss->hash_func; rss->hash_func = func; rc = ena_com_set_hash_function(ena_dev); /* Restore the old function */ if (unlikely(rc)) - ena_com_get_hash_function(ena_dev, NULL, NULL); + rss->hash_func = old_func; return rc; } int ena_com_get_hash_function(struct ena_com_dev *ena_dev, - enum ena_admin_hash_functions *func, - u8 *key) + enum ena_admin_hash_functions *func) { struct ena_rss *rss = &ena_dev->rss; struct ena_admin_get_feat_resp get_resp; - struct ena_admin_feature_rss_flow_hash_control *hash_key = - rss->hash_key; int rc; + if (unlikely(!func)) + return ENA_COM_INVAL; + rc = ena_com_get_feature_ex(ena_dev, &get_resp, ENA_ADMIN_RSS_HASH_FUNCTION, rss->hash_key_dma_addr, @@ -2521,10 +2517,21 @@ int ena_com_get_hash_function(struct ena_com_dev *ena_ if (unlikely(rc)) return rc; - rss->hash_func = get_resp.u.flow_hash_func.selected_func; - if (func) - *func = rss->hash_func; + /* ENA_FFS() returns 1 in case the lsb is set */ + rss->hash_func = ENA_FFS(get_resp.u.flow_hash_func.selected_func); + if (rss->hash_func) + rss->hash_func--; + *func = rss->hash_func; + + return 0; +} + +int ena_com_get_hash_key(struct ena_com_dev *ena_dev, u8 *key) +{ + struct ena_admin_feature_rss_flow_hash_control *hash_key = + ena_dev->rss.hash_key; + if (key) memcpy(key, hash_key->key, (size_t)(hash_key->keys_num) << 2); @@ -2785,10 +2792,6 @@ int ena_com_indirect_table_get(struct ena_com_dev *ena if (!ind_tbl) return 0; - rc = ena_com_ind_tbl_convert_from_device(ena_dev); - if (unlikely(rc)) - return rc; - for (i = 0; i < (1 << rss->tbl_log_size); i++) ind_tbl[i] = rss->host_rss_ind_tbl[i]; @@ -2805,8 +2808,14 @@ int ena_com_rss_init(struct ena_com_dev *ena_dev, u16 if (unlikely(rc)) goto err_indr_tbl; + /* The following function might return unsupported in case the + * device doesn't support setting the key / hash function. We can safely + * ignore this error and have indirection table support only. + */ rc = ena_com_hash_key_allocate(ena_dev); - if (unlikely(rc)) + if (likely(!rc)) + ena_com_hash_key_fill_default_key(ena_dev); + else if (rc != ENA_COM_UNSUPPORTED) goto err_hash_key; rc = ena_com_hash_ctrl_init(ena_dev); @@ -2956,42 +2965,35 @@ bool ena_com_interrupt_moderation_supported(struct ena ENA_ADMIN_INTERRUPT_MODERATION); } -int ena_com_update_nonadaptive_moderation_interval_tx(struct ena_com_dev *ena_dev, - u32 tx_coalesce_usecs) +static int ena_com_update_nonadaptive_moderation_interval(u32 coalesce_usecs, + u32 intr_delay_resolution, + u32 *intr_moder_interval) { - if (!ena_dev->intr_delay_resolution) { + if (!intr_delay_resolution) { ena_trc_err("Illegal interrupt delay granularity value\n"); return ENA_COM_FAULT; } - ena_dev->intr_moder_tx_interval = tx_coalesce_usecs / - ena_dev->intr_delay_resolution; + *intr_moder_interval = coalesce_usecs / intr_delay_resolution; return 0; } -int ena_com_update_nonadaptive_moderation_interval_rx(struct ena_com_dev *ena_dev, - u32 rx_coalesce_usecs) -{ - if (!ena_dev->intr_delay_resolution) { - ena_trc_err("Illegal interrupt delay granularity value\n"); - return ENA_COM_FAULT; - } - /* We use LOWEST entry of moderation table for storing - * nonadaptive interrupt coalescing values - */ - ena_dev->intr_moder_tbl[ENA_INTR_MODER_LOWEST].intr_moder_interval = - rx_coalesce_usecs / ena_dev->intr_delay_resolution; - - return 0; +int ena_com_update_nonadaptive_moderation_interval_tx(struct ena_com_dev *ena_dev, + u32 tx_coalesce_usecs) +{ + return ena_com_update_nonadaptive_moderation_interval(tx_coalesce_usecs, + ena_dev->intr_delay_resolution, + &ena_dev->intr_moder_tx_interval); } -void ena_com_destroy_interrupt_moderation(struct ena_com_dev *ena_dev) +int ena_com_update_nonadaptive_moderation_interval_rx(struct ena_com_dev *ena_dev, + u32 rx_coalesce_usecs) { - if (ena_dev->intr_moder_tbl) - ENA_MEM_FREE(ena_dev->dmadev, ena_dev->intr_moder_tbl); - ena_dev->intr_moder_tbl = NULL; + return ena_com_update_nonadaptive_moderation_interval(rx_coalesce_usecs, + ena_dev->intr_delay_resolution, + &ena_dev->intr_moder_rx_interval); } int ena_com_init_interrupt_moderation(struct ena_com_dev *ena_dev) @@ -3018,64 +3020,16 @@ int ena_com_init_interrupt_moderation(struct ena_com_d return rc; } - rc = ena_com_init_interrupt_moderation_table(ena_dev); - if (rc) - goto err; - /* if moderation is supported by device we set adaptive moderation */ delay_resolution = get_resp.u.intr_moderation.intr_delay_resolution; ena_com_update_intr_delay_resolution(ena_dev, delay_resolution); - ena_com_enable_adaptive_moderation(ena_dev); + /* Disable adaptive moderation by default - can be enabled later */ + ena_com_disable_adaptive_moderation(ena_dev); + return 0; -err: - ena_com_destroy_interrupt_moderation(ena_dev); - return rc; } -void ena_com_config_default_interrupt_moderation_table(struct ena_com_dev *ena_dev) -{ - struct ena_intr_moder_entry *intr_moder_tbl = ena_dev->intr_moder_tbl; - - if (!intr_moder_tbl) - return; - - intr_moder_tbl[ENA_INTR_MODER_LOWEST].intr_moder_interval = - ENA_INTR_LOWEST_USECS; - intr_moder_tbl[ENA_INTR_MODER_LOWEST].pkts_per_interval = - ENA_INTR_LOWEST_PKTS; - intr_moder_tbl[ENA_INTR_MODER_LOWEST].bytes_per_interval = - ENA_INTR_LOWEST_BYTES; - - intr_moder_tbl[ENA_INTR_MODER_LOW].intr_moder_interval = - ENA_INTR_LOW_USECS; - intr_moder_tbl[ENA_INTR_MODER_LOW].pkts_per_interval = - ENA_INTR_LOW_PKTS; - intr_moder_tbl[ENA_INTR_MODER_LOW].bytes_per_interval = - ENA_INTR_LOW_BYTES; - - intr_moder_tbl[ENA_INTR_MODER_MID].intr_moder_interval = - ENA_INTR_MID_USECS; - intr_moder_tbl[ENA_INTR_MODER_MID].pkts_per_interval = - ENA_INTR_MID_PKTS; - intr_moder_tbl[ENA_INTR_MODER_MID].bytes_per_interval = - ENA_INTR_MID_BYTES; - - intr_moder_tbl[ENA_INTR_MODER_HIGH].intr_moder_interval = - ENA_INTR_HIGH_USECS; - intr_moder_tbl[ENA_INTR_MODER_HIGH].pkts_per_interval = - ENA_INTR_HIGH_PKTS; - intr_moder_tbl[ENA_INTR_MODER_HIGH].bytes_per_interval = - ENA_INTR_HIGH_BYTES; - - intr_moder_tbl[ENA_INTR_MODER_HIGHEST].intr_moder_interval = - ENA_INTR_HIGHEST_USECS; - intr_moder_tbl[ENA_INTR_MODER_HIGHEST].pkts_per_interval = - ENA_INTR_HIGHEST_PKTS; - intr_moder_tbl[ENA_INTR_MODER_HIGHEST].bytes_per_interval = - ENA_INTR_HIGHEST_BYTES; -} - unsigned int ena_com_get_nonadaptive_moderation_interval_tx(struct ena_com_dev *ena_dev) { return ena_dev->intr_moder_tx_interval; @@ -3083,57 +3037,15 @@ unsigned int ena_com_get_nonadaptive_moderation_interv unsigned int ena_com_get_nonadaptive_moderation_interval_rx(struct ena_com_dev *ena_dev) { - struct ena_intr_moder_entry *intr_moder_tbl = ena_dev->intr_moder_tbl; - - if (intr_moder_tbl) - return intr_moder_tbl[ENA_INTR_MODER_LOWEST].intr_moder_interval; - - return 0; + return ena_dev->intr_moder_rx_interval; } -void ena_com_init_intr_moderation_entry(struct ena_com_dev *ena_dev, - enum ena_intr_moder_level level, - struct ena_intr_moder_entry *entry) -{ - struct ena_intr_moder_entry *intr_moder_tbl = ena_dev->intr_moder_tbl; - - if (level >= ENA_INTR_MAX_NUM_OF_LEVELS) - return; - - intr_moder_tbl[level].intr_moder_interval = entry->intr_moder_interval; - if (ena_dev->intr_delay_resolution) - intr_moder_tbl[level].intr_moder_interval /= - ena_dev->intr_delay_resolution; - intr_moder_tbl[level].pkts_per_interval = entry->pkts_per_interval; - - /* use hardcoded value until ethtool supports bytecount parameter */ - if (entry->bytes_per_interval != ENA_INTR_BYTE_COUNT_NOT_SUPPORTED) - intr_moder_tbl[level].bytes_per_interval = entry->bytes_per_interval; -} - -void ena_com_get_intr_moderation_entry(struct ena_com_dev *ena_dev, - enum ena_intr_moder_level level, - struct ena_intr_moder_entry *entry) -{ - struct ena_intr_moder_entry *intr_moder_tbl = ena_dev->intr_moder_tbl; - - if (level >= ENA_INTR_MAX_NUM_OF_LEVELS) - return; - - entry->intr_moder_interval = intr_moder_tbl[level].intr_moder_interval; - if (ena_dev->intr_delay_resolution) - entry->intr_moder_interval *= ena_dev->intr_delay_resolution; - entry->pkts_per_interval = - intr_moder_tbl[level].pkts_per_interval; - entry->bytes_per_interval = intr_moder_tbl[level].bytes_per_interval; -} - int ena_com_config_dev_mode(struct ena_com_dev *ena_dev, struct ena_admin_feature_llq_desc *llq_features, struct ena_llq_configurations *llq_default_cfg) { + struct ena_com_llq_info *llq_info = &ena_dev->llq_info; int rc; - int size; if (!llq_features->max_llq_num) { ena_dev->tx_mem_queue_type = ENA_ADMIN_PLACEMENT_POLICY_HOST; @@ -3144,14 +3056,12 @@ int ena_com_config_dev_mode(struct ena_com_dev *ena_de if (rc) return rc; - /* Validate the descriptor is not too big */ - size = ena_dev->tx_max_header_size; - size += ena_dev->llq_info.descs_num_before_header * - sizeof(struct ena_eth_io_tx_desc); + ena_dev->tx_max_header_size = llq_info->desc_list_entry_size - + (llq_info->descs_num_before_header * sizeof(struct ena_eth_io_tx_desc)); - if (unlikely(ena_dev->llq_info.desc_list_entry_size < size)) { + if (unlikely(ena_dev->tx_max_header_size == 0)) { ena_trc_err("the size of the LLQ entry is smaller than needed\n"); - return ENA_COM_INVAL; + return -EINVAL; } ena_dev->tx_mem_queue_type = ENA_ADMIN_PLACEMENT_POLICY_DEV; Modified: stable/12/sys/contrib/ena-com/ena_com.h ============================================================================== --- stable/12/sys/contrib/ena-com/ena_com.h Sun Sep 6 14:23:31 2020 (r365380) +++ stable/12/sys/contrib/ena-com/ena_com.h Sun Sep 6 14:41:35 2020 (r365381) @@ -1,7 +1,7 @@ /*- * BSD LICENSE * - * Copyright (c) 2015-2019 Amazon.com, Inc. or its affiliates. + * Copyright (c) 2015-2020 Amazon.com, Inc. or its affiliates. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -36,9 +36,9 @@ #include "ena_plat.h" -#define ENA_MAX_NUM_IO_QUEUES 128U +#define ENA_MAX_NUM_IO_QUEUES 128U /* We need to queues for each IO (on for Tx and one for Rx) */ -#define ENA_TOTAL_NUM_QUEUES (2 * (ENA_MAX_NUM_IO_QUEUES)) +#define ENA_TOTAL_NUM_QUEUES (2 * (ENA_MAX_NUM_IO_QUEUES)) #define ENA_MAX_HANDLERS 256 @@ -55,46 +55,16 @@ /*****************************************************************************/ /* ENA adaptive interrupt moderation settings */ -#define ENA_INTR_LOWEST_USECS (0) -#define ENA_INTR_LOWEST_PKTS (3) -#define ENA_INTR_LOWEST_BYTES (2 * 1524) +#define ENA_INTR_INITIAL_TX_INTERVAL_USECS ENA_INTR_INITIAL_TX_INTERVAL_USECS_PLAT +#define ENA_INTR_INITIAL_RX_INTERVAL_USECS 0 +#define ENA_DEFAULT_INTR_DELAY_RESOLUTION 1 -#define ENA_INTR_LOW_USECS (32) -#define ENA_INTR_LOW_PKTS (12) -#define ENA_INTR_LOW_BYTES (16 * 1024) +#define ENA_HASH_KEY_SIZE 40 -#define ENA_INTR_MID_USECS (80) -#define ENA_INTR_MID_PKTS (48) -#define ENA_INTR_MID_BYTES (64 * 1024) +#define ENA_HW_HINTS_NO_TIMEOUT 0xFFFF -#define ENA_INTR_HIGH_USECS (128) -#define ENA_INTR_HIGH_PKTS (96) -#define ENA_INTR_HIGH_BYTES (128 * 1024) +#define ENA_FEATURE_MAX_QUEUE_EXT_VER 1 -#define ENA_INTR_HIGHEST_USECS (192) -#define ENA_INTR_HIGHEST_PKTS (128) -#define ENA_INTR_HIGHEST_BYTES (192 * 1024) - -#define ENA_INTR_INITIAL_TX_INTERVAL_USECS 196 -#define ENA_INTR_INITIAL_RX_INTERVAL_USECS 4 -#define ENA_INTR_DELAY_OLD_VALUE_WEIGHT 6 -#define ENA_INTR_DELAY_NEW_VALUE_WEIGHT 4 -#define ENA_INTR_MODER_LEVEL_STRIDE 1 -#define ENA_INTR_BYTE_COUNT_NOT_SUPPORTED 0xFFFFFF - -#define ENA_HW_HINTS_NO_TIMEOUT 0xFFFF - -#define ENA_FEATURE_MAX_QUEUE_EXT_VER 1 - -enum ena_intr_moder_level { - ENA_INTR_MODER_LOWEST = 0, - ENA_INTR_MODER_LOW, - ENA_INTR_MODER_MID, - ENA_INTR_MODER_HIGH, - ENA_INTR_MODER_HIGHEST, - ENA_INTR_MAX_NUM_OF_LEVELS, -}; - struct ena_llq_configurations { enum ena_admin_llq_header_location llq_header_location; enum ena_admin_llq_ring_entry_size llq_ring_entry_size; @@ -103,12 +73,6 @@ struct ena_llq_configurations { u16 llq_ring_entry_size_value; }; -struct ena_intr_moder_entry { - unsigned int intr_moder_interval; - unsigned int pkts_per_interval; - unsigned int bytes_per_interval; -}; - enum queue_direction { ENA_COM_IO_QUEUE_DIRECTION_TX, ENA_COM_IO_QUEUE_DIRECTION_RX @@ -146,6 +110,7 @@ struct ena_com_llq_info { u16 descs_num_before_header; u16 descs_per_entry; u16 max_entries_in_tx_burst; + bool disable_meta_caching; }; struct ena_com_io_cq { @@ -210,6 +175,8 @@ struct ena_com_io_sq { enum queue_direction direction; enum ena_admin_placement_policy_type mem_queue_type; + bool disable_meta_caching; + u32 msix_vector; struct ena_com_tx_meta cached_tx_meta; struct ena_com_llq_info llq_info; @@ -253,16 +220,17 @@ struct ena_com_admin_sq { }; struct ena_com_stats_admin { - u32 aborted_cmd; - u32 submitted_cmd; - u32 completed_cmd; - u32 out_of_space; - u32 no_completion; + u64 aborted_cmd; + u64 submitted_cmd; + u64 completed_cmd; + u64 out_of_space; + u64 no_completion; }; struct ena_com_admin_queue { void *q_dmadev; void *bus; + struct ena_com_dev *ena_dev; ena_spinlock_t q_lock; /* spinlock for the admin queue */ struct ena_comp_ctx *comp_ctx; @@ -274,6 +242,9 @@ struct ena_com_admin_queue { /* Indicate if the admin queue should poll for completion */ bool polling; + /* Define if fallback to polling mode should occur */ + bool auto_polling; + u16 curr_cmd_id; /* Indicate that the ena was initialized and can @@ -345,13 +316,6 @@ struct ena_host_attribute { ena_mem_handle_t host_info_dma_handle; }; -struct ena_extra_properties_strings { - u8 *virt_addr; - dma_addr_t dma_addr; - ena_mem_handle_t dma_handle; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sun Sep 6 15:44:10 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6792E3D51F5; Sun, 6 Sep 2020 15:44:10 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bkwgt25mvz47VG; Sun, 6 Sep 2020 15:44:10 +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 2AFBA10F09; Sun, 6 Sep 2020 15:44:10 +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 086FiADM093704; Sun, 6 Sep 2020 15:44:10 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 086FiAqX093703; Sun, 6 Sep 2020 15:44:10 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <202009061544.086FiAqX093703@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Sun, 6 Sep 2020 15:44:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365382 - head/usr.sbin/traceroute6 X-SVN-Group: head X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: head/usr.sbin/traceroute6 X-SVN-Commit-Revision: 365382 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.33 Precedence: list List-Id: "SVN commit messages 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, 06 Sep 2020 15:44:10 -0000 Author: oshogbo Date: Sun Sep 6 15:44:09 2020 New Revision: 365382 URL: https://svnweb.freebsd.org/changeset/base/365382 Log: Remove duplicated line. Reported by: lwhsu Modified: head/usr.sbin/traceroute6/Makefile Modified: head/usr.sbin/traceroute6/Makefile ============================================================================== --- head/usr.sbin/traceroute6/Makefile Sun Sep 6 14:41:35 2020 (r365381) +++ head/usr.sbin/traceroute6/Makefile Sun Sep 6 15:44:09 2020 (r365382) @@ -15,8 +15,6 @@ .include -.include - TRACEROUTE_DISTDIR?= ${SRCTOP}/contrib/traceroute .PATH: ${TRACEROUTE_DISTDIR} From owner-svn-src-all@freebsd.org Sun Sep 6 17:40:37 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0D15E3D86CD; Sun, 6 Sep 2020 17:40:37 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BkzGD6dyVz4Gdf; Sun, 6 Sep 2020 17:40:36 +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 C72B512481; Sun, 6 Sep 2020 17:40:36 +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 086HeaXH061902; Sun, 6 Sep 2020 17:40:36 GMT (envelope-from wulf@FreeBSD.org) Received: (from wulf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 086HeZDQ061127; Sun, 6 Sep 2020 17:40:35 GMT (envelope-from wulf@FreeBSD.org) Message-Id: <202009061740.086HeZDQ061127@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wulf set sender to wulf@FreeBSD.org using -f From: Vladimir Kondratyev Date: Sun, 6 Sep 2020 17:40:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365383 - in stable/12: share/man/man9 sys/compat/linuxkpi/common/include/linux sys/kern sys/sys sys/vm X-SVN-Group: stable-12 X-SVN-Commit-Author: wulf X-SVN-Commit-Paths: in stable/12: share/man/man9 sys/compat/linuxkpi/common/include/linux sys/kern sys/sys sys/vm X-SVN-Commit-Revision: 365383 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.33 Precedence: list List-Id: "SVN commit messages 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, 06 Sep 2020 17:40:37 -0000 Author: wulf Date: Sun Sep 6 17:40:35 2020 New Revision: 365383 URL: https://svnweb.freebsd.org/changeset/base/365383 Log: MFC r364964: LinuxKPI: Implement ksize() function. In Linux, ksize() gets the actual amount of memory allocated for a given object. This commit adds malloc_usable_size() to FreeBSD KPI which does the same. It also maps LinuxKPI ksize() to newly created function. ksize() function is used by drm-kmod. Reviewed by: hselasky, kib Differential Revision: https://reviews.freebsd.org/D26215 Modified: stable/12/share/man/man9/malloc.9 stable/12/sys/compat/linuxkpi/common/include/linux/slab.h stable/12/sys/kern/kern_malloc.c stable/12/sys/sys/malloc.h stable/12/sys/vm/memguard.c stable/12/sys/vm/memguard.h Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man9/malloc.9 ============================================================================== --- stable/12/share/man/man9/malloc.9 Sun Sep 6 15:44:09 2020 (r365382) +++ stable/12/share/man/man9/malloc.9 Sun Sep 6 17:40:35 2020 (r365383) @@ -29,7 +29,7 @@ .\" $NetBSD: malloc.9,v 1.3 1996/11/11 00:05:11 lukem Exp $ .\" $FreeBSD$ .\" -.Dd October 30, 2018 +.Dd August 28, 2020 .Dt MALLOC 9 .Os .Sh NAME @@ -53,6 +53,8 @@ .Fn realloc "void *addr" "size_t size" "struct malloc_type *type" "int flags" .Ft void * .Fn reallocf "void *addr" "size_t size" "struct malloc_type *type" "int flags" +.Ft size_t +.Fn malloc_usable_size "const void *addr" .Fn MALLOC_DECLARE type .In sys/param.h .In sys/malloc.h @@ -138,6 +140,13 @@ function is identical to .Fn realloc except that it will free the passed pointer when the requested memory cannot be allocated. +.Pp +The +.Fn malloc_usable_size +function returns the usable size of the allocation pointed to by +.Fa addr . +The return value may be larger than the size that was requested during +allocation. .Pp Unlike its standard C library counterpart .Pq Xr malloc 3 , Modified: stable/12/sys/compat/linuxkpi/common/include/linux/slab.h ============================================================================== --- stable/12/sys/compat/linuxkpi/common/include/linux/slab.h Sun Sep 6 15:44:09 2020 (r365382) +++ stable/12/sys/compat/linuxkpi/common/include/linux/slab.h Sun Sep 6 17:40:35 2020 (r365383) @@ -154,6 +154,12 @@ kfree(const void *ptr) free(__DECONST(void *, ptr), M_KMALLOC); } +static inline size_t +ksize(const void *ptr) +{ + return (malloc_usable_size(ptr)); +} + extern struct linux_kmem_cache *linux_kmem_cache_create(const char *name, size_t size, size_t align, unsigned flags, linux_kmem_ctor_t *ctor); Modified: stable/12/sys/kern/kern_malloc.c ============================================================================== --- stable/12/sys/kern/kern_malloc.c Sun Sep 6 15:44:09 2020 (r365382) +++ stable/12/sys/kern/kern_malloc.c Sun Sep 6 17:40:35 2020 (r365383) @@ -867,6 +867,41 @@ reallocf(void *addr, size_t size, struct malloc_type * return (mem); } +/* + * malloc_usable_size: returns the usable size of the allocation. + */ +size_t +malloc_usable_size(const void *addr) +{ +#ifndef DEBUG_REDZONE + uma_slab_t slab; +#endif + u_long size; + + if (addr == NULL) + return (0); + +#ifdef DEBUG_MEMGUARD + if (is_memguard_addr(__DECONST(void *, addr))) + return (memguard_get_req_size(addr)); +#endif + +#ifdef DEBUG_REDZONE + size = redzone_get_size(__DECONST(void *, addr)); +#else + slab = vtoslab((vm_offset_t)addr & (~UMA_SLAB_MASK)); + if (slab == NULL) + panic("malloc_usable_size: address %p(%p) is not allocated.\n", + addr, (void *)((u_long)addr & (~UMA_SLAB_MASK))); + + if (!(slab->us_flags & UMA_SLAB_MALLOC)) + size = slab->us_keg->uk_size; + else + size = slab->us_size; +#endif + return (size); +} + #ifndef __sparc64__ CTASSERT(VM_KMEM_SIZE_SCALE >= 1); #endif Modified: stable/12/sys/sys/malloc.h ============================================================================== --- stable/12/sys/sys/malloc.h Sun Sep 6 15:44:09 2020 (r365382) +++ stable/12/sys/sys/malloc.h Sun Sep 6 17:40:35 2020 (r365383) @@ -244,6 +244,7 @@ void malloc_type_allocated(struct malloc_type *type, u void malloc_type_freed(struct malloc_type *type, unsigned long size); void malloc_type_list(malloc_type_list_func_t *, void *); void malloc_uninit(void *); +size_t malloc_usable_size(const void *); void *realloc(void *addr, size_t size, struct malloc_type *type, int flags) __result_use_check __alloc_size(2); void *reallocf(void *addr, size_t size, struct malloc_type *type, int flags) Modified: stable/12/sys/vm/memguard.c ============================================================================== --- stable/12/sys/vm/memguard.c Sun Sep 6 15:44:09 2020 (r365382) +++ stable/12/sys/vm/memguard.c Sun Sep 6 17:40:35 2020 (r365383) @@ -503,3 +503,9 @@ memguard_cmp_zone(uma_zone_t zone) */ return (strcmp(zone->uz_name, vm_memguard_desc) == 0); } + +unsigned long +memguard_get_req_size(const void *addr) +{ + return (*v2sizep(trunc_page((uintptr_t)addr))); +} Modified: stable/12/sys/vm/memguard.h ============================================================================== --- stable/12/sys/vm/memguard.h Sun Sep 6 15:44:09 2020 (r365382) +++ stable/12/sys/vm/memguard.h Sun Sep 6 17:40:35 2020 (r365383) @@ -43,6 +43,7 @@ void memguard_init(struct vmem *); void *memguard_alloc(unsigned long, int); void *memguard_realloc(void *, unsigned long, struct malloc_type *, int); void memguard_free(void *); +unsigned long memguard_get_req_size(const void *); int memguard_cmp_mtp(struct malloc_type *, unsigned long); int memguard_cmp_zone(uma_zone_t); int is_memguard_addr(void *); @@ -52,6 +53,7 @@ int is_memguard_addr(void *); #define memguard_alloc(size, flags) NULL #define memguard_realloc(a, s, mtp, f) NULL #define memguard_free(addr) do { } while (0) +#define memguard_get_req_size(addr) 0 #define memguard_cmp_mtp(mtp, size) 0 #define memguard_cmp_zone(zone) 0 #define is_memguard_addr(addr) 0 From owner-svn-src-all@freebsd.org Sun Sep 6 18:20:26 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2DE9D3D95BB; Sun, 6 Sep 2020 18:20:26 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bl08B0SRJz4JW4; Sun, 6 Sep 2020 18:20:26 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E7212127FB; Sun, 6 Sep 2020 18:20:25 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 086IKPqL086096; Sun, 6 Sep 2020 18:20:25 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 086IKPXN086094; Sun, 6 Sep 2020 18:20:25 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <202009061820.086IKPXN086094@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Sun, 6 Sep 2020 18:20:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365384 - stable/12/sys/net X-SVN-Group: stable-12 X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: stable/12/sys/net X-SVN-Commit-Revision: 365384 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.33 Precedence: list List-Id: "SVN commit messages 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, 06 Sep 2020 18:20:26 -0000 Author: gonzo Date: Sun Sep 6 18:20:25 2020 New Revision: 365384 URL: https://svnweb.freebsd.org/changeset/base/365384 Log: MFC r353419: Provide new KPI for network drivers to access lists of interface addresses. The KPI doesn't reveal neither how addresses are stored, how the access to them is synchronized, neither reveal struct ifaddr and struct ifmaddr. Reviewed by: gallatin, erj, hselasky, philip, stevek Differential Revision: https://reviews.freebsd.org/D21943 Modified: stable/12/sys/net/if.c stable/12/sys/net/if_var.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/net/if.c ============================================================================== --- stable/12/sys/net/if.c Sun Sep 6 17:40:35 2020 (r365383) +++ stable/12/sys/net/if.c Sun Sep 6 18:20:25 2020 (r365384) @@ -4313,6 +4313,53 @@ if_getmtu_family(if_t ifp, int family) return (((struct ifnet *)ifp)->if_mtu); } +/* + * Methods for drivers to access interface unicast and multicast + * link level addresses. Driver shall not know 'struct ifaddr' neither + * 'struct ifmultiaddr'. + */ +u_int +if_foreach_lladdr(if_t ifp, iflladdr_cb_t cb, void *cb_arg) +{ + struct ifaddr *ifa; + u_int count; + + MPASS(cb); + + count = 0; + IF_ADDR_RLOCK(ifp); + CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { + if (ifa->ifa_addr->sa_family != AF_LINK) + continue; + count += (*cb)(cb_arg, (struct sockaddr_dl *)ifa->ifa_addr, + count); + } + IF_ADDR_RUNLOCK(ifp); + + return (count); +} + +u_int +if_foreach_llmaddr(if_t ifp, iflladdr_cb_t cb, void *cb_arg) +{ + struct ifmultiaddr *ifma; + u_int count; + + MPASS(cb); + + count = 0; + IF_ADDR_RLOCK(ifp); + CK_STAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + if (ifma->ifma_addr->sa_family != AF_LINK) + continue; + count += (*cb)(cb_arg, (struct sockaddr_dl *)ifma->ifma_addr, + count); + } + IF_ADDR_RUNLOCK(ifp); + + return (count); +} + int if_setsoftc(if_t ifp, void *softc) { Modified: stable/12/sys/net/if_var.h ============================================================================== --- stable/12/sys/net/if_var.h Sun Sep 6 17:40:35 2020 (r365383) +++ stable/12/sys/net/if_var.h Sun Sep 6 18:20:25 2020 (r365384) @@ -735,11 +735,20 @@ void if_bpfmtap(if_t ifp, struct mbuf *m); void if_etherbpfmtap(if_t ifp, struct mbuf *m); void if_vlancap(if_t ifp); -int if_setupmultiaddr(if_t ifp, void *mta, int *cnt, int max); -int if_multiaddr_array(if_t ifp, void *mta, int *cnt, int max); +/* + * Traversing through interface address lists. + */ +struct sockaddr_dl; +typedef u_int iflladdr_cb_t(void *, struct sockaddr_dl *, u_int); +u_int if_foreach_lladdr(if_t, iflladdr_cb_t, void *); +u_int if_foreach_llmaddr(if_t, iflladdr_cb_t, void *); int if_multiaddr_count(if_t ifp, int max); +/* Obsoleted multicast management functions. */ +int if_setupmultiaddr(if_t ifp, void *mta, int *cnt, int max); +int if_multiaddr_array(if_t ifp, void *mta, int *cnt, int max); int if_multi_apply(struct ifnet *ifp, int (*filter)(void *, struct ifmultiaddr *, int), void *arg); + int if_getamcount(if_t ifp); struct ifaddr * if_getifaddr(if_t ifp); From owner-svn-src-all@freebsd.org Sun Sep 6 18:25:51 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A73303D975B; Sun, 6 Sep 2020 18:25:51 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bl0GR3zs1z4Jvf; Sun, 6 Sep 2020 18:25:51 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6BD1812999; Sun, 6 Sep 2020 18:25:51 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 086IPprX092378; Sun, 6 Sep 2020 18:25:51 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 086IPpGt092376; Sun, 6 Sep 2020 18:25:51 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <202009061825.086IPpGt092376@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Sun, 6 Sep 2020 18:25:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365385 - in stable/12/sys: arm64/conf conf dev/altera/dwc X-SVN-Group: stable-12 X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: in stable/12/sys: arm64/conf conf dev/altera/dwc X-SVN-Commit-Revision: 365385 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.33 Precedence: list List-Id: "SVN commit messages 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, 06 Sep 2020 18:25:51 -0000 Author: gonzo Date: Sun Sep 6 18:25:50 2020 New Revision: 365385 URL: https://svnweb.freebsd.org/changeset/base/365385 Log: MFC r350418 by br: Add glue driver for Altera SOCFPGA Ethernet MAC (EMAC) found in Terasic DE10-Pro (an Intel Stratix 10 GX/SX FPGA Development Kit). The Altera EMAC is an instance of Synopsys DesignWare Gigabit MAC. This driver sets correct clock range for MDIO interface on Intel Stratix 10 platform. This is required due to lack of support for clock manager device for this platform that could tell us the clock frequency value for ethernet clock domain. Sponsored by: DARPA, AFRL Added: stable/12/sys/dev/altera/dwc/ - copied from r350418, head/sys/dev/altera/dwc/ Modified: stable/12/sys/arm64/conf/GENERIC stable/12/sys/conf/files.arm64 Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/arm64/conf/GENERIC ============================================================================== --- stable/12/sys/arm64/conf/GENERIC Sun Sep 6 18:20:25 2020 (r365384) +++ stable/12/sys/arm64/conf/GENERIC Sun Sep 6 18:25:50 2020 (r365385) @@ -146,6 +146,7 @@ device smc # SMSC LAN91C111 device vnic # Cavium ThunderX NIC device al_eth # Annapurna Alpine Ethernet NIC device dwc_rk # Rockchip Designware +device dwc_socfpga # Altera SOCFPGA Ethernet MAC # Block devices device ahci Modified: stable/12/sys/conf/files.arm64 ============================================================================== --- stable/12/sys/conf/files.arm64 Sun Sep 6 18:20:25 2020 (r365384) +++ stable/12/sys/conf/files.arm64 Sun Sep 6 18:25:50 2020 (r365385) @@ -214,6 +214,7 @@ dev/acpica/acpi_pci_link.c optional acpi pci dev/acpica/acpi_pcib.c optional acpi pci dev/acpica/acpi_pxm.c optional acpi dev/ahci/ahci_generic.c optional ahci +dev/altera/dwc/if_dwc_socfpga.c optional fdt dwc_socfpga dev/axgbe/if_axgbe.c optional axgbe dev/axgbe/xgbe-desc.c optional axgbe dev/axgbe/xgbe-dev.c optional axgbe From owner-svn-src-all@freebsd.org Sun Sep 6 18:27:37 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2D0143D9BA4; Sun, 6 Sep 2020 18:27:37 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bl0JT0QtRz4KFB; Sun, 6 Sep 2020 18:27:37 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E5FAA12A31; Sun, 6 Sep 2020 18:27:36 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 086IRaTw092512; Sun, 6 Sep 2020 18:27:36 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 086IRawb092511; Sun, 6 Sep 2020 18:27:36 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <202009061827.086IRawb092511@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Sun, 6 Sep 2020 18:27:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365386 - stable/12/sys/dev/dwc X-SVN-Group: stable-12 X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: stable/12/sys/dev/dwc X-SVN-Commit-Revision: 365386 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.33 Precedence: list List-Id: "SVN commit messages 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, 06 Sep 2020 18:27:37 -0000 Author: gonzo Date: Sun Sep 6 18:27:36 2020 New Revision: 365386 URL: https://svnweb.freebsd.org/changeset/base/365386 Log: MFC r353843 by glebius: Convert to if_foreach_llmaddr() KPI. Modified: stable/12/sys/dev/dwc/if_dwc.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/dwc/if_dwc.c ============================================================================== --- stable/12/sys/dev/dwc/if_dwc.c Sun Sep 6 18:25:50 2020 (r365385) +++ stable/12/sys/dev/dwc/if_dwc.c Sun Sep 6 18:27:36 2020 (r365386) @@ -581,13 +581,37 @@ bitreverse(uint8_t x) return (nibbletab[x & 0xf] << 4) | nibbletab[x >> 4]; } +struct dwc_hash_maddr_ctx { + struct dwc_softc *sc; + uint32_t hash[8]; +}; + +static u_int +dwc_hash_maddr(void *arg, struct sockaddr_dl *sdl, u_int cnt) +{ + struct dwc_hash_maddr_ctx *ctx = arg; + uint32_t crc, hashbit, hashreg; + uint8_t val; + + crc = ether_crc32_le(LLADDR(sdl), ETHER_ADDR_LEN); + /* Take lower 8 bits and reverse it */ + val = bitreverse(~crc & 0xff); + if (ctx->sc->mactype == DWC_GMAC_ALT_DESC) + val >>= 2; /* Only need lower 6 bits */ + hashreg = (val >> 5); + hashbit = (val & 31); + ctx->hash[hashreg] |= (1 << hashbit); + + return (1); +} + static void dwc_setup_rxfilter(struct dwc_softc *sc) { - struct ifmultiaddr *ifma; + struct dwc_hash_maddr_ctx ctx; struct ifnet *ifp; - uint8_t *eaddr, val; - uint32_t crc, ffval, hashbit, hashreg, hi, lo, hash[8]; + uint8_t *eaddr; + uint32_t ffval, hi, lo; int nhash, i; DWC_ASSERT_LOCKED(sc); @@ -601,27 +625,13 @@ dwc_setup_rxfilter(struct dwc_softc *sc) if ((ifp->if_flags & IFF_ALLMULTI) != 0) { ffval = (FRAME_FILTER_PM); for (i = 0; i < nhash; i++) - hash[i] = ~0; + ctx.hash[i] = ~0; } else { ffval = (FRAME_FILTER_HMC); for (i = 0; i < nhash; i++) - hash[i] = 0; - if_maddr_rlock(ifp); - CK_STAILQ_FOREACH(ifma, &sc->ifp->if_multiaddrs, ifma_link) { - if (ifma->ifma_addr->sa_family != AF_LINK) - continue; - crc = ether_crc32_le(LLADDR((struct sockaddr_dl *) - ifma->ifma_addr), ETHER_ADDR_LEN); - - /* Take lower 8 bits and reverse it */ - val = bitreverse(~crc & 0xff); - if (sc->mactype == DWC_GMAC_ALT_DESC) - val >>= nhash; /* Only need lower 6 bits */ - hashreg = (val >> 5); - hashbit = (val & 31); - hash[hashreg] |= (1 << hashbit); - } - if_maddr_runlock(ifp); + ctx.hash[i] = 0; + ctx.sc = sc; + if_foreach_llmaddr(ifp, dwc_hash_maddr, &ctx); } /* @@ -641,11 +651,11 @@ dwc_setup_rxfilter(struct dwc_softc *sc) WRITE4(sc, MAC_ADDRESS_HIGH(0), hi); WRITE4(sc, MAC_FRAME_FILTER, ffval); if (sc->mactype == DWC_GMAC_ALT_DESC) { - WRITE4(sc, GMAC_MAC_HTLOW, hash[0]); - WRITE4(sc, GMAC_MAC_HTHIGH, hash[1]); + WRITE4(sc, GMAC_MAC_HTLOW, ctx.hash[0]); + WRITE4(sc, GMAC_MAC_HTHIGH, ctx.hash[1]); } else { for (i = 0; i < nhash; i++) - WRITE4(sc, HASH_TABLE_REG(i), hash[i]); + WRITE4(sc, HASH_TABLE_REG(i), ctx.hash[i]); } } From owner-svn-src-all@freebsd.org Sun Sep 6 18:32:48 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3CBB33DA053; Sun, 6 Sep 2020 18:32:48 +0000 (UTC) (envelope-from oliver.pntr@gmail.com) Received: from mail-yb1-xb34.google.com (mail-yb1-xb34.google.com [IPv6:2607:f8b0:4864:20::b34]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bl0QR6ZZ2z4KQ1; Sun, 6 Sep 2020 18:32:47 +0000 (UTC) (envelope-from oliver.pntr@gmail.com) Received: by mail-yb1-xb34.google.com with SMTP id s92so8052615ybi.2; Sun, 06 Sep 2020 11:32:47 -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=IrHitLijfwPIyOz3Vi/ckT+9afR7/JI1mb4Q+fTRovo=; b=XqKMTtxBgRSXYFaqw+eQPnmi8NXml/68iZWNY/6nS2Czi2yASCMLhHkKky9JQjcOWj rgePzBbyCBtExhUJWrXaRbOEiYTTv3nNY06Edb6NndzLirqZkJ6GhvZuintZN9VrGWWf 3SN4IPom9JQdU85v7wTPgoytg6ZWibpiPeAqmXyUSfhNPLz2CZ3BFqhvav89xQGg4t72 g+S9fgJsXTtmFsnWWSmaCNLBxRIIQ9H8QyuwBC0To0JKSSVzh4334oCHIlhBm0NfrQIV tDLhyveJPtlS25O6pMFxEK4bVI0fYbx5D+Sl/VGshpjHqfX+zpqNEVMoQKwLmM+O2Xqb wnzg== 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=IrHitLijfwPIyOz3Vi/ckT+9afR7/JI1mb4Q+fTRovo=; b=gMbMIjwUIZusiorB16MA+U7kl0pFSOhvbCxU+CnkdF8jop6pwgYL9HP9PHUIiyQONb 5n+MfS2vtx6VeLS6OG68qZ4UUZWeokfHbMXvrcUESgira3qFbFX1FiHzvwr2sPWXYPDv +XIrjGOh4gUM+VcS2lHXOE3R93EdPY8tcwqbty5KZ4xjMLB9vETMhcEM9Gj6IE7NHiTi Wdre8Jr6WGso5tpPXbqi0MefhSFEUm5CeKXSeuOyhYuxnDemKP8cJ0KO0DcGpEwydNrh vKw4m8y9/uximUmhQoH7TZkcaB5kuU8ltaf979MpSz4BlLOwSXUWVWOBQ6QJ2e3s96kF heIw== X-Gm-Message-State: AOAM531Z0f41ZlcqzouwvZLFaaCfzLoWjQJba6iqj00iBUhmXuCDkRAr pOFwCcHMtnvPDo9I3B571Ek3OMOFOcnOtWl7fEz/GWzv X-Google-Smtp-Source: ABdhPJy974ZcntDs/qQB7yyhmkpRHUFVzCAP6vg1OPKVr+LXTsHDdgkqaEMOmDR1kNphH2dsQVXUcTNa+hhuPoNk3og= X-Received: by 2002:a25:99c6:: with SMTP id q6mr23295017ybo.328.1599417166551; Sun, 06 Sep 2020 11:32:46 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a25:b0d:0:0:0:0:0 with HTTP; Sun, 6 Sep 2020 11:32:46 -0700 (PDT) In-Reply-To: <202009061404.086E43HH024712@repo.freebsd.org> References: <202009061404.086E43HH024712@repo.freebsd.org> From: Oliver Pinter Date: Sun, 6 Sep 2020 20:32:46 +0200 Message-ID: Subject: Re: svn commit: r365378 - head/usr.sbin/traceroute6 To: Mariusz Zaborski Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" X-Rspamd-Queue-Id: 4Bl0QR6ZZ2z4KQ1 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; TAGGED_FROM(0.00)[] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.33 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 06 Sep 2020 18:32:48 -0000 On Sunday, September 6, 2020, Mariusz Zaborski wrote: > Author: oshogbo > Date: Sun Sep 6 14:04:02 2020 > New Revision: 365378 > URL: https://svnweb.freebsd.org/changeset/base/365378 > > Log: > traceroute6: capsicumize it > > Submitted by: Shubh Gupta > Sponsored by: Google (GSOC 2020) > Differential Revision: https://reviews.freebsd.org/D25604 > > Modified: > head/usr.sbin/traceroute6/Makefile > head/usr.sbin/traceroute6/traceroute6.c > > Modified: head/usr.sbin/traceroute6/Makefile > ============================================================ > ================== > --- head/usr.sbin/traceroute6/Makefile Sun Sep 6 11:29:06 2020 > (r365377) > +++ head/usr.sbin/traceroute6/Makefile Sun Sep 6 14:04:02 2020 > (r365378) > @@ -13,6 +13,10 @@ > # A PARTICULAR PURPOSE. > # $FreeBSD$ > > +.include > + > +.include Dup > + > TRACEROUTE_DISTDIR?= ${SRCTOP}/contrib/traceroute > .PATH: ${TRACEROUTE_DISTDIR} > > @@ -26,7 +30,13 @@ BINMODE= 4555 > CFLAGS+= -DIPSEC -DHAVE_POLL > CFLAGS+= -I${.CURDIR} -I${TRACEROUTE_DISTDIR} -I. > > -LIBADD= ipsec > +.if ${MK_CASPER} != "no" > +LIBADD+= casper > +LIBADD+= cap_dns > +CFLAGS+= -DWITH_CASPER > +.endif > + > +LIBADD+= ipsec > > .include > > > Modified: head/usr.sbin/traceroute6/traceroute6.c > ============================================================ > ================== > --- head/usr.sbin/traceroute6/traceroute6.c Sun Sep 6 11:29:06 2020 > (r365377) > +++ head/usr.sbin/traceroute6/traceroute6.c Sun Sep 6 14:04:02 2020 > (r365378) > @@ -249,6 +249,7 @@ static const char rcsid[] = > */ > > #include > +#include > #include > #include > #include > @@ -260,6 +261,10 @@ static const char rcsid[] = > > #include > > +#include > +#include > +#include > + > #include > #include > #include > @@ -289,11 +294,6 @@ static const char rcsid[] = > > #define MAXPACKET 65535 /* max ip packet size */ > > -#ifndef HAVE_GETIPNODEBYNAME > -#define getipnodebyname(x, y, z, u) gethostbyname2((x), (y)) > -#define freehostent(x) > -#endif > - > static u_char packet[512]; /* last inbound (icmp) packet */ > static char *outpacket; /* last output packet */ > > @@ -304,6 +304,7 @@ int setpolicy(int so, char *policy); > #endif > void send_probe(int, u_long); > void *get_uphdr(struct ip6_hdr *, u_char *); > +void capdns_open(void); > int get_hoplim(struct msghdr *); > double deltaT(struct timeval *, struct timeval *); > const char *pr_type(int); > @@ -312,6 +313,8 @@ void print(struct msghdr *, int); > const char *inetname(struct sockaddr *); > u_int32_t sctp_crc32c(void *, u_int32_t); > u_int16_t in_cksum(u_int16_t *addr, int); > +u_int16_t udp_cksum(struct sockaddr_in6 *, struct sockaddr_in6 *, > + void *, u_int32_t); > u_int16_t tcp_chksum(struct sockaddr_in6 *, struct sockaddr_in6 *, > void *, u_int32_t); > void usage(void); > @@ -335,6 +338,8 @@ static struct cmsghdr *cmsg; > static char *source = NULL; > static char *hostname; > > +static cap_channel_t *capdns; > + > static u_long nprobes = 3; > static u_long first_hop = 1; > static u_long max_hops = 30; > @@ -368,7 +373,10 @@ main(int argc, char *argv[]) > char ipsec_inpolicy[] = "in bypass"; > char ipsec_outpolicy[] = "out bypass"; > #endif > + cap_rights_t rights; > > + capdns_open(); > + > /* > * Receive ICMP > */ > @@ -429,6 +437,7 @@ main(int argc, char *argv[]) > } > break; > case 'g': > + /* XXX use after capability mode is entered */ > hp = getipnodebyname(optarg, AF_INET6, 0, > &h_errno); > if (hp == NULL) { > fprintf(stderr, > @@ -560,8 +569,8 @@ main(int argc, char *argv[]) > sndsock = rcvsock; > break; > case IPPROTO_UDP: > - if ((sndsock = socket(AF_INET6, SOCK_DGRAM, 0)) < 0) { > - perror("socket(SOCK_DGRAM)"); > + if ((sndsock = socket(AF_INET6, SOCK_RAW, IPPROTO_UDP)) < > 0) { > + perror("socket(SOCK_RAW)"); > exit(5); > } > break; > @@ -606,7 +615,9 @@ main(int argc, char *argv[]) > hints.ai_socktype = SOCK_RAW; > hints.ai_protocol = IPPROTO_ICMPV6; > hints.ai_flags = AI_CANONNAME; > - error = getaddrinfo(*argv, NULL, &hints, &res); > + > + error = cap_getaddrinfo(capdns, *argv, NULL, &hints, &res); > + > if (error) { > fprintf(stderr, > "traceroute6: %s\n", gai_strerror(error)); > @@ -624,7 +635,7 @@ main(int argc, char *argv[]) > exit(1); > } > if (res->ai_next) { > - if (getnameinfo(res->ai_addr, res->ai_addrlen, hbuf, > + if (cap_getnameinfo(capdns, res->ai_addr, res->ai_addrlen, > hbuf, > sizeof(hbuf), NULL, 0, NI_NUMERICHOST) != 0) > strlcpy(hbuf, "?", sizeof(hbuf)); > fprintf(stderr, "traceroute6: Warning: %s has multiple " > @@ -803,7 +814,7 @@ main(int argc, char *argv[]) > hints.ai_family = AF_INET6; > hints.ai_socktype = SOCK_DGRAM; /*dummy*/ > hints.ai_flags = AI_NUMERICHOST; > - error = getaddrinfo(source, "0", &hints, &res); > + error = cap_getaddrinfo(capdns, source, "0", &hints, &res); > if (error) { > printf("traceroute6: %s: %s\n", source, > gai_strerror(error)); > @@ -839,7 +850,7 @@ main(int argc, char *argv[]) > perror("getsockname"); > exit(1); > } > - if (getnameinfo((struct sockaddr *)&Src, Src.sin6_len, > + if (cap_getnameinfo(capdns, (struct sockaddr *)&Src, > Src.sin6_len, > src0, sizeof(src0), NULL, 0, NI_NUMERICHOST)) { > fprintf(stderr, "getnameinfo failed for source\n"); > exit(1); > @@ -879,7 +890,7 @@ main(int argc, char *argv[]) > /* > * Message to users > */ > - if (getnameinfo((struct sockaddr *)&Dst, Dst.sin6_len, hbuf, > + if (cap_getnameinfo(capdns, (struct sockaddr *)&Dst, Dst.sin6_len, > hbuf, > sizeof(hbuf), NULL, 0, NI_NUMERICHOST)) > strlcpy(hbuf, "(invalid)", sizeof(hbuf)); > fprintf(stderr, "traceroute6"); > @@ -894,7 +905,31 @@ main(int argc, char *argv[]) > if (first_hop > 1) > printf("Skipping %lu intermediate hops\n", first_hop - 1); > > + if (connect(sndsock, (struct sockaddr *)&Dst, > + sizeof(Dst)) != 0) { > + fprintf(stderr, "connect: %s\n", strerror(errno)); > + exit(1); > + } > + > /* > + * Here we enter capability mode. Further down access to global > + * namespaces (e.g filesystem) is restricted (see capsicum(4)). > + * We must connect(2) our socket before this point. > + */ > + > + if (caph_enter_casper() < 0) { > + fprintf(stderr, "caph_enter_casper: %s\n", > strerror(errno)); > + exit(1); > + } > + > + cap_rights_init(&rights, CAP_SEND, CAP_SETSOCKOPT); > + if (caph_rights_limit(sndsock, &rights) < 0) { > + fprintf(stderr, "caph_rights_limit sndsock: %s\n", > + strerror(errno)); > + exit(1); > + } > + > + /* > * Main loop > */ > for (hops = first_hop; hops <= max_hops; ++hops) { > @@ -1038,6 +1073,7 @@ send_probe(int seq, u_long hops) > { > struct icmp6_hdr *icp; > struct sctphdr *sctp; > + struct udphdr *outudp; > struct sctp_chunkhdr *chk; > struct sctp_init_chunk *init; > struct sctp_paramhdr *param; > @@ -1063,6 +1099,11 @@ send_probe(int seq, u_long hops) > icp->icmp6_seq = htons(seq); > break; > case IPPROTO_UDP: > + outudp = (struct udphdr *) outpacket; > + outudp->uh_sport = htons(ident); > + outudp->uh_dport = htons(port+seq); > + outudp->uh_ulen = htons(datalen); > + outudp->uh_sum = udp_cksum(&Src, &Dst, outpacket, datalen); > break; > case IPPROTO_NONE: > /* No space for anything. No harm as seq/tv32 are > decorative. */ > @@ -1149,12 +1190,11 @@ send_probe(int seq, u_long hops) > fprintf(stderr, "Unknown probe protocol %d.\n", useproto); > exit(1); > } > - > - i = sendto(sndsock, (char *)outpacket, datalen, 0, > - (struct sockaddr *)&Dst, Dst.sin6_len); > + > + i = send(sndsock, (char *)outpacket, datalen, 0); > if (i < 0 || (u_long)i != datalen) { > if (i < 0) > - perror("sendto"); > + perror("send"); > printf("traceroute6: wrote %s %lu chars, ret=%d\n", > hostname, datalen, i); > (void) fflush(stdout); > @@ -1266,7 +1306,7 @@ packet_ok(struct msghdr *mhdr, int cc, int seq, > u_char > hlen = sizeof(struct ip6_hdr); > if (cc < hlen + sizeof(struct icmp6_hdr)) { > if (verbose) { > - if (getnameinfo((struct sockaddr *)from, > from->sin6_len, > + if (cap_getnameinfo(capdns, (struct sockaddr > *)from, from->sin6_len, > hbuf, sizeof(hbuf), NULL, 0, NI_NUMERICHOST) > != 0) > strlcpy(hbuf, "invalid", sizeof(hbuf)); > printf("packet too short (%d bytes) from %s\n", cc, > @@ -1279,7 +1319,7 @@ packet_ok(struct msghdr *mhdr, int cc, int seq, > u_char > #else > if (cc < (int)sizeof(struct icmp6_hdr)) { > if (verbose) { > - if (getnameinfo((struct sockaddr *)from, > from->sin6_len, > + if (cap_getnameinfo(capdns, (struct sockaddr > *)from, from->sin6_len, > hbuf, sizeof(hbuf), NULL, 0, NI_NUMERICHOST) > != 0) > strlcpy(hbuf, "invalid", sizeof(hbuf)); > printf("data too short (%d bytes) from %s\n", cc, > hbuf); > @@ -1345,7 +1385,7 @@ packet_ok(struct msghdr *mhdr, int cc, int seq, > u_char > break; > case IPPROTO_UDP: > udp = (struct udphdr *)up; > - if (udp->uh_sport == htons(srcport) && > + if (udp->uh_sport == htons(ident) && > udp->uh_dport == htons(port + seq)) > return (1); > break; > @@ -1401,7 +1441,7 @@ packet_ok(struct msghdr *mhdr, int cc, int seq, > u_char > u_int8_t *p; > int i; > > - if (getnameinfo((struct sockaddr *)from, from->sin6_len, > + if (cap_getnameinfo(capdns, (struct sockaddr *)from, > from->sin6_len, > sbuf, sizeof(sbuf), NULL, 0, NI_NUMERICHOST) != 0) > strlcpy(sbuf, "invalid", sizeof(sbuf)); > printf("\n%d bytes from %s to %s", cc, sbuf, > @@ -1475,12 +1515,33 @@ get_uphdr(struct ip6_hdr *ip6, u_char *lim) > } > > void > +capdns_open() > +{ > + const char *types[] = { "NAME", "ADDR" }; > + int families[1]; > + cap_channel_t *casper; > + > + casper = cap_init(); > + if (casper == NULL) > + errx(1, "unable to create casper process"); > + capdns = cap_service_open(casper, "system.dns"); > + if (capdns == NULL) > + errx(1, "unable to open system.dns service"); > + if (cap_dns_type_limit(capdns, types, nitems(types)) < 0) > + errx(1, "unable to limit access to system.dns service"); > + families[0] = AF_INET6; > + if (cap_dns_family_limit(capdns, families, nitems(families)) < 0) > + errx(1, "unable to limit access to system.dns service"); > + cap_close(casper); > +} > + > +void > print(struct msghdr *mhdr, int cc) > { > struct sockaddr_in6 *from = (struct sockaddr_in6 *)mhdr->msg_name; > char hbuf[NI_MAXHOST]; > > - if (getnameinfo((struct sockaddr *)from, from->sin6_len, > + if (cap_getnameinfo(capdns, (struct sockaddr *)from, > from->sin6_len, > hbuf, sizeof(hbuf), NULL, 0, NI_NUMERICHOST) != 0) > strlcpy(hbuf, "invalid", sizeof(hbuf)); > if (as_path) > @@ -1527,7 +1588,7 @@ inetname(struct sockaddr *sa) > } > cp = NULL; > if (!nflag) { > - if (getnameinfo(sa, sa->sa_len, line, sizeof(line), NULL, > 0, > + if (cap_getnameinfo(capdns, sa, sa->sa_len, line, > sizeof(line), NULL, 0, > NI_NAMEREQD) == 0) { > if ((cp = strchr(line, '.')) && > !strcmp(cp + 1, domain)) > @@ -1538,7 +1599,7 @@ inetname(struct sockaddr *sa) > if (cp) > return cp; > > - if (getnameinfo(sa, sa->sa_len, line, sizeof(line), NULL, 0, > + if (cap_getnameinfo(capdns, sa, sa->sa_len, line, sizeof(line), > NULL, 0, > NI_NUMERICHOST) != 0) > strlcpy(line, "invalid", sizeof(line)); > return line; > @@ -1666,6 +1727,33 @@ in_cksum(u_int16_t *addr, int len) > sum += (sum >> 16); /* add carry */ > answer = ~sum; /* truncate to 16 bits */ > return (answer); > +} > + > +u_int16_t > +udp_cksum(struct sockaddr_in6 *src, struct sockaddr_in6 *dst, > + void *payload, u_int32_t len) > +{ > + struct { > + struct in6_addr src; > + struct in6_addr dst; > + u_int32_t len; > + u_int8_t zero[3]; > + u_int8_t next; > + } pseudo_hdr; > + u_int16_t sum[2]; > + > + pseudo_hdr.src = src->sin6_addr; > + pseudo_hdr.dst = dst->sin6_addr; > + pseudo_hdr.len = htonl(len); > + pseudo_hdr.zero[0] = 0; > + pseudo_hdr.zero[1] = 0; > + pseudo_hdr.zero[2] = 0; > + pseudo_hdr.next = IPPROTO_UDP; > + > + sum[1] = in_cksum((u_int16_t *)&pseudo_hdr, sizeof(pseudo_hdr)); > + sum[0] = in_cksum(payload, len); > + > + return (~in_cksum(sum, sizeof(sum))); > } > > u_int16_t > _______________________________________________ > svn-src-head@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" > From owner-svn-src-all@freebsd.org Sun Sep 6 18:39:38 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B6DB73D9C77; Sun, 6 Sep 2020 18:39:38 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bl0ZL4Hcyz4Kjb; Sun, 6 Sep 2020 18:39:38 +0000 (UTC) (envelope-from danfe@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1599417578; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=v7W7jETYcHlzukHFkLnT339iOaZTBXULWXLE1Y0bS9c=; b=HHPMU26TEdjviEuRLuwdtpk6iSaYV89JKS99Nu8wKilmsCTDaBC+bO3GyKBBK1ySw31qUc ++O4jLTSTyT0rXvAjlN6OuKgm/5avXiWG97B3NaCLugGL4YTB3/gBpeox/gyASRKn0nXp2 iRSaEhI0Wedyw8/C4qsITVEq78qRmycooKOqQK0xrDS3Nqw6PnlRVrt/Y5t5UyMRbWqlT2 +IQw7XPQ6FtKXF7lDf68YNC9gud7WzLqhrA8IhU1OMF8h4wbDDrXBdhtmxw46xRuQNX0Z7 qbaKxCzy+qrD5EqKLl2VCS9QjhwzDDWpbSRnauhFd/ebM1uexNA7suPtfcfWxw== Received: by freefall.freebsd.org (Postfix, from userid 1033) id 84D7D1EB25; Sun, 6 Sep 2020 18:39:38 +0000 (UTC) Date: Sun, 6 Sep 2020 18:39:38 +0000 From: Alexey Dokuchaev To: Oliver Pinter Cc: Mariusz Zaborski , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r365378 - head/usr.sbin/traceroute6 Message-ID: <20200906183938.GA80186@FreeBSD.org> References: <202009061404.086E43HH024712@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1599417578; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=v7W7jETYcHlzukHFkLnT339iOaZTBXULWXLE1Y0bS9c=; b=ta1HnGeU/Ksr6gU1foceA8vsTW1791yzdufcroa1t13U0ABodpc+dG7ka1dZ6Bi4hTKK+T i8fM7syGE5a5/fz+G2x0ToRuKPxzd4zAXbS16rDLHnlWGIiv/I5GJXP6z6JO2LF7ZDIthz sN6C3fDv1FNtRRAMhBffbmqD658He0Q+rXNUJB13KT40Ukt32HEYV+/aXey8zaSJgqN9Wn G5Vn7CMdjU1gutEk/Zc+gAyEEDaf+3QBDYXwK0MpzjqiFYJXMvR3GX5PFfAUlp0zzFVJph tfCskXSgYBss/c8hi9pwwh/FL5li9gZDUrDtli+2WrLGKVo7OOzTsIjGTT4PBQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1599417578; a=rsa-sha256; cv=none; b=u2rSUm87Um6ZwKvhCx1/cW+0dkLzXasywH4qg6n0SSm3YvmWA2Om/5aH8H+lSukIZqywtU Oz6DMhkQnviCcJSAW9GHHLPV2vTVWDiknnUA0nv5TzRh/DmHjQjX3NSZlH5zNs5FY98mqP jN+MLAjRTzkEn9dsKxhVmbmENzcrtN5JWaiR/R6feDcSPGmkYV7CldeLnh6HepmoRZ9klO jpfXgjth3Sjvsuoz4FTcr2bTRS8mEV7eiBs8vtxzcRebCySv+G3sHKaBo8xM41dTE31SGB cJGwmM4zQkUTW7/XI+hVxlqZlDncyzCEcYvOluOcM3ZaSY4KBTESCZIuydYx7Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 06 Sep 2020 18:39:38 -0000 On Sun, Sep 06, 2020 at 08:32:46PM +0200, Oliver Pinter wrote: > On Sunday, September 6, 2020, Mariusz Zaborski wrote: > > New Revision: 365378 > > URL: https://svnweb.freebsd.org/changeset/base/365378 > > > > Log: > > traceroute6: capsicumize it > > > > ... > > @@ -13,6 +13,10 @@ > > # A PARTICULAR PURPOSE. > > # $FreeBSD$ > > > > +.include > > + > > +.include > > Dup 1) It's usually a good idea to read all svn-mail in your inbox before replying to a particular commit, the problem could already be fixed; 2) Please don't overquote, i.e. do *not* include the rest of the diff if you only wanted to comment on the first lines it. ./danfe From owner-svn-src-all@freebsd.org Sun Sep 6 18:48:52 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9837D3DA547; Sun, 6 Sep 2020 18:48:52 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bl0n03sB9z4LRm; Sun, 6 Sep 2020 18:48:52 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6798412F23; Sun, 6 Sep 2020 18:48:52 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 086ImqQX004647; Sun, 6 Sep 2020 18:48:52 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 086ImoH1004639; Sun, 6 Sep 2020 18:48:50 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <202009061848.086ImoH1004639@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Sun, 6 Sep 2020 18:48:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365387 - in stable/12/sys: arm/allwinner arm/amlogic/aml8726 arm64/rockchip dev/altera/dwc dev/dwc X-SVN-Group: stable-12 X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: in stable/12/sys: arm/allwinner arm/amlogic/aml8726 arm64/rockchip dev/altera/dwc dev/dwc X-SVN-Commit-Revision: 365387 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.33 Precedence: list List-Id: "SVN commit messages 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, 06 Sep 2020 18:48:52 -0000 Author: gonzo Date: Sun Sep 6 18:48:50 2020 New Revision: 365387 URL: https://svnweb.freebsd.org/changeset/base/365387 Log: MFC r360467, r362399, r362405, r362415 r360467 by mmel: Fix style(9). Strip write only variables. Not a functional change. r362399 by mmel: Use naming nomenclature used in DesignWare TRM. Use naming nomenclature used in DesignWare TRM. This driver was written by using Altera (now Intel) documentation for Arria FPGA manual. Unfortunately this manual used very different (and in some cases opposite naming) for registers and descriptor fields. Unfortunately, this makes future expansion extremely hard. Should not been functional change. r362405 by mmel: Finish renaming in if_dwc. By using DWC TRM terminology, normal descriptor format should be named extended and alternate descriptor format should be named normal. Should not been functional change. r362415 by mmel: Improve if_dwc: - refactorize packet receive path. Make sure that we don't leak mbufs and/or that we don't create holes in RX descriptor ring - slightly simplify handling with TX descriptors Modified: stable/12/sys/arm/allwinner/aw_if_dwc.c stable/12/sys/arm/amlogic/aml8726/aml8726_if_dwc.c stable/12/sys/arm64/rockchip/if_dwc_rk.c stable/12/sys/dev/altera/dwc/if_dwc_socfpga.c stable/12/sys/dev/dwc/if_dwc.c stable/12/sys/dev/dwc/if_dwc.h stable/12/sys/dev/dwc/if_dwc_if.m stable/12/sys/dev/dwc/if_dwcvar.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/arm/allwinner/aw_if_dwc.c ============================================================================== --- stable/12/sys/arm/allwinner/aw_if_dwc.c Sun Sep 6 18:27:36 2020 (r365386) +++ stable/12/sys/arm/allwinner/aw_if_dwc.c Sun Sep 6 18:48:50 2020 (r365387) @@ -114,7 +114,7 @@ static int a20_if_dwc_mac_type(device_t dev) { - return (DWC_GMAC_ALT_DESC); + return (DWC_GMAC_NORMAL_DESC); } static int Modified: stable/12/sys/arm/amlogic/aml8726/aml8726_if_dwc.c ============================================================================== --- stable/12/sys/arm/amlogic/aml8726/aml8726_if_dwc.c Sun Sep 6 18:27:36 2020 (r365386) +++ stable/12/sys/arm/amlogic/aml8726/aml8726_if_dwc.c Sun Sep 6 18:48:50 2020 (r365387) @@ -66,7 +66,7 @@ static int aml8726_if_dwc_mac_type(device_t dev) { - return (DWC_GMAC_ALT_DESC); + return (DWC_GMAC_NORMAL_DESC); } static int Modified: stable/12/sys/arm64/rockchip/if_dwc_rk.c ============================================================================== --- stable/12/sys/arm64/rockchip/if_dwc_rk.c Sun Sep 6 18:27:36 2020 (r365386) +++ stable/12/sys/arm64/rockchip/if_dwc_rk.c Sun Sep 6 18:48:50 2020 (r365387) @@ -161,7 +161,7 @@ static int if_dwc_rk_mac_type(device_t dev) { - return (DWC_GMAC_ALT_DESC); + return (DWC_GMAC_NORMAL_DESC); } static int Modified: stable/12/sys/dev/altera/dwc/if_dwc_socfpga.c ============================================================================== --- stable/12/sys/dev/altera/dwc/if_dwc_socfpga.c Sun Sep 6 18:27:36 2020 (r365386) +++ stable/12/sys/dev/altera/dwc/if_dwc_socfpga.c Sun Sep 6 18:48:50 2020 (r365387) @@ -74,7 +74,7 @@ static int if_dwc_socfpga_mac_type(device_t dev) { - return (DWC_GMAC); + return (DWC_GMAC_EXT_DESC); } static int Modified: stable/12/sys/dev/dwc/if_dwc.c ============================================================================== --- stable/12/sys/dev/dwc/if_dwc.c Sun Sep 6 18:27:36 2020 (r365386) +++ stable/12/sys/dev/dwc/if_dwc.c Sun Sep 6 18:48:50 2020 (r365387) @@ -93,46 +93,113 @@ __FBSDID("$FreeBSD$"); #define DWC_ASSERT_LOCKED(sc) mtx_assert(&(sc)->mtx, MA_OWNED) #define DWC_ASSERT_UNLOCKED(sc) mtx_assert(&(sc)->mtx, MA_NOTOWNED) -#define DDESC_TDES0_OWN (1U << 31) -#define DDESC_TDES0_TXINT (1U << 30) -#define DDESC_TDES0_TXLAST (1U << 29) -#define DDESC_TDES0_TXFIRST (1U << 28) -#define DDESC_TDES0_TXCRCDIS (1U << 27) -#define DDESC_TDES0_TXRINGEND (1U << 21) -#define DDESC_TDES0_TXCHAIN (1U << 20) +/* TX descriptors - TDESC0 is almost unified */ +#define TDESC0_OWN (1U << 31) +#define TDESC0_IHE (1U << 16) /* IP Header Error */ +#define TDESC0_ES (1U << 15) /* Error Summary */ +#define TDESC0_JT (1U << 14) /* Jabber Timeout */ +#define TDESC0_FF (1U << 13) /* Frame Flushed */ +#define TDESC0_PCE (1U << 12) /* Payload Checksum Error */ +#define TDESC0_LOC (1U << 11) /* Loss of Carrier */ +#define TDESC0_NC (1U << 10) /* No Carrier */ +#define TDESC0_LC (1U << 9) /* Late Collision */ +#define TDESC0_EC (1U << 8) /* Excessive Collision */ +#define TDESC0_VF (1U << 7) /* VLAN Frame */ +#define TDESC0_CC_MASK 0xf +#define TDESC0_CC_SHIFT 3 /* Collision Count */ +#define TDESC0_ED (1U << 2) /* Excessive Deferral */ +#define TDESC0_UF (1U << 1) /* Underflow Error */ +#define TDESC0_DB (1U << 0) /* Deferred Bit */ +/* TX descriptors - TDESC0 extended format only */ +#define ETDESC0_IC (1U << 30) /* Interrupt on Completion */ +#define ETDESC0_LS (1U << 29) /* Last Segment */ +#define ETDESC0_FS (1U << 28) /* First Segment */ +#define ETDESC0_DC (1U << 27) /* Disable CRC */ +#define ETDESC0_DP (1U << 26) /* Disable Padding */ +#define ETDESC0_CIC_NONE (0U << 22) /* Checksum Insertion Control */ +#define ETDESC0_CIC_HDR (1U << 22) +#define ETDESC0_CIC_SEG (2U << 22) +#define ETDESC0_CIC_FULL (3U << 22) +#define ETDESC0_TER (1U << 21) /* Transmit End of Ring */ +#define ETDESC0_TCH (1U << 20) /* Second Address Chained */ -#define DDESC_RDES0_OWN (1U << 31) -#define DDESC_RDES0_FL_MASK 0x3fff -#define DDESC_RDES0_FL_SHIFT 16 /* Frame Length */ -#define DDESC_RDES1_CHAINED (1U << 14) +/* TX descriptors - TDESC1 normal format */ +#define NTDESC1_IC (1U << 31) /* Interrupt on Completion */ +#define NTDESC1_LS (1U << 30) /* Last Segment */ +#define NTDESC1_FS (1U << 29) /* First Segment */ +#define NTDESC1_CIC_NONE (0U << 27) /* Checksum Insertion Control */ +#define NTDESC1_CIC_HDR (1U << 27) +#define NTDESC1_CIC_SEG (2U << 27) +#define NTDESC1_CIC_FULL (3U << 27) +#define NTDESC1_DC (1U << 26) /* Disable CRC */ +#define NTDESC1_TER (1U << 25) /* Transmit End of Ring */ +#define NTDESC1_TCH (1U << 24) /* Second Address Chained */ +/* TX descriptors - TDESC1 extended format */ +#define ETDESC1_DP (1U << 23) /* Disable Padding */ +#define ETDESC1_TBS2_MASK 0x7ff +#define ETDESC1_TBS2_SHIFT 11 /* Receive Buffer 2 Size */ +#define ETDESC1_TBS1_MASK 0x7ff +#define ETDESC1_TBS1_SHIFT 0 /* Receive Buffer 1 Size */ -/* Alt descriptor bits. */ -#define DDESC_CNTL_TXINT (1U << 31) -#define DDESC_CNTL_TXLAST (1U << 30) -#define DDESC_CNTL_TXFIRST (1U << 29) -#define DDESC_CNTL_TXCRCDIS (1U << 26) -#define DDESC_CNTL_TXRINGEND (1U << 25) -#define DDESC_CNTL_TXCHAIN (1U << 24) +/* RX descriptor - RDESC0 is unified */ +#define RDESC0_OWN (1U << 31) +#define RDESC0_AFM (1U << 30) /* Dest. Address Filter Fail */ +#define RDESC0_FL_MASK 0x3fff +#define RDESC0_FL_SHIFT 16 /* Frame Length */ +#define RDESC0_ES (1U << 15) /* Error Summary */ +#define RDESC0_DE (1U << 14) /* Descriptor Error */ +#define RDESC0_SAF (1U << 13) /* Source Address Filter Fail */ +#define RDESC0_LE (1U << 12) /* Length Error */ +#define RDESC0_OE (1U << 11) /* Overflow Error */ +#define RDESC0_VLAN (1U << 10) /* VLAN Tag */ +#define RDESC0_FS (1U << 9) /* First Descriptor */ +#define RDESC0_LS (1U << 8) /* Last Descriptor */ +#define RDESC0_ICE (1U << 7) /* IPC Checksum Error */ +#define RDESC0_GF (1U << 7) /* Giant Frame */ +#define RDESC0_LC (1U << 6) /* Late Collision */ +#define RDESC0_FT (1U << 5) /* Frame Type */ +#define RDESC0_RWT (1U << 4) /* Receive Watchdog Timeout */ +#define RDESC0_RE (1U << 3) /* Receive Error */ +#define RDESC0_DBE (1U << 2) /* Dribble Bit Error */ +#define RDESC0_CE (1U << 1) /* CRC Error */ +#define RDESC0_PCE (1U << 0) /* Payload Checksum Error */ +#define RDESC0_RXMA (1U << 0) /* Rx MAC Address */ -#define DDESC_CNTL_CHAINED (1U << 24) +/* RX descriptors - RDESC1 normal format */ +#define NRDESC1_DIC (1U << 31) /* Disable Intr on Completion */ +#define NRDESC1_RER (1U << 25) /* Receive End of Ring */ +#define NRDESC1_RCH (1U << 24) /* Second Address Chained */ +#define NRDESC1_RBS2_MASK 0x7ff +#define NRDESC1_RBS2_SHIFT 11 /* Receive Buffer 2 Size */ +#define NRDESC1_RBS1_MASK 0x7ff +#define NRDESC1_RBS1_SHIFT 0 /* Receive Buffer 1 Size */ +/* RX descriptors - RDESC1 enhanced format */ +#define ERDESC1_DIC (1U << 31) /* Disable Intr on Completion */ +#define ERDESC1_RBS2_MASK 0x7ffff +#define ERDESC1_RBS2_SHIFT 16 /* Receive Buffer 2 Size */ +#define ERDESC1_RER (1U << 15) /* Receive End of Ring */ +#define ERDESC1_RCH (1U << 14) /* Second Address Chained */ +#define ERDESC1_RBS1_MASK 0x7ffff +#define ERDESC1_RBS1_SHIFT 0 /* Receive Buffer 1 Size */ + /* * A hardware buffer descriptor. Rx and Tx buffers have the same descriptor * layout, but the bits in the fields have different meanings. */ struct dwc_hwdesc { - uint32_t tdes0; /* status for alt layout */ - uint32_t tdes1; /* cntl for alt layout */ - uint32_t addr; /* pointer to buffer data */ - uint32_t addr_next; /* link to next descriptor */ + uint32_t desc0; + uint32_t desc1; + uint32_t addr1; /* ptr to first buffer data */ + uint32_t addr2; /* ptr to next descriptor / second buffer data*/ }; /* * The hardware imposes alignment restrictions on various objects involved in * DMA transfers. These values are expressed in bytes (not bits). */ -#define DWC_DESC_RING_ALIGN 2048 +#define DWC_DESC_RING_ALIGN 2048 static struct resource_spec dwc_spec[] = { { SYS_RES_MEMORY, 0, RF_ACTIVE }, @@ -168,45 +235,39 @@ dwc_get1paddr(void *arg, bus_dma_segment_t *segs, int *(bus_addr_t *)arg = segs[0].ds_addr; } -inline static uint32_t +inline static void dwc_setup_txdesc(struct dwc_softc *sc, int idx, bus_addr_t paddr, uint32_t len) { - uint32_t flags; - uint32_t nidx; + uint32_t desc0, desc1; - nidx = next_txidx(sc, idx); - /* Addr/len 0 means we're clearing the descriptor after xmit done. */ if (paddr == 0 || len == 0) { - flags = 0; + desc0 = 0; + desc1 = 0; --sc->txcount; } else { - if (sc->mactype == DWC_GMAC_ALT_DESC) - flags = DDESC_CNTL_TXCHAIN | DDESC_CNTL_TXFIRST - | DDESC_CNTL_TXLAST | DDESC_CNTL_TXINT; - else - flags = DDESC_TDES0_TXCHAIN | DDESC_TDES0_TXFIRST - | DDESC_TDES0_TXLAST | DDESC_TDES0_TXINT; + if (sc->mactype != DWC_GMAC_EXT_DESC) { + desc0 = 0; + desc1 = NTDESC1_TCH | NTDESC1_FS | NTDESC1_LS | + NTDESC1_IC | len; + } else { + desc0 = ETDESC0_TCH | ETDESC0_FS | ETDESC0_LS | + ETDESC0_IC; + desc1 = len; + } ++sc->txcount; } - sc->txdesc_ring[idx].addr = (uint32_t)(paddr); - if (sc->mactype == DWC_GMAC_ALT_DESC) { - sc->txdesc_ring[idx].tdes0 = 0; - sc->txdesc_ring[idx].tdes1 = flags | len; - } else { - sc->txdesc_ring[idx].tdes0 = flags; - sc->txdesc_ring[idx].tdes1 = len; - } + sc->txdesc_ring[idx].addr1 = (uint32_t)(paddr); + sc->txdesc_ring[idx].desc0 = desc0; + sc->txdesc_ring[idx].desc1 = desc1; if (paddr && len) { wmb(); - sc->txdesc_ring[idx].tdes0 |= DDESC_TDES0_OWN; + sc->txdesc_ring[idx].desc0 |= TDESC0_OWN; wmb(); } - - return (nidx); } static int @@ -252,14 +313,13 @@ dwc_txstart_locked(struct dwc_softc *sc) ifp = sc->ifp; - if (ifp->if_drv_flags & IFF_DRV_OACTIVE) { + if (ifp->if_drv_flags & IFF_DRV_OACTIVE) return; - } enqueued = 0; for (;;) { - if (sc->txcount == (TX_DESC_COUNT-1)) { + if (sc->txcount == (TX_DESC_COUNT - 1)) { ifp->if_drv_flags |= IFF_DRV_OACTIVE; break; } @@ -268,7 +328,7 @@ dwc_txstart_locked(struct dwc_softc *sc) if (m == NULL) break; if (dwc_setup_txbuf(sc, sc->tx_idx_head, &m) != 0) { - IFQ_DRV_PREPEND(&ifp->if_snd, m); + IFQ_DRV_PREPEND(&ifp->if_snd, m); break; } BPF_MTAP(ifp, m); @@ -462,24 +522,26 @@ dwc_init(void *if_softc) DWC_UNLOCK(sc); } + inline static uint32_t dwc_setup_rxdesc(struct dwc_softc *sc, int idx, bus_addr_t paddr) { uint32_t nidx; - sc->rxdesc_ring[idx].addr = (uint32_t)paddr; + sc->rxdesc_ring[idx].addr1 = (uint32_t)paddr; nidx = next_rxidx(sc, idx); - sc->rxdesc_ring[idx].addr_next = sc->rxdesc_ring_paddr + \ + sc->rxdesc_ring[idx].addr2 = sc->rxdesc_ring_paddr + (nidx * sizeof(struct dwc_hwdesc)); - if (sc->mactype == DWC_GMAC_ALT_DESC) - sc->rxdesc_ring[idx].tdes1 = DDESC_CNTL_CHAINED | RX_MAX_PACKET; + if (sc->mactype != DWC_GMAC_EXT_DESC) + sc->rxdesc_ring[idx].desc1 = NRDESC1_RCH | + MIN(MCLBYTES, NRDESC1_RBS1_MASK); else - sc->rxdesc_ring[idx].tdes1 = DDESC_RDES1_CHAINED | MCLBYTES; + sc->rxdesc_ring[idx].desc1 = ERDESC1_RCH | + MIN(MCLBYTES, ERDESC1_RBS1_MASK); wmb(); - sc->rxdesc_ring[idx].tdes0 = DDESC_RDES0_OWN; + sc->rxdesc_ring[idx].desc0 = RDESC0_OWN; wmb(); - return (nidx); } @@ -493,9 +555,8 @@ dwc_setup_rxbuf(struct dwc_softc *sc, int idx, struct error = bus_dmamap_load_mbuf_sg(sc->rxbuf_tag, sc->rxbuf_map[idx].map, m, &seg, &nsegs, 0); - if (error != 0) { + if (error != 0) return (error); - } KASSERT(nsegs == 1, ("%s: %d segments returned!", __func__, nsegs)); @@ -520,6 +581,74 @@ dwc_alloc_mbufcl(struct dwc_softc *sc) return (m); } +static struct mbuf * +dwc_rxfinish_one(struct dwc_softc *sc, struct dwc_hwdesc *desc, + struct dwc_bufmap *map) +{ + struct ifnet *ifp; + struct mbuf *m, *m0; + int len; + uint32_t rdesc0; + + m = map->mbuf; + ifp = sc->ifp; + rdesc0 = desc ->desc0; + /* Validate descriptor. */ + if (rdesc0 & RDESC0_ES) { + /* + * Errored packet. Statistic counters are updated + * globally, so do nothing + */ + return (NULL); + } + + if ((rdesc0 & (RDESC0_FS | RDESC0_LS)) != + (RDESC0_FS | RDESC0_LS)) { + /* + * Something very wrong happens. The whole packet should be + * recevied in one descriptr. Report problem. + */ + device_printf(sc->dev, + "%s: RX descriptor without FIRST and LAST bit set: 0x%08X", + __func__, rdesc0); + return (NULL); + } + + len = (rdesc0 >> RDESC0_FL_SHIFT) & RDESC0_FL_MASK; + if (len < 64) { + /* + * Lenght is invalid, recycle old mbuf + * Probably impossible case + */ + return (NULL); + } + + /* Allocate new buffer */ + m0 = dwc_alloc_mbufcl(sc); + if (m0 == NULL) { + /* no new mbuf available, recycle old */ + if_inc_counter(sc->ifp, IFCOUNTER_IQDROPS, 1); + return (NULL); + } + /* Do dmasync for newly received packet */ + bus_dmamap_sync(sc->rxbuf_tag, map->map, BUS_DMASYNC_POSTREAD); + bus_dmamap_unload(sc->rxbuf_tag, map->map); + + /* Received packet is valid, process it */ + m->m_pkthdr.rcvif = ifp; + m->m_pkthdr.len = len; + m->m_len = len; + if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); + + /* Remove trailing FCS */ + m_adj(m, -ETHER_CRC_LEN); + + DWC_UNLOCK(sc); + (*ifp->if_input)(ifp, m); + DWC_LOCK(sc); + return (m0); +} + static void dwc_media_status(struct ifnet * ifp, struct ifmediareq *ifmr) { @@ -596,7 +725,7 @@ dwc_hash_maddr(void *arg, struct sockaddr_dl *sdl, u_i crc = ether_crc32_le(LLADDR(sdl), ETHER_ADDR_LEN); /* Take lower 8 bits and reverse it */ val = bitreverse(~crc & 0xff); - if (ctx->sc->mactype == DWC_GMAC_ALT_DESC) + if (ctx->sc->mactype != DWC_GMAC_EXT_DESC) val >>= 2; /* Only need lower 6 bits */ hashreg = (val >> 5); hashbit = (val & 31); @@ -617,7 +746,7 @@ dwc_setup_rxfilter(struct dwc_softc *sc) DWC_ASSERT_LOCKED(sc); ifp = sc->ifp; - nhash = sc->mactype == DWC_GMAC_ALT_DESC ? 2 : 8; + nhash = sc->mactype != DWC_GMAC_EXT_DESC ? 2 : 8; /* * Set the multicast (group) filter hash. @@ -650,7 +779,7 @@ dwc_setup_rxfilter(struct dwc_softc *sc) WRITE4(sc, MAC_ADDRESS_LOW(0), lo); WRITE4(sc, MAC_ADDRESS_HIGH(0), hi); WRITE4(sc, MAC_FRAME_FILTER, ffval); - if (sc->mactype == DWC_GMAC_ALT_DESC) { + if (sc->mactype != DWC_GMAC_EXT_DESC) { WRITE4(sc, GMAC_MAC_HTLOW, ctx.hash[0]); WRITE4(sc, GMAC_MAC_HTHIGH, ctx.hash[1]); } else { @@ -731,7 +860,7 @@ dwc_txfinish_locked(struct dwc_softc *sc) ifp = sc->ifp; while (sc->tx_idx_tail != sc->tx_idx_head) { desc = &sc->txdesc_ring[sc->tx_idx_tail]; - if ((desc->tdes0 & DDESC_TDES0_OWN) != 0) + if ((desc->desc0 & TDESC0_OWN) != 0) break; bmap = &sc->txbuf_map[sc->tx_idx_tail]; bus_dmamap_sync(sc->txbuf_tag, bmap->map, @@ -755,52 +884,30 @@ static void dwc_rxfinish_locked(struct dwc_softc *sc) { struct ifnet *ifp; - struct mbuf *m0; struct mbuf *m; - int error, idx, len; - uint32_t rdes0; + int error, idx; + struct dwc_hwdesc *desc; + DWC_ASSERT_LOCKED(sc); ifp = sc->ifp; - for (;;) { idx = sc->rx_idx; - - rdes0 = sc->rxdesc_ring[idx].tdes0; - if ((rdes0 & DDESC_RDES0_OWN) != 0) + desc = sc->rxdesc_ring + idx; + if ((desc->desc0 & RDESC0_OWN) != 0) break; - bus_dmamap_sync(sc->rxbuf_tag, sc->rxbuf_map[idx].map, - BUS_DMASYNC_POSTREAD); - bus_dmamap_unload(sc->rxbuf_tag, sc->rxbuf_map[idx].map); - - len = (rdes0 >> DDESC_RDES0_FL_SHIFT) & DDESC_RDES0_FL_MASK; - if (len != 0) { - m = sc->rxbuf_map[idx].mbuf; - m->m_pkthdr.rcvif = ifp; - m->m_pkthdr.len = len; - m->m_len = len; - if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); - - /* Remove trailing FCS */ - m_adj(m, -ETHER_CRC_LEN); - - DWC_UNLOCK(sc); - (*ifp->if_input)(ifp, m); - DWC_LOCK(sc); + m = dwc_rxfinish_one(sc, desc, sc->rxbuf_map + idx); + if (m == NULL) { + wmb(); + desc->desc0 = RDESC0_OWN; + wmb(); } else { - /* XXX Zero-length packet ? */ + /* We cannot create hole in RX ring */ + error = dwc_setup_rxbuf(sc, idx, m); + if (error != 0) + panic("dwc_setup_rxbuf failed: error %d\n", + error); } - - if ((m0 = dwc_alloc_mbufcl(sc)) != NULL) { - if ((error = dwc_setup_rxbuf(sc, idx, m0)) != 0) { - /* - * XXX Now what? - * We've got a hole in the rx ring. - */ - } - } else - if_inc_counter(sc->ifp, IFCOUNTER_IQDROPS, 1); - sc->rx_idx = next_rxidx(sc, sc->rx_idx); } } @@ -892,7 +999,7 @@ setup_dma(struct dwc_softc *sc) for (idx = 0; idx < TX_DESC_COUNT; idx++) { nidx = next_txidx(sc, idx); - sc->txdesc_ring[idx].addr_next = sc->txdesc_ring_paddr + + sc->txdesc_ring[idx].addr2 = sc->txdesc_ring_paddr + (nidx * sizeof(struct dwc_hwdesc)); } @@ -1168,10 +1275,6 @@ dwc_attach(device_t dev) return (ENXIO); } - /* Memory interface */ - sc->bst = rman_get_bustag(sc->res[0]); - sc->bsh = rman_get_bushandle(sc->res[0]); - /* Read MAC before reset */ if (dwc_get_hwaddr(sc, macaddr)) { device_printf(sc->dev, "can't get mac\n"); @@ -1199,7 +1302,7 @@ dwc_attach(device_t dev) return (ENXIO); } - if (sc->mactype == DWC_GMAC_ALT_DESC) { + if (sc->mactype != DWC_GMAC_EXT_DESC) { reg = BUS_MODE_FIXEDBURST; reg |= (BUS_MODE_PRIORXTX_41 << BUS_MODE_PRIORXTX_SHIFT); } else Modified: stable/12/sys/dev/dwc/if_dwc.h ============================================================================== --- stable/12/sys/dev/dwc/if_dwc.h Sun Sep 6 18:27:36 2020 (r365386) +++ stable/12/sys/dev/dwc/if_dwc.h Sun Sep 6 18:48:50 2020 (r365387) @@ -272,8 +272,9 @@ #define CURRENT_HOST_RECEIVE_BUF_ADDR 0x1054 #define HW_FEATURE 0x1058 -#define DWC_GMAC 0x1 -#define DWC_GMAC_ALT_DESC 0x2 +#define DWC_GMAC_NORMAL_DESC 0x1 +#define DWC_GMAC_EXT_DESC 0x2 + #define GMAC_MII_CLK_60_100M_DIV42 0x0 #define GMAC_MII_CLK_100_150M_DIV62 0x1 #define GMAC_MII_CLK_25_35M_DIV16 0x2 Modified: stable/12/sys/dev/dwc/if_dwc_if.m ============================================================================== --- stable/12/sys/dev/dwc/if_dwc_if.m Sun Sep 6 18:27:36 2020 (r365386) +++ stable/12/sys/dev/dwc/if_dwc_if.m Sun Sep 6 18:48:50 2020 (r365387) @@ -41,7 +41,7 @@ CODE { static int if_dwc_default_mac_type(device_t dev) { - return (DWC_GMAC); + return (DWC_GMAC_EXT_DESC); } static int Modified: stable/12/sys/dev/dwc/if_dwcvar.h ============================================================================== --- stable/12/sys/dev/dwc/if_dwcvar.h Sun Sep 6 18:27:36 2020 (r365386) +++ stable/12/sys/dev/dwc/if_dwcvar.h Sun Sep 6 18:48:50 2020 (r365387) @@ -44,7 +44,6 @@ /* * Driver data and defines. */ -#define RX_MAX_PACKET 0x7ff #define RX_DESC_COUNT 1024 #define RX_DESC_SIZE (sizeof(struct dwc_hwdesc) * RX_DESC_COUNT) #define TX_DESC_COUNT 1024 @@ -57,8 +56,6 @@ struct dwc_bufmap { struct dwc_softc { struct resource *res[2]; - bus_space_tag_t bst; - bus_space_handle_t bsh; device_t dev; int mactype; int mii_clk; From owner-svn-src-all@freebsd.org Sun Sep 6 19:03:21 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 043313DA7B8; Sun, 6 Sep 2020 19:03:21 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bl15h6YKpz4MGH; Sun, 6 Sep 2020 19:03:20 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C4317130E9; Sun, 6 Sep 2020 19:03:20 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 086J3KR9016904; Sun, 6 Sep 2020 19:03:20 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 086J3J9v016899; Sun, 6 Sep 2020 19:03:19 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <202009061903.086J3J9v016899@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Sun, 6 Sep 2020 19:03:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365388 - in stable/12/sys: arm64/rockchip dev/dwc X-SVN-Group: stable-12 X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: in stable/12/sys: arm64/rockchip dev/dwc X-SVN-Commit-Revision: 365388 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.33 Precedence: list List-Id: "SVN commit messages 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, 06 Sep 2020 19:03:21 -0000 Author: gonzo Date: Sun Sep 6 19:03:19 2020 New Revision: 365388 URL: https://svnweb.freebsd.org/changeset/base/365388 Log: MFC r362736, r364088 r362736: Configure rx_delay/tx_delay values for RK3399/RK3328 GMAC For 1000Mb mode to work reliably TX/RX delays need to be configured between the TX/RX clock and the respective signals on the PHY to compensate for differing trace lengths on the PCB. Reviewed by: manu r364088: Improve Rockchip's integration of if_dwc - Do not rely on U-Boot for clocks configuration, enable and set frequencies in the driver's attach method. - Adjust MAC settings according to detected linespeed on RK3399 and RK3328. - Add support for RMII PHY mode on RK3328. Reviewed by: manu Differential Revision: https://reviews.freebsd.org/D26006 Modified: stable/12/sys/arm64/rockchip/if_dwc_rk.c stable/12/sys/dev/dwc/if_dwc.c stable/12/sys/dev/dwc/if_dwc.h stable/12/sys/dev/dwc/if_dwc_if.m stable/12/sys/dev/dwc/if_dwcvar.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/arm64/rockchip/if_dwc_rk.c ============================================================================== --- stable/12/sys/arm64/rockchip/if_dwc_rk.c Sun Sep 6 18:48:50 2020 (r365387) +++ stable/12/sys/arm64/rockchip/if_dwc_rk.c Sun Sep 6 19:03:19 2020 (r365388) @@ -24,7 +24,7 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - */ +*/ #include __FBSDID("$FreeBSD$"); @@ -34,91 +34,350 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include +#include +#include + #include #include #include #include #include +#include #include - #include +#include "if_dwc_if.h" #include "syscon_if.h" -#include "if_dwc_if.h" - #define RK3328_GRF_MAC_CON0 0x0900 -#define RK3328_GRF_MAC_CON0_TX_MASK 0x7F -#define RK3328_GRF_MAC_CON0_TX_SHIFT 0 -#define RK3328_GRF_MAC_CON0_RX_MASK 0x7F -#define RK3328_GRF_MAC_CON0_RX_SHIFT 7 +#define MAC_CON0_GMAC2IO_TX_DL_CFG_MASK 0x7F +#define MAC_CON0_GMAC2IO_TX_DL_CFG_SHIFT 0 +#define MAC_CON0_GMAC2IO_RX_DL_CFG_MASK 0x7F +#define MAC_CON0_GMAC2IO_RX_DL_CFG_SHIFT 7 #define RK3328_GRF_MAC_CON1 0x0904 +#define MAC_CON1_GMAC2IO_GMAC_TXCLK_DLY_ENA (1 << 0) +#define MAC_CON1_GMAC2IO_GMAC_RXCLK_DLY_ENA (1 << 1) +#define MAC_CON1_GMAC2IO_GMII_CLK_SEL_MASK (3 << 11) +#define MAC_CON1_GMAC2IO_GMII_CLK_SEL_125 (0 << 11) +#define MAC_CON1_GMAC2IO_GMII_CLK_SEL_25 (3 << 11) +#define MAC_CON1_GMAC2IO_GMII_CLK_SEL_2_5 (2 << 11) +#define MAC_CON1_GMAC2IO_RMII_MODE_MASK (1 << 9) +#define MAC_CON1_GMAC2IO_RMII_MODE (1 << 9) +#define MAC_CON1_GMAC2IO_INTF_SEL_MASK (7 << 4) +#define MAC_CON1_GMAC2IO_INTF_RMII (4 << 4) +#define MAC_CON1_GMAC2IO_INTF_RGMII (1 << 4) +#define MAC_CON1_GMAC2IO_RMII_CLK_SEL_MASK (1 << 7) +#define MAC_CON1_GMAC2IO_RMII_CLK_SEL_25 (1 << 7) +#define MAC_CON1_GMAC2IO_RMII_CLK_SEL_2_5 (0 << 7) +#define MAC_CON1_GMAC2IO_MAC_SPEED_MASK (1 << 2) +#define MAC_CON1_GMAC2IO_MAC_SPEED_100 (1 << 2) +#define MAC_CON1_GMAC2IO_MAC_SPEED_10 (0 << 2) #define RK3328_GRF_MAC_CON2 0x0908 #define RK3328_GRF_MACPHY_CON0 0x0B00 +#define MACPHY_CON0_CLK_50M_MASK (1 << 14) +#define MACPHY_CON0_CLK_50M (1 << 14) +#define MACPHY_CON0_RMII_MODE_MASK (3 << 6) +#define MACPHY_CON0_RMII_MODE (1 << 6) #define RK3328_GRF_MACPHY_CON1 0x0B04 +#define MACPHY_CON1_RMII_MODE_MASK (1 << 9) +#define MACPHY_CON1_RMII_MODE (1 << 9) #define RK3328_GRF_MACPHY_CON2 0x0B08 #define RK3328_GRF_MACPHY_CON3 0x0B0C #define RK3328_GRF_MACPHY_STATUS 0x0B10 +#define RK3399_GRF_SOC_CON5 0xc214 +#define SOC_CON5_GMAC_CLK_SEL_MASK (3 << 4) +#define SOC_CON5_GMAC_CLK_SEL_125 (0 << 4) +#define SOC_CON5_GMAC_CLK_SEL_25 (3 << 4) +#define SOC_CON5_GMAC_CLK_SEL_2_5 (2 << 4) +#define RK3399_GRF_SOC_CON6 0xc218 +#define SOC_CON6_GMAC_TXCLK_DLY_ENA (1 << 7) +#define SOC_CON6_TX_DL_CFG_MASK 0x7F +#define SOC_CON6_TX_DL_CFG_SHIFT 0 +#define SOC_CON6_RX_DL_CFG_MASK 0x7F +#define SOC_CON6_GMAC_RXCLK_DLY_ENA (1 << 15) +#define SOC_CON6_RX_DL_CFG_SHIFT 8 + +struct if_dwc_rk_softc; + +typedef void (*if_dwc_rk_set_delaysfn_t)(struct if_dwc_rk_softc *); +typedef int (*if_dwc_rk_set_speedfn_t)(struct if_dwc_rk_softc *, int); +typedef void (*if_dwc_rk_set_phy_modefn_t)(struct if_dwc_rk_softc *); +typedef void (*if_dwc_rk_phy_powerupfn_t)(struct if_dwc_rk_softc *); + +struct if_dwc_rk_ops { + if_dwc_rk_set_delaysfn_t set_delays; + if_dwc_rk_set_speedfn_t set_speed; + if_dwc_rk_set_phy_modefn_t set_phy_mode; + if_dwc_rk_phy_powerupfn_t phy_powerup; +}; + +struct if_dwc_rk_softc { + struct dwc_softc base; + uint32_t tx_delay; + uint32_t rx_delay; + bool integrated_phy; + bool clock_in; + phandle_t phy_node; + struct syscon *grf; + struct if_dwc_rk_ops *ops; + /* Common clocks */ + clk_t mac_clk_rx; + clk_t mac_clk_tx; + clk_t aclk_mac; + clk_t pclk_mac; + clk_t clk_stmmaceth; + /* RMII clocks */ + clk_t clk_mac_ref; + clk_t clk_mac_refout; + /* PHY clock */ + clk_t clk_phy; +}; + +static void rk3328_set_delays(struct if_dwc_rk_softc *sc); +static int rk3328_set_speed(struct if_dwc_rk_softc *sc, int speed); +static void rk3328_set_phy_mode(struct if_dwc_rk_softc *sc); +static void rk3328_phy_powerup(struct if_dwc_rk_softc *sc); + +static void rk3399_set_delays(struct if_dwc_rk_softc *sc); +static int rk3399_set_speed(struct if_dwc_rk_softc *sc, int speed); + +static struct if_dwc_rk_ops rk3288_ops = { +}; + +static struct if_dwc_rk_ops rk3328_ops = { + .set_delays = rk3328_set_delays, + .set_speed = rk3328_set_speed, + .set_phy_mode = rk3328_set_phy_mode, + .phy_powerup = rk3328_phy_powerup, +}; + +static struct if_dwc_rk_ops rk3399_ops = { + .set_delays = rk3399_set_delays, + .set_speed = rk3399_set_speed, +}; + static struct ofw_compat_data compat_data[] = { - {"rockchip,rk3288-gmac", 1}, - {"rockchip,rk3328-gmac", 1}, - {"rockchip,rk3399-gmac", 1}, + {"rockchip,rk3288-gmac", (uintptr_t)&rk3288_ops}, + {"rockchip,rk3328-gmac", (uintptr_t)&rk3328_ops}, + {"rockchip,rk3399-gmac", (uintptr_t)&rk3399_ops}, {NULL, 0} }; -#ifdef notyet static void -rk3328_set_delays(struct syscon *grf, phandle_t node) +rk3328_set_delays(struct if_dwc_rk_softc *sc) { + uint32_t reg; uint32_t tx, rx; - if (OF_getencprop(node, "tx_delay", &tx, sizeof(tx)) <= 0) - tx = 0x30; - if (OF_getencprop(node, "rx_delay", &rx, sizeof(rx)) <= 0) - rx = 0x10; + if (sc->base.phy_mode != PHY_MODE_RGMII) + return; - tx = ((tx & RK3328_GRF_MAC_CON0_TX_MASK) << - RK3328_GRF_MAC_CON0_TX_SHIFT); - rx = ((rx & RK3328_GRF_MAC_CON0_TX_MASK) << - RK3328_GRF_MAC_CON0_RX_SHIFT); + reg = SYSCON_READ_4(sc->grf, RK3328_GRF_MAC_CON0); + tx = ((reg >> MAC_CON0_GMAC2IO_TX_DL_CFG_SHIFT) & MAC_CON0_GMAC2IO_TX_DL_CFG_MASK); + rx = ((reg >> MAC_CON0_GMAC2IO_RX_DL_CFG_SHIFT) & MAC_CON0_GMAC2IO_RX_DL_CFG_MASK); - SYSCON_WRITE_4(grf, RK3328_GRF_MAC_CON0, tx | rx | 0xFFFF0000); + reg = SYSCON_READ_4(sc->grf, RK3328_GRF_MAC_CON1); + if (bootverbose) { + device_printf(sc->base.dev, "current delays settings: tx=%u(%s) rx=%u(%s)\n", + tx, ((reg & MAC_CON1_GMAC2IO_GMAC_TXCLK_DLY_ENA) ? "enabled" : "disabled"), + rx, ((reg & MAC_CON1_GMAC2IO_GMAC_RXCLK_DLY_ENA) ? "enabled" : "disabled")); + + device_printf(sc->base.dev, "setting new RK3328 RX/TX delays: %d/%d\n", + sc->tx_delay, sc->rx_delay); + } + + reg = (MAC_CON1_GMAC2IO_GMAC_TXCLK_DLY_ENA | MAC_CON1_GMAC2IO_GMAC_RXCLK_DLY_ENA) << 16; + reg |= (MAC_CON1_GMAC2IO_GMAC_TXCLK_DLY_ENA | MAC_CON1_GMAC2IO_GMAC_RXCLK_DLY_ENA); + SYSCON_WRITE_4(sc->grf, RK3328_GRF_MAC_CON1, reg); + + reg = 0xffff << 16; + reg |= ((sc->tx_delay & MAC_CON0_GMAC2IO_TX_DL_CFG_MASK) << + MAC_CON0_GMAC2IO_TX_DL_CFG_SHIFT); + reg |= ((sc->rx_delay & MAC_CON0_GMAC2IO_TX_DL_CFG_MASK) << + MAC_CON0_GMAC2IO_RX_DL_CFG_SHIFT); + SYSCON_WRITE_4(sc->grf, RK3328_GRF_MAC_CON0, reg); } -#endif -#define RK3399_GRF_SOC_CON6 0xc218 -#define RK3399_GRF_SOC_CON6_TX_MASK 0x7F -#define RK3399_GRF_SOC_CON6_TX_SHIFT 0 -#define RK3399_GRF_SOC_CON6_RX_MASK 0x7F -#define RK3399_GRF_SOC_CON6_RX_SHIFT 8 +static int +rk3328_set_speed(struct if_dwc_rk_softc *sc, int speed) +{ + uint32_t reg; -#ifdef notyet + switch (sc->base.phy_mode) { + case PHY_MODE_RGMII: + switch (speed) { + case IFM_1000_T: + case IFM_1000_SX: + reg = MAC_CON1_GMAC2IO_GMII_CLK_SEL_125; + break; + case IFM_100_TX: + reg = MAC_CON1_GMAC2IO_GMII_CLK_SEL_25; + break; + case IFM_10_T: + reg = MAC_CON1_GMAC2IO_GMII_CLK_SEL_2_5; + break; + default: + device_printf(sc->base.dev, "unsupported RGMII media %u\n", speed); + return (-1); + } + + SYSCON_WRITE_4(sc->grf, RK3328_GRF_MAC_CON1, + ((MAC_CON1_GMAC2IO_GMII_CLK_SEL_MASK << 16) | reg)); + break; + case PHY_MODE_RMII: + switch (speed) { + case IFM_100_TX: + reg = MAC_CON1_GMAC2IO_RMII_CLK_SEL_25 | + MAC_CON1_GMAC2IO_MAC_SPEED_100; + break; + case IFM_10_T: + reg = MAC_CON1_GMAC2IO_RMII_CLK_SEL_2_5 | + MAC_CON1_GMAC2IO_MAC_SPEED_10; + break; + default: + device_printf(sc->base.dev, "unsupported RMII media %u\n", speed); + return (-1); + } + + SYSCON_WRITE_4(sc->grf, + sc->integrated_phy ? RK3328_GRF_MAC_CON2 : RK3328_GRF_MAC_CON1, + reg | + ((MAC_CON1_GMAC2IO_RMII_CLK_SEL_MASK | MAC_CON1_GMAC2IO_MAC_SPEED_MASK) << 16)); + break; + } + + return (0); +} + static void -rk3399_set_delays(struct syscon *grf, phandle_t node) +rk3328_set_phy_mode(struct if_dwc_rk_softc *sc) { - uint32_t tx, rx; - if (OF_getencprop(node, "tx_delay", &tx, sizeof(tx)) <= 0) - tx = 0x30; - if (OF_getencprop(node, "rx_delay", &rx, sizeof(rx)) <= 0) - rx = 0x10; + switch (sc->base.phy_mode) { + case PHY_MODE_RGMII: + SYSCON_WRITE_4(sc->grf, RK3328_GRF_MAC_CON1, + ((MAC_CON1_GMAC2IO_INTF_SEL_MASK | MAC_CON1_GMAC2IO_RMII_MODE_MASK) << 16) | + MAC_CON1_GMAC2IO_INTF_RGMII); + break; + case PHY_MODE_RMII: + SYSCON_WRITE_4(sc->grf, sc->integrated_phy ? RK3328_GRF_MAC_CON2 : RK3328_GRF_MAC_CON1, + ((MAC_CON1_GMAC2IO_INTF_SEL_MASK | MAC_CON1_GMAC2IO_RMII_MODE_MASK) << 16) | + MAC_CON1_GMAC2IO_INTF_RMII | MAC_CON1_GMAC2IO_RMII_MODE); + break; + } +} - tx = ((tx & RK3399_GRF_SOC_CON6_TX_MASK) << - RK3399_GRF_SOC_CON6_TX_SHIFT); - rx = ((rx & RK3399_GRF_SOC_CON6_TX_MASK) << - RK3399_GRF_SOC_CON6_RX_SHIFT); +static void +rk3328_phy_powerup(struct if_dwc_rk_softc *sc) +{ + SYSCON_WRITE_4(sc->grf, RK3328_GRF_MACPHY_CON1, + (MACPHY_CON1_RMII_MODE_MASK << 16) | + MACPHY_CON1_RMII_MODE); +} - SYSCON_WRITE_4(grf, RK3399_GRF_SOC_CON6, tx | rx | 0xFFFF0000); +static void +rk3399_set_delays(struct if_dwc_rk_softc *sc) +{ + uint32_t reg, tx, rx; + + if (sc->base.phy_mode != PHY_MODE_RGMII) + return; + + reg = SYSCON_READ_4(sc->grf, RK3399_GRF_SOC_CON6); + tx = ((reg >> SOC_CON6_TX_DL_CFG_SHIFT) & SOC_CON6_TX_DL_CFG_MASK); + rx = ((reg >> SOC_CON6_RX_DL_CFG_SHIFT) & SOC_CON6_RX_DL_CFG_MASK); + + if (bootverbose) { + device_printf(sc->base.dev, "current delays settings: tx=%u(%s) rx=%u(%s)\n", + tx, ((reg & SOC_CON6_GMAC_TXCLK_DLY_ENA) ? "enabled" : "disabled"), + rx, ((reg & SOC_CON6_GMAC_RXCLK_DLY_ENA) ? "enabled" : "disabled")); + + device_printf(sc->base.dev, "setting new RK3399 RX/TX delays: %d/%d\n", + sc->rx_delay, sc->tx_delay); + } + + reg = 0xFFFF << 16; + reg |= ((sc->tx_delay & SOC_CON6_TX_DL_CFG_MASK) << + SOC_CON6_TX_DL_CFG_SHIFT); + reg |= ((sc->rx_delay & SOC_CON6_RX_DL_CFG_MASK) << + SOC_CON6_RX_DL_CFG_SHIFT); + reg |= SOC_CON6_GMAC_TXCLK_DLY_ENA | SOC_CON6_GMAC_RXCLK_DLY_ENA; + + SYSCON_WRITE_4(sc->grf, RK3399_GRF_SOC_CON6, reg); } -#endif static int +rk3399_set_speed(struct if_dwc_rk_softc *sc, int speed) +{ + uint32_t reg; + + switch (speed) { + case IFM_1000_T: + case IFM_1000_SX: + reg = SOC_CON5_GMAC_CLK_SEL_125; + break; + case IFM_100_TX: + reg = SOC_CON5_GMAC_CLK_SEL_25; + break; + case IFM_10_T: + reg = SOC_CON5_GMAC_CLK_SEL_2_5; + break; + default: + device_printf(sc->base.dev, "unsupported media %u\n", speed); + return (-1); + } + + SYSCON_WRITE_4(sc->grf, RK3399_GRF_SOC_CON5, + ((SOC_CON5_GMAC_CLK_SEL_MASK << 16) | reg)); + return (0); +} + +static int +if_dwc_rk_sysctl_delays(SYSCTL_HANDLER_ARGS) +{ + struct if_dwc_rk_softc *sc; + int rv; + uint32_t rxtx; + + sc = arg1; + rxtx = ((sc->rx_delay << 8) | sc->tx_delay); + + rv = sysctl_handle_int(oidp, &rxtx, 0, req); + if (rv != 0 || req->newptr == NULL) + return (rv); + sc->tx_delay = rxtx & 0xff; + sc->rx_delay = (rxtx >> 8) & 0xff; + + if (sc->ops->set_delays) + sc->ops->set_delays(sc); + + return (0); +} + +static int +if_dwc_rk_init_sysctl(struct if_dwc_rk_softc *sc) +{ + struct sysctl_oid *child; + struct sysctl_ctx_list *ctx_list; + + ctx_list = device_get_sysctl_ctx(sc->base.dev); + child = device_get_sysctl_tree(sc->base.dev); + SYSCTL_ADD_PROC(ctx_list, + SYSCTL_CHILDREN(child), OID_AUTO, "delays", + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_RWTUN | CTLFLAG_MPSAFE, sc, 0, + if_dwc_rk_sysctl_delays, "", "RGMII RX/TX delays: ((rx << 8) | tx)"); + + return (0); +} + +static int if_dwc_rk_probe(device_t dev) { @@ -132,28 +391,189 @@ if_dwc_rk_probe(device_t dev) } static int +if_dwc_rk_init_clocks(device_t dev) +{ + struct if_dwc_rk_softc *sc; + int error; + + sc = device_get_softc(dev); + error = clk_set_assigned(dev, ofw_bus_get_node(dev)); + if (error != 0) { + device_printf(dev, "clk_set_assigned failed\n"); + return (error); + } + + /* Enable clocks */ + error = clk_get_by_ofw_name(dev, 0, "stmmaceth", &sc->clk_stmmaceth); + if (error != 0) { + device_printf(dev, "could not find clock stmmaceth\n"); + return (error); + } + + if (clk_get_by_ofw_name(dev, 0, "mac_clk_rx", &sc->mac_clk_rx) != 0) { + device_printf(sc->base.dev, "could not get mac_clk_rx clock\n"); + sc->mac_clk_rx = NULL; + } + + if (clk_get_by_ofw_name(dev, 0, "mac_clk_tx", &sc->mac_clk_tx) != 0) { + device_printf(sc->base.dev, "could not get mac_clk_tx clock\n"); + sc->mac_clk_tx = NULL; + } + + if (clk_get_by_ofw_name(dev, 0, "aclk_mac", &sc->aclk_mac) != 0) { + device_printf(sc->base.dev, "could not get aclk_mac clock\n"); + sc->aclk_mac = NULL; + } + + if (clk_get_by_ofw_name(dev, 0, "pclk_mac", &sc->pclk_mac) != 0) { + device_printf(sc->base.dev, "could not get pclk_mac clock\n"); + sc->pclk_mac = NULL; + } + + if (sc->base.phy_mode == PHY_MODE_RGMII) { + if (clk_get_by_ofw_name(dev, 0, "clk_mac_ref", &sc->clk_mac_ref) != 0) { + device_printf(sc->base.dev, "could not get clk_mac_ref clock\n"); + sc->clk_mac_ref = NULL; + } + + if (!sc->clock_in) { + if (clk_get_by_ofw_name(dev, 0, "clk_mac_refout", &sc->clk_mac_refout) != 0) { + device_printf(sc->base.dev, "could not get clk_mac_refout clock\n"); + sc->clk_mac_refout = NULL; + } + + clk_set_freq(sc->clk_stmmaceth, 50000000, 0); + } + } + + if ((sc->phy_node != 0) && sc->integrated_phy) { + if (clk_get_by_ofw_index(dev, sc->phy_node, 0, &sc->clk_phy) != 0) { + device_printf(sc->base.dev, "could not get PHY clock\n"); + sc->clk_phy = NULL; + } + + if (sc->clk_phy) { + clk_set_freq(sc->clk_phy, 50000000, 0); + } + } + + if (sc->base.phy_mode == PHY_MODE_RMII) { + if (sc->mac_clk_rx) + clk_enable(sc->mac_clk_rx); + if (sc->clk_mac_ref) + clk_enable(sc->clk_mac_ref); + if (sc->clk_mac_refout) + clk_enable(sc->clk_mac_refout); + } + if (sc->clk_phy) + clk_enable(sc->clk_phy); + if (sc->aclk_mac) + clk_enable(sc->aclk_mac); + if (sc->pclk_mac) + clk_enable(sc->pclk_mac); + if (sc->mac_clk_tx) + clk_enable(sc->mac_clk_tx); + + DELAY(50); + + return (0); +} + +static int if_dwc_rk_init(device_t dev) { + struct if_dwc_rk_softc *sc; phandle_t node; - struct syscon *grf = NULL; + uint32_t rx, tx; + int err; + pcell_t phy_handle; + char *clock_in_out; + hwreset_t phy_reset; + regulator_t phy_supply; + sc = device_get_softc(dev); node = ofw_bus_get_node(dev); + sc->ops = (struct if_dwc_rk_ops *)ofw_bus_search_compatible(dev, compat_data)->ocd_data; if (OF_hasprop(node, "rockchip,grf") && syscon_get_by_ofw_property(dev, node, - "rockchip,grf", &grf) != 0) { + "rockchip,grf", &sc->grf) != 0) { device_printf(dev, "cannot get grf driver handle\n"); return (ENXIO); } -#ifdef notyet - if (ofw_bus_is_compatible(dev, "rockchip,rk3399-gmac")) - rk3399_set_delays(grf, node); - else if (ofw_bus_is_compatible(dev, "rockchip,rk3328-gmac")) - rk3328_set_delays(grf, node); -#endif + if (OF_getencprop(node, "tx_delay", &tx, sizeof(tx)) <= 0) + tx = 0x30; + if (OF_getencprop(node, "rx_delay", &rx, sizeof(rx)) <= 0) + rx = 0x10; + sc->tx_delay = tx; + sc->rx_delay = rx; - /* Mode should be set according to dtb property */ + sc->clock_in = true; + if (OF_getprop_alloc(node, "clock_in_out", (void **)&clock_in_out)) { + if (strcmp(clock_in_out, "input") == 0) + sc->clock_in = true; + else + sc->clock_in = false; + OF_prop_free(clock_in_out); + } + if (OF_getencprop(node, "phy-handle", (void *)&phy_handle, + sizeof(phy_handle)) > 0) + sc->phy_node = OF_node_from_xref(phy_handle); + + if (sc->phy_node) + sc->integrated_phy = OF_hasprop(sc->phy_node, "phy-is-integrated"); + + if (sc->integrated_phy) + device_printf(sc->base.dev, "PHY is integrated\n"); + + if_dwc_rk_init_clocks(dev); + + if (sc->ops->set_phy_mode) + sc->ops->set_phy_mode(sc); + + if (sc->ops->set_delays) + sc->ops->set_delays(sc); + + /* + * this also sets delays if tunable is defined + */ + err = if_dwc_rk_init_sysctl(sc); + if (err != 0) + return (err); + + if (regulator_get_by_ofw_property(sc->base.dev, 0, + "phy-supply", &phy_supply) == 0) { + if (regulator_enable(phy_supply)) { + device_printf(sc->base.dev, + "cannot enable 'phy' regulator\n"); + } + } + else + device_printf(sc->base.dev, "no phy-supply property\n"); + + /* Power up */ + if (sc->integrated_phy) { + if (sc->ops->phy_powerup) + sc->ops->phy_powerup(sc); + + SYSCON_WRITE_4(sc->grf, RK3328_GRF_MACPHY_CON0, + (MACPHY_CON0_CLK_50M_MASK << 16) | + MACPHY_CON0_CLK_50M); + SYSCON_WRITE_4(sc->grf, RK3328_GRF_MACPHY_CON0, + (MACPHY_CON0_RMII_MODE_MASK << 16) | + MACPHY_CON0_RMII_MODE); + SYSCON_WRITE_4(sc->grf, RK3328_GRF_MACPHY_CON2, 0xffff1234); + SYSCON_WRITE_4(sc->grf, RK3328_GRF_MACPHY_CON3, 0x003f0035); + + if (hwreset_get_by_ofw_idx(dev, sc->phy_node, 0, &phy_reset) == 0) { + hwreset_assert(phy_reset); + DELAY(20); + hwreset_deassert(phy_reset); + DELAY(20); + } + } + return (0); } @@ -172,12 +592,26 @@ if_dwc_rk_mii_clk(device_t dev) return (GMAC_MII_CLK_150_250M_DIV102); } +static int +if_dwc_rk_set_speed(device_t dev, int speed) +{ + struct if_dwc_rk_softc *sc; + + sc = device_get_softc(dev); + + if (sc->ops->set_speed) + return sc->ops->set_speed(sc, speed); + + return (0); +} + static device_method_t if_dwc_rk_methods[] = { DEVMETHOD(device_probe, if_dwc_rk_probe), DEVMETHOD(if_dwc_init, if_dwc_rk_init), DEVMETHOD(if_dwc_mac_type, if_dwc_rk_mac_type), DEVMETHOD(if_dwc_mii_clk, if_dwc_rk_mii_clk), + DEVMETHOD(if_dwc_set_speed, if_dwc_rk_set_speed), DEVMETHOD_END }; @@ -187,6 +621,6 @@ static devclass_t dwc_rk_devclass; extern driver_t dwc_driver; DEFINE_CLASS_1(dwc, dwc_rk_driver, if_dwc_rk_methods, - sizeof(struct dwc_softc), dwc_driver); + sizeof(struct if_dwc_rk_softc), dwc_driver); DRIVER_MODULE(dwc_rk, simplebus, dwc_rk_driver, dwc_rk_devclass, 0, 0); MODULE_DEPEND(dwc_rk, dwc, 1, 1, 1); Modified: stable/12/sys/dev/dwc/if_dwc.c ============================================================================== --- stable/12/sys/dev/dwc/if_dwc.c Sun Sep 6 18:48:50 2020 (r365387) +++ stable/12/sys/dev/dwc/if_dwc.c Sun Sep 6 19:03:19 2020 (r365388) @@ -1209,15 +1209,23 @@ dwc_clock_init(device_t dev) hwreset_t rst; clk_t clk; int error; + int64_t freq; - /* Enable clock */ + /* Enable clocks */ if (clk_get_by_ofw_name(dev, 0, "stmmaceth", &clk) == 0) { error = clk_enable(clk); if (error != 0) { device_printf(dev, "could not enable main clock\n"); return (error); } + if (bootverbose) { + clk_get_freq(clk, &freq); + device_printf(dev, "MAC clock(%s) freq: %ld\n", clk_get_name(clk), freq); + } } + else { + device_printf(dev, "could not find clock stmmaceth\n"); + } /* De-assert reset */ if (hwreset_get_by_ofw_name(dev, 0, "stmmaceth", &rst) == 0) { @@ -1254,6 +1262,8 @@ dwc_attach(device_t dev) struct ifnet *ifp; int error, i; uint32_t reg; + char *phy_mode; + phandle_t node; sc = device_get_softc(dev); sc->dev = dev; @@ -1262,6 +1272,15 @@ dwc_attach(device_t dev) sc->mii_clk = IF_DWC_MII_CLK(dev); sc->mactype = IF_DWC_MAC_TYPE(dev); + node = ofw_bus_get_node(dev); + if (OF_getprop_alloc(node, "phy-mode", (void **)&phy_mode)) { + if (strcmp(phy_mode, "rgmii") == 0) + sc->phy_mode = PHY_MODE_RGMII; + if (strcmp(phy_mode, "rmii") == 0) + sc->phy_mode = PHY_MODE_RMII; + OF_prop_free(phy_mode); + } + if (IF_DWC_INIT(dev) != 0) return (ENXIO); @@ -1475,6 +1494,9 @@ dwc_miibus_statchg(device_t dev) else reg &= ~(CONF_DM); WRITE4(sc, MAC_CONFIGURATION, reg); + + IF_DWC_SET_SPEED(dev, IFM_SUBTYPE(mii->mii_media_active)); + } static device_method_t dwc_methods[] = { Modified: stable/12/sys/dev/dwc/if_dwc.h ============================================================================== --- stable/12/sys/dev/dwc/if_dwc.h Sun Sep 6 18:48:50 2020 (r365387) +++ stable/12/sys/dev/dwc/if_dwc.h Sun Sep 6 19:03:19 2020 (r365388) @@ -37,6 +37,10 @@ #ifndef __IF_DWC_H__ #define __IF_DWC_H__ +#define PHY_MODE_UNKNOWN 0x0 +#define PHY_MODE_RMII 0x1 +#define PHY_MODE_RGMII 0x2 + #define MAC_CONFIGURATION 0x0 #define CONF_JD (1 << 22) /* jabber timer disable */ #define CONF_BE (1 << 21) /* Frame Burst Enable */ Modified: stable/12/sys/dev/dwc/if_dwc_if.m ============================================================================== --- stable/12/sys/dev/dwc/if_dwc_if.m Sun Sep 6 18:48:50 2020 (r365387) +++ stable/12/sys/dev/dwc/if_dwc_if.m Sun Sep 6 19:03:19 2020 (r365388) @@ -49,6 +49,12 @@ CODE { { return (GMAC_MII_CLK_25_35M_DIV16); } + + static int + if_dwc_default_set_speed(device_t dev, int speed) + { + return (0); + } }; HEADER { @@ -74,3 +80,11 @@ METHOD int mac_type { METHOD int mii_clk { device_t dev; } DEFAULT if_dwc_default_mii_clk; + +# +# Signal media change to a specific hardware +# +METHOD int set_speed { + device_t dev; + int speed; +} DEFAULT if_dwc_default_set_speed; Modified: stable/12/sys/dev/dwc/if_dwcvar.h ============================================================================== --- stable/12/sys/dev/dwc/if_dwcvar.h Sun Sep 6 18:48:50 2020 (r365387) +++ stable/12/sys/dev/dwc/if_dwcvar.h Sun Sep 6 19:03:19 2020 (r365388) @@ -71,6 +71,7 @@ struct dwc_softc { boolean_t is_detaching; int tx_watchdog_count; int stats_harvest_count; + int phy_mode; /* RX */ bus_dma_tag_t rxdesc_tag; From owner-svn-src-all@freebsd.org Sun Sep 6 19:25:32 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0501B3DB4F5; Sun, 6 Sep 2020 19:25:32 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bl1bH6Lt7z4Nb2; Sun, 6 Sep 2020 19:25:31 +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 BDA6113896; Sun, 6 Sep 2020 19:25:31 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 086JPV7l029178; Sun, 6 Sep 2020 19:25:31 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 086JPVwi029177; Sun, 6 Sep 2020 19:25:31 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <202009061925.086JPVwi029177@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Sun, 6 Sep 2020 19:25:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365389 - head/sys/crypto/via X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/sys/crypto/via X-SVN-Commit-Revision: 365389 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.33 Precedence: list List-Id: "SVN commit messages 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, 06 Sep 2020 19:25:32 -0000 Author: asomers Date: Sun Sep 6 19:25:31 2020 New Revision: 365389 URL: https://svnweb.freebsd.org/changeset/base/365389 Log: padlock(4): fix instapanics with geli authentication cryptodev_process implementations are supposed to return 0 PR: 247986 Submitted by: jhb MFC after: 1 week Modified: head/sys/crypto/via/padlock.c Modified: head/sys/crypto/via/padlock.c ============================================================================== --- head/sys/crypto/via/padlock.c Sun Sep 6 19:03:19 2020 (r365388) +++ head/sys/crypto/via/padlock.c Sun Sep 6 19:25:31 2020 (r365389) @@ -275,7 +275,7 @@ out: #endif crp->crp_etype = error; crypto_done(crp); - return (error); + return (0); } static device_method_t padlock_methods[] = { From owner-svn-src-all@freebsd.org Sun Sep 6 20:03:14 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2E2D13DC21D; Sun, 6 Sep 2020 20:03:14 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bl2Qp0VnXz4QCy; Sun, 6 Sep 2020 20:03:14 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E825513F8E; Sun, 6 Sep 2020 20:03:13 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 086K3DDI053919; Sun, 6 Sep 2020 20:03:13 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 086K3DCV053918; Sun, 6 Sep 2020 20:03:13 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <202009062003.086K3DCV053918@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Sun, 6 Sep 2020 20:03:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365390 - stable/12/sys/dev/dwc X-SVN-Group: stable-12 X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: stable/12/sys/dev/dwc X-SVN-Commit-Revision: 365390 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.33 Precedence: list List-Id: "SVN commit messages 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, 06 Sep 2020 20:03:14 -0000 Author: gonzo Date: Sun Sep 6 20:03:13 2020 New Revision: 365390 URL: https://svnweb.freebsd.org/changeset/base/365390 Log: MFC r364098 by lwhsu: Fix armv{6,7} build after r364088 Sponsored by: The FreeBSD Foundation Modified: stable/12/sys/dev/dwc/if_dwc.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/dwc/if_dwc.c ============================================================================== --- stable/12/sys/dev/dwc/if_dwc.c Sun Sep 6 19:25:31 2020 (r365389) +++ stable/12/sys/dev/dwc/if_dwc.c Sun Sep 6 20:03:13 2020 (r365390) @@ -1220,7 +1220,8 @@ dwc_clock_init(device_t dev) } if (bootverbose) { clk_get_freq(clk, &freq); - device_printf(dev, "MAC clock(%s) freq: %ld\n", clk_get_name(clk), freq); + device_printf(dev, "MAC clock(%s) freq: %jd\n", + clk_get_name(clk), (intmax_t)freq); } } else { From owner-svn-src-all@freebsd.org Sun Sep 6 20:03:33 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 376043DC138; Sun, 6 Sep 2020 20:03:33 +0000 (UTC) (envelope-from gonzo@bluezbox.com) Received: from id.bluezbox.com (id.bluezbox.com [45.55.20.155]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bl2R80KD3z4QDy; Sun, 6 Sep 2020 20:03:31 +0000 (UTC) (envelope-from gonzo@bluezbox.com) Received: from localhost ([127.0.0.1] helo=id.bluezbox.com) by id.bluezbox.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94 (FreeBSD)) (envelope-from ) id 1kF0sn-000KwW-70; Sun, 06 Sep 2020 13:03:25 -0700 Received: (from gonzo@localhost) by id.bluezbox.com (8.15.2/8.15.2/Submit) id 086K3PXF080507; Sun, 6 Sep 2020 13:03:25 -0700 (PDT) (envelope-from gonzo@bluezbox.com) X-Authentication-Warning: id.bluezbox.com: gonzo set sender to gonzo@bluezbox.com using -f Date: Sun, 6 Sep 2020 13:03:24 -0700 From: Oleksandr Tymoshenko To: Li-Wen Hsu Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r364098 - head/sys/dev/dwc Message-ID: <20200906200324.GA80433@bluezbox.com> References: <202008110517.07B5HAoX088237@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202008110517.07B5HAoX088237@repo.freebsd.org> X-Operating-System: FreeBSD/11.2-RELEASE-p10 (amd64) X-Spam-Level: -- X-Spam-Report: Spam detection software, running on the system "id.bluezbox.com", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see The administrator of that system for details. Content preview: Li-Wen Hsu (lwhsu@FreeBSD.org) wrote: > Author: lwhsu > Date: Tue Aug 11 05:17:10 2020 > New Revision: 364098 > URL: https://svnweb.freebsd.org/changeset/base/364098 > > Log: > Fix armv{6,7} build aft [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Rspamd-Queue-Id: 4Bl2R80KD3z4QDy X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of gonzo@bluezbox.com designates 45.55.20.155 as permitted sender) smtp.mailfrom=gonzo@bluezbox.com X-Spamd-Result: default: False [-2.68 / 15.00]; RCVD_TLS_ALL(0.00)[]; ARC_NA(0.00)[]; FREEFALL_USER(0.00)[gonzo]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; DMARC_NA(0.00)[bluezbox.com]; MID_RHS_MATCH_FROM(0.00)[]; NEURAL_HAM_LONG(-1.01)[-1.006]; NEURAL_HAM_MEDIUM(-0.96)[-0.958]; R_SPF_ALLOW(-0.20)[+mx]; NEURAL_HAM_SHORT(-0.42)[-0.415]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:14061, ipnet:45.55.0.0/19, country:US]; RCVD_COUNT_TWO(0.00)[2]; MAILMAN_DEST(0.00)[svn-src-head,svn-src-all] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 06 Sep 2020 20:03:33 -0000 Li-Wen Hsu (lwhsu@FreeBSD.org) wrote: > Author: lwhsu > Date: Tue Aug 11 05:17:10 2020 > New Revision: 364098 > URL: https://svnweb.freebsd.org/changeset/base/364098 > > Log: > Fix armv{6,7} build after r364088 > > Sponsored by: The FreeBSD Foundation I overlooked this change when it was committed. Thanks for fixing and sorry for the breakage. -- gonzo From owner-svn-src-all@freebsd.org Sun Sep 6 20:32:14 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9EC773DC76D; Sun, 6 Sep 2020 20:32:14 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bl34G3jpxz4RZ8; Sun, 6 Sep 2020 20:32:14 +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 627871459B; Sun, 6 Sep 2020 20:32:14 +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 086KWESf070544; Sun, 6 Sep 2020 20:32:14 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 086KWEmW070543; Sun, 6 Sep 2020 20:32:14 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <202009062032.086KWEmW070543@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Sun, 6 Sep 2020 20:32:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365391 - head/share/man/man5 X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/share/man/man5 X-SVN-Commit-Revision: 365391 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.33 Precedence: list List-Id: "SVN commit messages 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, 06 Sep 2020 20:32:14 -0000 Author: asomers Date: Sun Sep 6 20:32:13 2020 New Revision: 365391 URL: https://svnweb.freebsd.org/changeset/base/365391 Log: nsswitch.conf(5): recommend placing cache after files When cache precedes files, and nscd is configured to allow negative caching, commands like "pw groupadd" can fail. The sequence of events looks like: 1. A command like pkg(8) looks up the group, and finds it absent. 2. pkg invokes pw(8) to add the group 3. pkg queries the group, but nscd says it doesn't exist, since it has a negative cache entry for that group. See also: https://lists.freebsd.org/pipermail/freebsd-current/2012-January/031595.html Reviewed by: bcr (manpages) MFC after: 1 week Sponsored by: Axcient Differential Revision: https://reviews.freebsd.org/D26184 Modified: head/share/man/man5/nsswitch.conf.5 Modified: head/share/man/man5/nsswitch.conf.5 ============================================================================== --- head/share/man/man5/nsswitch.conf.5 Sun Sep 6 20:03:13 2020 (r365390) +++ head/share/man/man5/nsswitch.conf.5 Sun Sep 6 20:32:13 2020 (r365391) @@ -33,7 +33,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 10, 2018 +.Dd September 6, 2020 .Dt NSSWITCH.CONF 5 .Os .Sh NAME @@ -224,20 +224,24 @@ and continue on anything else (i.e, .Ss Cache You can enable caching for the particular database by specifying .Dq cache -as the first source in the +in the .Nm file. +It should come after +.Dq files , +but before remote sources like +.Dq nis . You should also enable caching for this database in .Xr nscd.conf 5 . -If for the particular query +If for a particular query .Dq cache -source returns success, no further sources are queried. +source returns success, then no further sources are queried. On the other hand, if there are no previously cached data, the query result will be placed into the cache right after all other sources are processed. -Note, that +Note that .Dq cache -requires +requires the .Xr nscd 8 daemon to be running. .Ss Compat mode: +/- syntax @@ -321,15 +325,16 @@ resides in .Pa /etc . .El .Sh EXAMPLES -To lookup hosts in cache, then in +To lookup hosts in .Pa /etc/hosts +, then in cache, and then from the DNS, and lookup user information from .Tn NIS then files, use: .Pp .Bl -tag -width passwd: -compact .It hosts: -cache files dns +files cache dns .It passwd: nis [notfound=return] files .It group: From owner-svn-src-all@freebsd.org Sun Sep 6 20:46:16 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 76F173DD048; Sun, 6 Sep 2020 20:46:16 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-oi1-f182.google.com (mail-oi1-f182.google.com [209.85.167.182]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bl3NR3C3dz4SFW; Sun, 6 Sep 2020 20:46:15 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-oi1-f182.google.com with SMTP id 3so11891741oih.0; Sun, 06 Sep 2020 13:46:15 -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=J2kqSum5GBHdgMRY6IMHvhC6etFTdnea3iCvZhRZ46g=; b=swEFGiGNv4OmVVaO0IyNaextYPoVBeXCOKWZ6rR50j9kzOrhOcTu2XjQKksaow41wr 03V3G1tpLJtoJieRkUr5p4kw0yth5s+8Ap/j+t4/i7vsq1G3RESYTVvza/IQrICgMSMm 6Cy1J4L68QgpFvtE7XS4V0xdCoCO3elgS4AJYmYRRqpsn53K0bOepkRJOoutB4tgQ6XA Xe9+LqPdBwYElB9WkePJKVRwkHWW4s3wqDjL7HQhUWrHLd+d7jAvg9Gm3Bxh4GEgmaCp htpigXXwHnh4xQrYN+/Qw4yDWZWr7wcdGnXk3guUkUl+i8TTwmtVqbykEwTtx/SRy5Ft h3jA== X-Gm-Message-State: AOAM530WvwJ2RClz631wZwuPEjS1K+dlb2f2kbAFMlRuB33VFCTXO/bS IQlXzIzR2ZEMySlH9JYNyF3Nsvywc70/naJPlsDS/1A6 X-Google-Smtp-Source: ABdhPJwoxVUllLSLqwGjgIhIrJ887KOuHSdg7O3S7Z0BS6n+ZytElZNmR1fA1VRvYfcFyeSMIKzL9X267ARBatHST8g= X-Received: by 2002:aca:45c2:: with SMTP id s185mr11133586oia.57.1599425173774; Sun, 06 Sep 2020 13:46:13 -0700 (PDT) MIME-Version: 1.0 References: <202008240900.07O90w9Y093073@repo.freebsd.org> In-Reply-To: <202008240900.07O90w9Y093073@repo.freebsd.org> From: Alan Somers Date: Sun, 6 Sep 2020 14:46:02 -0600 Message-ID: Subject: Re: svn commit: r364637 - head/sys/kern To: Mateusz Guzik Cc: src-committers , svn-src-all , svn-src-head X-Rspamd-Queue-Id: 4Bl3NR3C3dz4SFW X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of asomers@gmail.com designates 209.85.167.182 as permitted sender) smtp.mailfrom=asomers@gmail.com X-Spamd-Result: default: False [-1.79 / 15.00]; RCVD_TLS_ALL(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; FREEFALL_USER(0.00)[asomers]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_ALL(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; DMARC_NA(0.00)[freebsd.org]; ARC_NA(0.00)[]; NEURAL_HAM_LONG(-0.44)[-0.444]; NEURAL_HAM_MEDIUM(-0.85)[-0.849]; TO_DN_ALL(0.00)[]; NEURAL_HAM_SHORT(-0.50)[-0.499]; RCVD_IN_DNSWL_NONE(0.00)[209.85.167.182:from]; FORGED_SENDER(0.30)[asomers@freebsd.org,asomers@gmail.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.167.182:from]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; RCVD_COUNT_TWO(0.00)[2]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[asomers@freebsd.org,asomers@gmail.com]; MAILMAN_DEST(0.00)[svn-src-all,svn-src-head] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.33 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 06 Sep 2020 20:46:16 -0000 On Mon, Aug 24, 2020 at 3:01 AM Mateusz Guzik wrote: > Author: mjg > Date: Mon Aug 24 09:00:57 2020 > New Revision: 364637 > URL: https://svnweb.freebsd.org/changeset/base/364637 > > Log: > cache: lockless reverse lookup > > This enables fully scalable operation for getcwd and significantly > improves > realpath. > > For example: > PATH_CUSTOM=/usr/src ./getcwd_processes -t 104 > before: 1550851 > after: 380135380 > > Tested by: pho > > Modified: > head/sys/kern/vfs_cache.c > > Modified: head/sys/kern/vfs_cache.c > > ============================================================================== > --- head/sys/kern/vfs_cache.c Mon Aug 24 09:00:07 2020 (r364636) > +++ head/sys/kern/vfs_cache.c Mon Aug 24 09:00:57 2020 (r364637) > @@ -477,6 +485,8 @@ STATNODE_COUNTER(shrinking_skipped, > static void cache_zap_locked(struct namecache *ncp); > static int vn_fullpath_hardlink(struct nameidata *ndp, char **retbuf, > char **freebuf, size_t *buflen); > +static int vn_fullpath_any_smr(struct vnode *vp, struct vnode *rdir, char > *buf, > + char **retbuf, size_t *buflen, bool slash_prefixed, size_t addend); > static int vn_fullpath_any(struct vnode *vp, struct vnode *rdir, char > *buf, > char **retbuf, size_t *buflen); > static int vn_fullpath_dir(struct vnode *vp, struct vnode *rdir, char > *buf, > @@ -2476,9 +2486,17 @@ vn_getcwd(char *buf, char **retbuf, size_t *buflen) > What does the "smr" stand for? -Alan From owner-svn-src-all@freebsd.org Sun Sep 6 21:11:21 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 13C843DE66A for ; Sun, 6 Sep 2020 21:11:21 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bl3xN0zBsz4V2r for ; Sun, 6 Sep 2020 21:11:19 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: by mail-wm1-f43.google.com with SMTP id l9so12056219wme.3 for ; Sun, 06 Sep 2020 14:11:19 -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:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=X9k2sB+DF/nXilEx4iDAN3GggWmIN4HHx51/Kih/2iI=; b=q67y+18nfcuD8GV0ReysbfQVaO7l/JTnHRpIo8R4mFHqX0YAtKpMzFo6iyMgNhxhD+ 4nHATR4cXbgsQhm6j48rY56C7eYrZMqzA3C/6+2hDMorc6Vd8KuM7L9lu8Eb4h45OIfD GKBLKBsaRLeMbKMaTwisiu8NAJsSS45A1YgH5allE91EVbCNo3qCNffExB7pq3UrsN4l vrOYO7klH51BDLtkF9BH6YT1drYlGxNC2qrD4dJtaZjobCqOC1moy15V2EM5XWAyFifQ kwCvsM7tNxo/dePJGgFuNFSSqKQKaprxq+3cVwqkH6lHo3zFnyUyciOqXcXOx+av9xW5 N9YQ== X-Gm-Message-State: AOAM53242Fl6e05qimFqmcey5wDPt/XqFkEnAeDtzDchU4H/AtX9DbeR 5y2vIHgqaSSFlSU+oG8eOx2l8Q== X-Google-Smtp-Source: ABdhPJwNve3ebNnD4H9c/OUgD50Pm2VXLlOg4IZMTLHsURPcJlZco2/fX/oEI0JVI77jIVoqDKdZCg== X-Received: by 2002:a7b:c00d:: with SMTP id c13mr17312749wmb.24.1599426678580; Sun, 06 Sep 2020 14:11:18 -0700 (PDT) Received: from [192.168.149.251] (trinity-students-nat.trin.cam.ac.uk. [131.111.193.104]) by smtp.gmail.com with ESMTPSA id 9sm4141836wmf.7.2020.09.06.14.11.17 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 06 Sep 2020 14:11:17 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.1\)) Subject: Re: svn commit: r364637 - head/sys/kern From: Jessica Clarke In-Reply-To: Date: Sun, 6 Sep 2020 22:11:15 +0100 Cc: Mateusz Guzik , src-committers , svn-src-all , svn-src-head Content-Transfer-Encoding: quoted-printable Message-Id: <98DF431F-0187-43B7-9A23-FD31928B9504@freebsd.org> References: <202008240900.07O90w9Y093073@repo.freebsd.org> To: Alan Somers X-Mailer: Apple Mail (2.3608.120.23.2.1) X-Rspamd-Queue-Id: 4Bl3xN0zBsz4V2r X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of jrtc27@jrtc27.com designates 209.85.128.43 as permitted sender) smtp.mailfrom=jrtc27@jrtc27.com X-Spamd-Result: default: False [-2.62 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; MV_CASE(0.50)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; RCPT_COUNT_FIVE(0.00)[5]; RCVD_COUNT_THREE(0.00)[3]; TO_DN_ALL(0.00)[]; NEURAL_HAM_SHORT(-1.04)[-1.042]; FORGED_SENDER(0.30)[jrtc27@freebsd.org,jrtc27@jrtc27.com]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; MID_RHS_MATCH_FROM(0.00)[]; FROM_NEQ_ENVFROM(0.00)[jrtc27@freebsd.org,jrtc27@jrtc27.com]; NEURAL_HAM_MEDIUM(-1.07)[-1.075]; ARC_NA(0.00)[]; FREEFALL_USER(0.00)[jrtc27]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-0.999]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-all@freebsd.org]; DMARC_NA(0.00)[freebsd.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[209.85.128.43:from]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.128.43:from]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[svn-src-all] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 06 Sep 2020 21:11:21 -0000 On 6 Sep 2020, at 21:46, Alan Somers wrote: >=20 > On Mon, Aug 24, 2020 at 3:01 AM Mateusz Guzik wrote: > Author: mjg > Date: Mon Aug 24 09:00:57 2020 > New Revision: 364637 > URL: https://svnweb.freebsd.org/changeset/base/364637 >=20 > Log: > cache: lockless reverse lookup >=20 > This enables fully scalable operation for getcwd and significantly = improves > realpath. >=20 > For example: > PATH_CUSTOM=3D/usr/src ./getcwd_processes -t 104 > before: 1550851 > after: 380135380 >=20 > Tested by: pho >=20 > Modified: > head/sys/kern/vfs_cache.c >=20 > Modified: head/sys/kern/vfs_cache.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/kern/vfs_cache.c Mon Aug 24 09:00:07 2020 = (r364636) > +++ head/sys/kern/vfs_cache.c Mon Aug 24 09:00:57 2020 = (r364637) > @@ -477,6 +485,8 @@ STATNODE_COUNTER(shrinking_skipped, > static void cache_zap_locked(struct namecache *ncp); > static int vn_fullpath_hardlink(struct nameidata *ndp, char **retbuf, > char **freebuf, size_t *buflen); > +static int vn_fullpath_any_smr(struct vnode *vp, struct vnode *rdir, = char *buf, > + char **retbuf, size_t *buflen, bool slash_prefixed, size_t = addend); > static int vn_fullpath_any(struct vnode *vp, struct vnode *rdir, char = *buf, > char **retbuf, size_t *buflen); > static int vn_fullpath_dir(struct vnode *vp, struct vnode *rdir, char = *buf, > @@ -2476,9 +2486,17 @@ vn_getcwd(char *buf, char **retbuf, size_t = *buflen) >=20 > What does the "smr" stand for? Safe Memory Reclamation (see sys/sys/smr.h and sys/kern/subr_smr.c). Jess From owner-svn-src-all@freebsd.org Mon Sep 7 06:14:43 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1AB2D3EA34E; Mon, 7 Sep 2020 06:14:43 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BlJ0L6t93z3Rcg; Mon, 7 Sep 2020 06:14:42 +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 B6F0C1B21A; Mon, 7 Sep 2020 06:14:42 +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 0876EgMo026782; Mon, 7 Sep 2020 06:14:42 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0876EgED026781; Mon, 7 Sep 2020 06:14:42 GMT (envelope-from avg@FreeBSD.org) Message-Id: <202009070614.0876EgED026781@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 7 Sep 2020 06:14:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365392 - stable/12/sys/dev/gpio X-SVN-Group: stable-12 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/12/sys/dev/gpio X-SVN-Commit-Revision: 365392 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.33 Precedence: list List-Id: "SVN commit messages 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, 07 Sep 2020 06:14:43 -0000 Author: avg Date: Mon Sep 7 06:14:42 2020 New Revision: 365392 URL: https://svnweb.freebsd.org/changeset/base/365392 Log: MFC r364145: gpiokeys: add evdev support Only linux,code is supported as it maps 1:1 to evdev key codes. No reverse mapping for freebsd,code yet. Modified: stable/12/sys/dev/gpio/gpiokeys.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/gpio/gpiokeys.c ============================================================================== --- stable/12/sys/dev/gpio/gpiokeys.c Sun Sep 6 20:32:13 2020 (r365391) +++ stable/12/sys/dev/gpio/gpiokeys.c Mon Sep 7 06:14:42 2020 (r365392) @@ -29,6 +29,7 @@ __FBSDID("$FreeBSD$"); #include "opt_platform.h" #include "opt_kbd.h" +#include "opt_evdev.h" #include #include @@ -56,6 +57,11 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef EVDEV_SUPPORT +#include +#include +#endif + #define KBD_DRIVER_NAME "gpiokeys" #define GPIOKEYS_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx) @@ -99,6 +105,9 @@ struct gpiokey struct resource *irq_res; void *intr_hl; struct mtx mtx; +#ifdef EVDEV_SUPPORT + uint32_t evcode; +#endif uint32_t keycode; int autorepeat; struct callout debounce_callout; @@ -115,6 +124,9 @@ struct gpiokeys_softc struct gpiokey *sc_keys; int sc_total_keys; +#ifdef EVDEV_SUPPORT + struct evdev_dev *sc_evdev; +#endif keyboard_t sc_kbd; keymap_t sc_keymap; accentmap_t sc_accmap; @@ -171,26 +183,34 @@ gpiokeys_put_key(struct gpiokeys_softc *sc, uint32_t k } static void -gpiokeys_key_event(struct gpiokeys_softc *sc, uint16_t keycode, int pressed) +gpiokeys_key_event(struct gpiokeys_softc *sc, struct gpiokey *key, int pressed) { - uint32_t key; + uint32_t code; - - key = keycode & SCAN_KEYCODE_MASK; - - if (!pressed) - key |= KEY_RELEASE; - GPIOKEYS_LOCK(sc); - if (keycode & SCAN_PREFIX_E0) - gpiokeys_put_key(sc, 0xe0); - else if (keycode & SCAN_PREFIX_E1) - gpiokeys_put_key(sc, 0xe1); +#ifdef EVDEV_SUPPORT + if (key->evcode != GPIOKEY_NONE && + (evdev_rcpt_mask & EVDEV_RCPT_HW_KBD) != 0) { + evdev_push_key(sc->sc_evdev, key->evcode, pressed); + evdev_sync(sc->sc_evdev); + } +#endif + if (key->keycode != GPIOKEY_NONE) { + code = key->keycode & SCAN_KEYCODE_MASK; + if (!pressed) + code |= KEY_RELEASE; - gpiokeys_put_key(sc, key); + if (key->keycode & SCAN_PREFIX_E0) + gpiokeys_put_key(sc, 0xe0); + else if (key->keycode & SCAN_PREFIX_E1) + gpiokeys_put_key(sc, 0xe1); + + gpiokeys_put_key(sc, code); + } GPIOKEYS_UNLOCK(sc); - gpiokeys_event_keyinput(sc); + if (key->keycode != GPIOKEY_NONE) + gpiokeys_event_keyinput(sc); } static void @@ -200,11 +220,8 @@ gpiokey_autorepeat(void *arg) key = arg; - if (key->keycode == GPIOKEY_NONE) - return; + gpiokeys_key_event(key->parent_sc, key, 1); - gpiokeys_key_event(key->parent_sc, key->keycode, 1); - callout_reset(&key->repeat_callout, key->repeat, gpiokey_autorepeat, key); } @@ -217,12 +234,9 @@ gpiokey_debounced_intr(void *arg) key = arg; - if (key->keycode == GPIOKEY_NONE) - return; - gpio_pin_is_active(key->pin, &active); if (active) { - gpiokeys_key_event(key->parent_sc, key->keycode, 1); + gpiokeys_key_event(key->parent_sc, key, 1); if (key->autorepeat) { callout_reset(&key->repeat_callout, key->repeat_delay, gpiokey_autorepeat, key); @@ -232,7 +246,7 @@ gpiokey_debounced_intr(void *arg) if (key->autorepeat && callout_pending(&key->repeat_callout)) callout_stop(&key->repeat_callout); - gpiokeys_key_event(key->parent_sc, key->keycode, 0); + gpiokeys_key_event(key->parent_sc, key, 0); } } @@ -301,6 +315,10 @@ gpiokeys_attach_key(struct gpiokeys_softc *sc, phandle if (key->keycode == GPIOKEY_NONE) device_printf(sc->sc_dev, "<%s> failed to map linux,code value 0x%x\n", key_name, code); +#ifdef EVDEV_SUPPORT + key->evcode = code; + evdev_support_key(sc->sc_evdev, code); +#endif } else device_printf(sc->sc_dev, "<%s> no linux,code or freebsd,code property\n", @@ -365,7 +383,6 @@ gpiokeys_detach_key(struct gpiokeys_softc *sc, struct if (key->pin) gpio_pin_release(key->pin); GPIOKEY_UNLOCK(key); - GPIOKEY_LOCK_DESTROY(key); } @@ -383,11 +400,14 @@ gpiokeys_probe(device_t dev) static int gpiokeys_attach(device_t dev) { - int unit; struct gpiokeys_softc *sc; keyboard_t *kbd; +#ifdef EVDEV_SUPPORT + char *name; +#endif phandle_t keys, child; int total_keys; + int unit; if ((keys = ofw_bus_get_node(dev)) == -1) return (ENXIO); @@ -435,6 +455,19 @@ gpiokeys_attach(device_t dev) kbdd_diag(kbd, 1); } +#ifdef EVDEV_SUPPORT + sc->sc_evdev = evdev_alloc(); + evdev_set_name(sc->sc_evdev, device_get_desc(dev)); + + OF_getprop_alloc(keys, "name", (void **)&name); + evdev_set_phys(sc->sc_evdev, name != NULL ? name : "unknown"); + OF_prop_free(name); + + evdev_set_id(sc->sc_evdev, BUS_VIRTUAL, 0, 0, 0); + evdev_support_event(sc->sc_evdev, EV_SYN); + evdev_support_event(sc->sc_evdev, EV_KEY); +#endif + total_keys = 0; /* Traverse the 'gpio-keys' node and count keys */ @@ -458,6 +491,13 @@ gpiokeys_attach(device_t dev) } } +#ifdef EVDEV_SUPPORT + if (evdev_register_mtx(sc->sc_evdev, &sc->sc_mtx) != 0) { + device_printf(dev, "failed to register evdev device\n"); + goto detach; + } +#endif + return (0); detach: @@ -484,6 +524,10 @@ gpiokeys_detach(device_t dev) kbd_detach(kbd); #endif kbd_unregister(kbd); + +#ifdef EVDEV_SUPPORT + evdev_free(sc->sc_evdev); +#endif GPIOKEYS_LOCK_DESTROY(sc); if (sc->sc_keys) From owner-svn-src-all@freebsd.org Mon Sep 7 06:21:02 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 44C513EA6A4; Mon, 7 Sep 2020 06:21:02 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BlJ7f17Cnz3SCc; Mon, 7 Sep 2020 06:21:02 +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 09FF01B404; Mon, 7 Sep 2020 06:21:02 +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 0876L1ZW029689; Mon, 7 Sep 2020 06:21:01 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0876L1O1029688; Mon, 7 Sep 2020 06:21:01 GMT (envelope-from avg@FreeBSD.org) Message-Id: <202009070621.0876L1O1029688@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 7 Sep 2020 06:21:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365393 - stable/12/sys/arm/allwinner X-SVN-Group: stable-12 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/12/sys/arm/allwinner X-SVN-Commit-Revision: 365393 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.33 Precedence: list List-Id: "SVN commit messages 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, 07 Sep 2020 06:21:02 -0000 Author: avg Date: Mon Sep 7 06:21:01 2020 New Revision: 365393 URL: https://svnweb.freebsd.org/changeset/base/365393 Log: MFC r364148: aw_cir: lower activation threshold to support NECx protocol Modified: stable/12/sys/arm/allwinner/aw_cir.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/arm/allwinner/aw_cir.c ============================================================================== --- stable/12/sys/arm/allwinner/aw_cir.c Mon Sep 7 06:14:42 2020 (r365392) +++ stable/12/sys/arm/allwinner/aw_cir.c Mon Sep 7 06:21:01 2020 (r365393) @@ -126,8 +126,10 @@ __FBSDID("$FreeBSD$"); #define AW_IR_DMAX 53 /* Active Thresholds */ -#define AW_IR_ACTIVE_T ((0 & 0xff) << 16) -#define AW_IR_ACTIVE_T_C ((1 & 0xff) << 23) +#define AW_IR_ACTIVE_T_VAL AW_IR_L1_MIN +#define AW_IR_ACTIVE_T (((AW_IR_ACTIVE_T_VAL - 1) & 0xff) << 16) +#define AW_IR_ACTIVE_T_C_VAL 0 +#define AW_IR_ACTIVE_T_C ((AW_IR_ACTIVE_T_C_VAL & 0xff) << 23) /* Code masks */ #define CODE_MASK 0x00ff00ff @@ -209,9 +211,9 @@ aw_ir_decode_packets(struct aw_ir_softc *sc) device_printf(sc->dev, "sc->dcnt = %d\n", sc->dcnt); /* Find Lead 1 (bit separator) */ - active_delay = (AW_IR_ACTIVE_T + 1) * (AW_IR_ACTIVE_T_C != 0 ? 128 : 1); - len = 0; - len += (active_delay >> 1); + active_delay = AW_IR_ACTIVE_T_VAL * + (AW_IR_ACTIVE_T_C_VAL != 0 ? 128 : 1); + len = active_delay; if (bootverbose) device_printf(sc->dev, "Initial len: %ld\n", len); for (i = 0; i < sc->dcnt; i++) { From owner-svn-src-all@freebsd.org Mon Sep 7 06:22:31 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2081E3EA89B; Mon, 7 Sep 2020 06:22:31 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BlJ9M01PGz3SYC; Mon, 7 Sep 2020 06:22:31 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D80451B556; Mon, 7 Sep 2020 06:22:30 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0876MUme033087; Mon, 7 Sep 2020 06:22:30 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0876MUiI033086; Mon, 7 Sep 2020 06:22:30 GMT (envelope-from avg@FreeBSD.org) Message-Id: <202009070622.0876MUiI033086@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 7 Sep 2020 06:22:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365394 - stable/12/sys/arm/allwinner X-SVN-Group: stable-12 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/12/sys/arm/allwinner X-SVN-Commit-Revision: 365394 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.33 Precedence: list List-Id: "SVN commit messages 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, 07 Sep 2020 06:22:31 -0000 Author: avg Date: Mon Sep 7 06:22:30 2020 New Revision: 365394 URL: https://svnweb.freebsd.org/changeset/base/365394 Log: MFC r364149: aw_cir: in pulse encoding actual length is one greater than value Modified: stable/12/sys/arm/allwinner/aw_cir.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/arm/allwinner/aw_cir.c ============================================================================== --- stable/12/sys/arm/allwinner/aw_cir.c Mon Sep 7 06:21:01 2020 (r365393) +++ stable/12/sys/arm/allwinner/aw_cir.c Mon Sep 7 06:22:30 2020 (r365394) @@ -202,9 +202,9 @@ aw_ir_read_data(struct aw_ir_softc *sc) static unsigned long aw_ir_decode_packets(struct aw_ir_softc *sc) { - unsigned long len, code; - unsigned char val, last; + unsigned int len, code; unsigned int active_delay; + unsigned char val, last; int i, bitcount; if (bootverbose) @@ -215,11 +215,11 @@ aw_ir_decode_packets(struct aw_ir_softc *sc) (AW_IR_ACTIVE_T_C_VAL != 0 ? 128 : 1); len = active_delay; if (bootverbose) - device_printf(sc->dev, "Initial len: %ld\n", len); + device_printf(sc->dev, "Initial len: %d\n", len); for (i = 0; i < sc->dcnt; i++) { val = sc->buf[i]; if (val & VAL_MASK) - len += val & PERIOD_MASK; + len += (val & PERIOD_MASK) + 1; else { if (len > AW_IR_L1_MIN) break; @@ -227,7 +227,7 @@ aw_ir_decode_packets(struct aw_ir_softc *sc) } } if (bootverbose) - device_printf(sc->dev, "len = %ld\n", len); + device_printf(sc->dev, "len = %d\n", len); if ((val & VAL_MASK) || (len <= AW_IR_L1_MIN)) { if (bootverbose) device_printf(sc->dev, "Bit separator error\n"); @@ -243,7 +243,7 @@ aw_ir_decode_packets(struct aw_ir_softc *sc) break; len = 0; } else - len += val & PERIOD_MASK; + len += (val & PERIOD_MASK) + 1; } if ((!(val & VAL_MASK)) || (len <= AW_IR_L0_MIN)) { if (bootverbose) @@ -260,23 +260,25 @@ aw_ir_decode_packets(struct aw_ir_softc *sc) val = sc->buf[i]; if (last) { if (val & VAL_MASK) - len += val & PERIOD_MASK; + len += (val & PERIOD_MASK) + 1; else { if (len > AW_IR_PMAX) { if (bootverbose) device_printf(sc->dev, - "Pulse error\n"); + "Pulse error, len=%d\n", + len); goto error_code; } last = 0; - len = val & PERIOD_MASK; + len = (val & PERIOD_MASK) + 1; } } else { if (val & VAL_MASK) { if (len > AW_IR_DMAX) { if (bootverbose) device_printf(sc->dev, - "Distant error\n"); + "Distance error, len=%d\n", + len); goto error_code; } else { if (len > AW_IR_DMID) { @@ -288,9 +290,9 @@ aw_ir_decode_packets(struct aw_ir_softc *sc) break; /* Finish decoding */ } last = 1; - len = val & PERIOD_MASK; + len = (val & PERIOD_MASK) + 1; } else - len += val & PERIOD_MASK; + len += (val & PERIOD_MASK) + 1; } } return (code); From owner-svn-src-all@freebsd.org Mon Sep 7 06:27:19 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 34E373EA62D; Mon, 7 Sep 2020 06:27:19 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BlJGv0ftXz3SQd; Mon, 7 Sep 2020 06:27:19 +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 EE1C41B3B2; Mon, 7 Sep 2020 06:27:18 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0876RIN0033535; Mon, 7 Sep 2020 06:27:18 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0876RISS033534; Mon, 7 Sep 2020 06:27:18 GMT (envelope-from avg@FreeBSD.org) Message-Id: <202009070627.0876RISS033534@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 7 Sep 2020 06:27:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365395 - in head/sys: arm/allwinner/clkng dev/extres/clk X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: in head/sys: arm/allwinner/clkng dev/extres/clk X-SVN-Commit-Revision: 365395 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.33 Precedence: list List-Id: "SVN commit messages 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, 07 Sep 2020 06:27:19 -0000 Author: avg Date: Mon Sep 7 06:27:18 2020 New Revision: 365395 URL: https://svnweb.freebsd.org/changeset/base/365395 Log: aw_clk_nm: fix incorrect use of abs() abs() takes a (signed) int as input. Instead, it was used with unsigned 64-bit integers. So, add and use a new helper function to calculate a difference between two uint64_t-s. Reviewed by: manu MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D26307 Modified: head/sys/arm/allwinner/clkng/aw_clk_nm.c head/sys/dev/extres/clk/clk.h Modified: head/sys/arm/allwinner/clkng/aw_clk_nm.c ============================================================================== --- head/sys/arm/allwinner/clkng/aw_clk_nm.c Mon Sep 7 06:22:30 2020 (r365394) +++ head/sys/arm/allwinner/clkng/aw_clk_nm.c Mon Sep 7 06:27:18 2020 (r365395) @@ -153,7 +153,8 @@ aw_clk_nm_find_best(struct aw_clk_nm_sc *sc, uint64_t for (m = min_m; m <= max_m; ) { for (n = min_n; n <= max_n; ) { cur = fparent / n / m; - if (abs(*fout - cur) < abs(*fout - best)) { + if (clk_freq_diff(*fout, cur) < + clk_freq_diff(*fout, best)) { best = cur; *factor_n = n; *factor_m = m; @@ -196,7 +197,8 @@ aw_clk_nm_set_freq(struct clknode *clk, uint64_t fpare clknode_get_freq(p_clk, &fparent); cur = aw_clk_nm_find_best(sc, fparent, fout, &n, &m); - if (abs((*fout - cur)) < abs((*fout - best))) { + if (clk_freq_diff(*fout, cur) < + clk_freq_diff(*fout, best)) { best = cur; best_parent = p_idx; best_n = n; Modified: head/sys/dev/extres/clk/clk.h ============================================================================== --- head/sys/dev/extres/clk/clk.h Mon Sep 7 06:22:30 2020 (r365394) +++ head/sys/dev/extres/clk/clk.h Mon Sep 7 06:27:18 2020 (r365395) @@ -135,6 +135,12 @@ int clk_get_parent(clk_t clk, clk_t *parent); int clk_set_parent_by_clk(clk_t clk, clk_t parent); const char *clk_get_name(clk_t clk); +static inline uint64_t +clk_freq_diff(uint64_t x, uint64_t y) +{ + return (x >= y ? x - y : y - x); +} + #ifdef FDT int clk_set_assigned(device_t dev, phandle_t node); int clk_get_by_ofw_index(device_t dev, phandle_t node, int idx, clk_t *clk); From owner-svn-src-all@freebsd.org Mon Sep 7 06:29:41 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AD7543EAA15; Mon, 7 Sep 2020 06:29:41 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BlJKd4Dt4z3SmJ; Mon, 7 Sep 2020 06:29:41 +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 74B8F1B241; Mon, 7 Sep 2020 06:29:41 +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 0876TfTB033684; Mon, 7 Sep 2020 06:29:41 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0876Tfro033683; Mon, 7 Sep 2020 06:29:41 GMT (envelope-from avg@FreeBSD.org) Message-Id: <202009070629.0876Tfro033683@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 7 Sep 2020 06:29:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365396 - head/sys/dev/iicbus/twsi X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/sys/dev/iicbus/twsi X-SVN-Commit-Revision: 365396 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.33 Precedence: list List-Id: "SVN commit messages 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, 07 Sep 2020 06:29:41 -0000 Author: avg Date: Mon Sep 7 06:29:41 2020 New Revision: 365396 URL: https://svnweb.freebsd.org/changeset/base/365396 Log: twsi: use tsleep instead of pause for better responsiveness wakeup() does not have any effect on pause(), so if a transfer was not finished by the time of the first check, then the thread would sleep full 30 ms. To do: protect the transfer and interrupt code with the mutex, switch from tsleep from msleep Reviewed by: manu MFC after: 3 weeks Differential Revision: https://reviews.freebsd.org/D26309 Modified: head/sys/dev/iicbus/twsi/twsi.c Modified: head/sys/dev/iicbus/twsi/twsi.c ============================================================================== --- head/sys/dev/iicbus/twsi/twsi.c Mon Sep 7 06:27:18 2020 (r365395) +++ head/sys/dev/iicbus/twsi/twsi.c Mon Sep 7 06:29:41 2020 (r365396) @@ -510,7 +510,7 @@ twsi_transfer(device_t dev, struct iic_msg *msgs, uint sc->control_val &= ~TWSI_CONTROL_ACK; TWSI_WRITE(sc, sc->reg_control, sc->control_val | TWSI_CONTROL_START); while (sc->error == 0 && sc->transfer != 0) { - pause_sbt("twsi", SBT_1MS * 30, SBT_1MS, 0); + tsleep_sbt(sc, 0, "twsi", SBT_1MS * 30, SBT_1MS, 0); } debugf(sc->dev, "pause finish\n"); From owner-svn-src-all@freebsd.org Mon Sep 7 06:32:04 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 770873EA9AB; Mon, 7 Sep 2020 06:32:04 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BlJNN1Rllz3TK4; Mon, 7 Sep 2020 06:32:04 +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 1542E1B3D0; Mon, 7 Sep 2020 06:32:04 +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 0876W3Bq038342; Mon, 7 Sep 2020 06:32:03 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0876W37l038177; Mon, 7 Sep 2020 06:32:03 GMT (envelope-from avg@FreeBSD.org) Message-Id: <202009070632.0876W37l038177@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 7 Sep 2020 06:32:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365397 - head/sys/dev/iicbus/twsi X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/sys/dev/iicbus/twsi X-SVN-Commit-Revision: 365397 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.33 Precedence: list List-Id: "SVN commit messages 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, 07 Sep 2020 06:32:04 -0000 Author: avg Date: Mon Sep 7 06:32:03 2020 New Revision: 365397 URL: https://svnweb.freebsd.org/changeset/base/365397 Log: twsi: some variants clear interrupt flag by writing 0, others by writing 1 Make that distinction more explicit and regular in the code. The difference in behavior is documented in the respective datasheets. Previously, the code handled the distinction by writing the control register multiple times where at least one write was zero and another was one. This can be considered a follow-up to r363021. Reviewed by: manu MFC after: 4 weeks Differential Revision: https://reviews.freebsd.org/D26308 Modified: head/sys/dev/iicbus/twsi/a10_twsi.c head/sys/dev/iicbus/twsi/twsi.c head/sys/dev/iicbus/twsi/twsi.h Modified: head/sys/dev/iicbus/twsi/a10_twsi.c ============================================================================== --- head/sys/dev/iicbus/twsi/a10_twsi.c Mon Sep 7 06:29:41 2020 (r365396) +++ head/sys/dev/iicbus/twsi/a10_twsi.c Mon Sep 7 06:32:03 2020 (r365397) @@ -122,6 +122,10 @@ a10_twsi_attach(device_t dev) sc->reg_soft_reset = TWI_SRST; sc->need_ack = true; + + if (ofw_bus_is_compatible(dev, "allwinner,sun6i-a31-i2c") || + ofw_bus_is_compatible(dev, "allwinner,sun6i-a83t-i2c")) + sc->iflag_w1c = true; return (twsi_attach(dev)); } Modified: head/sys/dev/iicbus/twsi/twsi.c ============================================================================== --- head/sys/dev/iicbus/twsi/twsi.c Mon Sep 7 06:29:41 2020 (r365396) +++ head/sys/dev/iicbus/twsi/twsi.c Mon Sep 7 06:32:03 2020 (r365397) @@ -147,7 +147,11 @@ twsi_clear_iflg(struct twsi_softc *sc) { DELAY(1000); - twsi_control_clear(sc, TWSI_CONTROL_IFLG); + /* There are two ways of clearing IFLAG. */ + if (sc->iflag_w1c) + twsi_control_set(sc, TWSI_CONTROL_IFLG); + else + twsi_control_clear(sc, TWSI_CONTROL_IFLG); DELAY(1000); } @@ -667,13 +671,11 @@ twsi_intr(void *arg) } debugf(sc->dev, "Refresh reg_control\n"); - /* - * Fix silicon bug on > Allwinner A20 by doing a read and writing - * again to the control register + /* + * Newer Allwinner chips clear IFLG after writing 1 to it. */ - status = TWSI_READ(sc, sc->reg_status); - TWSI_WRITE(sc, sc->reg_control, - sc->control_val | TWSI_CONTROL_IFLG); + TWSI_WRITE(sc, sc->reg_control, sc->control_val | + (sc->iflag_w1c ? TWSI_CONTROL_IFLG : 0)); debugf(sc->dev, "Done with interrupts\n\n"); if (transfer_done == 1) { Modified: head/sys/dev/iicbus/twsi/twsi.h ============================================================================== --- head/sys/dev/iicbus/twsi/twsi.h Mon Sep 7 06:29:41 2020 (r365396) +++ head/sys/dev/iicbus/twsi/twsi.h Mon Sep 7 06:32:03 2020 (r365397) @@ -66,6 +66,7 @@ struct twsi_softc { int error; uint32_t control_val; bool need_ack; + bool iflag_w1c; bus_size_t reg_data; bus_size_t reg_slave_addr; From owner-svn-src-all@freebsd.org Mon Sep 7 06:39:01 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B8C213EAB6B; Mon, 7 Sep 2020 06:39:01 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BlJXP4KZ9z3TkQ; Mon, 7 Sep 2020 06:39:01 +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 596FD1B3DB; Mon, 7 Sep 2020 06:39:01 +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 0876d1vr039719; Mon, 7 Sep 2020 06:39:01 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0876d0ih039716; Mon, 7 Sep 2020 06:39:00 GMT (envelope-from avg@FreeBSD.org) Message-Id: <202009070639.0876d0ih039716@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 7 Sep 2020 06:39:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365398 - in head/sys: arm/allwinner arm64/conf conf X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: in head/sys: arm/allwinner arm64/conf conf X-SVN-Commit-Revision: 365398 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.33 Precedence: list List-Id: "SVN commit messages 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, 07 Sep 2020 06:39:01 -0000 Author: avg Date: Mon Sep 7 06:39:00 2020 New Revision: 365398 URL: https://svnweb.freebsd.org/changeset/base/365398 Log: Allwinner USB DRD support (musb_otg) Allwinner USB DRD is based on the Mentor USB OTG controller, with a different register layout and a few missing registers. The code is by Andrew Turner (andrew). Reviewed by: hselasky, manu Obtained from: andrew MFC after: 5 weeks Differential Revision: https://reviews.freebsd.org/D5881 Modified: head/sys/arm/allwinner/aw_usbphy.c head/sys/arm/allwinner/files.allwinner head/sys/arm64/conf/GENERIC head/sys/conf/files.arm64 Modified: head/sys/arm/allwinner/aw_usbphy.c ============================================================================== --- head/sys/arm/allwinner/aw_usbphy.c Mon Sep 7 06:32:03 2020 (r365397) +++ head/sys/arm/allwinner/aw_usbphy.c Mon Sep 7 06:39:00 2020 (r365398) @@ -169,6 +169,18 @@ DEFINE_CLASS_1(awusbphy_phynode, awusbphy_phynode_clas #define CLR4(res, o, m) WR4(res, o, RD4(res, o) & ~(m)) #define SET4(res, o, m) WR4(res, o, RD4(res, o) | (m)) +#define PHY_CSR 0x00 +#define ID_PULLUP_EN (1 << 17) +#define DPDM_PULLUP_EN (1 << 16) +#define FORCE_ID (0x3 << 14) +#define FORCE_ID_SHIFT 14 +#define FORCE_ID_LOW 2 +#define FORCE_VBUS_VALID (0x3 << 12) +#define FORCE_VBUS_VALID_SHIFT 12 +#define FORCE_VBUS_VALID_HIGH 3 +#define VBUS_CHANGE_DET (1 << 6) +#define ID_CHANGE_DET (1 << 5) +#define DPDM_CHANGE_DET (1 << 4) #define OTG_PHY_CFG 0x20 #define OTG_PHY_ROUTE_OTG (1 << 0) #define PMU_IRQ_ENABLE 0x00 @@ -214,6 +226,7 @@ awusbphy_init(device_t dev) struct awusbphy_softc *sc; phandle_t node; char pname[20]; + uint32_t val; int error, off, rid; regulator_t reg; hwreset_t rst; @@ -288,6 +301,16 @@ awusbphy_init(device_t dev) return (ENXIO); } } + + /* Enable OTG PHY for host mode */ + val = bus_read_4(sc->phy_ctrl, PHY_CSR); + val &= ~(VBUS_CHANGE_DET | ID_CHANGE_DET | DPDM_CHANGE_DET); + val |= (ID_PULLUP_EN | DPDM_PULLUP_EN); + val &= ~FORCE_ID; + val |= (FORCE_ID_LOW << FORCE_ID_SHIFT); + val &= ~FORCE_VBUS_VALID; + val |= (FORCE_VBUS_VALID_HIGH << FORCE_VBUS_VALID_SHIFT); + bus_write_4(sc->phy_ctrl, PHY_CSR, val); return (0); } Modified: head/sys/arm/allwinner/files.allwinner ============================================================================== --- head/sys/arm/allwinner/files.allwinner Mon Sep 7 06:32:03 2020 (r365397) +++ head/sys/arm/allwinner/files.allwinner Mon Sep 7 06:39:00 2020 (r365398) @@ -27,6 +27,7 @@ dev/usb/controller/generic_ohci.c optional ohci dev/usb/controller/generic_usb_if.m optional ohci dev/usb/controller/generic_ehci.c optional ehci dev/usb/controller/generic_ehci_fdt.c optional ehci +dev/usb/controller/musb_otg_allwinner.c optional musb arm/allwinner/aw_sid.c optional aw_sid arm/allwinner/aw_thermal.c optional aw_thermal arm/allwinner/aw_cir.c optional aw_cir evdev Modified: head/sys/arm64/conf/GENERIC ============================================================================== --- head/sys/arm64/conf/GENERIC Mon Sep 7 06:32:03 2020 (r365397) +++ head/sys/arm64/conf/GENERIC Mon Sep 7 06:39:00 2020 (r365398) @@ -222,6 +222,7 @@ device aw_usbphy # Allwinner USB PHY device rk_usb2phy # Rockchip USB2PHY device rk_typec_phy # Rockchip TypeC PHY device dwcotg # DWC OTG controller +device musb # Mentor Graphics USB OTG controller device ohci # OHCI USB interface device ehci # EHCI USB interface (USB 2.0) device ehci_mv # Marvell EHCI USB interface Modified: head/sys/conf/files.arm64 ============================================================================== --- head/sys/conf/files.arm64 Mon Sep 7 06:32:03 2020 (r365397) +++ head/sys/conf/files.arm64 Mon Sep 7 06:39:00 2020 (r365398) @@ -339,6 +339,7 @@ dev/usb/controller/generic_ehci_acpi.c optional ehci a dev/usb/controller/generic_ehci_fdt.c optional ehci fdt dev/usb/controller/generic_ohci.c optional ohci fdt dev/usb/controller/generic_usb_if.m optional ohci fdt +dev/usb/controller/musb_otg_allwinner.c optional musb fdt soc_allwinner_a64 dev/usb/controller/usb_nop_xceiv.c optional fdt ext_resources dev/usb/controller/generic_xhci.c optional xhci dev/usb/controller/generic_xhci_acpi.c optional xhci acpi From owner-svn-src-all@freebsd.org Mon Sep 7 06:44:25 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 968013EB181; Mon, 7 Sep 2020 06:44:25 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BlJfd3msMz3V2N; Mon, 7 Sep 2020 06:44:25 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 63BE51B5C5; Mon, 7 Sep 2020 06:44:25 +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 0876iPDI045375; Mon, 7 Sep 2020 06:44:25 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0876iP85045374; Mon, 7 Sep 2020 06:44:25 GMT (envelope-from avg@FreeBSD.org) Message-Id: <202009070644.0876iP85045374@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 7 Sep 2020 06:44:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365399 - head/sys/dev/usb/controller X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/sys/dev/usb/controller X-SVN-Commit-Revision: 365399 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.33 Precedence: list List-Id: "SVN commit messages 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, 07 Sep 2020 06:44:25 -0000 Author: avg Date: Mon Sep 7 06:44:24 2020 New Revision: 365399 URL: https://svnweb.freebsd.org/changeset/base/365399 Log: fixup r365398: add a missed file with all the new Allwinner musb_otg code Obtained from: andrew MFC after: 5 weeks X-MFC with: r365398 Added: head/sys/dev/usb/controller/musb_otg_allwinner.c (contents, props changed) Added: head/sys/dev/usb/controller/musb_otg_allwinner.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/usb/controller/musb_otg_allwinner.c Mon Sep 7 06:44:24 2020 (r365399) @@ -0,0 +1,543 @@ +/*- + * Copyright (c) 2016 Jared McNeill + * Copyright (c) 2018 Andrew Turner + * All rights reserved. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract FA8750-10-C-0237 + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +/* + * Allwinner USB Dual-Role Device (DRD) controller + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include + +#include +#include +#include +#include + +#include +#include +#include + +#include +#include + +#ifdef __arm__ +#include +#include +#endif + +#define DRD_EP_MAX 5 + +#define MUSB2_REG_AWIN_VEND0 0x0043 +#define VEND0_PIO_MODE 0 + +#if defined(__arm__) +#define bs_parent_space(bs) ((bs)->bs_parent) +typedef bus_space_tag_t awusb_bs_tag; +#elif defined(__aarch64__) +#define bs_parent_space(bs) (bs) +typedef void * awusb_bs_tag; +#endif + +#define AWUSB_OKAY 0x01 +#define AWUSB_NO_CONFDATA 0x02 +static struct ofw_compat_data compat_data[] = { + { "allwinner,sun4i-a10-musb", AWUSB_OKAY }, + { "allwinner,sun6i-a31-musb", AWUSB_OKAY }, + { "allwinner,sun8i-a33-musb", AWUSB_OKAY | AWUSB_NO_CONFDATA }, + { NULL, 0 } +}; + +static const struct musb_otg_ep_cfg musbotg_ep_allwinner[] = { + { + .ep_end = 5, + .ep_fifosz_shift = 9, + .ep_fifosz_reg = MUSB2_VAL_FIFOSZ_512, + }, + { + .ep_end = -1, + }, +}; + +struct awusbdrd_softc { + struct musbotg_softc sc; + struct resource *res[2]; + clk_t clk; + hwreset_t reset; + struct bus_space bs; + int flags; +}; + +static struct resource_spec awusbdrd_spec[] = { + { SYS_RES_MEMORY, 0, RF_ACTIVE }, + { SYS_RES_IRQ, 0, RF_ACTIVE }, + { -1, 0 } +}; + +#define REMAPFLAG 0x8000 +#define REGDECL(a, b) [(a)] = ((b) | REMAPFLAG) + +/* Allwinner USB DRD register mappings */ +static const uint16_t awusbdrd_regmap[] = { + REGDECL(MUSB2_REG_EPFIFO(0), 0x0000), + REGDECL(MUSB2_REG_EPFIFO(1), 0x0004), + REGDECL(MUSB2_REG_EPFIFO(2), 0x0008), + REGDECL(MUSB2_REG_EPFIFO(3), 0x000c), + REGDECL(MUSB2_REG_EPFIFO(4), 0x0010), + REGDECL(MUSB2_REG_EPFIFO(5), 0x0014), + REGDECL(MUSB2_REG_POWER, 0x0040), + REGDECL(MUSB2_REG_DEVCTL, 0x0041), + REGDECL(MUSB2_REG_EPINDEX, 0x0042), + REGDECL(MUSB2_REG_INTTX, 0x0044), + REGDECL(MUSB2_REG_INTRX, 0x0046), + REGDECL(MUSB2_REG_INTTXE, 0x0048), + REGDECL(MUSB2_REG_INTRXE, 0x004a), + REGDECL(MUSB2_REG_INTUSB, 0x004c), + REGDECL(MUSB2_REG_INTUSBE, 0x0050), + REGDECL(MUSB2_REG_FRAME, 0x0054), + REGDECL(MUSB2_REG_TESTMODE, 0x007c), + REGDECL(MUSB2_REG_TXMAXP, 0x0080), + REGDECL(MUSB2_REG_TXCSRL, 0x0082), + REGDECL(MUSB2_REG_TXCSRH, 0x0083), + REGDECL(MUSB2_REG_RXMAXP, 0x0084), + REGDECL(MUSB2_REG_RXCSRL, 0x0086), + REGDECL(MUSB2_REG_RXCSRH, 0x0087), + REGDECL(MUSB2_REG_RXCOUNT, 0x0088), + REGDECL(MUSB2_REG_TXTI, 0x008c), + REGDECL(MUSB2_REG_TXNAKLIMIT, 0x008d), + REGDECL(MUSB2_REG_RXNAKLIMIT, 0x008f), + REGDECL(MUSB2_REG_RXTI, 0x008e), + REGDECL(MUSB2_REG_TXFIFOSZ, 0x0090), + REGDECL(MUSB2_REG_TXFIFOADD, 0x0092), + REGDECL(MUSB2_REG_RXFIFOSZ, 0x0094), + REGDECL(MUSB2_REG_RXFIFOADD, 0x0096), + REGDECL(MUSB2_REG_FADDR, 0x0098), + REGDECL(MUSB2_REG_TXFADDR(0), 0x0098), + REGDECL(MUSB2_REG_TXHADDR(0), 0x009a), + REGDECL(MUSB2_REG_TXHUBPORT(0), 0x009b), + REGDECL(MUSB2_REG_RXFADDR(0), 0x009c), + REGDECL(MUSB2_REG_RXHADDR(0), 0x009e), + REGDECL(MUSB2_REG_RXHUBPORT(0), 0x009f), + REGDECL(MUSB2_REG_TXFADDR(1), 0x0098), + REGDECL(MUSB2_REG_TXHADDR(1), 0x009a), + REGDECL(MUSB2_REG_TXHUBPORT(1), 0x009b), + REGDECL(MUSB2_REG_RXFADDR(1), 0x009c), + REGDECL(MUSB2_REG_RXHADDR(1), 0x009e), + REGDECL(MUSB2_REG_RXHUBPORT(1), 0x009f), + REGDECL(MUSB2_REG_TXFADDR(2), 0x0098), + REGDECL(MUSB2_REG_TXHADDR(2), 0x009a), + REGDECL(MUSB2_REG_TXHUBPORT(2), 0x009b), + REGDECL(MUSB2_REG_RXFADDR(2), 0x009c), + REGDECL(MUSB2_REG_RXHADDR(2), 0x009e), + REGDECL(MUSB2_REG_RXHUBPORT(2), 0x009f), + REGDECL(MUSB2_REG_TXFADDR(3), 0x0098), + REGDECL(MUSB2_REG_TXHADDR(3), 0x009a), + REGDECL(MUSB2_REG_TXHUBPORT(3), 0x009b), + REGDECL(MUSB2_REG_RXFADDR(3), 0x009c), + REGDECL(MUSB2_REG_RXHADDR(3), 0x009e), + REGDECL(MUSB2_REG_RXHUBPORT(3), 0x009f), + REGDECL(MUSB2_REG_TXFADDR(4), 0x0098), + REGDECL(MUSB2_REG_TXHADDR(4), 0x009a), + REGDECL(MUSB2_REG_TXHUBPORT(4), 0x009b), + REGDECL(MUSB2_REG_RXFADDR(4), 0x009c), + REGDECL(MUSB2_REG_RXHADDR(4), 0x009e), + REGDECL(MUSB2_REG_RXHUBPORT(4), 0x009f), + REGDECL(MUSB2_REG_TXFADDR(5), 0x0098), + REGDECL(MUSB2_REG_TXHADDR(5), 0x009a), + REGDECL(MUSB2_REG_TXHUBPORT(5), 0x009b), + REGDECL(MUSB2_REG_RXFADDR(5), 0x009c), + REGDECL(MUSB2_REG_RXHADDR(5), 0x009e), + REGDECL(MUSB2_REG_RXHUBPORT(5), 0x009f), + REGDECL(MUSB2_REG_CONFDATA, 0x00c0), +}; + +static bus_size_t +awusbdrd_reg(bus_size_t o) +{ + bus_size_t v; + + KASSERT(o < nitems(awusbdrd_regmap), + ("%s: Invalid register %#lx", __func__, o)); + if (o >= nitems(awusbdrd_regmap)) + return (o); + + v = awusbdrd_regmap[o]; + + KASSERT((v & REMAPFLAG) != 0, ("%s: reg %#lx not in regmap", + __func__, o)); + + return (v & ~REMAPFLAG); +} + +static int +awusbdrd_filt(bus_size_t o) +{ + switch (o) { + case MUSB2_REG_MISC: + case MUSB2_REG_RXDBDIS: + case MUSB2_REG_TXDBDIS: + return (1); + default: + return (0); + } +} + +static uint8_t +awusbdrd_bs_r_1(awusb_bs_tag t, bus_space_handle_t h, bus_size_t o) +{ + const struct bus_space *bs = t; + + switch (o) { + case MUSB2_REG_HWVERS: + return (0); /* no known equivalent */ + } + + return (bus_space_read_1(bs_parent_space(bs), h, awusbdrd_reg(o))); +} + +static uint8_t +awusbdrd_bs_r_1_noconf(awusb_bs_tag t, bus_space_handle_t h, bus_size_t o) +{ + + /* + * There is no confdata register on some SoCs, return the same + * magic value as Linux. + */ + if (o == MUSB2_REG_CONFDATA) + return (0xde); + + return (awusbdrd_bs_r_1(t, h, o)); +} + + +static uint16_t +awusbdrd_bs_r_2(awusb_bs_tag t, bus_space_handle_t h, bus_size_t o) +{ + const struct bus_space *bs = t; + + return bus_space_read_2(bs_parent_space(bs), h, awusbdrd_reg(o)); +} + +static void +awusbdrd_bs_w_1(awusb_bs_tag t, bus_space_handle_t h, bus_size_t o, + uint8_t v) +{ + const struct bus_space *bs = t; + + if (awusbdrd_filt(o) != 0) + return; + + bus_space_write_1(bs_parent_space(bs), h, awusbdrd_reg(o), v); +} + +static void +awusbdrd_bs_w_2(awusb_bs_tag t, bus_space_handle_t h, bus_size_t o, + uint16_t v) +{ + const struct bus_space *bs = t; + + if (awusbdrd_filt(o) != 0) + return; + + bus_space_write_2(bs_parent_space(bs), h, awusbdrd_reg(o), v); +} + +static void +awusbdrd_bs_rm_1(awusb_bs_tag t, bus_space_handle_t h, bus_size_t o, + uint8_t *d, bus_size_t c) +{ + const struct bus_space *bs = t; + + bus_space_read_multi_1(bs_parent_space(bs), h, awusbdrd_reg(o), d, c); +} + +static void +awusbdrd_bs_rm_4(awusb_bs_tag t, bus_space_handle_t h, bus_size_t o, + uint32_t *d, bus_size_t c) +{ + const struct bus_space *bs = t; + + bus_space_read_multi_4(bs_parent_space(bs), h, awusbdrd_reg(o), d, c); +} + +static void +awusbdrd_bs_wm_1(awusb_bs_tag t, bus_space_handle_t h, bus_size_t o, + const uint8_t *d, bus_size_t c) +{ + const struct bus_space *bs = t; + + if (awusbdrd_filt(o) != 0) + return; + + bus_space_write_multi_1(bs_parent_space(bs), h, awusbdrd_reg(o), d, c); +} + +static void +awusbdrd_bs_wm_4(awusb_bs_tag t, bus_space_handle_t h, bus_size_t o, + const uint32_t *d, bus_size_t c) +{ + const struct bus_space *bs = t; + + if (awusbdrd_filt(o) != 0) + return; + + bus_space_write_multi_4(bs_parent_space(bs), h, awusbdrd_reg(o), d, c); +} + +static void +awusbdrd_intr(void *arg) +{ + struct awusbdrd_softc *sc = arg; + uint8_t intusb; + uint16_t inttx, intrx; + + intusb = MUSB2_READ_1(&sc->sc, MUSB2_REG_INTUSB); + inttx = MUSB2_READ_2(&sc->sc, MUSB2_REG_INTTX); + intrx = MUSB2_READ_2(&sc->sc, MUSB2_REG_INTRX); + if (intusb == 0 && inttx == 0 && intrx == 0) + return; + + if (intusb) + MUSB2_WRITE_1(&sc->sc, MUSB2_REG_INTUSB, intusb); + if (inttx) + MUSB2_WRITE_2(&sc->sc, MUSB2_REG_INTTX, inttx); + if (intrx) + MUSB2_WRITE_2(&sc->sc, MUSB2_REG_INTRX, intrx); + + musbotg_interrupt(arg, intrx, inttx, intusb); +} + +static int +awusbdrd_probe(device_t dev) +{ + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0) + return (ENXIO); + + device_set_desc(dev, "Allwinner USB DRD"); + return (BUS_PROBE_DEFAULT); +} + +static int +awusbdrd_attach(device_t dev) +{ + struct awusbdrd_softc *sc; + int error; + + sc = device_get_softc(dev); + sc->flags = ofw_bus_search_compatible(dev, compat_data)->ocd_data; + + error = bus_alloc_resources(dev, awusbdrd_spec, sc->res); + if (error != 0) + return (error); + + /* AHB gate clock is required */ + error = clk_get_by_ofw_index(dev, 0, 0, &sc->clk); + if (error != 0) + goto fail; + + /* AHB reset is only present on some SoCs */ + (void)hwreset_get_by_ofw_idx(dev, 0, 0, &sc->reset); + + /* Enable clocks */ + error = clk_enable(sc->clk); + if (error != 0) { + device_printf(dev, "failed to enable clock: %d\n", error); + goto fail; + } + if (sc->reset != NULL) { + error = hwreset_deassert(sc->reset); + if (error != 0) { + device_printf(dev, "failed to de-assert reset: %d\n", + error); + goto fail; + } + } + + sc->sc.sc_bus.parent = dev; + sc->sc.sc_bus.devices = sc->sc.sc_devices; + sc->sc.sc_bus.devices_max = MUSB2_MAX_DEVICES; + sc->sc.sc_bus.dma_bits = 32; + + error = usb_bus_mem_alloc_all(&sc->sc.sc_bus, USB_GET_DMA_TAG(dev), + NULL); + if (error != 0) { + error = ENOMEM; + goto fail; + } + +#if defined(__arm__) + sc->bs.bs_parent = rman_get_bustag(sc->res[0]); +#elif defined(__aarch64__) + sc->bs.bs_cookie = rman_get_bustag(sc->res[0]); +#endif + + if ((sc->flags & AWUSB_NO_CONFDATA) == AWUSB_NO_CONFDATA) + sc->bs.bs_r_1 = awusbdrd_bs_r_1_noconf; + else + sc->bs.bs_r_1 = awusbdrd_bs_r_1; + sc->bs.bs_r_2 = awusbdrd_bs_r_2; + sc->bs.bs_w_1 = awusbdrd_bs_w_1; + sc->bs.bs_w_2 = awusbdrd_bs_w_2; + sc->bs.bs_rm_1 = awusbdrd_bs_rm_1; + sc->bs.bs_rm_4 = awusbdrd_bs_rm_4; + sc->bs.bs_wm_1 = awusbdrd_bs_wm_1; + sc->bs.bs_wm_4 = awusbdrd_bs_wm_4; + + sc->sc.sc_io_tag = &sc->bs; + sc->sc.sc_io_hdl = rman_get_bushandle(sc->res[0]); + sc->sc.sc_io_size = rman_get_size(sc->res[0]); + + sc->sc.sc_bus.bdev = device_add_child(dev, "usbus", -1); + if (sc->sc.sc_bus.bdev == NULL) { + error = ENXIO; + goto fail; + } + device_set_ivars(sc->sc.sc_bus.bdev, &sc->sc.sc_bus); + sc->sc.sc_id = 0; + sc->sc.sc_platform_data = sc; + sc->sc.sc_mode = MUSB2_HOST_MODE; /* XXX HOST vs DEVICE mode */ + sc->sc.sc_ep_max = DRD_EP_MAX; + sc->sc.sc_ep_cfg = musbotg_ep_allwinner; + + error = bus_setup_intr(dev, sc->res[1], INTR_MPSAFE | INTR_TYPE_BIO, + NULL, awusbdrd_intr, sc, &sc->sc.sc_intr_hdl); + if (error != 0) + goto fail; + + /* Enable PIO mode */ + bus_write_1(sc->res[0], MUSB2_REG_AWIN_VEND0, VEND0_PIO_MODE); + +#ifdef __arm__ + /* Map SRAMD area to USB0 (sun4i/sun7i only) */ + switch (allwinner_soc_family()) { + case ALLWINNERSOC_SUN4I: + case ALLWINNERSOC_SUN7I: + a10_map_to_otg(); + break; + } +#endif + + error = musbotg_init(&sc->sc); + if (error != 0) + goto fail; + + error = device_probe_and_attach(sc->sc.sc_bus.bdev); + if (error != 0) + goto fail; + + musbotg_vbus_interrupt(&sc->sc, 1); /* XXX VBUS */ + + return (0); + +fail: + if (sc->reset != NULL) + hwreset_release(sc->reset); + if (sc->clk != NULL) + clk_release(sc->clk); + bus_release_resources(dev, awusbdrd_spec, sc->res); + return (error); +} + +static int +awusbdrd_detach(device_t dev) +{ + struct awusbdrd_softc *sc; + device_t bdev; + int error; + + sc = device_get_softc(dev); + + if (sc->sc.sc_bus.bdev != NULL) { + bdev = sc->sc.sc_bus.bdev; + device_detach(bdev); + device_delete_child(dev, bdev); + } + + musbotg_uninit(&sc->sc); + error = bus_teardown_intr(dev, sc->res[1], sc->sc.sc_intr_hdl); + if (error != 0) + return (error); + + usb_bus_mem_free_all(&sc->sc.sc_bus, NULL); + + if (sc->reset != NULL) + hwreset_release(sc->reset); + if (sc->clk != NULL) + clk_release(sc->clk); + + bus_release_resources(dev, awusbdrd_spec, sc->res); + + device_delete_children(dev); + + return (0); +} + +static device_method_t awusbdrd_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, awusbdrd_probe), + DEVMETHOD(device_attach, awusbdrd_attach), + DEVMETHOD(device_detach, awusbdrd_detach), + DEVMETHOD(device_suspend, bus_generic_suspend), + DEVMETHOD(device_resume, bus_generic_resume), + DEVMETHOD(device_shutdown, bus_generic_shutdown), + + DEVMETHOD_END +}; + +static driver_t awusbdrd_driver = { + .name = "musbotg", + .methods = awusbdrd_methods, + .size = sizeof(struct awusbdrd_softc), +}; + +static devclass_t awusbdrd_devclass; + +DRIVER_MODULE(musbotg, simplebus, awusbdrd_driver, awusbdrd_devclass, 0, 0); +MODULE_DEPEND(musbotg, usb, 1, 1, 1); From owner-svn-src-all@freebsd.org Mon Sep 7 06:48:09 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 196643EAE40; Mon, 7 Sep 2020 06:48:09 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BlJkw6wZhz3VSJ; Mon, 7 Sep 2020 06:48:08 +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 CC35B1B88A; Mon, 7 Sep 2020 06:48:08 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0876m8nj045575; Mon, 7 Sep 2020 06:48:08 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0876m8UV045574; Mon, 7 Sep 2020 06:48:08 GMT (envelope-from avg@FreeBSD.org) Message-Id: <202009070648.0876m8UV045574@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 7 Sep 2020 06:48:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365400 - head/sys/dev/usb/controller X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/sys/dev/usb/controller X-SVN-Commit-Revision: 365400 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.33 Precedence: list List-Id: "SVN commit messages 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, 07 Sep 2020 06:48:09 -0000 Author: avg Date: Mon Sep 7 06:48:08 2020 New Revision: 365400 URL: https://svnweb.freebsd.org/changeset/base/365400 Log: musb/allwinner: apply register filter in awusbdrd_bs_r_2() as well Otherwise, I get this panic: panic: awusbdrd_reg: Invalid register 0x342 It looks that musb code both writes and reads at least MUSB2_REG_TXDBDIS. MFC after: 5 weeks X-MFC after: r365399 Modified: head/sys/dev/usb/controller/musb_otg_allwinner.c Modified: head/sys/dev/usb/controller/musb_otg_allwinner.c ============================================================================== --- head/sys/dev/usb/controller/musb_otg_allwinner.c Mon Sep 7 06:44:24 2020 (r365399) +++ head/sys/dev/usb/controller/musb_otg_allwinner.c Mon Sep 7 06:48:08 2020 (r365400) @@ -259,6 +259,8 @@ awusbdrd_bs_r_2(awusb_bs_tag t, bus_space_handle_t h, { const struct bus_space *bs = t; + if (awusbdrd_filt(o) != 0) + return (0); return bus_space_read_2(bs_parent_space(bs), h, awusbdrd_reg(o)); } From owner-svn-src-all@freebsd.org Mon Sep 7 06:49:08 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A5AE33EAE50; Mon, 7 Sep 2020 06:49:08 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BlJm43x0hz3VLD; Mon, 7 Sep 2020 06:49:08 +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 6A45F1B88B; Mon, 7 Sep 2020 06:49:08 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0876n8hs045666; Mon, 7 Sep 2020 06:49:08 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0876n8K6045665; Mon, 7 Sep 2020 06:49:08 GMT (envelope-from avg@FreeBSD.org) Message-Id: <202009070649.0876n8K6045665@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 7 Sep 2020 06:49:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365401 - head/sys/dev/usb/controller X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/sys/dev/usb/controller X-SVN-Commit-Revision: 365401 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.33 Precedence: list List-Id: "SVN commit messages 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, 07 Sep 2020 06:49:08 -0000 Author: avg Date: Mon Sep 7 06:49:07 2020 New Revision: 365401 URL: https://svnweb.freebsd.org/changeset/base/365401 Log: musb/allwinner: add H3 support MFC after: 6 weeks Modified: head/sys/dev/usb/controller/musb_otg_allwinner.c Modified: head/sys/dev/usb/controller/musb_otg_allwinner.c ============================================================================== --- head/sys/dev/usb/controller/musb_otg_allwinner.c Mon Sep 7 06:48:08 2020 (r365400) +++ head/sys/dev/usb/controller/musb_otg_allwinner.c Mon Sep 7 06:49:07 2020 (r365401) @@ -71,6 +71,7 @@ __FBSDID("$FreeBSD$"); #endif #define DRD_EP_MAX 5 +#define DRD_EP_MAX_H3 4 #define MUSB2_REG_AWIN_VEND0 0x0043 #define VEND0_PIO_MODE 0 @@ -89,12 +90,13 @@ static struct ofw_compat_data compat_data[] = { { "allwinner,sun4i-a10-musb", AWUSB_OKAY }, { "allwinner,sun6i-a31-musb", AWUSB_OKAY }, { "allwinner,sun8i-a33-musb", AWUSB_OKAY | AWUSB_NO_CONFDATA }, + { "allwinner,sun8i-h3-musb", AWUSB_OKAY | AWUSB_NO_CONFDATA }, { NULL, 0 } }; static const struct musb_otg_ep_cfg musbotg_ep_allwinner[] = { { - .ep_end = 5, + .ep_end = DRD_EP_MAX, .ep_fifosz_shift = 9, .ep_fifosz_reg = MUSB2_VAL_FIFOSZ_512, }, @@ -103,6 +105,17 @@ static const struct musb_otg_ep_cfg musbotg_ep_allwinn }, }; +static const struct musb_otg_ep_cfg musbotg_ep_allwinner_h3[] = { + { + .ep_end = DRD_EP_MAX_H3, + .ep_fifosz_shift = 9, + .ep_fifosz_reg = MUSB2_VAL_FIFOSZ_512, + }, + { + .ep_end = -1, + }, +}; + struct awusbdrd_softc { struct musbotg_softc sc; struct resource *res[2]; @@ -445,8 +458,13 @@ awusbdrd_attach(device_t dev) sc->sc.sc_id = 0; sc->sc.sc_platform_data = sc; sc->sc.sc_mode = MUSB2_HOST_MODE; /* XXX HOST vs DEVICE mode */ - sc->sc.sc_ep_max = DRD_EP_MAX; - sc->sc.sc_ep_cfg = musbotg_ep_allwinner; + if (ofw_bus_is_compatible(dev, "allwinner,sun8i-h3-musb")) { + sc->sc.sc_ep_cfg = musbotg_ep_allwinner_h3; + sc->sc.sc_ep_max = DRD_EP_MAX_H3; + } else { + sc->sc.sc_ep_cfg = musbotg_ep_allwinner; + sc->sc.sc_ep_max = DRD_EP_MAX; + } error = bus_setup_intr(dev, sc->res[1], INTR_MPSAFE | INTR_TYPE_BIO, NULL, awusbdrd_intr, sc, &sc->sc.sc_intr_hdl); From owner-svn-src-all@freebsd.org Mon Sep 7 06:53:30 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 011713EAE72; Mon, 7 Sep 2020 06:53:29 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BlJs567N9z3Vrx; Mon, 7 Sep 2020 06:53:29 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B235D1BA91; Mon, 7 Sep 2020 06:53:29 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0876rTng052071; Mon, 7 Sep 2020 06:53:29 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0876rTwm052070; Mon, 7 Sep 2020 06:53:29 GMT (envelope-from avg@FreeBSD.org) Message-Id: <202009070653.0876rTwm052070@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 7 Sep 2020 06:53:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365402 - head/sys/dev/usb/controller X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/sys/dev/usb/controller X-SVN-Commit-Revision: 365402 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.33 Precedence: list List-Id: "SVN commit messages 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, 07 Sep 2020 06:53:30 -0000 Author: avg Date: Mon Sep 7 06:53:29 2020 New Revision: 365402 URL: https://svnweb.freebsd.org/changeset/base/365402 Log: musb/allwinner: add support for configuring phy as well as device mode At least on Orange Pi PC Plus even the host mode does not work without enabling the phy and setting it to the host mode. The driver will now parse dr_mode property and will try to configure itself and the phy accordingly. OTG mode is not supported yet, so it is treated as the device / peripheral mode. The phy is enabled -- powered on -- only for the host mode. The device mode requires support from a phy driver, e.g., aw_usbphy on Allwinner platform. aw_usbphy does not support the device mode, so it cannnot work yet. MFC after: 6 weeks Modified: head/sys/dev/usb/controller/musb_otg_allwinner.c Modified: head/sys/dev/usb/controller/musb_otg_allwinner.c ============================================================================== --- head/sys/dev/usb/controller/musb_otg_allwinner.c Mon Sep 7 06:49:07 2020 (r365401) +++ head/sys/dev/usb/controller/musb_otg_allwinner.c Mon Sep 7 06:53:29 2020 (r365402) @@ -64,6 +64,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include #ifdef __arm__ #include @@ -121,6 +123,7 @@ struct awusbdrd_softc { struct resource *res[2]; clk_t clk; hwreset_t reset; + phy_t phy; struct bus_space bs; int flags; }; @@ -382,7 +385,10 @@ awusbdrd_probe(device_t dev) static int awusbdrd_attach(device_t dev) { + char usb_mode[24]; struct awusbdrd_softc *sc; + uint8_t musb_mode; + int phy_mode; int error; sc = device_get_softc(dev); @@ -392,6 +398,31 @@ awusbdrd_attach(device_t dev) if (error != 0) return (error); + musb_mode = MUSB2_HOST_MODE; /* default */ + phy_mode = PHY_USB_MODE_HOST; + if (OF_getprop(ofw_bus_get_node(dev), "dr_mode", + &usb_mode, sizeof(usb_mode)) > 0) { + usb_mode[sizeof(usb_mode) - 1] = 0; + if (strcasecmp(usb_mode, "host") == 0) { + musb_mode = MUSB2_HOST_MODE; + phy_mode = PHY_USB_MODE_HOST; + } else if (strcasecmp(usb_mode, "peripheral") == 0) { + musb_mode = MUSB2_DEVICE_MODE; + phy_mode = PHY_USB_MODE_DEVICE; + } else if (strcasecmp(usb_mode, "otg") == 0) { + /* + * XXX phy has PHY_USB_MODE_OTG, but MUSB does not have + * it. It's not clear how to propagate mode changes + * from phy layer (that detects them) to MUSB. + */ + musb_mode = MUSB2_DEVICE_MODE; + phy_mode = PHY_USB_MODE_DEVICE; + } else { + device_printf(dev, "Invalid FDT dr_mode: %s\n", + usb_mode); + } + } + /* AHB gate clock is required */ error = clk_get_by_ofw_index(dev, 0, 0, &sc->clk); if (error != 0) @@ -415,6 +446,24 @@ awusbdrd_attach(device_t dev) } } + /* XXX not sure if this is universally needed. */ + (void)phy_get_by_ofw_name(dev, 0, "usb", &sc->phy); + if (sc->phy != NULL) { + device_printf(dev, "setting phy mode %d\n", phy_mode); + if (musb_mode == MUSB2_HOST_MODE) { + error = phy_enable(sc->phy); + if (error != 0) { + device_printf(dev, "Could not enable phy\n"); + goto fail; + } + } + error = phy_usb_set_mode(sc->phy, phy_mode); + if (error != 0) { + device_printf(dev, "Could not set phy mode\n"); + goto fail; + } + } + sc->sc.sc_bus.parent = dev; sc->sc.sc_bus.devices = sc->sc.sc_devices; sc->sc.sc_bus.devices_max = MUSB2_MAX_DEVICES; @@ -457,7 +506,7 @@ awusbdrd_attach(device_t dev) device_set_ivars(sc->sc.sc_bus.bdev, &sc->sc.sc_bus); sc->sc.sc_id = 0; sc->sc.sc_platform_data = sc; - sc->sc.sc_mode = MUSB2_HOST_MODE; /* XXX HOST vs DEVICE mode */ + sc->sc.sc_mode = musb_mode; if (ofw_bus_is_compatible(dev, "allwinner,sun8i-h3-musb")) { sc->sc.sc_ep_cfg = musbotg_ep_allwinner_h3; sc->sc.sc_ep_max = DRD_EP_MAX_H3; @@ -497,8 +546,15 @@ awusbdrd_attach(device_t dev) return (0); fail: - if (sc->reset != NULL) + if (sc->phy != NULL) { + if (musb_mode == MUSB2_HOST_MODE) + (void)phy_disable(sc->phy); + phy_release(sc->phy); + } + if (sc->reset != NULL) { + hwreset_assert(sc->reset); hwreset_release(sc->reset); + } if (sc->clk != NULL) clk_release(sc->clk); bus_release_resources(dev, awusbdrd_spec, sc->res); @@ -527,8 +583,16 @@ awusbdrd_detach(device_t dev) usb_bus_mem_free_all(&sc->sc.sc_bus, NULL); - if (sc->reset != NULL) + if (sc->phy != NULL) { + if (sc->sc.sc_mode == MUSB2_HOST_MODE) + phy_disable(sc->phy); + phy_release(sc->phy); + } + if (sc->reset != NULL) { + if (hwreset_assert(sc->reset) != 0) + device_printf(dev, "failed to assert reset\n"); hwreset_release(sc->reset); + } if (sc->clk != NULL) clk_release(sc->clk); From owner-svn-src-all@freebsd.org Mon Sep 7 07:44:15 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 91F953EB9F3; Mon, 7 Sep 2020 07:44:15 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BlKzg3QvTz3Xb8; Mon, 7 Sep 2020 07:44:15 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 5A5A71C227; Mon, 7 Sep 2020 07:44:15 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0877iFXI082301; Mon, 7 Sep 2020 07:44:15 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0877iF1V082300; Mon, 7 Sep 2020 07:44:15 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <202009070744.0877iF1V082300@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Mon, 7 Sep 2020 07:44:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365403 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 365403 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.33 Precedence: list List-Id: "SVN commit messages 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, 07 Sep 2020 07:44:15 -0000 Author: lwhsu Date: Mon Sep 7 07:44:14 2020 New Revision: 365403 URL: https://svnweb.freebsd.org/changeset/base/365403 Log: Slightly improve usb(4) - Mention USB 3.0 - Update links - Fix `mandoc -T lint` warnings Reviewed by: bcr, hselasky MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D26349 Modified: head/share/man/man4/usb.4 Modified: head/share/man/man4/usb.4 ============================================================================== --- head/share/man/man4/usb.4 Mon Sep 7 06:53:29 2020 (r365402) +++ head/share/man/man4/usb.4 Mon Sep 7 07:44:14 2020 (r365403) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 24, 2018 +.Dd September 7, 2020 .Dt USB 4 .Os .Sh NAME @@ -52,8 +52,7 @@ for more information. .Sh DESCRIPTION .Fx provides machine-independent bus support and drivers for -.Tn USB -devices in host and device side mode. +USB devices in host and device side mode. .Pp The .Nm @@ -67,32 +66,25 @@ driver has three layers: The controller attaches to a physical bus like .Xr pci 4 . -The -.Tn USB -bus attaches to the controller, and the root hub attaches +The USB bus attaches to the controller, and the root hub attaches to the controller. Any devices attached to the bus will attach to the root hub -or another hub attached to the -.Tn USB -bus. +or another hub attached to the USB bus. .Pp The .Nm uhub device will always be present as it is needed for the root hub. .Sh INTRODUCTION TO USB -The -.Tn USB -is a system where external devices can be connected to a PC. +The USB is a system where external devices can be connected to a PC. The most common USB speeds are: .Bl -tag -width 6n -offset indent -.It Low Speed (1.5MBit/sec) -.It Full Speed (12MBit/sec) -.It High Speed (480MBit/sec) +.It Low Speed (1.5 MBit/sec) +.It Full Speed (12 MBit/sec) +.It High Speed (480 MBit/sec) +.It SuperSpeed (5 GBit/sec) .El .Pp -Each -.Tn USB -has a USB controller that is the master of the bus. +Each USB has a USB controller that is the master of the bus. The physical communication is simplex which means the host controller only communicates with one USB device at a time. .Pp @@ -122,9 +114,7 @@ A device may operate in different configurations. Depending on the configuration, the device may present different sets of endpoints and interfaces. .Pp -The bus enumeration of the -.Tn USB -bus proceeds in several steps: +The bus enumeration of the USB bus proceeds in several steps: .Bl -enum .It Any interface specific driver can attach to the device. @@ -144,11 +134,9 @@ debug message verbosity. Default is 0. .El .Sh SEE ALSO -The -.Tn USB -specifications can be found at: +The USB specifications can be found at: .Pp -.D1 Pa http://www.usb.org/developers/docs/ +.D1 Pa https://www.usb.org/documents .Pp .Xr libusb 3 , .Xr aue 4 , @@ -178,7 +166,7 @@ specifications can be found at: .Sh STANDARDS The .Nm -module complies with the USB 2.0 standard. +module complies with the USB 3.0 standard. .Sh HISTORY The .Nm From owner-svn-src-all@freebsd.org Mon Sep 7 10:13:55 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 82E873EDF1F; Mon, 7 Sep 2020 10:13:55 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BlPJM2fL6z3fkP; Mon, 7 Sep 2020 10:13:55 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 24F271DD9C; Mon, 7 Sep 2020 10:13:55 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 087ADsTO073906; Mon, 7 Sep 2020 10:13:54 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 087ADsfW073905; Mon, 7 Sep 2020 10:13:54 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <202009071013.087ADsfW073905@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Mon, 7 Sep 2020 10:13:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365404 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: melifaro X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 365404 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.33 Precedence: list List-Id: "SVN commit messages 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, 07 Sep 2020 10:13:55 -0000 Author: melifaro Date: Mon Sep 7 10:13:54 2020 New Revision: 365404 URL: https://svnweb.freebsd.org/changeset/base/365404 Log: Consistently use the same gateway when adding/deleting interface routes. Use the same link-level gateway when adding or deleting interface routes. This helps nexthop checking in the upcoming multipath changes. Differential Revision: https://reviews.freebsd.org/D26317 Modified: head/sys/net/route.c Modified: head/sys/net/route.c ============================================================================== --- head/sys/net/route.c Mon Sep 7 07:44:14 2020 (r365403) +++ head/sys/net/route.c Mon Sep 7 10:13:54 2020 (r365404) @@ -883,7 +883,6 @@ rt_maskedcopy(struct sockaddr *src, struct sockaddr *d * Set up a routing table entry, normally * for an interface. */ -#define _SOCKADDR_TMPSIZE 128 /* Not too big.. kernel stack size is limited */ static inline int rtinit1(struct ifaddr *ifa, int cmd, int flags, int fibnum) { @@ -895,10 +894,10 @@ rtinit1(struct ifaddr *ifa, int cmd, int flags, int fi struct rt_addrinfo info; int error = 0; int startfib, endfib; - char tempbuf[_SOCKADDR_TMPSIZE]; + struct sockaddr_storage ss; int didwork = 0; int a_failure = 0; - struct sockaddr_dl_short *sdl = NULL; + struct sockaddr_dl_short sdl; struct rib_head *rnh; if (flags & RTF_HOST) { @@ -946,17 +945,15 @@ rtinit1(struct ifaddr *ifa, int cmd, int flags, int fi * XXX this is kinda inet specific.. */ if (netmask != NULL) { - rt_maskedcopy(dst, (struct sockaddr *)tempbuf, netmask); - dst = (struct sockaddr *)tempbuf; + rt_maskedcopy(dst, (struct sockaddr *)&ss, netmask); + dst = (struct sockaddr *)&ss; } - } else if (cmd == RTM_ADD) { - sdl = (struct sockaddr_dl_short *)tempbuf; - bzero(sdl, sizeof(struct sockaddr_dl_short)); - sdl->sdl_family = AF_LINK; - sdl->sdl_len = sizeof(struct sockaddr_dl_short); - sdl->sdl_type = ifa->ifa_ifp->if_type; - sdl->sdl_index = ifa->ifa_ifp->if_index; - } + } + bzero(&sdl, sizeof(struct sockaddr_dl_short)); + sdl.sdl_family = AF_LINK; + sdl.sdl_len = sizeof(struct sockaddr_dl_short); + sdl.sdl_type = ifa->ifa_ifp->if_type; + sdl.sdl_index = ifa->ifa_ifp->if_index; /* * Now go through all the requested tables (fibs) and do the * requested action. Realistically, this will either be fib 0 @@ -1012,13 +1009,7 @@ rtinit1(struct ifaddr *ifa, int cmd, int flags, int fi info.rti_flags = flags | (ifa->ifa_flags & ~IFA_RTSELF) | RTF_PINNED; info.rti_info[RTAX_DST] = dst; - /* - * doing this for compatibility reasons - */ - if (cmd == RTM_ADD) - info.rti_info[RTAX_GATEWAY] = (struct sockaddr *)sdl; - else - info.rti_info[RTAX_GATEWAY] = ifa->ifa_addr; + info.rti_info[RTAX_GATEWAY] = (struct sockaddr *)&sdl; info.rti_info[RTAX_NETMASK] = netmask; NET_EPOCH_ENTER(et); error = rib_action(fibnum, cmd, &info, &rc); From owner-svn-src-all@freebsd.org Mon Sep 7 10:34:24 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1A9E13EE12B; Mon, 7 Sep 2020 10:34:24 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BlPlz68p9z3gV4; Mon, 7 Sep 2020 10:34:23 +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 9DB631E387; Mon, 7 Sep 2020 10:34:23 +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 087AYN7X086391; Mon, 7 Sep 2020 10:34:23 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 087AYMMv086388; Mon, 7 Sep 2020 10:34:22 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202009071034.087AYMMv086388@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 7 Sep 2020 10:34:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365405 - in stable/12/sys/dev/mlx5: . mlx5_core X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in stable/12/sys/dev/mlx5: . mlx5_core X-SVN-Commit-Revision: 365405 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.33 Precedence: list List-Id: "SVN commit messages 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, 07 Sep 2020 10:34:24 -0000 Author: kib Date: Mon Sep 7 10:34:22 2020 New Revision: 365405 URL: https://svnweb.freebsd.org/changeset/base/365405 Log: MFC r364999: mlx5_core: Import PDDR register definitions Modified: stable/12/sys/dev/mlx5/driver.h stable/12/sys/dev/mlx5/mlx5_core/mlx5_core.h stable/12/sys/dev/mlx5/mlx5_ifc.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/mlx5/driver.h ============================================================================== --- stable/12/sys/dev/mlx5/driver.h Mon Sep 7 10:13:54 2020 (r365404) +++ stable/12/sys/dev/mlx5/driver.h Mon Sep 7 10:34:22 2020 (r365405) @@ -145,6 +145,7 @@ enum { MLX5_REG_PMPE = 0x5010, MLX5_REG_PMAOS = 0x5012, MLX5_REG_PPLM = 0x5023, + MLX5_REG_PDDR = 0x5031, MLX5_REG_PBSR = 0x5038, MLX5_REG_PCAM = 0x507f, MLX5_REG_NODE_DESC = 0x6001, Modified: stable/12/sys/dev/mlx5/mlx5_core/mlx5_core.h ============================================================================== --- stable/12/sys/dev/mlx5/mlx5_core/mlx5_core.h Mon Sep 7 10:13:54 2020 (r365404) +++ stable/12/sys/dev/mlx5/mlx5_core/mlx5_core.h Mon Sep 7 10:34:22 2020 (r365405) @@ -79,6 +79,35 @@ enum mlx5_semaphore_space_address { struct mlx5_core_dev; +enum mlx5_pddr_page_select { + MLX5_PDDR_OPERATIONAL_INFO_PAGE = 0x0, + MLX5_PDDR_TROUBLESHOOTING_INFO_PAGE = 0x1, + MLX5_PDDR_MODULE_INFO_PAGE = 0x3, +}; + +enum mlx5_pddr_monitor_opcodes { + MLX5_LINK_NO_ISSUE_OBSERVED = 0x0, + MLX5_LINK_PORT_CLOSED = 0x1, + MLX5_LINK_AN_FAILURE = 0x2, + MLX5_LINK_TRAINING_FAILURE = 0x5, + MLX5_LINK_LOGICAL_MISMATCH = 0x9, + MLX5_LINK_REMOTE_FAULT_INDICATION = 0xe, + MLX5_LINK_BAD_SIGNAL_INTEGRITY = 0xf, + MLX5_LINK_CABLE_COMPLIANCE_CODE_MISMATCH = 0x10, + MLX5_LINK_INTERNAL_ERR = 0x17, + MLX5_LINK_INFO_NOT_AVAIL = 0x3ff, + MLX5_LINK_CABLE_UNPLUGGED = 0x400, + MLX5_LINK_LONG_RANGE_FOR_NON_MLX_CABLE = 0x401, + MLX5_LINK_BUS_STUCK = 0x402, + MLX5_LINK_UNSUPP_EEPROM = 0x403, + MLX5_LINK_PART_NUM_LIST = 0x404, + MLX5_LINK_UNSUPP_CABLE = 0x405, + MLX5_LINK_MODULE_TEMP_SHUTDOWN = 0x406, + MLX5_LINK_SHORTED_CABLE = 0x407, + MLX5_LINK_POWER_BUDGET_EXCEEDED = 0x408, + MLX5_LINK_MNG_FORCED_DOWN = 0x409, +}; + int mlx5_query_hca_caps(struct mlx5_core_dev *dev); int mlx5_query_board_id(struct mlx5_core_dev *dev); int mlx5_query_qcam_reg(struct mlx5_core_dev *mdev, u32 *qcam, Modified: stable/12/sys/dev/mlx5/mlx5_ifc.h ============================================================================== --- stable/12/sys/dev/mlx5/mlx5_ifc.h Mon Sep 7 10:13:54 2020 (r365404) +++ stable/12/sys/dev/mlx5/mlx5_ifc.h Mon Sep 7 10:34:22 2020 (r365405) @@ -849,23 +849,6 @@ struct mlx5_ifc_pddr_module_info_bits { u8 reserved_at_4c0[0x300]; }; -union mlx5_ifc_pddr_operation_info_page_pddr_phy_info_page_pddr_troubleshooting_page_pddr_module_info_auto_bits { - struct mlx5_ifc_pddr_module_info_bits pddr_module_info; - u8 reserved_at_0[0x7c0]; -}; - -struct mlx5_ifc_pddr_reg_bits { - u8 reserved_at_0[0x8]; - u8 local_port[0x8]; - u8 pnat[0x2]; - u8 reserved_at_12[0xe]; - - u8 reserved_at_20[0x18]; - u8 page_select[0x8]; - - union mlx5_ifc_pddr_operation_info_page_pddr_phy_info_page_pddr_troubleshooting_page_pddr_module_info_auto_bits page_data; -}; - struct mlx5_ifc_per_protocol_networking_offload_caps_bits { u8 csum_cap[0x1]; u8 vlan_cap[0x1]; @@ -8637,7 +8620,10 @@ struct mlx5_ifc_pcam_regs_5000_to_507f_bits { u8 port_access_reg_cap_mask_127_to_96[0x20]; u8 port_access_reg_cap_mask_95_to_64[0x20]; - u8 port_access_reg_cap_mask_63_to_36[0x1c]; + u8 reserved_at_40[0xe]; + u8 pddr[0x1]; + u8 reserved_at_4f[0xd]; + u8 pplm[0x1]; u8 port_access_reg_cap_mask_34_to_32[0x3]; @@ -10189,6 +10175,46 @@ struct mlx5_ifc_mpcnt_reg_ext_bits { u8 reserved_at_21[0x1f]; union mlx5_ifc_mpcnt_reg_counter_set_auto_ext_bits counter_set; +}; + +struct mlx5_ifc_monitor_opcodes_layout_bits { + u8 reserved_at_0[0x10]; + u8 monitor_opcode[0x10]; +}; + +union mlx5_ifc_pddr_status_opcode_bits { + struct mlx5_ifc_monitor_opcodes_layout_bits monitor_opcodes; + u8 reserved_at_0[0x20]; +}; + +struct mlx5_ifc_troubleshooting_info_page_layout_bits { + u8 reserved_at_0[0x10]; + u8 group_opcode[0x10]; + + union mlx5_ifc_pddr_status_opcode_bits status_opcode; + + u8 user_feedback_data[0x10]; + u8 user_feedback_index[0x10]; + + u8 status_message[0x760]; +}; + +union mlx5_ifc_pddr_page_data_bits { + struct mlx5_ifc_troubleshooting_info_page_layout_bits troubleshooting_info_page; + struct mlx5_ifc_pddr_module_info_bits pddr_module_info; + u8 reserved_at_0[0x7c0]; +}; + +struct mlx5_ifc_pddr_reg_bits { + u8 reserved_at_0[0x8]; + u8 local_port[0x8]; + u8 pnat[0x2]; + u8 reserved_at_12[0xe]; + + u8 reserved_at_20[0x18]; + u8 page_select[0x8]; + + union mlx5_ifc_pddr_page_data_bits page_data; }; enum { From owner-svn-src-all@freebsd.org Mon Sep 7 10:35:23 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CA9083EDEDF; Mon, 7 Sep 2020 10:35:23 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BlPn74vxZz3gjb; Mon, 7 Sep 2020 10:35:23 +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 8BC211E406; Mon, 7 Sep 2020 10:35:23 +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 087AZNMr086501; Mon, 7 Sep 2020 10:35:23 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 087AZNA2086499; Mon, 7 Sep 2020 10:35:23 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202009071035.087AZNA2086499@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 7 Sep 2020 10:35:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365406 - in stable/12/sys/dev/mlx5: . mlx5_core X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in stable/12/sys/dev/mlx5: . mlx5_core X-SVN-Commit-Revision: 365406 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.33 Precedence: list List-Id: "SVN commit messages 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, 07 Sep 2020 10:35:23 -0000 Author: kib Date: Mon Sep 7 10:35:22 2020 New Revision: 365406 URL: https://svnweb.freebsd.org/changeset/base/365406 Log: MFC r365000: mlx5_core: add mlx5_query_pddr(). Modified: stable/12/sys/dev/mlx5/mlx5_core/mlx5_port.c stable/12/sys/dev/mlx5/mlx5_ifc.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/mlx5/mlx5_core/mlx5_port.c ============================================================================== --- stable/12/sys/dev/mlx5/mlx5_core/mlx5_port.c Mon Sep 7 10:34:22 2020 (r365405) +++ stable/12/sys/dev/mlx5/mlx5_core/mlx5_port.c Mon Sep 7 10:35:22 2020 (r365406) @@ -1175,19 +1175,29 @@ out: return err; } +static int mlx5_query_pddr(struct mlx5_core_dev *mdev, + u8 local_port, int page_select, u32 *out, int outlen) +{ + u32 in[MLX5_ST_SZ_DW(pddr_reg)] = {0}; + + if (!MLX5_CAP_PCAM_REG(mdev, pddr)) + return -EOPNOTSUPP; + + MLX5_SET(pddr_reg, in, local_port, local_port); + MLX5_SET(pddr_reg, in, page_select, page_select); + + return mlx5_core_access_reg(mdev, in, sizeof(in), out, outlen, MLX5_REG_PDDR, 0, 0); +} + int mlx5_query_pddr_range_info(struct mlx5_core_dev *mdev, u8 local_port, u8 *is_er_type) { u32 pddr_reg[MLX5_ST_SZ_DW(pddr_reg)] = {}; - int sz = MLX5_ST_SZ_BYTES(pddr_reg); int error; u8 ecc; u8 ci; - MLX5_SET(pddr_reg, pddr_reg, local_port, local_port); - MLX5_SET(pddr_reg, pddr_reg, page_select, 3 /* module info page */); - - error = mlx5_core_access_reg(mdev, pddr_reg, sz, pddr_reg, sz, - MLX5_ACCESS_REG_SUMMARY_CTRL_ID_PDDR, 0, 0); + error = mlx5_query_pddr(mdev, local_port, MLX5_PDDR_MODULE_INFO_PAGE, + pddr_reg, sizeof(pddr_reg)); if (error != 0) return (error); Modified: stable/12/sys/dev/mlx5/mlx5_ifc.h ============================================================================== --- stable/12/sys/dev/mlx5/mlx5_ifc.h Mon Sep 7 10:34:22 2020 (r365405) +++ stable/12/sys/dev/mlx5/mlx5_ifc.h Mon Sep 7 10:35:22 2020 (r365406) @@ -757,10 +757,6 @@ struct mlx5_ifc_flow_table_nic_cap_bits { u8 reserved_1[0x7200]; }; -enum { - MLX5_ACCESS_REG_SUMMARY_CTRL_ID_PDDR = 0x5031, -}; - struct mlx5_ifc_pddr_module_info_bits { u8 cable_technology[0x8]; u8 cable_breakout[0x8]; From owner-svn-src-all@freebsd.org Mon Sep 7 10:36:08 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C95FA3EE2C8; Mon, 7 Sep 2020 10:36:08 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BlPp04vF2z3gmy; Mon, 7 Sep 2020 10:36:08 +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 8B4161E198; Mon, 7 Sep 2020 10:36:08 +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 087Aa8tf086590; Mon, 7 Sep 2020 10:36:08 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 087Aa7rl086587; Mon, 7 Sep 2020 10:36:07 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202009071036.087Aa7rl086587@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 7 Sep 2020 10:36:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365407 - in stable/12/sys/dev/mlx5: mlx5_core mlx5_en X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in stable/12/sys/dev/mlx5: mlx5_core mlx5_en X-SVN-Commit-Revision: 365407 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.33 Precedence: list List-Id: "SVN commit messages 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, 07 Sep 2020 10:36:08 -0000 Author: kib Date: Mon Sep 7 10:36:07 2020 New Revision: 365407 URL: https://svnweb.freebsd.org/changeset/base/365407 Log: MFC r365001: mlx5en: Implement SIOCGIFDOWNREASON. Modified: stable/12/sys/dev/mlx5/mlx5_core/mlx5_core.h stable/12/sys/dev/mlx5/mlx5_core/mlx5_port.c stable/12/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/mlx5/mlx5_core/mlx5_core.h ============================================================================== --- stable/12/sys/dev/mlx5/mlx5_core/mlx5_core.h Mon Sep 7 10:35:22 2020 (r365406) +++ stable/12/sys/dev/mlx5/mlx5_core/mlx5_core.h Mon Sep 7 10:36:07 2020 (r365407) @@ -127,6 +127,9 @@ void mlx5_core_event(struct mlx5_core_dev *dev, enum m void mlx5_enter_error_state(struct mlx5_core_dev *dev, bool force); void mlx5_disable_device(struct mlx5_core_dev *dev); void mlx5_recover_device(struct mlx5_core_dev *dev); +int mlx5_query_pddr_troubleshooting_info(struct mlx5_core_dev *mdev, + u16 *monitor_opcode, + u8 *status_message, size_t sm_len); int mlx5_register_device(struct mlx5_core_dev *dev); void mlx5_unregister_device(struct mlx5_core_dev *dev); Modified: stable/12/sys/dev/mlx5/mlx5_core/mlx5_port.c ============================================================================== --- stable/12/sys/dev/mlx5/mlx5_core/mlx5_port.c Mon Sep 7 10:35:22 2020 (r365406) +++ stable/12/sys/dev/mlx5/mlx5_core/mlx5_port.c Mon Sep 7 10:36:07 2020 (r365407) @@ -1221,6 +1221,31 @@ int mlx5_query_pddr_range_info(struct mlx5_core_dev *m } EXPORT_SYMBOL_GPL(mlx5_query_pddr_range_info); +int mlx5_query_pddr_troubleshooting_info(struct mlx5_core_dev *mdev, + u16 *monitor_opcode, u8 *status_message, size_t sm_len) +{ + int outlen = MLX5_ST_SZ_BYTES(pddr_reg); + u32 out[MLX5_ST_SZ_DW(pddr_reg)] = {0}; + int err; + + err = mlx5_query_pddr(mdev, MLX5_PDDR_TROUBLESHOOTING_INFO_PAGE, 1, + out, outlen); + if (err != 0) + return err; + if (monitor_opcode != NULL) { + *monitor_opcode = MLX5_GET(pddr_reg, out, + page_data.troubleshooting_info_page.status_opcode. + monitor_opcodes); + } + if (status_message != NULL) { + strlcpy(status_message, + MLX5_ADDR_OF(pddr_reg, out, + page_data.troubleshooting_info_page.status_message), + sm_len); + } + return (0); +} + int mlx5_query_mfrl_reg(struct mlx5_core_dev *mdev, u8 *reset_level) { Modified: stable/12/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- stable/12/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Mon Sep 7 10:35:22 2020 (r365406) +++ stable/12/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Mon Sep 7 10:36:07 2020 (r365407) @@ -3195,6 +3195,7 @@ mlx5e_ioctl(struct ifnet *ifp, u_long command, caddr_t { struct mlx5e_priv *priv; struct ifreq *ifr; + struct ifdownreason *ifdr; struct ifi2creq i2c; int error = 0; int mask = 0; @@ -3456,6 +3457,16 @@ out: error = copyout(&i2c, ifr_data_get_ptr(ifr), sizeof(i2c)); err_i2c: PRIV_UNLOCK(priv); + break; + case SIOCGIFDOWNREASON: + ifdr = (struct ifdownreason *)data; + bzero(ifdr->ifdr_msg, sizeof(ifdr->ifdr_msg)); + PRIV_LOCK(priv); + error = -mlx5_query_pddr_troubleshooting_info(priv->mdev, NULL, + ifdr->ifdr_msg, sizeof(ifdr->ifdr_msg)); + PRIV_UNLOCK(priv); + if (error == 0) + ifdr->ifdr_reason = IFDR_REASON_MSG; break; default: From owner-svn-src-all@freebsd.org Mon Sep 7 10:36:53 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E4B393EE15F; Mon, 7 Sep 2020 10:36:53 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BlPps5kVnz3xwN; Mon, 7 Sep 2020 10:36:53 +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 A82491E30B; Mon, 7 Sep 2020 10:36:53 +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 087AarqN086677; Mon, 7 Sep 2020 10:36:53 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 087AarZd086676; Mon, 7 Sep 2020 10:36:53 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202009071036.087AarZd086676@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 7 Sep 2020 10:36:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365408 - stable/12/sys/dev/mlx5/mlx5_core X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/sys/dev/mlx5/mlx5_core X-SVN-Commit-Revision: 365408 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.33 Precedence: list List-Id: "SVN commit messages 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, 07 Sep 2020 10:36:54 -0000 Author: kib Date: Mon Sep 7 10:36:53 2020 New Revision: 365408 URL: https://svnweb.freebsd.org/changeset/base/365408 Log: MFC r365002: mlx5 sriov: add error message for failed MAC programming on VF. Modified: stable/12/sys/dev/mlx5/mlx5_core/mlx5_main.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/mlx5/mlx5_core/mlx5_main.c ============================================================================== --- stable/12/sys/dev/mlx5/mlx5_core/mlx5_main.c Mon Sep 7 10:36:07 2020 (r365407) +++ stable/12/sys/dev/mlx5/mlx5_core/mlx5_main.c Mon Sep 7 10:36:53 2020 (r365408) @@ -1838,6 +1838,11 @@ mlx5_iov_add_vf(device_t dev, uint16_t vfnum, const nv &mac_size); error = -mlx5_eswitch_set_vport_mac(priv->eswitch, vfnum + 1, __DECONST(u8 *, mac)); + if (error != 0) { + mlx5_core_err(core_dev, + "setting MAC for VF %d failed, error %d\n", + vfnum + 1, error); + } } error = -mlx5_eswitch_set_vport_state(priv->eswitch, vfnum + 1, From owner-svn-src-all@freebsd.org Mon Sep 7 10:37:45 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2EBA03EE59E; Mon, 7 Sep 2020 10:37:45 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BlPqs0RJxz3gtM; Mon, 7 Sep 2020 10:37:45 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E66981E407; Mon, 7 Sep 2020 10:37:44 +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 087AbiSP086768; Mon, 7 Sep 2020 10:37:44 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 087Abih6086767; Mon, 7 Sep 2020 10:37:44 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202009071037.087Abih6086767@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 7 Sep 2020 10:37:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365409 - stable/12/sys/dev/mlx5/mlx5_core X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/sys/dev/mlx5/mlx5_core X-SVN-Commit-Revision: 365409 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.33 Precedence: list List-Id: "SVN commit messages 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, 07 Sep 2020 10:37:45 -0000 Author: kib Date: Mon Sep 7 10:37:44 2020 New Revision: 365409 URL: https://svnweb.freebsd.org/changeset/base/365409 Log: MFC r365003: mlx5 sriov: Add controls for VFs to set port/node GUIDs. Modified: stable/12/sys/dev/mlx5/mlx5_core/mlx5_main.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/mlx5/mlx5_core/mlx5_main.c ============================================================================== --- stable/12/sys/dev/mlx5/mlx5_core/mlx5_main.c Mon Sep 7 10:36:53 2020 (r365408) +++ stable/12/sys/dev/mlx5/mlx5_core/mlx5_main.c Mon Sep 7 10:37:44 2020 (r365409) @@ -179,6 +179,8 @@ static struct mlx5_profile profiles[] = { #ifdef PCI_IOV static const char iov_mac_addr_name[] = "mac-addr"; +static const char iov_node_guid_name[] = "node-guid"; +static const char iov_port_guid_name[] = "port-guid"; #endif static int set_dma_caps(struct pci_dev *pdev) @@ -1623,6 +1625,10 @@ static int init_one(struct pci_dev *pdev, vf_schema = pci_iov_schema_alloc_node(); pci_iov_schema_add_unicast_mac(vf_schema, iov_mac_addr_name, 0, NULL); + pci_iov_schema_add_uint64(vf_schema, iov_node_guid_name, + 0, 0); + pci_iov_schema_add_uint64(vf_schema, iov_port_guid_name, + 0, 0); err = pci_iov_attach(bsddev, pf_schema, vf_schema); if (err != 0) { device_printf(bsddev, @@ -1824,6 +1830,7 @@ mlx5_iov_add_vf(device_t dev, uint16_t vfnum, const nv struct mlx5_priv *priv; const void *mac; size_t mac_size; + uint64_t node_guid, port_guid; int error; pdev = device_get_softc(dev); @@ -1841,6 +1848,28 @@ mlx5_iov_add_vf(device_t dev, uint16_t vfnum, const nv if (error != 0) { mlx5_core_err(core_dev, "setting MAC for VF %d failed, error %d\n", + vfnum + 1, error); + } + } + + if (nvlist_exists_number(vf_config, iov_node_guid_name)) { + node_guid = nvlist_get_number(vf_config, iov_node_guid_name); + error = -mlx5_modify_nic_vport_node_guid(core_dev, vfnum + 1, + node_guid); + if (error != 0) { + mlx5_core_err(core_dev, + "modifying node GUID for VF %d failed, error %d\n", + vfnum + 1, error); + } + } + + if (nvlist_exists_number(vf_config, iov_port_guid_name)) { + port_guid = nvlist_get_number(vf_config, iov_port_guid_name); + error = -mlx5_modify_nic_vport_port_guid(core_dev, vfnum + 1, + port_guid); + if (error != 0) { + mlx5_core_err(core_dev, + "modifying port GUID for VF %d failed, error %d\n", vfnum + 1, error); } } From owner-svn-src-all@freebsd.org Mon Sep 7 10:49:43 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8C5293EE887; Mon, 7 Sep 2020 10:49:43 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BlQ5g3BLSz3y1y; Mon, 7 Sep 2020 10:49:43 +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 50D9E1DFEB; Mon, 7 Sep 2020 10:49:43 +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 087Anhvd092720; Mon, 7 Sep 2020 10:49:43 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 087AngTP092718; Mon, 7 Sep 2020 10:49:42 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202009071049.087AngTP092718@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 7 Sep 2020 10:49:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r365410 - in stable/11/sys/dev/mlx5: . mlx5_core X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in stable/11/sys/dev/mlx5: . mlx5_core X-SVN-Commit-Revision: 365410 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.33 Precedence: list List-Id: "SVN commit messages 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, 07 Sep 2020 10:49:43 -0000 Author: kib Date: Mon Sep 7 10:49:42 2020 New Revision: 365410 URL: https://svnweb.freebsd.org/changeset/base/365410 Log: MFC r364999: mlx5_core: Import PDDR register definitions Modified: stable/11/sys/dev/mlx5/driver.h stable/11/sys/dev/mlx5/mlx5_core/mlx5_core.h stable/11/sys/dev/mlx5/mlx5_ifc.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/mlx5/driver.h ============================================================================== --- stable/11/sys/dev/mlx5/driver.h Mon Sep 7 10:37:44 2020 (r365409) +++ stable/11/sys/dev/mlx5/driver.h Mon Sep 7 10:49:42 2020 (r365410) @@ -143,6 +143,7 @@ enum { MLX5_REG_PMPE = 0x5010, MLX5_REG_PMAOS = 0x5012, MLX5_REG_PPLM = 0x5023, + MLX5_REG_PDDR = 0x5031, MLX5_REG_PBSR = 0x5038, MLX5_REG_PCAM = 0x507f, MLX5_REG_NODE_DESC = 0x6001, Modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_core.h ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_core/mlx5_core.h Mon Sep 7 10:37:44 2020 (r365409) +++ stable/11/sys/dev/mlx5/mlx5_core/mlx5_core.h Mon Sep 7 10:49:42 2020 (r365410) @@ -79,6 +79,35 @@ enum mlx5_semaphore_space_address { struct mlx5_core_dev; +enum mlx5_pddr_page_select { + MLX5_PDDR_OPERATIONAL_INFO_PAGE = 0x0, + MLX5_PDDR_TROUBLESHOOTING_INFO_PAGE = 0x1, + MLX5_PDDR_MODULE_INFO_PAGE = 0x3, +}; + +enum mlx5_pddr_monitor_opcodes { + MLX5_LINK_NO_ISSUE_OBSERVED = 0x0, + MLX5_LINK_PORT_CLOSED = 0x1, + MLX5_LINK_AN_FAILURE = 0x2, + MLX5_LINK_TRAINING_FAILURE = 0x5, + MLX5_LINK_LOGICAL_MISMATCH = 0x9, + MLX5_LINK_REMOTE_FAULT_INDICATION = 0xe, + MLX5_LINK_BAD_SIGNAL_INTEGRITY = 0xf, + MLX5_LINK_CABLE_COMPLIANCE_CODE_MISMATCH = 0x10, + MLX5_LINK_INTERNAL_ERR = 0x17, + MLX5_LINK_INFO_NOT_AVAIL = 0x3ff, + MLX5_LINK_CABLE_UNPLUGGED = 0x400, + MLX5_LINK_LONG_RANGE_FOR_NON_MLX_CABLE = 0x401, + MLX5_LINK_BUS_STUCK = 0x402, + MLX5_LINK_UNSUPP_EEPROM = 0x403, + MLX5_LINK_PART_NUM_LIST = 0x404, + MLX5_LINK_UNSUPP_CABLE = 0x405, + MLX5_LINK_MODULE_TEMP_SHUTDOWN = 0x406, + MLX5_LINK_SHORTED_CABLE = 0x407, + MLX5_LINK_POWER_BUDGET_EXCEEDED = 0x408, + MLX5_LINK_MNG_FORCED_DOWN = 0x409, +}; + int mlx5_query_hca_caps(struct mlx5_core_dev *dev); int mlx5_query_board_id(struct mlx5_core_dev *dev); int mlx5_query_qcam_reg(struct mlx5_core_dev *mdev, u32 *qcam, Modified: stable/11/sys/dev/mlx5/mlx5_ifc.h ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_ifc.h Mon Sep 7 10:37:44 2020 (r365409) +++ stable/11/sys/dev/mlx5/mlx5_ifc.h Mon Sep 7 10:49:42 2020 (r365410) @@ -848,23 +848,6 @@ struct mlx5_ifc_pddr_module_info_bits { u8 reserved_at_4c0[0x300]; }; -union mlx5_ifc_pddr_operation_info_page_pddr_phy_info_page_pddr_troubleshooting_page_pddr_module_info_auto_bits { - struct mlx5_ifc_pddr_module_info_bits pddr_module_info; - u8 reserved_at_0[0x7c0]; -}; - -struct mlx5_ifc_pddr_reg_bits { - u8 reserved_at_0[0x8]; - u8 local_port[0x8]; - u8 pnat[0x2]; - u8 reserved_at_12[0xe]; - - u8 reserved_at_20[0x18]; - u8 page_select[0x8]; - - union mlx5_ifc_pddr_operation_info_page_pddr_phy_info_page_pddr_troubleshooting_page_pddr_module_info_auto_bits page_data; -}; - struct mlx5_ifc_per_protocol_networking_offload_caps_bits { u8 csum_cap[0x1]; u8 vlan_cap[0x1]; @@ -8630,7 +8613,10 @@ struct mlx5_ifc_pcam_regs_5000_to_507f_bits { u8 port_access_reg_cap_mask_127_to_96[0x20]; u8 port_access_reg_cap_mask_95_to_64[0x20]; - u8 port_access_reg_cap_mask_63_to_36[0x1c]; + u8 reserved_at_40[0xe]; + u8 pddr[0x1]; + u8 reserved_at_4f[0xd]; + u8 pplm[0x1]; u8 port_access_reg_cap_mask_34_to_32[0x3]; @@ -10182,6 +10168,46 @@ struct mlx5_ifc_mpcnt_reg_ext_bits { u8 reserved_at_21[0x1f]; union mlx5_ifc_mpcnt_reg_counter_set_auto_ext_bits counter_set; +}; + +struct mlx5_ifc_monitor_opcodes_layout_bits { + u8 reserved_at_0[0x10]; + u8 monitor_opcode[0x10]; +}; + +union mlx5_ifc_pddr_status_opcode_bits { + struct mlx5_ifc_monitor_opcodes_layout_bits monitor_opcodes; + u8 reserved_at_0[0x20]; +}; + +struct mlx5_ifc_troubleshooting_info_page_layout_bits { + u8 reserved_at_0[0x10]; + u8 group_opcode[0x10]; + + union mlx5_ifc_pddr_status_opcode_bits status_opcode; + + u8 user_feedback_data[0x10]; + u8 user_feedback_index[0x10]; + + u8 status_message[0x760]; +}; + +union mlx5_ifc_pddr_page_data_bits { + struct mlx5_ifc_troubleshooting_info_page_layout_bits troubleshooting_info_page; + struct mlx5_ifc_pddr_module_info_bits pddr_module_info; + u8 reserved_at_0[0x7c0]; +}; + +struct mlx5_ifc_pddr_reg_bits { + u8 reserved_at_0[0x8]; + u8 local_port[0x8]; + u8 pnat[0x2]; + u8 reserved_at_12[0xe]; + + u8 reserved_at_20[0x18]; + u8 page_select[0x8]; + + union mlx5_ifc_pddr_page_data_bits page_data; }; enum { From owner-svn-src-all@freebsd.org Mon Sep 7 10:50:18 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E6A463EE83C; Mon, 7 Sep 2020 10:50:18 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BlQ6L5rj1z3yMc; Mon, 7 Sep 2020 10:50:18 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 91FDD1DFEC; Mon, 7 Sep 2020 10:50:18 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 087AoI2R092841; Mon, 7 Sep 2020 10:50:18 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 087AoI0A092839; Mon, 7 Sep 2020 10:50:18 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202009071050.087AoI0A092839@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 7 Sep 2020 10:50: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: r365411 - in stable/11/sys/dev/mlx5: . mlx5_core X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in stable/11/sys/dev/mlx5: . mlx5_core X-SVN-Commit-Revision: 365411 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.33 Precedence: list List-Id: "SVN commit messages 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, 07 Sep 2020 10:50:19 -0000 Author: kib Date: Mon Sep 7 10:50:17 2020 New Revision: 365411 URL: https://svnweb.freebsd.org/changeset/base/365411 Log: MFC r365000: mlx5_core: add mlx5_query_pddr(). Modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_port.c stable/11/sys/dev/mlx5/mlx5_ifc.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_port.c ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_core/mlx5_port.c Mon Sep 7 10:49:42 2020 (r365410) +++ stable/11/sys/dev/mlx5/mlx5_core/mlx5_port.c Mon Sep 7 10:50:17 2020 (r365411) @@ -1175,19 +1175,29 @@ out: return err; } +static int mlx5_query_pddr(struct mlx5_core_dev *mdev, + u8 local_port, int page_select, u32 *out, int outlen) +{ + u32 in[MLX5_ST_SZ_DW(pddr_reg)] = {0}; + + if (!MLX5_CAP_PCAM_REG(mdev, pddr)) + return -EOPNOTSUPP; + + MLX5_SET(pddr_reg, in, local_port, local_port); + MLX5_SET(pddr_reg, in, page_select, page_select); + + return mlx5_core_access_reg(mdev, in, sizeof(in), out, outlen, MLX5_REG_PDDR, 0, 0); +} + int mlx5_query_pddr_range_info(struct mlx5_core_dev *mdev, u8 local_port, u8 *is_er_type) { u32 pddr_reg[MLX5_ST_SZ_DW(pddr_reg)] = {}; - int sz = MLX5_ST_SZ_BYTES(pddr_reg); int error; u8 ecc; u8 ci; - MLX5_SET(pddr_reg, pddr_reg, local_port, local_port); - MLX5_SET(pddr_reg, pddr_reg, page_select, 3 /* module info page */); - - error = mlx5_core_access_reg(mdev, pddr_reg, sz, pddr_reg, sz, - MLX5_ACCESS_REG_SUMMARY_CTRL_ID_PDDR, 0, 0); + error = mlx5_query_pddr(mdev, local_port, MLX5_PDDR_MODULE_INFO_PAGE, + pddr_reg, sizeof(pddr_reg)); if (error != 0) return (error); Modified: stable/11/sys/dev/mlx5/mlx5_ifc.h ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_ifc.h Mon Sep 7 10:49:42 2020 (r365410) +++ stable/11/sys/dev/mlx5/mlx5_ifc.h Mon Sep 7 10:50:17 2020 (r365411) @@ -756,10 +756,6 @@ struct mlx5_ifc_flow_table_nic_cap_bits { u8 reserved_1[0x7200]; }; -enum { - MLX5_ACCESS_REG_SUMMARY_CTRL_ID_PDDR = 0x5031, -}; - struct mlx5_ifc_pddr_module_info_bits { u8 cable_technology[0x8]; u8 cable_breakout[0x8]; From owner-svn-src-all@freebsd.org Mon Sep 7 10:50:48 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 96E313EE855; Mon, 7 Sep 2020 10:50:48 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BlQ6w3RkNz3ydT; Mon, 7 Sep 2020 10:50:48 +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 5AEF71E32C; Mon, 7 Sep 2020 10:50:48 +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 087AomkX092919; Mon, 7 Sep 2020 10:50:48 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 087Aol68092914; Mon, 7 Sep 2020 10:50:47 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202009071050.087Aol68092914@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 7 Sep 2020 10:50:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r365412 - in stable/11/sys/dev/mlx5: mlx5_core mlx5_en X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in stable/11/sys/dev/mlx5: mlx5_core mlx5_en X-SVN-Commit-Revision: 365412 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.33 Precedence: list List-Id: "SVN commit messages 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, 07 Sep 2020 10:50:48 -0000 Author: kib Date: Mon Sep 7 10:50:47 2020 New Revision: 365412 URL: https://svnweb.freebsd.org/changeset/base/365412 Log: MFC r365001: mlx5en: Implement SIOCGIFDOWNREASON. Modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_core.h stable/11/sys/dev/mlx5/mlx5_core/mlx5_port.c stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_core.h ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_core/mlx5_core.h Mon Sep 7 10:50:17 2020 (r365411) +++ stable/11/sys/dev/mlx5/mlx5_core/mlx5_core.h Mon Sep 7 10:50:47 2020 (r365412) @@ -127,6 +127,9 @@ void mlx5_core_event(struct mlx5_core_dev *dev, enum m void mlx5_enter_error_state(struct mlx5_core_dev *dev, bool force); void mlx5_disable_device(struct mlx5_core_dev *dev); void mlx5_recover_device(struct mlx5_core_dev *dev); +int mlx5_query_pddr_troubleshooting_info(struct mlx5_core_dev *mdev, + u16 *monitor_opcode, + u8 *status_message, size_t sm_len); int mlx5_register_device(struct mlx5_core_dev *dev); void mlx5_unregister_device(struct mlx5_core_dev *dev); Modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_port.c ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_core/mlx5_port.c Mon Sep 7 10:50:17 2020 (r365411) +++ stable/11/sys/dev/mlx5/mlx5_core/mlx5_port.c Mon Sep 7 10:50:47 2020 (r365412) @@ -1221,6 +1221,31 @@ int mlx5_query_pddr_range_info(struct mlx5_core_dev *m } EXPORT_SYMBOL_GPL(mlx5_query_pddr_range_info); +int mlx5_query_pddr_troubleshooting_info(struct mlx5_core_dev *mdev, + u16 *monitor_opcode, u8 *status_message, size_t sm_len) +{ + int outlen = MLX5_ST_SZ_BYTES(pddr_reg); + u32 out[MLX5_ST_SZ_DW(pddr_reg)] = {0}; + int err; + + err = mlx5_query_pddr(mdev, MLX5_PDDR_TROUBLESHOOTING_INFO_PAGE, 1, + out, outlen); + if (err != 0) + return err; + if (monitor_opcode != NULL) { + *monitor_opcode = MLX5_GET(pddr_reg, out, + page_data.troubleshooting_info_page.status_opcode. + monitor_opcodes); + } + if (status_message != NULL) { + strlcpy(status_message, + MLX5_ADDR_OF(pddr_reg, out, + page_data.troubleshooting_info_page.status_message), + sm_len); + } + return (0); +} + int mlx5_query_mfrl_reg(struct mlx5_core_dev *mdev, u8 *reset_level) { Modified: stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Mon Sep 7 10:50:17 2020 (r365411) +++ stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Mon Sep 7 10:50:47 2020 (r365412) @@ -3077,6 +3077,7 @@ mlx5e_ioctl(struct ifnet *ifp, u_long command, caddr_t { struct mlx5e_priv *priv; struct ifreq *ifr; + struct ifdownreason *ifdr; struct ifi2creq i2c; int error = 0; int mask = 0; @@ -3328,6 +3329,16 @@ out: error = copyout(&i2c, ifr_data_get_ptr(ifr), sizeof(i2c)); err_i2c: PRIV_UNLOCK(priv); + break; + case SIOCGIFDOWNREASON: + ifdr = (struct ifdownreason *)data; + bzero(ifdr->ifdr_msg, sizeof(ifdr->ifdr_msg)); + PRIV_LOCK(priv); + error = -mlx5_query_pddr_troubleshooting_info(priv->mdev, NULL, + ifdr->ifdr_msg, sizeof(ifdr->ifdr_msg)); + PRIV_UNLOCK(priv); + if (error == 0) + ifdr->ifdr_reason = IFDR_REASON_MSG; break; default: From owner-svn-src-all@freebsd.org Mon Sep 7 10:51:19 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DE7CD3EEB8E; Mon, 7 Sep 2020 10:51:19 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BlQ7W5X3fz3ybk; Mon, 7 Sep 2020 10:51:19 +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 A28FE1DFFC; Mon, 7 Sep 2020 10:51:19 +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 087ApJm6096050; Mon, 7 Sep 2020 10:51:19 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 087ApJAN096049; Mon, 7 Sep 2020 10:51:19 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202009071051.087ApJAN096049@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 7 Sep 2020 10:51:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r365413 - stable/11/sys/dev/mlx5/mlx5_core X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/sys/dev/mlx5/mlx5_core X-SVN-Commit-Revision: 365413 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.33 Precedence: list List-Id: "SVN commit messages 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, 07 Sep 2020 10:51:19 -0000 Author: kib Date: Mon Sep 7 10:51:19 2020 New Revision: 365413 URL: https://svnweb.freebsd.org/changeset/base/365413 Log: MFC r365002: mlx5 sriov: add error message for failed MAC programming on VF. Modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_main.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_main.c ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_core/mlx5_main.c Mon Sep 7 10:50:47 2020 (r365412) +++ stable/11/sys/dev/mlx5/mlx5_core/mlx5_main.c Mon Sep 7 10:51:19 2020 (r365413) @@ -1820,6 +1820,11 @@ mlx5_iov_add_vf(device_t dev, uint16_t vfnum, const nv &mac_size); error = -mlx5_eswitch_set_vport_mac(priv->eswitch, vfnum + 1, __DECONST(u8 *, mac)); + if (error != 0) { + mlx5_core_err(core_dev, + "setting MAC for VF %d failed, error %d\n", + vfnum + 1, error); + } } error = -mlx5_eswitch_set_vport_state(priv->eswitch, vfnum + 1, From owner-svn-src-all@freebsd.org Mon Sep 7 10:51:49 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9C0883EEC10; Mon, 7 Sep 2020 10:51:49 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BlQ853jvrz3yyL; Mon, 7 Sep 2020 10:51:49 +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 6343E1DDEE; Mon, 7 Sep 2020 10:51:49 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 087ApnTo097374; Mon, 7 Sep 2020 10:51:49 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 087Apn2v097361; Mon, 7 Sep 2020 10:51:49 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202009071051.087Apn2v097361@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 7 Sep 2020 10:51:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r365414 - stable/11/sys/dev/mlx5/mlx5_core X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/sys/dev/mlx5/mlx5_core X-SVN-Commit-Revision: 365414 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.33 Precedence: list List-Id: "SVN commit messages 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, 07 Sep 2020 10:51:49 -0000 Author: kib Date: Mon Sep 7 10:51:48 2020 New Revision: 365414 URL: https://svnweb.freebsd.org/changeset/base/365414 Log: MFC r365003: mlx5 sriov: Add controls for VFs to set port/node GUIDs. Modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_main.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_main.c ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_core/mlx5_main.c Mon Sep 7 10:51:19 2020 (r365413) +++ stable/11/sys/dev/mlx5/mlx5_core/mlx5_main.c Mon Sep 7 10:51:48 2020 (r365414) @@ -179,6 +179,8 @@ static struct mlx5_profile profiles[] = { #ifdef PCI_IOV static const char iov_mac_addr_name[] = "mac-addr"; +static const char iov_node_guid_name[] = "node-guid"; +static const char iov_port_guid_name[] = "port-guid"; #endif static int set_dma_caps(struct pci_dev *pdev) @@ -1605,6 +1607,10 @@ static int init_one(struct pci_dev *pdev, vf_schema = pci_iov_schema_alloc_node(); pci_iov_schema_add_unicast_mac(vf_schema, iov_mac_addr_name, 0, NULL); + pci_iov_schema_add_uint64(vf_schema, iov_node_guid_name, + 0, 0); + pci_iov_schema_add_uint64(vf_schema, iov_port_guid_name, + 0, 0); err = pci_iov_attach(bsddev, pf_schema, vf_schema); if (err != 0) { device_printf(bsddev, @@ -1806,6 +1812,7 @@ mlx5_iov_add_vf(device_t dev, uint16_t vfnum, const nv struct mlx5_priv *priv; const void *mac; size_t mac_size; + uint64_t node_guid, port_guid; int error; pdev = device_get_softc(dev); @@ -1823,6 +1830,28 @@ mlx5_iov_add_vf(device_t dev, uint16_t vfnum, const nv if (error != 0) { mlx5_core_err(core_dev, "setting MAC for VF %d failed, error %d\n", + vfnum + 1, error); + } + } + + if (nvlist_exists_number(vf_config, iov_node_guid_name)) { + node_guid = nvlist_get_number(vf_config, iov_node_guid_name); + error = -mlx5_modify_nic_vport_node_guid(core_dev, vfnum + 1, + node_guid); + if (error != 0) { + mlx5_core_err(core_dev, + "modifying node GUID for VF %d failed, error %d\n", + vfnum + 1, error); + } + } + + if (nvlist_exists_number(vf_config, iov_port_guid_name)) { + port_guid = nvlist_get_number(vf_config, iov_port_guid_name); + error = -mlx5_modify_nic_vport_port_guid(core_dev, vfnum + 1, + port_guid); + if (error != 0) { + mlx5_core_err(core_dev, + "modifying port GUID for VF %d failed, error %d\n", vfnum + 1, error); } } From owner-svn-src-all@freebsd.org Mon Sep 7 12:46:10 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8B9393C910C for ; Mon, 7 Sep 2020 12:46:10 +0000 (UTC) (envelope-from Amanda.Carvell@worldleadsourcing.com) Received: from IND01-BO1-obe.outbound.protection.outlook.com (mail-eopbgr1390112.outbound.protection.outlook.com [40.107.139.112]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "GlobalSign Organization Validation CA - SHA256 - G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BlSh12hrxz44Dj for ; Mon, 7 Sep 2020 12:46:08 +0000 (UTC) (envelope-from Amanda.Carvell@worldleadsourcing.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lDYyIaNKftnLEdr4qIlYznpGqB58mtNBQ/jt52xfBmwffCHEluoQXovF08//xlYujRDZhfF2HMcKltG3GxBJF4yn8JYcCRyzCY9b06nrNFPjZh7GO4ujB6+UoaUr5nmKOTBJDI0G7ttaRiyrhiSyjpOh9vty12FRnRg1bmb1QcsDY3ZdM78stNhKSmArNzz/mEkqQVIK3msKbo+8MJMMk2gAC0IavySb/VWiNIZglP3pbbkOK3hCz1BS1oAY2fBmkiOKMpcPdklRAlzUucS0T1twBbivV8/4wAtPpUr7TxeJ+Pmts8nMEOjZ5MHz9kqw/C3P1jR/z7S0ru3eg2uSZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=53mLBGdv/7xBy3J0gItUnNGRZOZ4C+VQq6kIl0bqLQ8=; b=fChouqvv0jC0NOydSxPcWRRYULbk0pdSjtMZmL7PqMnG8RSiW/VWGOVGQ0Y4kLv1hUXvAuwib637O35PjUwVpSI5vlqQ2/AWzOWhohVEc4wXHAYm1EYw2IbrQvpbHxdjtVbHVTJVHpvxzfdsA+WDujSkn+tMG9/zzLLuDmzZcqvzGR/3+wjMB9BuAy1BJqAXPGnbU/ZfWvUkUbX6rD/wNXcqHRQ0bMT6/mGLCO1T8vyVRf5aq4zUvPovWHd8G0jwW25VEhhERrYNbN8BcfCLlvV4Dp1voNYJd6R9SpLNA7qvcch4Kcm7ein3OFgWqcYLeOWAVSNzCGBYu53Y0Zmfbg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=worldleadsourcing.com; dmarc=pass action=none header.from=worldleadsourcing.com; dkim=pass header.d=worldleadsourcing.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=worldsourcing.onmicrosoft.com; s=selector1-worldsourcing-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=53mLBGdv/7xBy3J0gItUnNGRZOZ4C+VQq6kIl0bqLQ8=; b=owiCMsizbC62TUcypS3RqsD45dE5WxQohxa/oCHYUFwsW+0Y5jZlv+8A5bggUk7OoUv2a7vw1YK4wyVOBhs5XtGDAiXC1GgASC1xAeakJphLU5Vcg1MPCGqkBWhGK6H+NuFsdpApHbx4m7TToAas/jYP1hSkrnlNiqSDryFhB5I= Received: from MAXPR01MB3104.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:4c::16) by MAXPR0101MB1931.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:16::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3348.17; Mon, 7 Sep 2020 12:46:05 +0000 Received: from MAXPR01MB3104.INDPRD01.PROD.OUTLOOK.COM ([fe80::51dc:960c:bd93:4364]) by MAXPR01MB3104.INDPRD01.PROD.OUTLOOK.COM ([fe80::51dc:960c:bd93:4364%7]) with mapi id 15.20.3348.019; Mon, 7 Sep 2020 12:46:05 +0000 From: "Amanda Carvell" To: References: <01a701d677d3$3b594800$b20bd800$@worldleadsourcing.com> In-Reply-To: <01a701d677d3$3b594800$b20bd800$@worldleadsourcing.com> Subject: RE: OPT-IN Clothing Manufacturing Industry List Date: Mon, 7 Sep 2020 05:46:01 -0700 Message-ID: <0a5f01d68514$dad01b40$907051c0$@worldleadsourcing.com> X-Mailer: Microsoft Outlook 16.0 Content-Language: en-in Thread-Index: AQG0jncXnXZZgbkQhTC64DiFzIOuDKmhDLMg X-ClientProxiedBy: MAXPR0101CA0035.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:d::21) To MAXPR01MB3104.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:4c::16) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from DESKTOPQETD2CO (116.75.100.201) by MAXPR0101CA0035.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:d::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3348.15 via Frontend Transport; Mon, 7 Sep 2020 12:46:04 +0000 X-Mailer: Microsoft Outlook 16.0 X-Originating-IP: [116.75.100.201] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5930202f-aa72-4c8e-3895-08d8532bfc0c X-MS-TrafficTypeDiagnostic: MAXPR0101MB1931: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:9508; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: XMKbITEbruwEm9TYsTA9lnmNWcsuKJo399XWUmNHhP0SY98TujjPDQeYr9Be/Iv9Ubz6LslH6DQ8LK731jdWqgiZVZnAgI/8koCc8DcF0wpYYFhxetYtwH3nPdRSM6jFXG6YPy4fvEkpXKeRIrlPp5KMajGecgjEo7jGVEyp5AXfLQGBpdeNDCDLYTVbxOLm4h4L1407Bga0aiXGtfDUQ6+JJrCfpH/YWGh6GRJ82lBVWw0YaEYx2N5VATMd9PfZRMreImRicQ+PRa+j6jGz7+lklyxGFab5qoDmHCTA8vOptoBm3DWpwn+wIbsbsMuHnvXIwJVhTo0Mly4IlVunkeR81BNO0SYiLtoyoNP1INtU5Q4+39yOY7UwyL7WmnBg X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MAXPR01MB3104.INDPRD01.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFS:(346002)(136003)(376002)(396003)(39840400004)(366004)(53546011)(6496006)(52116002)(6666004)(478600001)(1420700001)(9326002)(2906002)(36756003)(8936002)(8676002)(2616005)(55236004)(16526019)(66946007)(186003)(6916009)(66556008)(66476007)(44736005)(956004)(26005)(316002)(86362001)(5660300002)(6486002)(554374003); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: ov4wZy04GOI47f8GMUyT1ggjR419oXIrWfS00n5V8ml/ygw93P8DqYlBm+F/NEXD+q9LyM+6jyNca6DN4NDPbHY4YksZdMAoomgmPXTQddB8K5hxVrjpANibHrX9fIMm0H7k9XE3DNLI+0VyetphlJzDw6GbcCXyTR0QQUA4Z3eNG97vbD9fLlqdKF7JSpsCGBwmCDi7EtfQb8FVdEJossweoyQ/1cHnzxemLfECSSCBW0bFOkd2UTWLEsSZ8CELgmcCphr1pzWPYXQA9JR/o+URatV62GhBQu3DpUuXwwkt9vZu7dU/Np1UTZJcZsbDZGXqIzzFVWOWJQY/d3YLgydR2Cgb2QQVIe9YEakbda987OiX1+QlXCN3ESogNBsKg0FVVAFkjmrv9rrqFazztO1pZ308EpiJRHQud01ttYCBDDv3kvrXik5AjtUBhnWdT4TVSm7azZh3QDvFFlAV9pN0vBVss9JwFSGrD5T75GIpNlG8cnVY0/5jWV+/SO2vQFnV1S1St2G0fUysYXY78TZEvPkVb2GJA/gY/LRmC6rUTB7EN5BRn8L+DMnktdz6fWQm8wp4bXfkFdMs3lzviEBOofNR0/IvjanMEDBWGKurNntIdqkYgfNh+P4jntGBMw03gsLPuLMI3DK+w6rlQg== X-OriginatorOrg: worldleadsourcing.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5930202f-aa72-4c8e-3895-08d8532bfc0c X-MS-Exchange-CrossTenant-AuthSource: MAXPR01MB3104.INDPRD01.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Sep 2020 12:46:05.2582 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: d835f0bb-2e82-4414-ad22-6718e1280542 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: ORAxjTM64ggT8BTi+jmr4EkjYA5rjj5dZ0R6vWikuITJfaRvIWYE9L28dnUePa4ErU5XYsj2kJk3kPL8BO7UYWSoBug+JLQUSI5/HG2XdMckqrUj1mepsKkDBkoCEacC X-MS-Exchange-Transport-CrossTenantHeadersStamped: MAXPR0101MB1931 X-Rspamd-Queue-Id: 4BlSh12hrxz44Dj X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=worldsourcing.onmicrosoft.com header.s=selector1-worldsourcing-onmicrosoft-com header.b=owiCMsiz; dmarc=none; spf=pass (mx1.freebsd.org: domain of Amanda.Carvell@worldleadsourcing.com designates 40.107.139.112 as permitted sender) smtp.mailfrom=Amanda.Carvell@worldleadsourcing.com X-Spamd-Result: default: False [-3.90 / 15.00]; NEURAL_HAM_MEDIUM(-0.97)[-0.974]; R_DKIM_ALLOW(-0.20)[worldsourcing.onmicrosoft.com:s=selector1-worldsourcing-onmicrosoft-com]; HAS_XOIP(0.00)[]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:40.107.0.0/16]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; TO_DN_NONE(0.00)[]; DMARC_NA(0.00)[worldleadsourcing.com]; ARC_ALLOW(-1.00)[microsoft.com:s=arcselector9901:i=1]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_LONG(-0.99)[-0.988]; RCVD_COUNT_THREE(0.00)[4]; DKIM_TRACE(0.00)[worldsourcing.onmicrosoft.com:+]; NEURAL_HAM_SHORT(-0.44)[-0.442]; RCVD_IN_DNSWL_NONE(0.00)[40.107.139.112:from]; RECEIVED_SPAMHAUS_PBL(0.00)[116.75.100.201:received]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:8075, ipnet:40.104.0.0/14, country:US]; MID_RHS_MATCH_FROM(0.00)[]; MAILMAN_DEST(0.00)[svn-src-all]; RWL_MAILSPIKE_POSSIBLE(0.00)[40.107.139.112:from] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.33 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 07 Sep 2020 12:46:10 -0000 Hi, I am just doing a follow up with my previous email to check whether you are interested in our Contacts List. Shall I get back to you with counts and pricing available.? Thank you and I look forward to hearing from you. Thanks and Regards, Amanda Carvell From: Amanda Carvell [mailto:amanda.carvell@worldleadsourcing.com] Sent: 21 August 2020 08:54 To: svn-src-all@freebsd.org Subject: OPT-IN Clothing Manufacturing Industry List Hi, Hope all is well. Would you be interested in acquiring the Clothing Manufacturing Professionals Contact List? We also have database of PPE suit, Biomedical/Life Sciences, Hotels/Restaurant/Hospital, Military, Defense, Institutions, Distributors, Factories, Aircraft, and many more. Fields of Information: Organization Name, Contact Name, Title, Phone Number, Website Address, Mailing Address, Industry, SIC Code, Opt-In Email Address. Let me know your interest to send you the number of contacts and cost . Best Regards, Amanda Carvell Marketing Executive If you do not wish to receive future emails from us, please reply as 'No Requirements' . From owner-svn-src-all@freebsd.org Mon Sep 7 13:44:55 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B14283CA4A4; Mon, 7 Sep 2020 13:44:55 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BlTzq4DBmz46S8; Mon, 7 Sep 2020 13:44:55 +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 7037220682; Mon, 7 Sep 2020 13:44:55 +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 087Ditb8002568; Mon, 7 Sep 2020 13:44:55 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 087Dits5002567; Mon, 7 Sep 2020 13:44:55 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <202009071344.087Dits5002567@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Mon, 7 Sep 2020 13:44:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365415 - head/share/man/man5 X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/share/man/man5 X-SVN-Commit-Revision: 365415 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.33 Precedence: list List-Id: "SVN commit messages 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, 07 Sep 2020 13:44:55 -0000 Author: asomers Date: Mon Sep 7 13:44:54 2020 New Revision: 365415 URL: https://svnweb.freebsd.org/changeset/base/365415 Log: nsswitch.conf.5: style fixes Fix some whitespace, and remove the .Tn macro Reported by: mandoc, igor Reviewed by: bcr (manpages) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D26345 Modified: head/share/man/man5/nsswitch.conf.5 Modified: head/share/man/man5/nsswitch.conf.5 ============================================================================== --- head/share/man/man5/nsswitch.conf.5 Mon Sep 7 10:51:48 2020 (r365414) +++ head/share/man/man5/nsswitch.conf.5 Mon Sep 7 13:44:54 2020 (r365415) @@ -1,4 +1,4 @@ -.\" $NetBSD: nsswitch.conf.5,v 1.14 1999/03/17 20:19:47 garbled Exp $ +.\" $NetBSD: nsswitch.conf.5,v 1.14 1999/03/17 20:19:47 garbled Exp $ .\" .\" Copyright (c) 1997, 1998, 1999 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -16,7 +16,7 @@ .\" documentation and/or other materials provided with the distribution. .\" 3. All advertising materials mentioning features or use of this software .\" must display the following acknowledgement: -.\" This product includes software developed by Luke Mewburn. +.\" This product includes software developed by Luke Mewburn. .\" 4. The name of the author may not be used to endorse or promote products .\" derived from this software without specific prior written permission. .\" @@ -48,8 +48,7 @@ file specifies how the .Pp The configuration file controls how a process looks up various databases containing information regarding hosts, users (passwords), groups, etc. -Each database comes from a source (such as local files, DNS, -.Tn NIS , +Each database comes from a source (such as local files, DNS, NIS , and cache), and the order to look up the sources is specified in .Nm . .Pp @@ -182,9 +181,7 @@ Try the next source Return with the current result .El .Ss Format of file -A -.Tn BNF -description of the syntax of +A BNF description of the syntax of .Nm is: .Pp @@ -250,12 +247,10 @@ In historical multi-source implementations, the and .Sq - characters are used to specify the importing of user password and -group information from -.Tn NIS . +group information from NIS . Although .Nm -provides alternative methods of accessing distributed sources such as -.Tn NIS , +provides alternative methods of accessing distributed sources such as NIS , specifying a sole source of .Dq compat will provide the historical behaviour. @@ -328,9 +323,7 @@ resides in To lookup hosts in .Pa /etc/hosts , then in cache, -and then from the DNS, and lookup user information from -.Tn NIS -then files, use: +and then from the DNS, and lookup user information from NIS then files, use: .Pp .Bl -tag -width passwd: -compact .It hosts: @@ -362,9 +355,7 @@ entries. .Fx Ns 's .Lb libc provides stubs for compatibility with NSS modules -written for the -.Tn GNU -C Library +written for the GNU C Library .Nm nsswitch interface. However, these stubs only support the use of the @@ -390,10 +381,8 @@ Project, where it appeared first in .Sh AUTHORS .An Luke Mewburn Aq Mt lukem@netbsd.org wrote this freely distributable name-service switch implementation, -using ideas from the -.Tn ULTRIX +using ideas from the ULTRIX .Xr svc.conf 5 -and -.Tn Solaris +and Solaris .Xr nsswitch.conf 4 manual pages. From owner-svn-src-all@freebsd.org Mon Sep 7 14:22:28 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 01B483CAA69; Mon, 7 Sep 2020 14:22:28 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BlVq76FsTz493s; Mon, 7 Sep 2020 14:22:27 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B9FB120B41; Mon, 7 Sep 2020 14:22:27 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 087EMRrW026910; Mon, 7 Sep 2020 14:22:27 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 087EMR3S026909; Mon, 7 Sep 2020 14:22:27 GMT (envelope-from bz@FreeBSD.org) Message-Id: <202009071422.087EMR3S026909@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Mon, 7 Sep 2020 14:22:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365416 - stable/12 X-SVN-Group: stable-12 X-SVN-Commit-Author: bz X-SVN-Commit-Paths: stable/12 X-SVN-Commit-Revision: 365416 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.33 Precedence: list List-Id: "SVN commit messages 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, 07 Sep 2020 14:22:28 -0000 Author: bz Date: Mon Sep 7 14:22:27 2020 New Revision: 365416 URL: https://svnweb.freebsd.org/changeset/base/365416 Log: MFC r364466: After the clang/llvm version 11 import LLD_VERSION is no longer used upstream so Version.inc now only defines LLD_VERSION_STRING. This breaks the WANT_LINKER_VERSION magic and might lead to us building more than needed (e.g., for croos-tools). Change the awk script to parse LLD_VERSION_STRING instead of LLD_VERSION, which not only unbreaks the current situation but should also be backwards compatible as dim points out. Merging this before r364284 will ensure that stable/12 won't break. PR: 248818 Reviewed by: emaste, dim (seems right and the way to go) Modified: stable/12/Makefile.inc1 Directory Properties: stable/12/ (props changed) Modified: stable/12/Makefile.inc1 ============================================================================== --- stable/12/Makefile.inc1 Mon Sep 7 13:44:54 2020 (r365415) +++ stable/12/Makefile.inc1 Mon Sep 7 14:22:27 2020 (r365416) @@ -286,7 +286,7 @@ _WANT_LINKER_FREEBSD_VERSION!= \ WANT_LINKER_FREEBSD_VERSION=${_WANT_LINKER_FREEBSD_VERSION:C/.*-(.*)/\1/} WANT_LINKER_VERSION_FILE= lib/clang/include/lld/Common/Version.inc WANT_LINKER_VERSION!= \ - awk '$$2 == "LLD_VERSION" {split($$3, a, "."); print a[1] * 10000 + a[2] * 100 + a[3]}' \ + awk '$$2 == "LLD_VERSION_STRING" { gsub("\"", "", $$3); split($$3, a, "."); print a[1] * 10000 + a[2] * 100 + a[3]}' \ ${SRCDIR}/${WANT_LINKER_VERSION_FILE} || echo unknown .else WANT_LINKER_FREEBSD_VERSION_FILE= From owner-svn-src-all@freebsd.org Mon Sep 7 14:36:47 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9EF943CAFAC for ; Mon, 7 Sep 2020 14:36:47 +0000 (UTC) (envelope-from noreply@portmone.host) Received: from portmone.host (portmone.host [62.4.16.31]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4BlW7f4BSvz49w8 for ; Mon, 7 Sep 2020 14:36:46 +0000 (UTC) (envelope-from noreply@portmone.host) Received: by portmone.host for ; Mon, 7 Sep 2020 16:34:17 +0200 (envelope-from ) Message-ID: Reply-To: Peebles Parkhurst From: Peebles Parkhurst To: svn-src-all@freebsd.org Subject: Compensation for invoice 8151641 Date: Mon, 7 Sep 2020 07:34:16 -0700 MIME-Version: 1.0 Precedence: bulk X-Rspamd-Queue-Id: 4BlW7f4BSvz49w8 X-Spamd-Bar: - X-Spamd-Result: default: False [-1.88 / 15.00]; HAS_REPLYTO(0.00)[noreply@portmone.host]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[portmone.host:s=mail]; REPLYTO_EQ_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; PRECEDENCE_BULK(0.00)[]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-all@freebsd.org]; TO_DN_NONE(0.00)[]; HAS_LIST_UNSUB(-0.01)[]; URI_COUNT_ODD(1.00)[1]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_MEDIUM(-0.98)[-0.984]; R_SPF_ALLOW(-0.20)[+ip4:62.4.16.31]; DKIM_TRACE(0.00)[portmone.host:+]; DMARC_POLICY_ALLOW(-0.50)[portmone.host,reject]; NEURAL_SPAM_SHORT(0.09)[0.092]; NEURAL_HAM_LONG(-0.98)[-0.979]; RCVD_COUNT_ZERO(0.00)[0]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:12876, ipnet:62.4.0.0/19, country:FR]; MID_RHS_MATCH_FROM(0.00)[]; MAILMAN_DEST(0.00)[svn-src-all] Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.33 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 List-Id: "SVN commit messages 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, 07 Sep 2020 14:36:47 -0000 Hello Dearest client, Actual statement info #34649 Click here for download statement Best Regards From owner-svn-src-all@freebsd.org Mon Sep 7 14:38:39 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AD1D13CB387; Mon, 7 Sep 2020 14:38:39 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BlW9q47sgz49j3; Mon, 7 Sep 2020 14:38:39 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 6DD0620A65; Mon, 7 Sep 2020 14:38:39 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 087Ecde9033506; Mon, 7 Sep 2020 14:38:39 GMT (envelope-from gbe@FreeBSD.org) Received: (from gbe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 087Ecd9m033505; Mon, 7 Sep 2020 14:38:39 GMT (envelope-from gbe@FreeBSD.org) Message-Id: <202009071438.087Ecd9m033505@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gbe set sender to gbe@FreeBSD.org using -f From: Gordon Bergling Date: Mon, 7 Sep 2020 14:38:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365417 - stable/12/share/man/man4 X-SVN-Group: stable-12 X-SVN-Commit-Author: gbe X-SVN-Commit-Paths: stable/12/share/man/man4 X-SVN-Commit-Revision: 365417 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.33 Precedence: list List-Id: "SVN commit messages 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, 07 Sep 2020 14:38:39 -0000 Author: gbe (doc committer) Date: Mon Sep 7 14:38:38 2020 New Revision: 365417 URL: https://svnweb.freebsd.org/changeset/base/365417 Log: MFC r365008: vtnet(4): improve the wording PR: 247936 Submitted by: PauAmma Reported by: PauAmma Differential Revision: https://reviews.freebsd.org/D26244 Modified: stable/12/share/man/man4/vtnet.4 Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man4/vtnet.4 ============================================================================== --- stable/12/share/man/man4/vtnet.4 Mon Sep 7 14:22:27 2020 (r365416) +++ stable/12/share/man/man4/vtnet.4 Mon Sep 7 14:38:38 2020 (r365417) @@ -49,7 +49,7 @@ The .Nm device driver provides support for VirtIO Ethernet devices. .Pp -If the hypervisor advertises the appreciate features, the +If the hypervisor advertises the appropriate features, the .Nm driver supports TCP/UDP checksum offload for both transmit and receive, TCP segmentation offload (TSO), TCP large receive offload (LRO), From owner-svn-src-all@freebsd.org Mon Sep 7 14:40:34 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3F6BA3CB52D; Mon, 7 Sep 2020 14:40:34 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BlWD20tFzz4BNv; Mon, 7 Sep 2020 14:40:34 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 024C720E43; Mon, 7 Sep 2020 14:40:34 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 087EeXHq034428; Mon, 7 Sep 2020 14:40:33 GMT (envelope-from gbe@FreeBSD.org) Received: (from gbe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 087EeX6r034427; Mon, 7 Sep 2020 14:40:33 GMT (envelope-from gbe@FreeBSD.org) Message-Id: <202009071440.087EeX6r034427@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gbe set sender to gbe@FreeBSD.org using -f From: Gordon Bergling Date: Mon, 7 Sep 2020 14:40:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365418 - stable/12/usr.bin/fortune/datfiles X-SVN-Group: stable-12 X-SVN-Commit-Author: gbe X-SVN-Commit-Paths: stable/12/usr.bin/fortune/datfiles X-SVN-Commit-Revision: 365418 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.33 Precedence: list List-Id: "SVN commit messages 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, 07 Sep 2020 14:40:34 -0000 Author: gbe (doc committer) Date: Mon Sep 7 14:40:33 2020 New Revision: 365418 URL: https://svnweb.freebsd.org/changeset/base/365418 Log: MFC r365328: fortune(6): Grammar fix for a hint on searching ports PR: 249078 Submitted by: PauAmma Reported by: PauAmma Modified: stable/12/usr.bin/fortune/datfiles/freebsd-tips Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.bin/fortune/datfiles/freebsd-tips ============================================================================== --- stable/12/usr.bin/fortune/datfiles/freebsd-tips Mon Sep 7 14:38:38 2020 (r365417) +++ stable/12/usr.bin/fortune/datfiles/freebsd-tips Mon Sep 7 14:40:33 2020 (r365418) @@ -304,8 +304,8 @@ been replaced with other messages, look at /var/run/dm Want colour in your directory listings? Use "ls -G". "ls -F" is also useful, and they can be combined as "ls -FG". % -Want to find a specific port, just type the following under /usr/ports -or one its subdirectories: +Want to find a specific port? Just type the following under /usr/ports +or one of its subdirectories: make search name= or From owner-svn-src-all@freebsd.org Mon Sep 7 15:35:42 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 746113CD702; Mon, 7 Sep 2020 15:35:42 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BlXRf2WxDz4Gw4; Mon, 7 Sep 2020 15:35:42 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3B2DC21928; Mon, 7 Sep 2020 15:35:42 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 087FZgnx070802; Mon, 7 Sep 2020 15:35:42 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 087FZeXD070791; Mon, 7 Sep 2020 15:35:40 GMT (envelope-from bz@FreeBSD.org) Message-Id: <202009071535.087FZeXD070791@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Mon, 7 Sep 2020 15:35:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365419 - in head/sys/dev: ath bwi iwm iwn mwl otus usb/wlan wtap X-SVN-Group: head X-SVN-Commit-Author: bz X-SVN-Commit-Paths: in head/sys/dev: ath bwi iwm iwn mwl otus usb/wlan wtap X-SVN-Commit-Revision: 365419 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.33 Precedence: list List-Id: "SVN commit messages 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, 07 Sep 2020 15:35:42 -0000 Author: bz Date: Mon Sep 7 15:35:40 2020 New Revision: 365419 URL: https://svnweb.freebsd.org/changeset/base/365419 Log: WiFi: fix ieee80211_media_change() callers In r178354 with the introduction of multi-bss ("vap") support factoring out started and with r193340 ieee80211_media_change() no longer returned ENETRESET but only 0 or error. As ieee80211(9) tells the ieee80211_media_change() function should not be called directly but is registered with ieee80211_vap_attach() instead. Some drivers have not been fully converted. After fixing the return checking some of these functions were simply wrappers between ieee80211_vap_attach() and ieee80211_media_change(), so remove the extra function, where possible as well. PR: 248955 Submitted by: Tong Zhang (ztong0001 gmail.com) (original) MFC after: 3 days Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/ath/if_ath.c head/sys/dev/bwi/if_bwi.c head/sys/dev/iwm/if_iwm.c head/sys/dev/iwn/if_iwn.c head/sys/dev/mwl/if_mwl.c head/sys/dev/otus/if_otus.c head/sys/dev/usb/wlan/if_run.c head/sys/dev/wtap/if_wtap.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Mon Sep 7 14:40:33 2020 (r365418) +++ head/sys/dev/ath/if_ath.c Mon Sep 7 15:35:40 2020 (r365419) @@ -160,7 +160,6 @@ static int ath_init(struct ath_softc *); static void ath_stop(struct ath_softc *); static int ath_reset_vap(struct ieee80211vap *, u_long); static int ath_transmit(struct ieee80211com *, struct mbuf *); -static int ath_media_change(struct ifnet *); static void ath_watchdog(void *); static void ath_parent(struct ieee80211com *); static void ath_fatal_proc(void *, int); @@ -1766,8 +1765,8 @@ ath_vap_create(struct ieee80211com *ic, const char nam ATH_UNLOCK(sc); /* complete setup */ - ieee80211_vap_attach(vap, ath_media_change, ieee80211_media_status, - mac); + ieee80211_vap_attach(vap, ieee80211_media_change, + ieee80211_media_status, mac); return vap; bad2: reclaim_address(sc, mac); @@ -3541,14 +3540,6 @@ finish: ATH_KTR(sc, ATH_KTR_TX, 0, "ath_transmit: finished"); return (retval); -} - -static int -ath_media_change(struct ifnet *ifp) -{ - int error = ieee80211_media_change(ifp); - /* NB: only the fixed rate can change and that doesn't need a reset */ - return (error == ENETRESET ? 0 : error); } /* Modified: head/sys/dev/bwi/if_bwi.c ============================================================================== --- head/sys/dev/bwi/if_bwi.c Mon Sep 7 14:40:33 2020 (r365418) +++ head/sys/dev/bwi/if_bwi.c Mon Sep 7 15:35:40 2020 (r365419) @@ -118,7 +118,6 @@ static void bwi_set_channel(struct ieee80211com *); static void bwi_scan_end(struct ieee80211com *); static int bwi_newstate(struct ieee80211vap *, enum ieee80211_state, int); static void bwi_updateslot(struct ieee80211com *); -static int bwi_media_change(struct ifnet *); static void bwi_calibrate(void *); @@ -607,8 +606,8 @@ bwi_vap_create(struct ieee80211com *ic, const char nam ieee80211_ratectl_init(vap); /* complete setup */ - ieee80211_vap_attach(vap, bwi_media_change, ieee80211_media_status, - mac); + ieee80211_vap_attach(vap, ieee80211_media_change, + ieee80211_media_status, mac); ic->ic_opmode = opmode; return vap; } @@ -1807,14 +1806,6 @@ back: BWI_UNLOCK(sc); return error; -} - -static int -bwi_media_change(struct ifnet *ifp) -{ - int error = ieee80211_media_change(ifp); - /* NB: only the fixed rate can change and that doesn't need a reset */ - return (error == ENETRESET ? 0 : error); } static int Modified: head/sys/dev/iwm/if_iwm.c ============================================================================== --- head/sys/dev/iwm/if_iwm.c Mon Sep 7 14:40:33 2020 (r365418) +++ head/sys/dev/iwm/if_iwm.c Mon Sep 7 15:35:40 2020 (r365419) @@ -4426,8 +4426,8 @@ iwm_media_change(struct ifnet *ifp) int error; error = ieee80211_media_change(ifp); - if (error != ENETRESET) - return error; + if (error != 0) + return (error); IWM_LOCK(sc); if (ic->ic_nrunning > 0) { @@ -4435,7 +4435,7 @@ iwm_media_change(struct ifnet *ifp) iwm_init(sc); } IWM_UNLOCK(sc); - return error; + return (0); } static void Modified: head/sys/dev/iwn/if_iwn.c ============================================================================== --- head/sys/dev/iwn/if_iwn.c Mon Sep 7 14:40:33 2020 (r365418) +++ head/sys/dev/iwn/if_iwn.c Mon Sep 7 15:35:40 2020 (r365419) @@ -194,7 +194,6 @@ static void iwn_read_eeprom_enhinfo(struct iwn_softc * static struct ieee80211_node *iwn_node_alloc(struct ieee80211vap *, const uint8_t mac[IEEE80211_ADDR_LEN]); static void iwn_newassoc(struct ieee80211_node *, int); -static int iwn_media_change(struct ifnet *); static int iwn_newstate(struct ieee80211vap *, enum ieee80211_state, int); static void iwn_calib_timeout(void *); static void iwn_rx_phy(struct iwn_softc *, struct iwn_rx_desc *); @@ -1356,8 +1355,8 @@ iwn_vap_create(struct ieee80211com *ic, const char nam ieee80211_ratectl_init(vap); /* Complete setup. */ - ieee80211_vap_attach(vap, iwn_media_change, ieee80211_media_status, - mac); + ieee80211_vap_attach(vap, ieee80211_media_change, + ieee80211_media_status, mac); ic->ic_opmode = opmode; return vap; } @@ -2881,16 +2880,6 @@ static void iwn_newassoc(struct ieee80211_node *ni, int isnew) { /* Doesn't do anything at the moment */ -} - -static int -iwn_media_change(struct ifnet *ifp) -{ - int error; - - error = ieee80211_media_change(ifp); - /* NB: only the fixed rate can change and that doesn't need a reset */ - return (error == ENETRESET ? 0 : error); } static int Modified: head/sys/dev/mwl/if_mwl.c ============================================================================== --- head/sys/dev/mwl/if_mwl.c Mon Sep 7 14:40:33 2020 (r365418) +++ head/sys/dev/mwl/if_mwl.c Mon Sep 7 15:35:40 2020 (r365419) @@ -1471,16 +1471,17 @@ mwl_raw_xmit(struct ieee80211_node *ni, struct mbuf *m static int mwl_media_change(struct ifnet *ifp) { - struct ieee80211vap *vap = ifp->if_softc; + struct ieee80211vap *vap; int error; - error = ieee80211_media_change(ifp); /* NB: only the fixed rate can change and that doesn't need a reset */ - if (error == ENETRESET) { - mwl_setrates(vap); - error = 0; - } - return error; + error = ieee80211_media_change(ifp); + if (error != 0) + return (error); + + vap = ifp->if_softc; + mwl_setrates(vap); + return (0); } #ifdef MWL_DEBUG Modified: head/sys/dev/otus/if_otus.c ============================================================================== --- head/sys/dev/otus/if_otus.c Mon Sep 7 14:40:33 2020 (r365418) +++ head/sys/dev/otus/if_otus.c Mon Sep 7 15:35:40 2020 (r365419) @@ -166,7 +166,6 @@ void otus_write(struct otus_softc *, uint32_t, uint32 int otus_write_barrier(struct otus_softc *); static struct ieee80211_node *otus_node_alloc(struct ieee80211vap *vap, const uint8_t mac[IEEE80211_ADDR_LEN]); -int otus_media_change(struct ifnet *); int otus_read_eeprom(struct otus_softc *); void otus_newassoc(struct ieee80211_node *, int); void otus_cmd_rxeof(struct otus_softc *, uint8_t *, int); @@ -1337,35 +1336,6 @@ otus_node_alloc(struct ieee80211vap *vap, const uint8_ return malloc(sizeof (struct otus_node), M_80211_NODE, M_NOWAIT | M_ZERO); } - -#if 0 -int -otus_media_change(struct ifnet *ifp) -{ - struct otus_softc *sc = ifp->if_softc; - struct ieee80211com *ic = &sc->sc_ic; - uint8_t rate, ridx; - int error; - - error = ieee80211_media_change(ifp); - if (error != ENETRESET) - return error; - - if (ic->ic_fixed_rate != -1) { - rate = ic->ic_sup_rates[ic->ic_curmode]. - rs_rates[ic->ic_fixed_rate] & IEEE80211_RATE_VAL; - for (ridx = 0; ridx <= OTUS_RIDX_MAX; ridx++) - if (otus_rates[ridx].rate == rate) - break; - sc->fixed_ridx = ridx; - } - - if ((ifp->if_flags & (IFF_UP | IFF_RUNNING)) == (IFF_UP | IFF_RUNNING)) - error = otus_init(sc); - - return error; -} -#endif int otus_read_eeprom(struct otus_softc *sc) Modified: head/sys/dev/usb/wlan/if_run.c ============================================================================== --- head/sys/dev/usb/wlan/if_run.c Mon Sep 7 14:40:33 2020 (r365418) +++ head/sys/dev/usb/wlan/if_run.c Mon Sep 7 15:35:40 2020 (r365419) @@ -2126,7 +2126,7 @@ run_media_change(struct ifnet *ifp) RUN_LOCK(sc); error = ieee80211_media_change(ifp); - if (error != ENETRESET) { + if (error != 0) { RUN_UNLOCK(sc); return (error); } Modified: head/sys/dev/wtap/if_wtap.c ============================================================================== --- head/sys/dev/wtap/if_wtap.c Mon Sep 7 14:40:33 2020 (r365418) +++ head/sys/dev/wtap/if_wtap.c Mon Sep 7 15:35:40 2020 (r365419) @@ -150,16 +150,6 @@ wtap_medium_enqueue(struct wtap_vap *avp, struct mbuf return medium_transmit(avp->av_md, avp->id, m); } -static int -wtap_media_change(struct ifnet *ifp) -{ - - DWTAP_PRINTF("%s\n", __func__); - int error = ieee80211_media_change(ifp); - /* NB: only the fixed rate can change and that doesn't need a reset */ - return (error == ENETRESET ? 0 : error); -} - /* * Intercept management frames to collect beacon rssi data * and to do ibss merges. @@ -352,8 +342,8 @@ wtap_vap_create(struct ieee80211com *ic, const char na vap->iv_bmiss = wtap_bmiss; /* complete setup */ - ieee80211_vap_attach(vap, wtap_media_change, ieee80211_media_status, - mac); + ieee80211_vap_attach(vap, ieee80211_media_change, + ieee80211_media_status, mac); avp->av_dev = make_dev(&wtap_cdevsw, 0, UID_ROOT, GID_WHEEL, 0600, "%s", (const char *)sc->name); From owner-svn-src-all@freebsd.org Mon Sep 7 16:09:38 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 794DA3CE0F8; Mon, 7 Sep 2020 16:09:38 +0000 (UTC) (envelope-from blackend@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BlYBp2cy7z4LNB; Mon, 7 Sep 2020 16:09:38 +0000 (UTC) (envelope-from blackend@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 3DFC921B4D; Mon, 7 Sep 2020 16:09:38 +0000 (UTC) (envelope-from blackend@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 087G9cIX094405; Mon, 7 Sep 2020 16:09:38 GMT (envelope-from blackend@FreeBSD.org) Received: (from blackend@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 087G9c4C094404; Mon, 7 Sep 2020 16:09:38 GMT (envelope-from blackend@FreeBSD.org) Message-Id: <202009071609.087G9c4C094404@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: blackend set sender to blackend@FreeBSD.org using -f From: Marc Fonvieille Date: Mon, 7 Sep 2020 16:09:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365420 - stable/12/usr.sbin/bsdinstall/scripts X-SVN-Group: stable-12 X-SVN-Commit-Author: blackend X-SVN-Commit-Paths: stable/12/usr.sbin/bsdinstall/scripts X-SVN-Commit-Revision: 365420 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.33 Precedence: list List-Id: "SVN commit messages 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, 07 Sep 2020 16:09:38 -0000 Author: blackend (doc committer) Date: Mon Sep 7 16:09:37 2020 New Revision: 365420 URL: https://svnweb.freebsd.org/changeset/base/365420 Log: MFC r364682: Add missing Korean doc package entry, remove non-existent Serbian doc package entry. Approved by: re (gjb) Modified: stable/12/usr.sbin/bsdinstall/scripts/docsinstall Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/bsdinstall/scripts/docsinstall ============================================================================== --- stable/12/usr.sbin/bsdinstall/scripts/docsinstall Mon Sep 7 15:35:40 2020 (r365419) +++ stable/12/usr.sbin/bsdinstall/scripts/docsinstall Mon Sep 7 16:09:37 2020 (r365420) @@ -42,7 +42,7 @@ f_include $BSDCFG_SHARE/packages/packages.subr # List of languages to display (descriptions pulled from $msg_{lang}doc_desc) # : ${DOCSINSTALL_LANGS:=\ - bn da de el en es fr hu it ja mn nl pl pt ru sr tr zh_cn zh_tw \ + bn da de el en es fr hu it ja ko mn nl pl pt ru tr zh_cn zh_tw \ } ############################################################ GLOBALS @@ -65,13 +65,13 @@ msg_freebsd_installer="FreeBSD Installer" msg_hudoc_desc="Hungarian Documentation" msg_itdoc_desc="Italian Documentation" msg_jadoc_desc="Japanese Documentation" +msg_kodoc_desc="Korean Documentation" msg_mndoc_desc="Mongolian Documentation" msg_nldoc_desc="Dutch Documentation" msg_ok="OK" msg_pldoc_desc="Polish Documentation" msg_ptdoc_desc="Portuguese Documentation" msg_rudoc_desc="Russian Documentation" -msg_srdoc_desc="Serbian Documentation" msg_trdoc_desc="Turkish Documentation" msg_zh_cndoc_desc="Simplified Chinese Documentation" msg_zh_twdoc_desc="Traditional Chinese Documentation" From owner-svn-src-all@freebsd.org Mon Sep 7 16:11:50 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3D9813CE995; Mon, 7 Sep 2020 16:11:50 +0000 (UTC) (envelope-from blackend@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BlYFL0whSz4LWs; Mon, 7 Sep 2020 16:11:50 +0000 (UTC) (envelope-from blackend@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 032F321CC0; Mon, 7 Sep 2020 16:11:50 +0000 (UTC) (envelope-from blackend@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 087GBnBc095644; Mon, 7 Sep 2020 16:11:49 GMT (envelope-from blackend@FreeBSD.org) Received: (from blackend@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 087GBn64095643; Mon, 7 Sep 2020 16:11:49 GMT (envelope-from blackend@FreeBSD.org) Message-Id: <202009071611.087GBn64095643@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: blackend set sender to blackend@FreeBSD.org using -f From: Marc Fonvieille Date: Mon, 7 Sep 2020 16:11:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365421 - stable/12/usr.sbin/bsdinstall X-SVN-Group: stable-12 X-SVN-Commit-Author: blackend X-SVN-Commit-Paths: stable/12/usr.sbin/bsdinstall X-SVN-Commit-Revision: 365421 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.33 Precedence: list List-Id: "SVN commit messages 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, 07 Sep 2020 16:11:50 -0000 Author: blackend (doc committer) Date: Mon Sep 7 16:11:49 2020 New Revision: 365421 URL: https://svnweb.freebsd.org/changeset/base/365421 Log: MFC r364684: s/redundacy/redundancy Modified: stable/12/usr.sbin/bsdinstall/bsdinstall.8 Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/bsdinstall/bsdinstall.8 ============================================================================== --- stable/12/usr.sbin/bsdinstall/bsdinstall.8 Mon Sep 7 16:09:37 2020 (r365420) +++ stable/12/usr.sbin/bsdinstall/bsdinstall.8 Mon Sep 7 16:11:49 2020 (r365421) @@ -345,7 +345,7 @@ Default: .Dq default .It Ev ZFSBOOT_VDEV_TYPE The type of pool to be created for the base system. -This variable can take one of this values: stripe (No redundacy), +This variable can take one of this values: stripe (No redundancy), mirror (n-Way mirroring), raid10 (RAID 1+0 - n x 2-Way Mirrors), raidz1 (RAID-Z1 - Single Redundacy RAID), raidz2 (RAID-Z2 - Double Redundacy RAID) or raidz3 (RAID-Z3 Triple Redundacy RAID). From owner-svn-src-all@freebsd.org Mon Sep 7 17:19:31 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D6B3C3D0330; Mon, 7 Sep 2020 17:19:31 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BlZlR5M0qz4QlZ; Mon, 7 Sep 2020 17:19:31 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9AE8222ADA; Mon, 7 Sep 2020 17:19:31 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 087HJVHJ040608; Mon, 7 Sep 2020 17:19:31 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 087HJVUJ040607; Mon, 7 Sep 2020 17:19:31 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202009071719.087HJVUJ040607@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 7 Sep 2020 17:19:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365422 - head/usr.sbin/ntp/ntpd X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/usr.sbin/ntp/ntpd X-SVN-Commit-Revision: 365422 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.33 Precedence: list List-Id: "SVN commit messages 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, 07 Sep 2020 17:19:31 -0000 Author: emaste Date: Mon Sep 7 17:19:31 2020 New Revision: 365422 URL: https://svnweb.freebsd.org/changeset/base/365422 Log: ntp: whitespace and typo fix in conf file PR: 248942 Submitted by: Jose Luis Duran (whitespace), igor (typo) MFC after: 1 week Modified: head/usr.sbin/ntp/ntpd/ntp.conf Modified: head/usr.sbin/ntp/ntpd/ntp.conf ============================================================================== --- head/usr.sbin/ntp/ntpd/ntp.conf Mon Sep 7 16:11:49 2020 (r365421) +++ head/usr.sbin/ntp/ntpd/ntp.conf Mon Sep 7 17:19:31 2020 (r365422) @@ -14,8 +14,8 @@ # Set the target and limit for adding servers configured via pool statements # or discovered dynamically via mechanisms such as broadcast and manycast. # Ntpd automatically adds maxclock-1 servers from configured pools, and may -# add as many as maxclock*2 if necessary to ensure that at least minclock -# servers are providing good consistant time. +# add as many as maxclock*2 if necessary to ensure that at least minclock +# servers are providing good consistent time. # tos minclock 3 maxclock 6 From owner-svn-src-all@freebsd.org Mon Sep 7 17:31:59 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3EA443D0944; Mon, 7 Sep 2020 17:31:59 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Blb1p73ryz4RMs; Mon, 7 Sep 2020 17:31:58 +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 D5B2622F9F; Mon, 7 Sep 2020 17:31:58 +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 087HVwoB052287; Mon, 7 Sep 2020 17:31:58 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 087HVwEq052286; Mon, 7 Sep 2020 17:31:58 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202009071731.087HVwEq052286@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 7 Sep 2020 17:31:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365423 - stable/12/sys/netinet/tcp_stacks X-SVN-Group: stable-12 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/12/sys/netinet/tcp_stacks X-SVN-Commit-Revision: 365423 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.33 Precedence: list List-Id: "SVN commit messages 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, 07 Sep 2020 17:31:59 -0000 Author: emaste Date: Mon Sep 7 17:31:58 2020 New Revision: 365423 URL: https://svnweb.freebsd.org/changeset/base/365423 Log: TPC rack: use #error rather than syntax error Until the changes to make this a proper dependency are merged, avoid using a syntax error for a user-facing error report. PR: 249037 Suggested by: avg Modified: stable/12/sys/netinet/tcp_stacks/rack.c Modified: stable/12/sys/netinet/tcp_stacks/rack.c ============================================================================== --- stable/12/sys/netinet/tcp_stacks/rack.c Mon Sep 7 17:19:31 2020 (r365422) +++ stable/12/sys/netinet/tcp_stacks/rack.c Mon Sep 7 17:31:58 2020 (r365423) @@ -128,7 +128,7 @@ struct sysctl_ctx_list rack_sysctl_ctx; struct sysctl_oid *rack_sysctl_root; #ifndef TCPHPTS -fatal error missing option TCPHSTS in the build; +#error Kernel option TCPHPTS is required #endif #define CUM_ACKED 1 From owner-svn-src-all@freebsd.org Mon Sep 7 18:15:59 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9E4883D3044; Mon, 7 Sep 2020 18:15:59 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Blc0b1wp2z4XDx; Mon, 7 Sep 2020 18:15:59 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 26A0623278; Mon, 7 Sep 2020 18:15:59 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 087IFw44079708; Mon, 7 Sep 2020 18:15:58 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 087IFwQY079707; Mon, 7 Sep 2020 18:15:58 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <202009071815.087IFwQY079707@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Mon, 7 Sep 2020 18:15:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365424 - head/sbin/bectl/tests X-SVN-Group: head X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: head/sbin/bectl/tests X-SVN-Commit-Revision: 365424 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.33 Precedence: list List-Id: "SVN commit messages 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, 07 Sep 2020 18:15:59 -0000 Author: lwhsu Date: Mon Sep 7 18:15:58 2020 New Revision: 365424 URL: https://svnweb.freebsd.org/changeset/base/365424 Log: Call atf_skip function in cleanup procedure as it also triggers zfs.ko loading PR: 249055 Sponsored by: The FreeBSD Foundation Modified: head/sbin/bectl/tests/bectl_test.sh Modified: head/sbin/bectl/tests/bectl_test.sh ============================================================================== --- head/sbin/bectl/tests/bectl_test.sh Mon Sep 7 17:31:58 2020 (r365423) +++ head/sbin/bectl/tests/bectl_test.sh Mon Sep 7 18:15:58 2020 (r365424) @@ -452,6 +452,11 @@ bectl_jail_body() # attempts to destroy the zpool. bectl_jail_cleanup() { + if [ "$(atf_config_get ci false)" = "true" ] && \ + [ "$(uname -p)" = "i386" ]; then + atf_skip "https://bugs.freebsd.org/249055" + fi + zpool=$(get_zpool_name) for bootenv in "default" "target" "1234"; do # mountpoint of the boot environment From owner-svn-src-all@freebsd.org Mon Sep 7 18:47:26 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B6CBE3D3DA5; Mon, 7 Sep 2020 18:47:26 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Blcht4W3Dz4ZN3; Mon, 7 Sep 2020 18:47:26 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 77B0D23B65; Mon, 7 Sep 2020 18:47:26 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 087IlQZh098504; Mon, 7 Sep 2020 18:47:26 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 087IlQq0098503; Mon, 7 Sep 2020 18:47:26 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <202009071847.087IlQq0098503@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Mon, 7 Sep 2020 18:47:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365425 - stable/12/release/tools X-SVN-Group: stable-12 X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: stable/12/release/tools X-SVN-Commit-Revision: 365425 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.33 Precedence: list List-Id: "SVN commit messages 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, 07 Sep 2020 18:47:26 -0000 Author: gonzo Date: Mon Sep 7 18:47:25 2020 New Revision: 365425 URL: https://svnweb.freebsd.org/changeset/base/365425 Log: Revert r364939 and add a stable/12 approach for populating the ESP make_esp_file is not available in stable/12 so r364939 broke VM-related targets. Revert offending commit and use pre-r342283 approach to populate ESP partition. PR: 249168 Tested on: VirtualBox, Hyper-V v2 VM Modified: stable/12/release/tools/vmimage.subr Modified: stable/12/release/tools/vmimage.subr ============================================================================== --- stable/12/release/tools/vmimage.subr Mon Sep 7 18:15:58 2020 (r365424) +++ stable/12/release/tools/vmimage.subr Mon Sep 7 18:47:25 2020 (r365425) @@ -21,17 +21,13 @@ write_partition_layout() { case "${TARGET}:${TARGET_ARCH}" in amd64:amd64 | i386:i386) - # Create an ESP - espfilename=$(mktemp /tmp/efiboot.XXXXXX) - make_esp_file ${espfilename} ${fat32min} ${BOOTFILES}/efi/loader_lua/loader_lua.efi mkimg -s gpt -f ${VMFORMAT} \ -b ${BOOTFILES}/i386/pmbr/pmbr \ -p freebsd-boot/bootfs:=${BOOTFILES}/i386/gptboot/gptboot \ - -p efi:=${espfilename} \ + -p efi:=${BOOTFILES}/efi/boot1/boot1.efifat \ ${SWAPOPT} \ -p freebsd-ufs/rootfs:=${VMBASE} \ -o ${VMIMAGE} - rm ${espfilename} ;; arm64:aarch64) mkimg -s mbr -f ${VMFORMAT} \ From owner-svn-src-all@freebsd.org Mon Sep 7 19:29:07 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F28633D4CC8; Mon, 7 Sep 2020 19:29:07 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bldcz6BHnz4cNh; Mon, 7 Sep 2020 19:29:07 +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 B7B892451A; Mon, 7 Sep 2020 19:29:07 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 087JT7cw023315; Mon, 7 Sep 2020 19:29:07 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 087JT7oo023312; Mon, 7 Sep 2020 19:29:07 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202009071929.087JT7oo023312@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Mon, 7 Sep 2020 19:29:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365426 - in stable: 11/lib/libclang_rt/fuzzer 11/lib/libclang_rt/profile 11/lib/libclang_rt/xray 12/lib/libclang_rt/fuzzer 12/lib/libclang_rt/profile 12/lib/libclang_rt/xray X-SVN-Group: stable-12 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in stable: 11/lib/libclang_rt/fuzzer 11/lib/libclang_rt/profile 11/lib/libclang_rt/xray 12/lib/libclang_rt/fuzzer 12/lib/libclang_rt/profile 12/lib/libclang_rt/xray X-SVN-Commit-Revision: 365426 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.33 Precedence: list List-Id: "SVN commit messages 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, 07 Sep 2020 19:29:08 -0000 Author: dim Date: Mon Sep 7 19:29:06 2020 New Revision: 365426 URL: https://svnweb.freebsd.org/changeset/base/365426 Log: MFC r364081: Follow-up to r358851 (llvm-project 10.0.0-rc3 import), where I added subdirectories for compiler-rt's internal fuzzer, profile and xray headers, but forgot to add installing those headers themselves. Modified: stable/12/lib/libclang_rt/fuzzer/Makefile stable/12/lib/libclang_rt/profile/Makefile stable/12/lib/libclang_rt/xray/Makefile Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/lib/libclang_rt/fuzzer/Makefile stable/11/lib/libclang_rt/profile/Makefile stable/11/lib/libclang_rt/xray/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/12/lib/libclang_rt/fuzzer/Makefile ============================================================================== --- stable/12/lib/libclang_rt/fuzzer/Makefile Mon Sep 7 18:47:25 2020 (r365425) +++ stable/12/lib/libclang_rt/fuzzer/Makefile Mon Sep 7 19:29:06 2020 (r365426) @@ -23,4 +23,8 @@ SRCS+= fuzzer/FuzzerUtil.cpp SRCS+= fuzzer/FuzzerUtilLinux.cpp SRCS+= fuzzer/FuzzerUtilPosix.cpp +.PATH: ${CRTSRC}/include/fuzzer +INCSDIR= ${CLANGDIR}/include/fuzzer +INCS+= FuzzedDataProvider.h + .include Modified: stable/12/lib/libclang_rt/profile/Makefile ============================================================================== --- stable/12/lib/libclang_rt/profile/Makefile Mon Sep 7 18:47:25 2020 (r365425) +++ stable/12/lib/libclang_rt/profile/Makefile Mon Sep 7 19:29:06 2020 (r365426) @@ -25,4 +25,8 @@ SRCS+= profile/InstrProfilingUtil.c SRCS+= profile/InstrProfilingValue.c SRCS+= profile/InstrProfilingWriter.c +.PATH: ${CRTSRC}/include/profile +INCSDIR= ${CLANGDIR}/include/profile +INCS+= InstrProfData.inc + .include Modified: stable/12/lib/libclang_rt/xray/Makefile ============================================================================== --- stable/12/lib/libclang_rt/xray/Makefile Mon Sep 7 18:47:25 2020 (r365425) +++ stable/12/lib/libclang_rt/xray/Makefile Mon Sep 7 19:29:06 2020 (r365426) @@ -41,4 +41,10 @@ SRCS+= xray/xray_trampoline_x86_64.S SRCS+= xray/xray_utils.cpp SRCS+= xray/xray_x86_64.cpp +.PATH: ${CRTSRC}/include/xray +INCSDIR= ${CLANGDIR}/include/xray +INCS+= xray_interface.h +INCS+= xray_log_interface.h +INCS+= xray_records.h + .include From owner-svn-src-all@freebsd.org Mon Sep 7 19:29:08 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B13C13D4E9D; Mon, 7 Sep 2020 19:29:08 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bldd04Kk8z4cF3; Mon, 7 Sep 2020 19:29:08 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 78B732451B; Mon, 7 Sep 2020 19:29:08 +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 087JT8XA023323; Mon, 7 Sep 2020 19:29:08 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 087JT7Kc023321; Mon, 7 Sep 2020 19:29:07 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202009071929.087JT7Kc023321@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Mon, 7 Sep 2020 19:29:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r365426 - in stable: 11/lib/libclang_rt/fuzzer 11/lib/libclang_rt/profile 11/lib/libclang_rt/xray 12/lib/libclang_rt/fuzzer 12/lib/libclang_rt/profile 12/lib/libclang_rt/xray X-SVN-Group: stable-11 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in stable: 11/lib/libclang_rt/fuzzer 11/lib/libclang_rt/profile 11/lib/libclang_rt/xray 12/lib/libclang_rt/fuzzer 12/lib/libclang_rt/profile 12/lib/libclang_rt/xray X-SVN-Commit-Revision: 365426 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.33 Precedence: list List-Id: "SVN commit messages 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, 07 Sep 2020 19:29:08 -0000 Author: dim Date: Mon Sep 7 19:29:06 2020 New Revision: 365426 URL: https://svnweb.freebsd.org/changeset/base/365426 Log: MFC r364081: Follow-up to r358851 (llvm-project 10.0.0-rc3 import), where I added subdirectories for compiler-rt's internal fuzzer, profile and xray headers, but forgot to add installing those headers themselves. Modified: stable/11/lib/libclang_rt/fuzzer/Makefile stable/11/lib/libclang_rt/profile/Makefile stable/11/lib/libclang_rt/xray/Makefile Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/lib/libclang_rt/fuzzer/Makefile stable/12/lib/libclang_rt/profile/Makefile stable/12/lib/libclang_rt/xray/Makefile Directory Properties: stable/12/ (props changed) Modified: stable/11/lib/libclang_rt/fuzzer/Makefile ============================================================================== --- stable/11/lib/libclang_rt/fuzzer/Makefile Mon Sep 7 18:47:25 2020 (r365425) +++ stable/11/lib/libclang_rt/fuzzer/Makefile Mon Sep 7 19:29:06 2020 (r365426) @@ -23,4 +23,8 @@ SRCS+= fuzzer/FuzzerUtil.cpp SRCS+= fuzzer/FuzzerUtilLinux.cpp SRCS+= fuzzer/FuzzerUtilPosix.cpp +.PATH: ${CRTSRC}/include/fuzzer +INCSDIR= ${CLANGDIR}/include/fuzzer +INCS+= FuzzedDataProvider.h + .include Modified: stable/11/lib/libclang_rt/profile/Makefile ============================================================================== --- stable/11/lib/libclang_rt/profile/Makefile Mon Sep 7 18:47:25 2020 (r365425) +++ stable/11/lib/libclang_rt/profile/Makefile Mon Sep 7 19:29:06 2020 (r365426) @@ -25,4 +25,8 @@ SRCS+= profile/InstrProfilingUtil.c SRCS+= profile/InstrProfilingValue.c SRCS+= profile/InstrProfilingWriter.c +.PATH: ${CRTSRC}/include/profile +INCSDIR= ${CLANGDIR}/include/profile +INCS+= InstrProfData.inc + .include Modified: stable/11/lib/libclang_rt/xray/Makefile ============================================================================== --- stable/11/lib/libclang_rt/xray/Makefile Mon Sep 7 18:47:25 2020 (r365425) +++ stable/11/lib/libclang_rt/xray/Makefile Mon Sep 7 19:29:06 2020 (r365426) @@ -41,4 +41,10 @@ SRCS+= xray/xray_trampoline_x86_64.S SRCS+= xray/xray_utils.cpp SRCS+= xray/xray_x86_64.cpp +.PATH: ${CRTSRC}/include/xray +INCSDIR= ${CLANGDIR}/include/xray +INCS+= xray_interface.h +INCS+= xray_log_interface.h +INCS+= xray_records.h + .include From owner-svn-src-all@freebsd.org Mon Sep 7 19:35:31 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CB0653D4CEE; Mon, 7 Sep 2020 19:35:31 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BldmM51qtz4csB; Mon, 7 Sep 2020 19:35:31 +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 8B0F02462A; Mon, 7 Sep 2020 19:35:31 +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 087JZVpH029141; Mon, 7 Sep 2020 19:35:31 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 087JZUYZ029135; Mon, 7 Sep 2020 19:35:30 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202009071935.087JZUYZ029135@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Mon, 7 Sep 2020 19:35:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365427 - in stable: 11/contrib/llvm-project/openmp/runtime/src 11/share/mk 12/contrib/llvm-project/openmp/runtime/src 12/share/mk X-SVN-Group: stable-12 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in stable: 11/contrib/llvm-project/openmp/runtime/src 11/share/mk 12/contrib/llvm-project/openmp/runtime/src 12/share/mk X-SVN-Commit-Revision: 365427 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.33 Precedence: list List-Id: "SVN commit messages 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, 07 Sep 2020 19:35:31 -0000 Author: dim Date: Mon Sep 7 19:35:30 2020 New Revision: 365427 URL: https://svnweb.freebsd.org/changeset/base/365427 Log: MFC r364732: Merge commit cde8f4c16 from llvm git (by me): Move special va_list handling to kmp_os.h Instead of copying and pasting the same #ifdef expressions in multiple places, define a type and a pair of macros in kmp_os.h, to handle whether va_list is pointer-like or not: * kmp_va_list is the type to use for __kmp_fork_call() * kmp_va_deref() dereferences a va_list, if necessary * kmp_va_addr_of() takes the address of a va_list, if necessary Also add FreeBSD to the list of OSes that has a non pointer-like va_list. This can now be easily extended to other OSes too. Reviewed By: AndreyChurbanov Differential Revision: https://reviews.llvm.org/D86397 This should enable building of LLVM's OpenMP on AArch64. Addition to share/mk will follow in a subsequent commit. PR: 248864 MFC r364733: After r364732, we can now enable MK_OPENMP for aarch64 by default. PR: 248864 Modified: stable/12/contrib/llvm-project/openmp/runtime/src/kmp.h stable/12/contrib/llvm-project/openmp/runtime/src/kmp_csupport.cpp stable/12/contrib/llvm-project/openmp/runtime/src/kmp_gsupport.cpp stable/12/contrib/llvm-project/openmp/runtime/src/kmp_os.h stable/12/contrib/llvm-project/openmp/runtime/src/kmp_runtime.cpp stable/12/share/mk/src.opts.mk Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/contrib/llvm-project/openmp/runtime/src/kmp.h stable/11/contrib/llvm-project/openmp/runtime/src/kmp_csupport.cpp stable/11/contrib/llvm-project/openmp/runtime/src/kmp_gsupport.cpp stable/11/contrib/llvm-project/openmp/runtime/src/kmp_os.h stable/11/contrib/llvm-project/openmp/runtime/src/kmp_runtime.cpp stable/11/share/mk/src.opts.mk Directory Properties: stable/11/ (props changed) stable/11/contrib/llvm-project/openmp/ (props changed) Modified: stable/12/contrib/llvm-project/openmp/runtime/src/kmp.h ============================================================================== --- stable/12/contrib/llvm-project/openmp/runtime/src/kmp.h Mon Sep 7 19:29:06 2020 (r365426) +++ stable/12/contrib/llvm-project/openmp/runtime/src/kmp.h Mon Sep 7 19:35:30 2020 (r365427) @@ -3463,13 +3463,7 @@ enum fork_context_e { extern int __kmp_fork_call(ident_t *loc, int gtid, enum fork_context_e fork_context, kmp_int32 argc, microtask_t microtask, launch_t invoker, -/* TODO: revert workaround for Intel(R) 64 tracker #96 */ -#if (KMP_ARCH_ARM || KMP_ARCH_X86_64 || KMP_ARCH_AARCH64) && KMP_OS_LINUX - va_list *ap -#else - va_list ap -#endif - ); + kmp_va_list ap); extern void __kmp_join_call(ident_t *loc, int gtid #if OMPT_SUPPORT Modified: stable/12/contrib/llvm-project/openmp/runtime/src/kmp_csupport.cpp ============================================================================== --- stable/12/contrib/llvm-project/openmp/runtime/src/kmp_csupport.cpp Mon Sep 7 19:29:06 2020 (r365426) +++ stable/12/contrib/llvm-project/openmp/runtime/src/kmp_csupport.cpp Mon Sep 7 19:35:30 2020 (r365427) @@ -308,13 +308,7 @@ void __kmpc_fork_call(ident_t *loc, kmp_int32 argc, km __kmp_fork_call(loc, gtid, fork_context_intel, argc, VOLATILE_CAST(microtask_t) microtask, // "wrapped" task VOLATILE_CAST(launch_t) __kmp_invoke_task_func, -/* TODO: revert workaround for Intel(R) 64 tracker #96 */ -#if (KMP_ARCH_X86_64 || KMP_ARCH_ARM || KMP_ARCH_AARCH64) && KMP_OS_LINUX - &ap -#else - ap -#endif - ); + kmp_va_addr_of(ap)); #if INCLUDE_SSC_MARKS SSC_MARK_JOINING(); #endif @@ -408,16 +402,10 @@ void __kmpc_fork_teams(ident_t *loc, kmp_int32 argc, k KMP_DEBUG_ASSERT(this_thr->th.th_teams_size.nteams >= 1); KMP_DEBUG_ASSERT(this_thr->th.th_teams_size.nth >= 1); - __kmp_fork_call(loc, gtid, fork_context_intel, argc, - VOLATILE_CAST(microtask_t) - __kmp_teams_master, // "wrapped" task - VOLATILE_CAST(launch_t) __kmp_invoke_teams_master, -#if (KMP_ARCH_X86_64 || KMP_ARCH_ARM || KMP_ARCH_AARCH64) && KMP_OS_LINUX - &ap -#else - ap -#endif - ); + __kmp_fork_call( + loc, gtid, fork_context_intel, argc, + VOLATILE_CAST(microtask_t) __kmp_teams_master, // "wrapped" task + VOLATILE_CAST(launch_t) __kmp_invoke_teams_master, kmp_va_addr_of(ap)); __kmp_join_call(loc, gtid #if OMPT_SUPPORT , Modified: stable/12/contrib/llvm-project/openmp/runtime/src/kmp_gsupport.cpp ============================================================================== --- stable/12/contrib/llvm-project/openmp/runtime/src/kmp_gsupport.cpp Mon Sep 7 19:29:06 2020 (r365426) +++ stable/12/contrib/llvm-project/openmp/runtime/src/kmp_gsupport.cpp Mon Sep 7 19:35:30 2020 (r365427) @@ -376,13 +376,7 @@ static va_start(ap, argc); rc = __kmp_fork_call(loc, gtid, fork_context_gnu, argc, wrapper, - __kmp_invoke_task_func, -#if (KMP_ARCH_X86_64 || KMP_ARCH_ARM || KMP_ARCH_AARCH64) && KMP_OS_LINUX - &ap -#else - ap -#endif - ); + __kmp_invoke_task_func, kmp_va_addr_of(ap)); va_end(ap); Modified: stable/12/contrib/llvm-project/openmp/runtime/src/kmp_os.h ============================================================================== --- stable/12/contrib/llvm-project/openmp/runtime/src/kmp_os.h Mon Sep 7 19:29:06 2020 (r365426) +++ stable/12/contrib/llvm-project/openmp/runtime/src/kmp_os.h Mon Sep 7 19:35:30 2020 (r365427) @@ -200,6 +200,18 @@ typedef kmp_uint32 kmp_uint; #define KMP_INT_MAX ((kmp_int32)0x7FFFFFFF) #define KMP_INT_MIN ((kmp_int32)0x80000000) +// stdarg handling +#if (KMP_ARCH_ARM || KMP_ARCH_X86_64 || KMP_ARCH_AARCH64) && \ + (KMP_OS_FREEBSD || KMP_OS_LINUX) +typedef va_list *kmp_va_list; +#define kmp_va_deref(ap) (*(ap)) +#define kmp_va_addr_of(ap) (&(ap)) +#else +typedef va_list kmp_va_list; +#define kmp_va_deref(ap) (ap) +#define kmp_va_addr_of(ap) (ap) +#endif + #ifdef __cplusplus // macros to cast out qualifiers and to re-interpret types #define CCAST(type, var) const_cast(var) Modified: stable/12/contrib/llvm-project/openmp/runtime/src/kmp_runtime.cpp ============================================================================== --- stable/12/contrib/llvm-project/openmp/runtime/src/kmp_runtime.cpp Mon Sep 7 19:29:06 2020 (r365426) +++ stable/12/contrib/llvm-project/openmp/runtime/src/kmp_runtime.cpp Mon Sep 7 19:35:30 2020 (r365427) @@ -1389,13 +1389,7 @@ void __kmp_serialized_parallel(ident_t *loc, kmp_int32 int __kmp_fork_call(ident_t *loc, int gtid, enum fork_context_e call_context, // Intel, GNU, ... kmp_int32 argc, microtask_t microtask, launch_t invoker, -/* TODO: revert workaround for Intel(R) 64 tracker #96 */ -#if (KMP_ARCH_X86_64 || KMP_ARCH_ARM || KMP_ARCH_AARCH64) && KMP_OS_LINUX - va_list *ap -#else - va_list ap -#endif - ) { + kmp_va_list ap) { void **argv; int i; int master_tid; @@ -1505,12 +1499,7 @@ int __kmp_fork_call(ident_t *loc, int gtid, parent_team->t.t_argc = argc; argv = (void **)parent_team->t.t_argv; for (i = argc - 1; i >= 0; --i) -/* TODO: revert workaround for Intel(R) 64 tracker #96 */ -#if (KMP_ARCH_X86_64 || KMP_ARCH_ARM || KMP_ARCH_AARCH64) && KMP_OS_LINUX - *argv++ = va_arg(*ap, void *); -#else - *argv++ = va_arg(ap, void *); -#endif + *argv++ = va_arg(kmp_va_deref(ap), void *); // Increment our nested depth levels, but not increase the serialization if (parent_team == master_th->th.th_serial_team) { // AC: we are in serialized parallel @@ -1804,12 +1793,7 @@ int __kmp_fork_call(ident_t *loc, int gtid, argv = (void **)team->t.t_argv; if (ap) { for (i = argc - 1; i >= 0; --i) -// TODO: revert workaround for Intel(R) 64 tracker #96 -#if (KMP_ARCH_X86_64 || KMP_ARCH_ARM || KMP_ARCH_AARCH64) && KMP_OS_LINUX - *argv++ = va_arg(*ap, void *); -#else - *argv++ = va_arg(ap, void *); -#endif + *argv++ = va_arg(kmp_va_deref(ap), void *); } else { for (i = 0; i < argc; ++i) // Get args from parent team for teams construct @@ -1840,12 +1824,7 @@ int __kmp_fork_call(ident_t *loc, int gtid, } else { argv = args; for (i = argc - 1; i >= 0; --i) -// TODO: revert workaround for Intel(R) 64 tracker #96 -#if (KMP_ARCH_X86_64 || KMP_ARCH_ARM || KMP_ARCH_AARCH64) && KMP_OS_LINUX - *argv++ = va_arg(*ap, void *); -#else - *argv++ = va_arg(ap, void *); -#endif + *argv++ = va_arg(kmp_va_deref(ap), void *); KMP_MB(); #if OMPT_SUPPORT @@ -2130,12 +2109,7 @@ int __kmp_fork_call(ident_t *loc, int gtid, argv = (void **)team->t.t_argv; if (ap) { for (i = argc - 1; i >= 0; --i) { -// TODO: revert workaround for Intel(R) 64 tracker #96 -#if (KMP_ARCH_X86_64 || KMP_ARCH_ARM || KMP_ARCH_AARCH64) && KMP_OS_LINUX - void *new_argv = va_arg(*ap, void *); -#else - void *new_argv = va_arg(ap, void *); -#endif + void *new_argv = va_arg(kmp_va_deref(ap), void *); KMP_CHECK_UPDATE(*argv, new_argv); argv++; } Modified: stable/12/share/mk/src.opts.mk ============================================================================== --- stable/12/share/mk/src.opts.mk Mon Sep 7 19:29:06 2020 (r365426) +++ stable/12/share/mk/src.opts.mk Mon Sep 7 19:35:30 2020 (r365427) @@ -409,7 +409,8 @@ BROKEN_OPTIONS+=BSD_CRTBEGIN .endif .if ${COMPILER_FEATURES:Mc++11} && \ - (${__T} == "amd64" || ${__T} == "i386" || ${__T} == "powerpc64") + (${__T} == "aarch64" || ${__T} == "amd64" || ${__T} == "i386" || \ + ${__T} == "powerpc64") __DEFAULT_YES_OPTIONS+=OPENMP .else __DEFAULT_NO_OPTIONS+=OPENMP From owner-svn-src-all@freebsd.org Mon Sep 7 19:35:33 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 56EAF3D4F4A; Mon, 7 Sep 2020 19:35: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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BldmP1hjyz4cvh; Mon, 7 Sep 2020 19:35: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 1D9CA2462B; Mon, 7 Sep 2020 19:35: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 087JZWoP029152; Mon, 7 Sep 2020 19:35:32 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 087JZVZV029146; Mon, 7 Sep 2020 19:35:31 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202009071935.087JZVZV029146@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Mon, 7 Sep 2020 19: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: r365427 - in stable: 11/contrib/llvm-project/openmp/runtime/src 11/share/mk 12/contrib/llvm-project/openmp/runtime/src 12/share/mk X-SVN-Group: stable-11 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in stable: 11/contrib/llvm-project/openmp/runtime/src 11/share/mk 12/contrib/llvm-project/openmp/runtime/src 12/share/mk X-SVN-Commit-Revision: 365427 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.33 Precedence: list List-Id: "SVN commit messages 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, 07 Sep 2020 19:35:33 -0000 Author: dim Date: Mon Sep 7 19:35:30 2020 New Revision: 365427 URL: https://svnweb.freebsd.org/changeset/base/365427 Log: MFC r364732: Merge commit cde8f4c16 from llvm git (by me): Move special va_list handling to kmp_os.h Instead of copying and pasting the same #ifdef expressions in multiple places, define a type and a pair of macros in kmp_os.h, to handle whether va_list is pointer-like or not: * kmp_va_list is the type to use for __kmp_fork_call() * kmp_va_deref() dereferences a va_list, if necessary * kmp_va_addr_of() takes the address of a va_list, if necessary Also add FreeBSD to the list of OSes that has a non pointer-like va_list. This can now be easily extended to other OSes too. Reviewed By: AndreyChurbanov Differential Revision: https://reviews.llvm.org/D86397 This should enable building of LLVM's OpenMP on AArch64. Addition to share/mk will follow in a subsequent commit. PR: 248864 MFC r364733: After r364732, we can now enable MK_OPENMP for aarch64 by default. PR: 248864 Modified: stable/11/contrib/llvm-project/openmp/runtime/src/kmp.h stable/11/contrib/llvm-project/openmp/runtime/src/kmp_csupport.cpp stable/11/contrib/llvm-project/openmp/runtime/src/kmp_gsupport.cpp stable/11/contrib/llvm-project/openmp/runtime/src/kmp_os.h stable/11/contrib/llvm-project/openmp/runtime/src/kmp_runtime.cpp stable/11/share/mk/src.opts.mk Directory Properties: stable/11/ (props changed) stable/11/contrib/llvm-project/openmp/ (props changed) Changes in other areas also in this revision: Modified: stable/12/contrib/llvm-project/openmp/runtime/src/kmp.h stable/12/contrib/llvm-project/openmp/runtime/src/kmp_csupport.cpp stable/12/contrib/llvm-project/openmp/runtime/src/kmp_gsupport.cpp stable/12/contrib/llvm-project/openmp/runtime/src/kmp_os.h stable/12/contrib/llvm-project/openmp/runtime/src/kmp_runtime.cpp stable/12/share/mk/src.opts.mk Directory Properties: stable/12/ (props changed) Modified: stable/11/contrib/llvm-project/openmp/runtime/src/kmp.h ============================================================================== --- stable/11/contrib/llvm-project/openmp/runtime/src/kmp.h Mon Sep 7 19:29:06 2020 (r365426) +++ stable/11/contrib/llvm-project/openmp/runtime/src/kmp.h Mon Sep 7 19:35:30 2020 (r365427) @@ -3463,13 +3463,7 @@ enum fork_context_e { extern int __kmp_fork_call(ident_t *loc, int gtid, enum fork_context_e fork_context, kmp_int32 argc, microtask_t microtask, launch_t invoker, -/* TODO: revert workaround for Intel(R) 64 tracker #96 */ -#if (KMP_ARCH_ARM || KMP_ARCH_X86_64 || KMP_ARCH_AARCH64) && KMP_OS_LINUX - va_list *ap -#else - va_list ap -#endif - ); + kmp_va_list ap); extern void __kmp_join_call(ident_t *loc, int gtid #if OMPT_SUPPORT Modified: stable/11/contrib/llvm-project/openmp/runtime/src/kmp_csupport.cpp ============================================================================== --- stable/11/contrib/llvm-project/openmp/runtime/src/kmp_csupport.cpp Mon Sep 7 19:29:06 2020 (r365426) +++ stable/11/contrib/llvm-project/openmp/runtime/src/kmp_csupport.cpp Mon Sep 7 19:35:30 2020 (r365427) @@ -308,13 +308,7 @@ void __kmpc_fork_call(ident_t *loc, kmp_int32 argc, km __kmp_fork_call(loc, gtid, fork_context_intel, argc, VOLATILE_CAST(microtask_t) microtask, // "wrapped" task VOLATILE_CAST(launch_t) __kmp_invoke_task_func, -/* TODO: revert workaround for Intel(R) 64 tracker #96 */ -#if (KMP_ARCH_X86_64 || KMP_ARCH_ARM || KMP_ARCH_AARCH64) && KMP_OS_LINUX - &ap -#else - ap -#endif - ); + kmp_va_addr_of(ap)); #if INCLUDE_SSC_MARKS SSC_MARK_JOINING(); #endif @@ -408,16 +402,10 @@ void __kmpc_fork_teams(ident_t *loc, kmp_int32 argc, k KMP_DEBUG_ASSERT(this_thr->th.th_teams_size.nteams >= 1); KMP_DEBUG_ASSERT(this_thr->th.th_teams_size.nth >= 1); - __kmp_fork_call(loc, gtid, fork_context_intel, argc, - VOLATILE_CAST(microtask_t) - __kmp_teams_master, // "wrapped" task - VOLATILE_CAST(launch_t) __kmp_invoke_teams_master, -#if (KMP_ARCH_X86_64 || KMP_ARCH_ARM || KMP_ARCH_AARCH64) && KMP_OS_LINUX - &ap -#else - ap -#endif - ); + __kmp_fork_call( + loc, gtid, fork_context_intel, argc, + VOLATILE_CAST(microtask_t) __kmp_teams_master, // "wrapped" task + VOLATILE_CAST(launch_t) __kmp_invoke_teams_master, kmp_va_addr_of(ap)); __kmp_join_call(loc, gtid #if OMPT_SUPPORT , Modified: stable/11/contrib/llvm-project/openmp/runtime/src/kmp_gsupport.cpp ============================================================================== --- stable/11/contrib/llvm-project/openmp/runtime/src/kmp_gsupport.cpp Mon Sep 7 19:29:06 2020 (r365426) +++ stable/11/contrib/llvm-project/openmp/runtime/src/kmp_gsupport.cpp Mon Sep 7 19:35:30 2020 (r365427) @@ -376,13 +376,7 @@ static va_start(ap, argc); rc = __kmp_fork_call(loc, gtid, fork_context_gnu, argc, wrapper, - __kmp_invoke_task_func, -#if (KMP_ARCH_X86_64 || KMP_ARCH_ARM || KMP_ARCH_AARCH64) && KMP_OS_LINUX - &ap -#else - ap -#endif - ); + __kmp_invoke_task_func, kmp_va_addr_of(ap)); va_end(ap); Modified: stable/11/contrib/llvm-project/openmp/runtime/src/kmp_os.h ============================================================================== --- stable/11/contrib/llvm-project/openmp/runtime/src/kmp_os.h Mon Sep 7 19:29:06 2020 (r365426) +++ stable/11/contrib/llvm-project/openmp/runtime/src/kmp_os.h Mon Sep 7 19:35:30 2020 (r365427) @@ -200,6 +200,18 @@ typedef kmp_uint32 kmp_uint; #define KMP_INT_MAX ((kmp_int32)0x7FFFFFFF) #define KMP_INT_MIN ((kmp_int32)0x80000000) +// stdarg handling +#if (KMP_ARCH_ARM || KMP_ARCH_X86_64 || KMP_ARCH_AARCH64) && \ + (KMP_OS_FREEBSD || KMP_OS_LINUX) +typedef va_list *kmp_va_list; +#define kmp_va_deref(ap) (*(ap)) +#define kmp_va_addr_of(ap) (&(ap)) +#else +typedef va_list kmp_va_list; +#define kmp_va_deref(ap) (ap) +#define kmp_va_addr_of(ap) (ap) +#endif + #ifdef __cplusplus // macros to cast out qualifiers and to re-interpret types #define CCAST(type, var) const_cast(var) Modified: stable/11/contrib/llvm-project/openmp/runtime/src/kmp_runtime.cpp ============================================================================== --- stable/11/contrib/llvm-project/openmp/runtime/src/kmp_runtime.cpp Mon Sep 7 19:29:06 2020 (r365426) +++ stable/11/contrib/llvm-project/openmp/runtime/src/kmp_runtime.cpp Mon Sep 7 19:35:30 2020 (r365427) @@ -1389,13 +1389,7 @@ void __kmp_serialized_parallel(ident_t *loc, kmp_int32 int __kmp_fork_call(ident_t *loc, int gtid, enum fork_context_e call_context, // Intel, GNU, ... kmp_int32 argc, microtask_t microtask, launch_t invoker, -/* TODO: revert workaround for Intel(R) 64 tracker #96 */ -#if (KMP_ARCH_X86_64 || KMP_ARCH_ARM || KMP_ARCH_AARCH64) && KMP_OS_LINUX - va_list *ap -#else - va_list ap -#endif - ) { + kmp_va_list ap) { void **argv; int i; int master_tid; @@ -1505,12 +1499,7 @@ int __kmp_fork_call(ident_t *loc, int gtid, parent_team->t.t_argc = argc; argv = (void **)parent_team->t.t_argv; for (i = argc - 1; i >= 0; --i) -/* TODO: revert workaround for Intel(R) 64 tracker #96 */ -#if (KMP_ARCH_X86_64 || KMP_ARCH_ARM || KMP_ARCH_AARCH64) && KMP_OS_LINUX - *argv++ = va_arg(*ap, void *); -#else - *argv++ = va_arg(ap, void *); -#endif + *argv++ = va_arg(kmp_va_deref(ap), void *); // Increment our nested depth levels, but not increase the serialization if (parent_team == master_th->th.th_serial_team) { // AC: we are in serialized parallel @@ -1804,12 +1793,7 @@ int __kmp_fork_call(ident_t *loc, int gtid, argv = (void **)team->t.t_argv; if (ap) { for (i = argc - 1; i >= 0; --i) -// TODO: revert workaround for Intel(R) 64 tracker #96 -#if (KMP_ARCH_X86_64 || KMP_ARCH_ARM || KMP_ARCH_AARCH64) && KMP_OS_LINUX - *argv++ = va_arg(*ap, void *); -#else - *argv++ = va_arg(ap, void *); -#endif + *argv++ = va_arg(kmp_va_deref(ap), void *); } else { for (i = 0; i < argc; ++i) // Get args from parent team for teams construct @@ -1840,12 +1824,7 @@ int __kmp_fork_call(ident_t *loc, int gtid, } else { argv = args; for (i = argc - 1; i >= 0; --i) -// TODO: revert workaround for Intel(R) 64 tracker #96 -#if (KMP_ARCH_X86_64 || KMP_ARCH_ARM || KMP_ARCH_AARCH64) && KMP_OS_LINUX - *argv++ = va_arg(*ap, void *); -#else - *argv++ = va_arg(ap, void *); -#endif + *argv++ = va_arg(kmp_va_deref(ap), void *); KMP_MB(); #if OMPT_SUPPORT @@ -2130,12 +2109,7 @@ int __kmp_fork_call(ident_t *loc, int gtid, argv = (void **)team->t.t_argv; if (ap) { for (i = argc - 1; i >= 0; --i) { -// TODO: revert workaround for Intel(R) 64 tracker #96 -#if (KMP_ARCH_X86_64 || KMP_ARCH_ARM || KMP_ARCH_AARCH64) && KMP_OS_LINUX - void *new_argv = va_arg(*ap, void *); -#else - void *new_argv = va_arg(ap, void *); -#endif + void *new_argv = va_arg(kmp_va_deref(ap), void *); KMP_CHECK_UPDATE(*argv, new_argv); argv++; } Modified: stable/11/share/mk/src.opts.mk ============================================================================== --- stable/11/share/mk/src.opts.mk Mon Sep 7 19:29:06 2020 (r365426) +++ stable/11/share/mk/src.opts.mk Mon Sep 7 19:35:30 2020 (r365427) @@ -342,7 +342,8 @@ __DEFAULT_NO_OPTIONS+=OFED .endif .if ${COMPILER_FEATURES:Mc++11} && \ - (${__T} == "amd64" || ${__T} == "i386" || ${__T} == "powerpc64") + (${__T} == "aarch64" || ${__T} == "amd64" || ${__T} == "i386" || \ + ${__T} == "powerpc64") __DEFAULT_YES_OPTIONS+=OPENMP .else __DEFAULT_NO_OPTIONS+=OPENMP From owner-svn-src-all@freebsd.org Mon Sep 7 20:05:19 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 09BF63D5261; Mon, 7 Sep 2020 20:05:19 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BlfQk6VGvz4fhH; Mon, 7 Sep 2020 20:05:18 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 C25F824BAC; Mon, 7 Sep 2020 20:05:18 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 087K5ICb047507; Mon, 7 Sep 2020 20:05:18 GMT (envelope-from bdragon@FreeBSD.org) Received: (from bdragon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 087K5Iic047506; Mon, 7 Sep 2020 20:05:18 GMT (envelope-from bdragon@FreeBSD.org) Message-Id: <202009072005.087K5Iic047506@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdragon set sender to bdragon@FreeBSD.org using -f From: Brandon Bergren Date: Mon, 7 Sep 2020 20:05:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365428 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: bdragon X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 365428 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.33 Precedence: list List-Id: "SVN commit messages 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, 07 Sep 2020 20:05:19 -0000 Author: bdragon Date: Mon Sep 7 20:05:18 2020 New Revision: 365428 URL: https://svnweb.freebsd.org/changeset/base/365428 Log: Fix vdso compat32 timekeeping on !=x86. Since x86 is the only 32-bit arch that has a 32-bit time_t, adjust the private bintime32 struct in vdso to only use a 32 bit sec on amd64. This matches the existing behavior in the compat code. Noticed while implementing vdso timekeeping on powerpc. This should also theoretically fix vdso timekeeping for arm binaries on aarch64. See tools attached to https://reviews.freebsd.org/D26347 for testing. Reviewed by: kib (in irc) Sponsored by: Tag1 Consulting, Inc. Modified: head/sys/sys/vdso.h Modified: head/sys/sys/vdso.h ============================================================================== --- head/sys/sys/vdso.h Mon Sep 7 19:35:30 2020 (r365427) +++ head/sys/sys/vdso.h Mon Sep 7 20:05:18 2020 (r365428) @@ -102,8 +102,16 @@ struct vdso_sv_tk *alloc_sv_tk(void); #define VDSO_TH_NUM 4 #ifdef COMPAT_FREEBSD32 + +/* + * i386 is the only arch with a 32 bit time_t. + */ struct bintime32 { +#if defined(__amd64__) uint32_t sec; +#else + uint64_t sec; +#endif uint32_t frac[2]; }; From owner-svn-src-all@freebsd.org Mon Sep 7 20:10:04 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 979B63D5354; Mon, 7 Sep 2020 20:10:04 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BlfXD344yz4fkT; Mon, 7 Sep 2020 20:10:04 +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 4804F24BAD; Mon, 7 Sep 2020 20:10:04 +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 087KA40C047789; Mon, 7 Sep 2020 20:10:04 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 087KA4do047788; Mon, 7 Sep 2020 20:10:04 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202009072010.087KA4do047788@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Mon, 7 Sep 2020 20:10:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365429 - head/contrib/llvm-project/openmp/runtime/src X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: head/contrib/llvm-project/openmp/runtime/src X-SVN-Commit-Revision: 365429 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.33 Precedence: list List-Id: "SVN commit messages 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, 07 Sep 2020 20:10:04 -0000 Author: dim Date: Mon Sep 7 20:10:03 2020 New Revision: 365429 URL: https://svnweb.freebsd.org/changeset/base/365429 Log: Merge commit 47b0262d3 from llvm git (by me): Add include to kmp_os.h, to get the va_list type, required after cde8f4c164a2. Sort system includes, while here. The original merged commit works fine by itself on head, but fails to compile on stable branches because stdarg.h is not implicitly pulled in. MFC after: immediately, to fix failing builds on stable/{11,12} Modified: head/contrib/llvm-project/openmp/runtime/src/kmp_os.h Modified: head/contrib/llvm-project/openmp/runtime/src/kmp_os.h ============================================================================== --- head/contrib/llvm-project/openmp/runtime/src/kmp_os.h Mon Sep 7 20:05:18 2020 (r365428) +++ head/contrib/llvm-project/openmp/runtime/src/kmp_os.h Mon Sep 7 20:10:03 2020 (r365429) @@ -14,8 +14,9 @@ #define KMP_OS_H #include "kmp_config.h" -#include #include +#include +#include #define KMP_FTN_PLAIN 1 #define KMP_FTN_APPEND 2 From owner-svn-src-all@freebsd.org Mon Sep 7 20:17:13 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C0CFB3D537D; Mon, 7 Sep 2020 20:17: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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BlfhT4YqYz4g7B; Mon, 7 Sep 2020 20:17:13 +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 7B67A24E1B; Mon, 7 Sep 2020 20:17:13 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 087KHD2X053793; Mon, 7 Sep 2020 20:17:13 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 087KHDIl053792; Mon, 7 Sep 2020 20:17:13 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202009072017.087KHDIl053792@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Mon, 7 Sep 2020 20:17:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365430 - in stable: 11/contrib/llvm-project/openmp/runtime/src 12/contrib/llvm-project/openmp/runtime/src X-SVN-Group: stable-12 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in stable: 11/contrib/llvm-project/openmp/runtime/src 12/contrib/llvm-project/openmp/runtime/src X-SVN-Commit-Revision: 365430 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.33 Precedence: list List-Id: "SVN commit messages 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, 07 Sep 2020 20:17:13 -0000 Author: dim Date: Mon Sep 7 20:17:13 2020 New Revision: 365430 URL: https://svnweb.freebsd.org/changeset/base/365430 Log: MFC r365429: Merge commit 47b0262d3 from llvm git (by me): Add include to kmp_os.h, to get the va_list type, required after cde8f4c164a2. Sort system includes, while here. The original merged commit works fine by itself on head, but fails to compile on stable branches because stdarg.h is not implicitly pulled in. PR: 248864 Modified: stable/12/contrib/llvm-project/openmp/runtime/src/kmp_os.h Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/contrib/llvm-project/openmp/runtime/src/kmp_os.h Directory Properties: stable/11/ (props changed) stable/11/contrib/llvm-project/openmp/ (props changed) Modified: stable/12/contrib/llvm-project/openmp/runtime/src/kmp_os.h ============================================================================== --- stable/12/contrib/llvm-project/openmp/runtime/src/kmp_os.h Mon Sep 7 20:10:03 2020 (r365429) +++ stable/12/contrib/llvm-project/openmp/runtime/src/kmp_os.h Mon Sep 7 20:17:13 2020 (r365430) @@ -14,8 +14,9 @@ #define KMP_OS_H #include "kmp_config.h" -#include #include +#include +#include #define KMP_FTN_PLAIN 1 #define KMP_FTN_APPEND 2 From owner-svn-src-all@freebsd.org Mon Sep 7 20:17:14 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0D5493D594A; Mon, 7 Sep 2020 20:17:14 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BlfhT6brSz4g7C; Mon, 7 Sep 2020 20:17:13 +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 C5FF924DAC; Mon, 7 Sep 2020 20:17:13 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 087KHDpt053799; Mon, 7 Sep 2020 20:17:13 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 087KHDGH053798; Mon, 7 Sep 2020 20:17:13 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202009072017.087KHDGH053798@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Mon, 7 Sep 2020 20:17: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: r365430 - in stable: 11/contrib/llvm-project/openmp/runtime/src 12/contrib/llvm-project/openmp/runtime/src X-SVN-Group: stable-11 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in stable: 11/contrib/llvm-project/openmp/runtime/src 12/contrib/llvm-project/openmp/runtime/src X-SVN-Commit-Revision: 365430 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.33 Precedence: list List-Id: "SVN commit messages 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, 07 Sep 2020 20:17:14 -0000 Author: dim Date: Mon Sep 7 20:17:13 2020 New Revision: 365430 URL: https://svnweb.freebsd.org/changeset/base/365430 Log: MFC r365429: Merge commit 47b0262d3 from llvm git (by me): Add include to kmp_os.h, to get the va_list type, required after cde8f4c164a2. Sort system includes, while here. The original merged commit works fine by itself on head, but fails to compile on stable branches because stdarg.h is not implicitly pulled in. PR: 248864 Modified: stable/11/contrib/llvm-project/openmp/runtime/src/kmp_os.h Directory Properties: stable/11/ (props changed) stable/11/contrib/llvm-project/openmp/ (props changed) Changes in other areas also in this revision: Modified: stable/12/contrib/llvm-project/openmp/runtime/src/kmp_os.h Directory Properties: stable/12/ (props changed) Modified: stable/11/contrib/llvm-project/openmp/runtime/src/kmp_os.h ============================================================================== --- stable/11/contrib/llvm-project/openmp/runtime/src/kmp_os.h Mon Sep 7 20:10:03 2020 (r365429) +++ stable/11/contrib/llvm-project/openmp/runtime/src/kmp_os.h Mon Sep 7 20:17:13 2020 (r365430) @@ -14,8 +14,9 @@ #define KMP_OS_H #include "kmp_config.h" -#include #include +#include +#include #define KMP_FTN_PLAIN 1 #define KMP_FTN_APPEND 2 From owner-svn-src-all@freebsd.org Mon Sep 7 20:25:55 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7E3513D5DE3; Mon, 7 Sep 2020 20:25:55 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BlftW2qCFz3S70; Mon, 7 Sep 2020 20:25:55 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 3FABA25202; Mon, 7 Sep 2020 20:25:55 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 087KPtF7059586; Mon, 7 Sep 2020 20:25:55 GMT (envelope-from bdragon@FreeBSD.org) Received: (from bdragon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 087KPt5N059585; Mon, 7 Sep 2020 20:25:55 GMT (envelope-from bdragon@FreeBSD.org) Message-Id: <202009072025.087KPt5N059585@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdragon set sender to bdragon@FreeBSD.org using -f From: Brandon Bergren Date: Mon, 7 Sep 2020 20:25:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365431 - head/sys/powerpc/powerpc X-SVN-Group: head X-SVN-Commit-Author: bdragon X-SVN-Commit-Paths: head/sys/powerpc/powerpc X-SVN-Commit-Revision: 365431 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.33 Precedence: list List-Id: "SVN commit messages 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, 07 Sep 2020 20:25:55 -0000 Author: bdragon Date: Mon Sep 7 20:25:54 2020 New Revision: 365431 URL: https://svnweb.freebsd.org/changeset/base/365431 Log: [PowerPC] Initialize ELFv1 as a secondary sysvec to ELFv2. In order to enable VDSO timekeeping, it is necessary that there be exactly one primary FreeBSD sysvec for each of the host and (optionally) compat32. So, switch ELFv1 to being a secondary sysvec of ELFv2, so it does not get double-allocated in the shared page. Since secondary sysvecs use the same sigcode allocation as the primary, define both to use the main sigcode64, and adjust the sv_sigcode_base on ELFv2 after initialization to point to the correct offset. This has the desirable side effect of avoiding having a separate copy of the signal trampoline in the shared page. Our sigcode64 was already written to take advantage of trampoline sharing, it was just not being allocated that way until now. Submitted by: jhibbits Sponsored by: Tag1 Consulting, Inc. Modified: head/sys/powerpc/powerpc/elf64_machdep.c Modified: head/sys/powerpc/powerpc/elf64_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/elf64_machdep.c Mon Sep 7 20:17:13 2020 (r365430) +++ head/sys/powerpc/powerpc/elf64_machdep.c Mon Sep 7 20:25:54 2020 (r365431) @@ -95,7 +95,6 @@ struct sysentvec elf64_freebsd_sysvec_v1 = { .sv_hwcap = &cpu_features, .sv_hwcap2 = &cpu_features2, }; -INIT_SYSENTVEC(elf64_sysvec_v1, &elf64_freebsd_sysvec_v1); struct sysentvec elf64_freebsd_sysvec_v2 = { .sv_size = SYS_MAXSYSCALL, @@ -105,8 +104,8 @@ struct sysentvec elf64_freebsd_sysvec_v2 = { .sv_transtrap = NULL, .sv_fixup = __elfN(freebsd_fixup), .sv_sendsig = sendsig, - .sv_sigcode = sigcode64_elfv2, - .sv_szsigcode = &szsigcode64_elfv2, + .sv_sigcode = sigcode64, /* Fixed up in ppc64_init_sysvecs(). */ + .sv_szsigcode = &szsigcode64, .sv_name = "FreeBSD ELF64 V2", .sv_coredump = __elfN(coredump), .sv_imgact_try = NULL, @@ -133,7 +132,6 @@ struct sysentvec elf64_freebsd_sysvec_v2 = { .sv_hwcap = &cpu_features, .sv_hwcap2 = &cpu_features2, }; -INIT_SYSENTVEC(elf64_sysvec_v2, &elf64_freebsd_sysvec_v2); static boolean_t ppc64_elfv1_header_match(struct image_params *params, int32_t *, uint32_t *); @@ -192,6 +190,26 @@ SYSINIT(oelf64, SI_SUB_EXEC, SI_ORDER_ANY, &freebsd_brand_oinfo); void elf_reloc_self(Elf_Dyn *dynp, Elf_Addr relocbase); + +static void +ppc64_init_sysvecs(void *arg) +{ + exec_sysvec_init(&elf64_freebsd_sysvec_v2); + exec_sysvec_init_secondary(&elf64_freebsd_sysvec_v2, + &elf64_freebsd_sysvec_v1); + /* + * Adjust elfv2 sigcode after elfv1 sysvec is initialized. + * exec_sysvec_init_secondary() assumes secondary sysvecs use + * identical signal code, and skips allocating a second copy. + * Since the ELFv2 trampoline is a strict subset of the ELFv1 code, + * we can work around this by adjusting the base address. This also + * avoids two copies of the trampoline code being allocated! + */ + elf64_freebsd_sysvec_v2.sv_sigcode_base += + (uintptr_t)sigcode64_elfv2 - (uintptr_t)&sigcode64; + elf64_freebsd_sysvec_v2.sv_szsigcode = &szsigcode64_elfv2; +} +SYSINIT(elf64_sysvec, SI_SUB_EXEC, SI_ORDER_ANY, ppc64_init_sysvecs, NULL); static boolean_t ppc64_elfv1_header_match(struct image_params *params, int32_t *osrel __unused, From owner-svn-src-all@freebsd.org Mon Sep 7 21:32:28 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8EE0B3D7269; Mon, 7 Sep 2020 21:32:28 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BlhMJ3KwKz3WBk; Mon, 7 Sep 2020 21:32:28 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 55EF725A60; Mon, 7 Sep 2020 21:32:28 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 087LWSDi003432; Mon, 7 Sep 2020 21:32:28 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 087LWSV8003431; Mon, 7 Sep 2020 21:32:28 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202009072132.087LWSV8003431@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 7 Sep 2020 21:32:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365432 - head/libexec/rtld-elf X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/libexec/rtld-elf X-SVN-Commit-Revision: 365432 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.33 Precedence: list List-Id: "SVN commit messages 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, 07 Sep 2020 21:32:28 -0000 Author: kib Date: Mon Sep 7 21:32:27 2020 New Revision: 365432 URL: https://svnweb.freebsd.org/changeset/base/365432 Log: rtld: pass argc/argv/env to dso inits. This is consistent with how array inits are called, and also makes us more compatible with glibc environment. Requested by: Alex S PR: 249162 Reviewed by: dim, emaste Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D26351 Modified: head/libexec/rtld-elf/rtld.c Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Mon Sep 7 20:25:54 2020 (r365431) +++ head/libexec/rtld-elf/rtld.c Mon Sep 7 21:32:27 2020 (r365432) @@ -2844,7 +2844,7 @@ objlist_call_init(Objlist *list, RtldLockState *lockst (void *)elm->obj->init); LD_UTRACE(UTRACE_INIT_CALL, elm->obj, (void *)elm->obj->init, 0, 0, elm->obj->path); - call_initfini_pointer(elm->obj, elm->obj->init); + call_init_pointer(elm->obj, elm->obj->init); } init_addr = (Elf_Addr *)elm->obj->init_array; if (init_addr != NULL) { From owner-svn-src-all@freebsd.org Mon Sep 7 21:37:17 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8D4D53D7995; Mon, 7 Sep 2020 21:37:17 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BlhSs0STwz3Wqv; Mon, 7 Sep 2020 21:37:17 +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 E2E9E25BDF; Mon, 7 Sep 2020 21:37:16 +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 087LbGJc003737; Mon, 7 Sep 2020 21:37:16 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 087LbGU5003736; Mon, 7 Sep 2020 21:37:16 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202009072137.087LbGU5003736@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 7 Sep 2020 21:37:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365433 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 365433 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.33 Precedence: list List-Id: "SVN commit messages 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, 07 Sep 2020 21:37:17 -0000 Author: kib Date: Mon Sep 7 21:37:16 2020 New Revision: 365433 URL: https://svnweb.freebsd.org/changeset/base/365433 Log: imgact_elf.c: unify check for phdr fitting into the first page. Similar to the userspace rtld check. Reviewed by: dim, emaste (previous versions) Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D26339 Modified: head/sys/kern/imgact_elf.c Modified: head/sys/kern/imgact_elf.c ============================================================================== --- head/sys/kern/imgact_elf.c Mon Sep 7 21:32:27 2020 (r365432) +++ head/sys/kern/imgact_elf.c Mon Sep 7 21:37:16 2020 (r365433) @@ -448,6 +448,13 @@ __elfN(get_brandinfo)(struct image_params *imgp, const return (NULL); } +static bool +__elfN(phdr_in_zero_page)(const Elf_Ehdr *hdr) +{ + return (hdr->e_phoff <= PAGE_SIZE && + (u_int)hdr->e_phentsize * hdr->e_phnum <= PAGE_SIZE - hdr->e_phoff); +} + static int __elfN(check_header)(const Elf_Ehdr *hdr) { @@ -811,8 +818,7 @@ __elfN(load_file)(struct proc *p, const char *file, u_ } /* Only support headers that fit within first page for now */ - if ((hdr->e_phoff > PAGE_SIZE) || - (u_int)hdr->e_phentsize * hdr->e_phnum > PAGE_SIZE - hdr->e_phoff) { + if (!__elfN(phdr_in_zero_page)(hdr)) { error = ENOEXEC; goto fail; } @@ -1088,9 +1094,7 @@ __CONCAT(exec_, __elfN(imgact))(struct image_params *i * detected an ELF file. */ - if ((hdr->e_phoff > PAGE_SIZE) || - (u_int)hdr->e_phentsize * hdr->e_phnum > PAGE_SIZE - hdr->e_phoff) { - /* Only support headers in first page for now */ + if (!__elfN(phdr_in_zero_page)(hdr)) { uprintf("Program headers not in the first page\n"); return (ENOEXEC); } From owner-svn-src-all@freebsd.org Mon Sep 7 23:20:03 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 424053D93B1; Mon, 7 Sep 2020 23:20: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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BlklR11zKz3cDT; Mon, 7 Sep 2020 23:20: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 02D7F26F2B; Mon, 7 Sep 2020 23:20: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 087NK2J0065486; Mon, 7 Sep 2020 23:20:02 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 087NK2or065485; Mon, 7 Sep 2020 23:20:02 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202009072320.087NK2or065485@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 7 Sep 2020 23:20:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365434 - stable/12/sys/netinet6 X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/12/sys/netinet6 X-SVN-Commit-Revision: 365434 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.33 Precedence: list List-Id: "SVN commit messages 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, 07 Sep 2020 23:20:03 -0000 Author: kevans Date: Mon Sep 7 23:20:02 2020 New Revision: 365434 URL: https://svnweb.freebsd.org/changeset/base/365434 Log: MFC r364982: ipv6: quit dropping packets looping back on p2p interfaces PR: 247718 Modified: stable/12/sys/netinet6/ip6_forward.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet6/ip6_forward.c ============================================================================== --- stable/12/sys/netinet6/ip6_forward.c Mon Sep 7 21:37:16 2020 (r365433) +++ stable/12/sys/netinet6/ip6_forward.c Mon Sep 7 23:20:02 2020 (r365434) @@ -257,24 +257,8 @@ again2: * modified by a redirect. */ if (V_ip6_sendredirects && rt->rt_ifp == m->m_pkthdr.rcvif && !srcrt && - (rt->rt_flags & (RTF_DYNAMIC|RTF_MODIFIED)) == 0) { - if ((rt->rt_ifp->if_flags & IFF_POINTOPOINT) != 0) { - /* - * If the incoming interface is equal to the outgoing - * one, and the link attached to the interface is - * point-to-point, then it will be highly probable - * that a routing loop occurs. Thus, we immediately - * drop the packet and send an ICMPv6 error message. - * - * type/code is based on suggestion by Rich Draves. - * not sure if it is the best pick. - */ - icmp6_error(mcopy, ICMP6_DST_UNREACH, - ICMP6_DST_UNREACH_ADDR, 0); - goto bad; - } + (rt->rt_flags & (RTF_DYNAMIC|RTF_MODIFIED)) == 0) type = ND_REDIRECT; - } /* * Fake scoped addresses. Note that even link-local source or From owner-svn-src-all@freebsd.org Mon Sep 7 23:21:54 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9FA663D961D; Mon, 7 Sep 2020 23:21:54 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BlknZ3p7Vz3cJR; Mon, 7 Sep 2020 23:21:54 +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 6589527277; Mon, 7 Sep 2020 23:21:54 +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 087NLsVO071153; Mon, 7 Sep 2020 23:21:54 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 087NLsxR071151; Mon, 7 Sep 2020 23:21:54 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202009072321.087NLsxR071151@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 7 Sep 2020 23:21:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365435 - in stable/12/sys/dev: rtwn/usb usb X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in stable/12/sys/dev: rtwn/usb usb X-SVN-Commit-Revision: 365435 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.33 Precedence: list List-Id: "SVN commit messages 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, 07 Sep 2020 23:21:54 -0000 Author: markj Date: Mon Sep 7 23:21:53 2020 New Revision: 365435 URL: https://svnweb.freebsd.org/changeset/base/365435 Log: MFC r364993: rtwn(4): Add support for the Belkin N300. PR: 249034 Modified: stable/12/sys/dev/rtwn/usb/rtwn_usb_attach.h stable/12/sys/dev/usb/usbdevs Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/rtwn/usb/rtwn_usb_attach.h ============================================================================== --- stable/12/sys/dev/rtwn/usb/rtwn_usb_attach.h Mon Sep 7 23:20:02 2020 (r365434) +++ stable/12/sys/dev/rtwn/usb/rtwn_usb_attach.h Mon Sep 7 23:21:53 2020 (r365435) @@ -49,6 +49,7 @@ static const STRUCT_USB_HOST_ID rtwn_devs[] = { RTWN_RTL8192CU_DEV(AZUREWAVE, RTL8188CE_2), RTWN_RTL8192CU_DEV(AZUREWAVE, RTL8188CU), RTWN_RTL8192CU_DEV(BELKIN, F7D2102), + RTWN_RTL8192CU_DEV(BELKIN, F9L1004V1), RTWN_RTL8192CU_DEV(BELKIN, RTL8188CU), RTWN_RTL8192CU_DEV(BELKIN, RTL8192CU), RTWN_RTL8192CU_DEV(CHICONY, RTL8188CUS_1), Modified: stable/12/sys/dev/usb/usbdevs ============================================================================== --- stable/12/sys/dev/usb/usbdevs Mon Sep 7 23:20:02 2020 (r365434) +++ stable/12/sys/dev/usb/usbdevs Mon Sep 7 23:21:53 2020 (r365435) @@ -1379,6 +1379,7 @@ product BELKIN F6C900UNV 0x0900 F6C900-UNV product BELKIN F6C100UNV 0x0910 F6C100-UNV product BELKIN F6C120UNV 0x0912 F6C120-UNV UPS product BELKIN F6C800UNV 0x0980 F6C800-UNV +product BELKIN F9L1004V1 0x1004 N300 Wireless Adapter product BELKIN F6C1100UNV 0x1100 F6C1100-UNV, F6C1200-UNV product BELKIN F5U120 0x1203 F5U120-PC Hub product BELKIN RTL8188CU 0x1102 RTL8188CU Wireless Adapter From owner-svn-src-all@freebsd.org Mon Sep 7 23:22:17 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3756B3D935E; Mon, 7 Sep 2020 23:22:17 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Blkp10nllz3cX6; Mon, 7 Sep 2020 23:22:17 +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 F297C26F43; Mon, 7 Sep 2020 23:22:16 +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 087NMGGP071256; Mon, 7 Sep 2020 23:22:16 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 087NMGK9071255; Mon, 7 Sep 2020 23:22:16 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202009072322.087NMGK9071255@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 7 Sep 2020 23:22:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365436 - stable/12/sbin/ggate/ggated X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sbin/ggate/ggated X-SVN-Commit-Revision: 365436 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.33 Precedence: list List-Id: "SVN commit messages 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, 07 Sep 2020 23:22:17 -0000 Author: markj Date: Mon Sep 7 23:22:16 2020 New Revision: 365436 URL: https://svnweb.freebsd.org/changeset/base/365436 Log: MFC r364995: ggated(8): Avoid doubly opening the requested disk device. PR: 132845 Modified: stable/12/sbin/ggate/ggated/ggated.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/ggate/ggated/ggated.c ============================================================================== --- stable/12/sbin/ggate/ggated/ggated.c Mon Sep 7 23:21:53 2020 (r365435) +++ stable/12/sbin/ggate/ggated/ggated.c Mon Sep 7 23:22:16 2020 (r365436) @@ -349,6 +349,16 @@ exports_check(struct ggd_export *ex, struct g_gate_cin flags = O_WRONLY; else flags = O_RDWR; + if (conn->c_diskfd != -1) { + if (strcmp(conn->c_path, ex->e_path) != 0) { + g_gate_log(LOG_ERR, "old %s and new %s: " + "Path mismatch during handshakes.", + conn->c_path, ex->e_path); + return (EPERM); + } + return (0); + } + conn->c_diskfd = open(ex->e_path, flags); if (conn->c_diskfd == -1) { error = errno; @@ -455,7 +465,7 @@ connection_new(struct g_gate_cinit *cinit, struct sock conn->c_token = cinit->gc_token; ip = htonl(((struct sockaddr_in *)(void *)s)->sin_addr.s_addr); conn->c_srcip = ip; - conn->c_sendfd = conn->c_recvfd = -1; + conn->c_diskfd = conn->c_sendfd = conn->c_recvfd = -1; if ((cinit->gc_flags & GGATE_FLAG_SEND) != 0) conn->c_sendfd = sfd; else @@ -510,6 +520,8 @@ connection_remove(struct ggd_connection *conn) LIST_REMOVE(conn, c_next); g_gate_log(LOG_DEBUG, "Connection removed [%s %s].", ip2str(conn->c_srcip), conn->c_path); + if (conn->c_diskfd != -1) + close(conn->c_diskfd); if (conn->c_sendfd != -1) close(conn->c_sendfd); if (conn->c_recvfd != -1) From owner-svn-src-all@freebsd.org Mon Sep 7 23:28:33 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C850D3D9651; Mon, 7 Sep 2020 23:28: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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BlkxF4wfdz3ck3; Mon, 7 Sep 2020 23:28: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 87E6027128; Mon, 7 Sep 2020 23:28: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 087NSXdl071570; Mon, 7 Sep 2020 23:28:33 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 087NSXHA071569; Mon, 7 Sep 2020 23:28:33 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202009072328.087NSXHA071569@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 7 Sep 2020 23:28:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365437 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 365437 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.33 Precedence: list List-Id: "SVN commit messages 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, 07 Sep 2020 23:28:33 -0000 Author: markj Date: Mon Sep 7 23:28:33 2020 New Revision: 365437 URL: https://svnweb.freebsd.org/changeset/base/365437 Log: vm_object_split(): Handle orig_object type changes. orig_object->type can change from OBJT_DEFAULT to OBJT_SWAP while vm_object_split() is sleeping. In this case some pages in new_object may be left unbusied, but vm_object_split() attempts to unbusy all of them. Track the beginning of the busied range. Add an assertion to verify that pages are not re-added to the source object while sleeping. Reported by: Olympios Petrakis Reviewed by: alc, kib Tested by: pho MFC after: 1 week Sponsored by: NetApp, Inc. Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D26223 Modified: head/sys/vm/vm_object.c Modified: head/sys/vm/vm_object.c ============================================================================== --- head/sys/vm/vm_object.c Mon Sep 7 23:22:16 2020 (r365436) +++ head/sys/vm/vm_object.c Mon Sep 7 23:28:33 2020 (r365437) @@ -1496,7 +1496,7 @@ vm_object_shadow(vm_object_t *object, vm_ooffset_t *of void vm_object_split(vm_map_entry_t entry) { - vm_page_t m, m_next; + vm_page_t m, m_busy, m_next; vm_object_t orig_object, new_object, backing_object; vm_pindex_t idx, offidxstart; vm_size_t size; @@ -1553,8 +1553,14 @@ vm_object_split(vm_map_entry_t entry) * that the object is in transition. */ vm_object_set_flag(orig_object, OBJ_SPLIT); + m_busy = NULL; +#ifdef INVARIANTS + idx = 0; +#endif retry: m = vm_page_find_least(orig_object, offidxstart); + KASSERT(m == NULL || idx <= m->pindex - offidxstart, + ("%s: object %p was repopulated", __func__, orig_object)); for (; m != NULL && (idx = m->pindex - offidxstart) < size; m = m_next) { m_next = TAILQ_NEXT(m, listq); @@ -1609,8 +1615,15 @@ retry: */ vm_reserv_rename(m, new_object, orig_object, offidxstart); #endif + + /* + * orig_object's type may change while sleeping, so keep track + * of the beginning of the busied range. + */ if (orig_object->type != OBJT_SWAP) vm_page_xunbusy(m); + else if (m_busy == NULL) + m_busy = m; } if (orig_object->type == OBJT_SWAP) { /* @@ -1618,8 +1631,9 @@ retry: * and new_object's locks are released and reacquired. */ swap_pager_copy(orig_object, new_object, offidxstart, 0); - TAILQ_FOREACH(m, &new_object->memq, listq) - vm_page_xunbusy(m); + if (m_busy != NULL) + TAILQ_FOREACH_FROM(m_busy, &new_object->memq, listq) + vm_page_xunbusy(m_busy); } vm_object_clear_flag(orig_object, OBJ_SPLIT); VM_OBJECT_WUNLOCK(orig_object); From owner-svn-src-all@freebsd.org Tue Sep 8 00:15:18 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D2B4A3DA788; Tue, 8 Sep 2020 00:15:18 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BllzB5CN5z3f9f; Tue, 8 Sep 2020 00:15:18 +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 9634327CA6; Tue, 8 Sep 2020 00:15:18 +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 0880FIxu002167; Tue, 8 Sep 2020 00:15:18 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0880FIef002166; Tue, 8 Sep 2020 00:15:18 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202009080015.0880FIef002166@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 8 Sep 2020 00:15:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365438 - head/tools/build X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/tools/build X-SVN-Commit-Revision: 365438 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.33 Precedence: list List-Id: "SVN commit messages 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, 08 Sep 2020 00:15:18 -0000 Author: emaste Date: Tue Sep 8 00:15:18 2020 New Revision: 365438 URL: https://svnweb.freebsd.org/changeset/base/365438 Log: retire an old NO_CLEAN dependency cleanup hack We have some hacks to remove stale dependency files for NO_CLEAN builds that are missed by make's dependency handling. These are intended to upport ongoing NO_CLEAN builds, and are no longer needed after a sufficient amount of time elapses. Modified: head/tools/build/depend-cleanup.sh Modified: head/tools/build/depend-cleanup.sh ============================================================================== --- head/tools/build/depend-cleanup.sh Mon Sep 7 23:28:33 2020 (r365437) +++ head/tools/build/depend-cleanup.sh Tue Sep 8 00:15:18 2020 (r365438) @@ -37,8 +37,6 @@ clean_dep() } # Date Rev Description -# 20190916 r352703 shm_open syscall reimplemented in C -clean_dep lib/libc shm_open S # 20200310 r358851 rename of openmp's ittnotify_static.c to .cpp clean_dep lib/libomp ittnotify_static c # 20200414 r359930 closefrom From owner-svn-src-all@freebsd.org Tue Sep 8 00:44:37 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2DE3B3DB0AC; Tue, 8 Sep 2020 00:44:37 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Blmd10Sbnz3ghX; Tue, 8 Sep 2020 00:44:37 +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 E745827BE2; Tue, 8 Sep 2020 00:44:36 +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 0880iai9020227; Tue, 8 Sep 2020 00:44:36 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0880iasn020223; Tue, 8 Sep 2020 00:44:36 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202009080044.0880iasn020223@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 8 Sep 2020 00:44:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365439 - in head: . share/mk tools/build/options X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in head: . share/mk tools/build/options X-SVN-Commit-Revision: 365439 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.33 Precedence: list List-Id: "SVN commit messages 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, 08 Sep 2020 00:44:37 -0000 Author: emaste Date: Tue Sep 8 00:44:35 2020 New Revision: 365439 URL: https://svnweb.freebsd.org/changeset/base/365439 Log: Add WITH_/WITHOUT_CLEAN option to replace NO_CLEAN This allows use of the standard src.conf configuration for controlling whether the tree is cleaned before build or not. The default is still to clean. Setting either NOCLEAN or NO_CLEAN will mention the new src.conf option. NOCLEAN remains a .warning, while for now NO_CLEAN is .info. Reviewed by: bdrewery (earlier version) MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D22762 Added: head/tools/build/options/WITHOUT_CLEAN (contents, props changed) Modified: head/Makefile.inc1 head/Makefile.libcompat head/share/mk/src.opts.mk Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Tue Sep 8 00:15:18 2020 (r365438) +++ head/Makefile.inc1 Tue Sep 8 00:44:35 2020 (r365439) @@ -441,9 +441,13 @@ SUBDIR+=etc .endif # !empty(SUBDIR_OVERRIDE) .if defined(NOCLEAN) -.warning NOCLEAN option is deprecated. Use NO_CLEAN instead. -NO_CLEAN= ${NOCLEAN} +.warning The src.conf WITHOUT_CLEAN option can now be used instead of NOCLEAN. +MK_CLEAN:= no .endif +.if defined(NO_CLEAN) +.info The src.conf WITHOUT_CLEAN option can now be used instead of NO_CLEAN. +MK_CLEAN:= no +.endif .if defined(NO_CLEANDIR) CLEANDIR= clean cleandepend .else @@ -451,7 +455,7 @@ CLEANDIR= cleandir .endif .if defined(WORLDFAST) -NO_CLEAN= t +MK_CLEAN:= no NO_OBJWALK= t .endif @@ -460,7 +464,7 @@ NO_OBJWALK= t # The .meta files will also track the build command and rebuild should # it change. .if empty(.MAKE.MODE:Mnofilemon) -NO_CLEAN= t +MK_CLEAN:= no .endif .endif .if defined(NO_OBJWALK) || ${MK_AUTO_OBJ} == "yes" @@ -837,7 +841,7 @@ _LIBCOMPAT= SOFT # timestamps (see NO_META_IGNORE_HOST in sys.mk). There are known times # when the ABI breaks though that we want to force rebuilding WORLDTMP # to get updated host tools. -.if ${MK_META_MODE} == "yes" && defined(NO_CLEAN) && \ +.if ${MK_META_MODE} == "yes" && ${MK_CLEAN} == "no" && \ !defined(NO_META_IGNORE_HOST) && !defined(NO_META_IGNORE_HOST_HEADERS) && \ !defined(_MKSHOWCONFIG) # r318736 - ino64 major ABI breakage @@ -869,7 +873,7 @@ NO_META_IGNORE_HOST_HEADERS= 1 .export NO_META_IGNORE_HOST_HEADERS .endif # defined(_meta_mode_need_rebuild) .endif # defined(OBJDIR_HOST_OSRELDATE) -.endif # ${MK_META_MODE} == "yes" && defined(NO_CLEAN) ... +.endif # ${MK_META_MODE} == "yes" && ${MK_CLEAN} == "no" ... # This is only used for META_MODE+filemon to track what the oldest # __FreeBSD_version is in WORLDTMP. This purposely does NOT have # a make dependency on /usr/include/osreldate.h as the file should @@ -1013,7 +1017,7 @@ _worldtmp: .PHONY @echo "--------------------------------------------------------------" @echo ">>> Rebuilding the temporary build tree" @echo "--------------------------------------------------------------" -.if !defined(NO_CLEAN) +.if ${MK_CLEAN} == "yes" rm -rf ${WORLDTMP} .else # Note: for delete-old we need to set $PATH to also include the host $PATH @@ -1038,7 +1042,7 @@ _worldtmp: .PHONY .if ${USING_SYSTEM_LINKER} == "yes" @rm -f ${WORLDTMP}/usr/bin/ld ${WORLDTMP}/usr/bin/ld.lld .endif # ${USING_SYSTEM_LINKER} == "yes" -.endif # !defined(NO_CLEAN) +.endif # ${MK_CLEAN} == "yes" @mkdir -p ${WORLDTMP} @touch ${WORLDTMP}/${.TARGET} # We can't use mtree to create the worldtmp directories since it may not be @@ -1077,7 +1081,7 @@ _bootstrap-tools: ${WORLDTMP_MTREE} -f ${.CURDIR}/${_mtree} -p ${WORLDTMP} > /dev/null .endfor _cleanobj: -.if !defined(NO_CLEAN) +.if ${MK_CLEAN} == "yes" @echo @echo "--------------------------------------------------------------" @echo ">>> stage 2.1: cleaning up the object tree" @@ -1090,7 +1094,7 @@ _cleanobj: .endif .else ${_+_}cd ${.CURDIR}; ${WMAKE} _NO_INCLUDE_COMPILERMK=t _cleanobj_fast_depend_hack -.endif # !defined(NO_CLEAN) +.endif # ${MK_CLEAN} == "yes" _obj: @echo @echo "--------------------------------------------------------------" @@ -1672,7 +1676,7 @@ buildkernel: .MAKE .PHONY -I '${KERNCONFDIR}' -I '${KRNLCONFDIR}' \ '${KERNCONFDIR}/${_kernel}' .endif -.if !defined(NO_CLEAN) && !defined(NO_KERNELCLEAN) +.if ${MK_CLEAN} == "yes" && !defined(NO_KERNELCLEAN) @echo @echo "--------------------------------------------------------------" @echo ">>> stage 2.1: cleaning up the object tree" @@ -2478,7 +2482,7 @@ _jevents=lib/libpmc/pmu-events # kernel-toolchain skips _cleanobj, so handle cleaning up previous # build-tools directories if needed. -.if !defined(NO_CLEAN) && make(kernel-toolchain) +.if ${MK_CLEAN} == "yes" && make(kernel-toolchain) _bt_clean= ${CLEANDIR} .endif Modified: head/Makefile.libcompat ============================================================================== --- head/Makefile.libcompat Tue Sep 8 00:15:18 2020 (r365438) +++ head/Makefile.libcompat Tue Sep 8 00:44:35 2020 (r365439) @@ -62,7 +62,7 @@ build${libcompat}: .PHONY @echo "--------------------------------------------------------------" @echo ">>> stage 4.3: building lib${libcompat} shim libraries" @echo "--------------------------------------------------------------" -.if !defined(NO_CLEAN) +.if ${MK_CLEAN} == "yes" rm -rf ${LIBCOMPATTMP} .else ${_+_}@if [ -e "${LIBCOMPATTMP}" ]; then \ @@ -71,7 +71,7 @@ build${libcompat}: .PHONY DESTDIR=${LIBCOMPATTMP} \ delete-old delete-old-libs >/dev/null; \ fi -.endif # !defined(NO_CLEAN) +.endif # MK_CLEAN == "yes" mkdir -p ${LIBCOMPATTMP}/usr/include ${WORLDTMP_MTREE} -f ${.CURDIR}/etc/mtree/BSD.usr.dist \ Modified: head/share/mk/src.opts.mk ============================================================================== --- head/share/mk/src.opts.mk Tue Sep 8 00:15:18 2020 (r365438) +++ head/share/mk/src.opts.mk Tue Sep 8 00:44:35 2020 (r365439) @@ -80,6 +80,7 @@ __DEFAULT_YES_OPTIONS = \ CLANG \ CLANG_BOOTSTRAP \ CLANG_IS_CC \ + CLEAN \ CPP \ CROSS_COMPILER \ CRYPT \ Added: head/tools/build/options/WITHOUT_CLEAN ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITHOUT_CLEAN Tue Sep 8 00:44:35 2020 (r365439) @@ -0,0 +1,2 @@ +.\" $FreeBSD$ +Do not clean before building world and/or kernel. From owner-svn-src-all@freebsd.org Tue Sep 8 00:48:18 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C527A3DB0D7; Tue, 8 Sep 2020 00:48:18 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BlmjG4h1lz3xBh; Tue, 8 Sep 2020 00:48:18 +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 7F7898305; Tue, 8 Sep 2020 00:48:18 +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 0880mIDc020440; Tue, 8 Sep 2020 00:48:18 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0880mIHJ020439; Tue, 8 Sep 2020 00:48:18 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202009080048.0880mIHJ020439@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 8 Sep 2020 00:48:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365440 - head/share/man/man5 X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/share/man/man5 X-SVN-Commit-Revision: 365440 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.33 Precedence: list List-Id: "SVN commit messages 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, 08 Sep 2020 00:48:18 -0000 Author: emaste Date: Tue Sep 8 00:48:18 2020 New Revision: 365440 URL: https://svnweb.freebsd.org/changeset/base/365440 Log: src.conf.5: regen after r365439, WITH_/WITHOUT_CLEAN option Modified: head/share/man/man5/src.conf.5 Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Tue Sep 8 00:44:35 2020 (r365439) +++ head/share/man/man5/src.conf.5 Tue Sep 8 00:48:18 2020 (r365440) @@ -1,6 +1,6 @@ .\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman. .\" $FreeBSD$ -.Dd September 5, 2020 +.Dd September 7, 2020 .Dt SRC.CONF 5 .Os .Sh NAME @@ -346,6 +346,8 @@ Do not install links to the Clang C/C++ compiler as .Pa /usr/bin/c++ and .Pa /usr/bin/cpp . +.It Va WITHOUT_CLEAN +Do not clean before building world and/or kernel. .It Va WITHOUT_CPP Set to not build .Xr cpp 1 . @@ -1108,7 +1110,6 @@ for more details. Set to disable assertions and statistics gathering in .Xr malloc 3 . It also defaults the A and J runtime options to off. -Disabled by default on -CURRENT. .It Va WITHOUT_MAN Set to not build manual pages. When set, these options are also in effect: From owner-svn-src-all@freebsd.org Tue Sep 8 01:27:04 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6EE673DC40C; Tue, 8 Sep 2020 01:27:04 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BlnZ02KNBz40vw; Tue, 8 Sep 2020 01:27:04 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 33CAF886B; Tue, 8 Sep 2020 01:27:04 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0881R46r046208; Tue, 8 Sep 2020 01:27:04 GMT (envelope-from bdragon@FreeBSD.org) Received: (from bdragon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0881R4Cl046207; Tue, 8 Sep 2020 01:27:04 GMT (envelope-from bdragon@FreeBSD.org) Message-Id: <202009080127.0881R4Cl046207@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdragon set sender to bdragon@FreeBSD.org using -f From: Brandon Bergren Date: Tue, 8 Sep 2020 01:27:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365441 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: bdragon X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 365441 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.33 Precedence: list List-Id: "SVN commit messages 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, 08 Sep 2020 01:27:04 -0000 Author: bdragon Date: Tue Sep 8 01:27:03 2020 New Revision: 365441 URL: https://svnweb.freebsd.org/changeset/base/365441 Log: [PowerPC] Work around -O miscompile on powerpc 32 bit. Work around llvm 11 miscompile in 32 bit powerpc that appears to cause ifuncs to branch to the wrong address by forcing -O2. This worked in previous versions because -O was mapped to -O2 previously (but is now -O1.) While here, remove the old temporary workaround from r224882 that does the opposite thing for powerpc non-DEBUG kernels, bringing it in line with other platforms that compile at -O2. This fixes kernel boot on powerpc and powerpcspe after the llvm11 transition. Sponsored by: Tag1 Consulting, Inc. Modified: head/sys/conf/kern.pre.mk Modified: head/sys/conf/kern.pre.mk ============================================================================== --- head/sys/conf/kern.pre.mk Tue Sep 8 00:48:18 2020 (r365440) +++ head/sys/conf/kern.pre.mk Tue Sep 8 01:27:03 2020 (r365441) @@ -51,14 +51,15 @@ OBJCOPY?= objcopy SIZE?= size .if defined(DEBUG) +.if ${MACHINE_ARCH} == "powerpc" || ${MACHINE_ARCH} == "powerpcspe" +# Work around clang 11 miscompile on 32 bit powerpc. +_MINUS_O= -O2 +.else _MINUS_O= -O +.endif CTFFLAGS+= -g .else -.if ${MACHINE_CPUARCH} == "powerpc" -_MINUS_O= -O # gcc miscompiles some code at -O2 -.else _MINUS_O= -O2 -.endif .endif .if ${MACHINE_CPUARCH} == "amd64" .if ${COMPILER_TYPE} == "clang" From owner-svn-src-all@freebsd.org Tue Sep 8 03:00:34 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3D6DC3DFB97; Tue, 8 Sep 2020 03:00:34 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Blqdt0y7Rz45vn; Tue, 8 Sep 2020 03:00:34 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 053F39A20; Tue, 8 Sep 2020 03:00:34 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08830XTq001290; Tue, 8 Sep 2020 03:00:33 GMT (envelope-from bdragon@FreeBSD.org) Received: (from bdragon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08830VGX001278; Tue, 8 Sep 2020 03:00:31 GMT (envelope-from bdragon@FreeBSD.org) Message-Id: <202009080300.08830VGX001278@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdragon set sender to bdragon@FreeBSD.org using -f From: Brandon Bergren Date: Tue, 8 Sep 2020 03:00:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365442 - in head: lib/libc/powerpc lib/libc/powerpc/sys lib/libc/powerpc64 lib/libc/powerpc64/sys lib/libc/powerpcspe sys/powerpc/include sys/powerpc/powerpc X-SVN-Group: head X-SVN-Commit-Author: bdragon X-SVN-Commit-Paths: in head: lib/libc/powerpc lib/libc/powerpc/sys lib/libc/powerpc64 lib/libc/powerpc64/sys lib/libc/powerpcspe sys/powerpc/include sys/powerpc/powerpc X-SVN-Commit-Revision: 365442 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.33 Precedence: list List-Id: "SVN commit messages 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, 08 Sep 2020 03:00:34 -0000 Author: bdragon Date: Tue Sep 8 03:00:31 2020 New Revision: 365442 URL: https://svnweb.freebsd.org/changeset/base/365442 Log: [PowerPC] Implement VDSO timebase access on powerpc* Implement the remaining pieces needed to allow userland timestamp reading. Rewritten based on an intial essay into the problem by Justin Hibbits. (Copyright changed to my own on his request.) Tested on ppc64 (POWER9 Talos II), powerpcspe (e500v2 RB800), and powerpc (g4 PowerBook). Reviewed by: jhibbits (in irc) Sponsored by: Tag1 Consulting, Inc. Differential Revision: https://reviews.freebsd.org/D26347 Added: head/lib/libc/powerpc/sys/__vdso_gettc.c (contents, props changed) head/lib/libc/powerpc64/sys/__vdso_gettc.c (contents, props changed) Modified: head/lib/libc/powerpc/Makefile.inc head/lib/libc/powerpc/sys/Makefile.inc head/lib/libc/powerpc64/Makefile.inc head/lib/libc/powerpc64/sys/Makefile.inc head/lib/libc/powerpcspe/Makefile.inc head/sys/powerpc/include/vdso.h head/sys/powerpc/powerpc/clock.c head/sys/powerpc/powerpc/elf32_machdep.c head/sys/powerpc/powerpc/elf64_machdep.c Modified: head/lib/libc/powerpc/Makefile.inc ============================================================================== --- head/lib/libc/powerpc/Makefile.inc Tue Sep 8 01:27:03 2020 (r365441) +++ head/lib/libc/powerpc/Makefile.inc Tue Sep 8 03:00:31 2020 (r365442) @@ -1,7 +1,5 @@ # $FreeBSD$ -SRCS+= trivial-vdso_tc.c - # Long double is 64-bits SRCS+=machdep_ldisd.c SYM_MAPS+=${LIBC_SRCTOP}/powerpc/Symbol.map Modified: head/lib/libc/powerpc/sys/Makefile.inc ============================================================================== --- head/lib/libc/powerpc/sys/Makefile.inc Tue Sep 8 01:27:03 2020 (r365441) +++ head/lib/libc/powerpc/sys/Makefile.inc Tue Sep 8 03:00:31 2020 (r365442) @@ -1,3 +1,4 @@ # $FreeBSD$ +SRCS+= __vdso_gettc.c MDASM+= cerror.S Added: head/lib/libc/powerpc/sys/__vdso_gettc.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/powerpc/sys/__vdso_gettc.c Tue Sep 8 03:00:31 2020 (r365442) @@ -0,0 +1,68 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2020 Brandon Bergren + * + * This software was developed by Konstantin Belousov + * 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 AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include + +#include +#include + +#include + +#include "libc_private.h" + +#pragma weak __vdso_gettc +int +__vdso_gettc(const struct vdso_timehands *th, u_int *tc) +{ + + if (__predict_false(th->th_algo != VDSO_TH_ALGO_PPC_TB)) + return (ENOSYS); + /* + * While the timebase is a 64 bit quantity, we are only interested + * in the lower 32 bits of it. + */ + *tc = mfspr(TBR_TBL); + + return (0); +} + +#pragma weak __vdso_gettimekeep +int +__vdso_gettimekeep(struct vdso_timekeep **tk) +{ + + return (_elf_aux_info(AT_TIMEKEEP, tk, sizeof(*tk))); +} Modified: head/lib/libc/powerpc64/Makefile.inc ============================================================================== --- head/lib/libc/powerpc64/Makefile.inc Tue Sep 8 01:27:03 2020 (r365441) +++ head/lib/libc/powerpc64/Makefile.inc Tue Sep 8 03:00:31 2020 (r365442) @@ -1,7 +1,5 @@ # $FreeBSD$ -SRCS+= trivial-vdso_tc.c - # Long double is 64-bits SRCS+=machdep_ldisd.c SYM_MAPS+=${LIBC_SRCTOP}/powerpc64/Symbol.map Modified: head/lib/libc/powerpc64/sys/Makefile.inc ============================================================================== --- head/lib/libc/powerpc64/sys/Makefile.inc Tue Sep 8 01:27:03 2020 (r365441) +++ head/lib/libc/powerpc64/sys/Makefile.inc Tue Sep 8 03:00:31 2020 (r365442) @@ -1,3 +1,4 @@ # $FreeBSD$ +SRCS+= __vdso_gettc.c MDASM+= cerror.S Added: head/lib/libc/powerpc64/sys/__vdso_gettc.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/powerpc64/sys/__vdso_gettc.c Tue Sep 8 03:00:31 2020 (r365442) @@ -0,0 +1,65 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2020 Brandon Bergren + * + * This software was developed by Konstantin Belousov + * 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 AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include + +#include + +#include + +#include "libc_private.h" + +#pragma weak __vdso_gettc +int +__vdso_gettc(const struct vdso_timehands *th, u_int *tc) +{ + u_quad_t tb; + + if (__predict_false(th->th_algo != VDSO_TH_ALGO_PPC_TB)) + return (ENOSYS); + + __asm __volatile ("mftb %0" : "=r"(tb)); + *tc = tb; + return (0); +} + +#pragma weak __vdso_gettimekeep +int +__vdso_gettimekeep(struct vdso_timekeep **tk) +{ + + return (_elf_aux_info(AT_TIMEKEEP, tk, sizeof(*tk))); +} Modified: head/lib/libc/powerpcspe/Makefile.inc ============================================================================== --- head/lib/libc/powerpcspe/Makefile.inc Tue Sep 8 01:27:03 2020 (r365441) +++ head/lib/libc/powerpcspe/Makefile.inc Tue Sep 8 03:00:31 2020 (r365442) @@ -1,7 +1,6 @@ # $FreeBSD$ CFLAGS+= -I${LIBC_SRCTOP}/powerpc -SRCS+= trivial-vdso_tc.c # Long double is 64-bits SRCS+=machdep_ldisd.c Modified: head/sys/powerpc/include/vdso.h ============================================================================== --- head/sys/powerpc/include/vdso.h Tue Sep 8 01:27:03 2020 (r365441) +++ head/sys/powerpc/include/vdso.h Tue Sep 8 03:00:31 2020 (r365442) @@ -33,6 +33,8 @@ #define VDSO_TIMEHANDS_MD \ uint32_t th_res[8]; +#define VDSO_TH_ALGO_PPC_TB VDSO_TH_ALGO_1 + #ifdef _KERNEL #ifdef COMPAT_FREEBSD32 Modified: head/sys/powerpc/powerpc/clock.c ============================================================================== --- head/sys/powerpc/powerpc/clock.c Tue Sep 8 01:27:03 2020 (r365441) +++ head/sys/powerpc/powerpc/clock.c Tue Sep 8 03:00:31 2020 (r365442) @@ -69,6 +69,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include @@ -90,6 +91,12 @@ static int decr_et_start(struct eventtimer *et, sbintime_t first, sbintime_t period); static int decr_et_stop(struct eventtimer *et); static timecounter_get_t decr_get_timecount; +static uint32_t decr_vdso_timehands(struct vdso_timehands *vdso_th, + struct timecounter *tc); +#ifdef COMPAT_FREEBSD32 +static uint32_t decr_vdso_timehands32(struct vdso_timehands32 *vdso_th32, + struct timecounter *tc); +#endif struct decr_state { int mode; /* 0 - off, 1 - periodic, 2 - one-shot. */ @@ -99,11 +106,14 @@ DPCPU_DEFINE_STATIC(struct decr_state, decr_state); static struct eventtimer decr_et; static struct timecounter decr_tc = { - decr_get_timecount, /* get_timecount */ - 0, /* no poll_pps */ - ~0u, /* counter_mask */ - 0, /* frequency */ - "timebase" /* name */ + .tc_get_timecount = decr_get_timecount, + .tc_counter_mask = ~0u, + .tc_name = "timebase", + .tc_quality = 1000, + .tc_fill_vdso_timehands = decr_vdso_timehands, +#ifdef COMPAT_FREEBSD32 + .tc_fill_vdso_timehands32 = decr_vdso_timehands32, +#endif }; /* @@ -223,6 +233,25 @@ decr_tc_init(void) decr_et.et_priv = NULL; et_register(&decr_et); } + +uint32_t +decr_vdso_timehands(struct vdso_timehands *vdso_th, struct timecounter *tc) +{ + vdso_th->th_algo = VDSO_TH_ALGO_PPC_TB; + bzero(vdso_th->th_res, sizeof(vdso_th->th_res)); + return (initialized == 1); +} + +#ifdef COMPAT_FREEBSD32 +uint32_t +decr_vdso_timehands32(struct vdso_timehands32 *vdso_th32, + struct timecounter *tc) +{ + vdso_th32->th_algo = VDSO_TH_ALGO_PPC_TB; + bzero(vdso_th32->th_res, sizeof(vdso_th32->th_res)); + return (initialized == 1); +} +#endif /* * Event timer start method. Modified: head/sys/powerpc/powerpc/elf32_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/elf32_machdep.c Tue Sep 8 01:27:03 2020 (r365441) +++ head/sys/powerpc/powerpc/elf32_machdep.c Tue Sep 8 03:00:31 2020 (r365442) @@ -122,7 +122,8 @@ struct sysentvec elf32_freebsd_sysvec = { .sv_fixlimit = NULL, #endif .sv_maxssiz = NULL, - .sv_flags = SV_ABI_FREEBSD | SV_ILP32 | SV_SHP | SV_ASLR, + .sv_flags = SV_ABI_FREEBSD | SV_ILP32 | SV_SHP | SV_ASLR | + SV_TIMEKEEP, .sv_set_syscall_retval = cpu_set_syscall_retval, .sv_fetch_syscall_args = cpu_fetch_syscall_args, .sv_shared_page_base = FREEBSD32_SHAREDPAGE, Modified: head/sys/powerpc/powerpc/elf64_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/elf64_machdep.c Tue Sep 8 01:27:03 2020 (r365441) +++ head/sys/powerpc/powerpc/elf64_machdep.c Tue Sep 8 03:00:31 2020 (r365442) @@ -83,7 +83,8 @@ struct sysentvec elf64_freebsd_sysvec_v1 = { .sv_setregs = exec_setregs_funcdesc, .sv_fixlimit = NULL, .sv_maxssiz = NULL, - .sv_flags = SV_ABI_FREEBSD | SV_LP64 | SV_SHP | SV_ASLR, + .sv_flags = SV_ABI_FREEBSD | SV_LP64 | SV_SHP | SV_ASLR | + SV_TIMEKEEP, .sv_set_syscall_retval = cpu_set_syscall_retval, .sv_fetch_syscall_args = cpu_fetch_syscall_args, .sv_syscallnames = syscallnames, @@ -120,7 +121,8 @@ struct sysentvec elf64_freebsd_sysvec_v2 = { .sv_setregs = exec_setregs, .sv_fixlimit = NULL, .sv_maxssiz = NULL, - .sv_flags = SV_ABI_FREEBSD | SV_LP64 | SV_SHP, + .sv_flags = SV_ABI_FREEBSD | SV_LP64 | SV_SHP | + SV_TIMEKEEP, .sv_set_syscall_retval = cpu_set_syscall_retval, .sv_fetch_syscall_args = cpu_fetch_syscall_args, .sv_syscallnames = syscallnames, From owner-svn-src-all@freebsd.org Tue Sep 8 03:55:50 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B11E23E1AF5; Tue, 8 Sep 2020 03:55:50 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Blrsf4GXMz4BJb; Tue, 8 Sep 2020 03:55:50 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 767C2A934; Tue, 8 Sep 2020 03:55:50 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0883to0D039051; Tue, 8 Sep 2020 03:55:50 GMT (envelope-from grehan@FreeBSD.org) Received: (from grehan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0883to9S039050; Tue, 8 Sep 2020 03:55:50 GMT (envelope-from grehan@FreeBSD.org) Message-Id: <202009080355.0883to9S039050@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: grehan set sender to grehan@FreeBSD.org using -f From: Peter Grehan Date: Tue, 8 Sep 2020 03:55:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365443 - stable/12/sys/amd64/vmm X-SVN-Group: stable-12 X-SVN-Commit-Author: grehan X-SVN-Commit-Paths: stable/12/sys/amd64/vmm X-SVN-Commit-Revision: 365443 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.33 Precedence: list List-Id: "SVN commit messages 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, 08 Sep 2020 03:55:50 -0000 Author: grehan Date: Tue Sep 8 03:55:49 2020 New Revision: 365443 URL: https://svnweb.freebsd.org/changeset/base/365443 Log: MFC 364339 Allow guest device MMIO access from bootmem memory segments. Differential Revision: https://reviews.freebsd.org/D25955 Modified: stable/12/sys/amd64/vmm/vmm.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/amd64/vmm/vmm.c ============================================================================== --- stable/12/sys/amd64/vmm/vmm.c Tue Sep 8 03:00:31 2020 (r365442) +++ stable/12/sys/amd64/vmm/vmm.c Tue Sep 8 03:55:49 2020 (r365443) @@ -980,8 +980,7 @@ vm_gpa_hold(struct vm *vm, int vcpuid, vm_paddr_t gpa, count = 0; for (i = 0; i < VM_MAX_MEMMAPS; i++) { mm = &vm->mem_maps[i]; - if (sysmem_mapping(vm, mm) && gpa >= mm->gpa && - gpa < mm->gpa + mm->len) { + if (gpa >= mm->gpa && gpa < mm->gpa + mm->len) { count = vm_fault_quick_hold_pages(&vm->vmspace->vm_map, trunc_page(gpa), PAGE_SIZE, reqprot, &m, 1); break; From owner-svn-src-all@freebsd.org Tue Sep 8 04:44:38 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 499D63E300F; Tue, 8 Sep 2020 04:44:38 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Blsxy1Ctwz4Dmr; Tue, 8 Sep 2020 04:44:38 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 0D361AFBB; Tue, 8 Sep 2020 04:44:38 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0884ibWe069141; Tue, 8 Sep 2020 04:44:37 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0884ibD2069139; Tue, 8 Sep 2020 04:44:37 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <202009080444.0884ibD2069139@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Tue, 8 Sep 2020 04:44:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365444 - in head/sys/dev/usb: . net X-SVN-Group: head X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: in head/sys/dev/usb: . net X-SVN-Commit-Revision: 365444 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.33 Precedence: list List-Id: "SVN commit messages 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, 08 Sep 2020 04:44:38 -0000 Author: lwhsu Date: Tue Sep 8 04:44:37 2020 New Revision: 365444 URL: https://svnweb.freebsd.org/changeset/base/365444 Log: Add support to BELKIN B2B128 USB3 Ethernet Adapter to axge(4) Github PR: https://github.com/freebsd/freebsd/pull/439 Submitted by: https://github.com/jdpc86 MFC after: 2 weeks Modified: head/sys/dev/usb/net/if_axge.c head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/net/if_axge.c ============================================================================== --- head/sys/dev/usb/net/if_axge.c Tue Sep 8 03:55:49 2020 (r365443) +++ head/sys/dev/usb/net/if_axge.c Tue Sep 8 04:44:37 2020 (r365444) @@ -75,6 +75,7 @@ static const STRUCT_USB_HOST_ID axge_devs[] = { #define AXGE_DEV(v,p) { USB_VP(USB_VENDOR_##v, USB_PRODUCT_##v##_##p) } AXGE_DEV(ASIX, AX88178A), AXGE_DEV(ASIX, AX88179), + AXGE_DEV(BELKIN, B2B128), AXGE_DEV(DLINK, DUB1312), AXGE_DEV(LENOVO, GIGALAN), AXGE_DEV(SITECOMEU, LN032), Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Tue Sep 8 03:55:49 2020 (r365443) +++ head/sys/dev/usb/usbdevs Tue Sep 8 04:44:37 2020 (r365444) @@ -1366,6 +1366,7 @@ product BELKIN F5U109 0x0109 F5U109 Serial product BELKIN USB2SCSI 0x0115 USB to SCSI product BELKIN F8T012 0x0121 F8T012xx1 Bluetooth USB Adapter product BELKIN USB2LAN 0x0121 USB to LAN +product BELKIN B2B128 0x0128 USB3 to LAN product BELKIN F5U208 0x0208 F5U208 VideoBus II product BELKIN F5U237 0x0237 F5U237 USB 2.0 7-Port Hub product BELKIN F5U257 0x0257 F5U257 Serial From owner-svn-src-all@freebsd.org Tue Sep 8 05:46:11 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6B38A3E43A3; Tue, 8 Sep 2020 05:46:11 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BlvJz2FGLz4HSB; Tue, 8 Sep 2020 05:46:11 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 318C9BACB; Tue, 8 Sep 2020 05:46:11 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0885kAIO006784; Tue, 8 Sep 2020 05:46:10 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0885kAgk006783; Tue, 8 Sep 2020 05:46:10 GMT (envelope-from avg@FreeBSD.org) Message-Id: <202009080546.0885kAgk006783@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Tue, 8 Sep 2020 05:46:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365445 - head/sys/cam/mmc X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/sys/cam/mmc X-SVN-Commit-Revision: 365445 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.33 Precedence: list List-Id: "SVN commit messages 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, 08 Sep 2020 05:46:11 -0000 Author: avg Date: Tue Sep 8 05:46:10 2020 New Revision: 365445 URL: https://svnweb.freebsd.org/changeset/base/365445 Log: mmc_da: make sure that part_index is not used uninitialized in sddastart This is a fix to r334065. Without this change I once got stuck I/O with endless partition switching: (sdda0:aw_mmc_sim2:0:0:0): sddastart (sdda0:aw_mmc_sim2:0:0:0): Partition 0 -> -525703168 (sdda0:aw_mmc_sim2:0:0:0): xpt_action: func 0x91d XPT_MMC_IO (sdda0:aw_mmc_sim2:0:0:0): xpt_done: func= 0x91d XPT_MMC_IO status 0x1 (sdda0:aw_mmc_sim2:0:0:0): sddadone (sdda0:aw_mmc_sim2:0:0:0): Card status: 00000000 (sdda0:aw_mmc_sim2:0:0:0): Current state: 4 (sdda0:aw_mmc_sim2:0:0:0): Compteting partition switch to 0 Note that -525703168 (an int) is 0xe0aa6800 in binary representation. The partition indexes are actually stored as uint8_t, so that value was converted / truncated to zero. MFC after: 1 week Modified: head/sys/cam/mmc/mmc_da.c Modified: head/sys/cam/mmc/mmc_da.c ============================================================================== --- head/sys/cam/mmc/mmc_da.c Tue Sep 8 04:44:37 2020 (r365444) +++ head/sys/cam/mmc/mmc_da.c Tue Sep 8 05:46:10 2020 (r365445) @@ -1808,6 +1808,7 @@ sddastart(struct cam_periph *periph, union ccb *start_ } /* Find partition that has outstanding commands. Prefer current partition. */ + part_index = softc->part_curr; part = softc->part[softc->part_curr]; bp = bioq_first(&part->bio_queue); if (bp == NULL) { From owner-svn-src-all@freebsd.org Tue Sep 8 06:18:35 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6960A3E4BDE; Tue, 8 Sep 2020 06:18:35 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Blw2M2BMHz4KLZ; Tue, 8 Sep 2020 06:18:35 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2B340C0B7; Tue, 8 Sep 2020 06:18:35 +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 0886IZxL025729; Tue, 8 Sep 2020 06:18:35 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0886IZSE025728; Tue, 8 Sep 2020 06:18:35 GMT (envelope-from avg@FreeBSD.org) Message-Id: <202009080618.0886IZSE025728@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Tue, 8 Sep 2020 06:18:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365446 - head/sys/cam/mmc X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/sys/cam/mmc X-SVN-Commit-Revision: 365446 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.33 Precedence: list List-Id: "SVN commit messages 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, 08 Sep 2020 06:18:35 -0000 Author: avg Date: Tue Sep 8 06:18:34 2020 New Revision: 365446 URL: https://svnweb.freebsd.org/changeset/base/365446 Log: mmc_da: fix a typo and a too long line MFC after: 1 week Modified: head/sys/cam/mmc/mmc_da.c Modified: head/sys/cam/mmc/mmc_da.c ============================================================================== --- head/sys/cam/mmc/mmc_da.c Tue Sep 8 05:46:10 2020 (r365445) +++ head/sys/cam/mmc/mmc_da.c Tue Sep 8 06:18:34 2020 (r365446) @@ -1965,7 +1965,8 @@ sddadone(struct cam_periph *periph, union ccb *done_cc /* Process result of switching MMC partitions */ if (softc->state == SDDA_STATE_PART_SWITCH) { CAM_DEBUG(path, CAM_DEBUG_TRACE, - ("Compteting partition switch to %d\n", softc->part_requested)); + ("Completing partition switch to %d\n", + softc->part_requested)); softc->outstanding_cmds--; /* Complete partition switch */ softc->state = SDDA_STATE_NORMAL; From owner-svn-src-all@freebsd.org Tue Sep 8 06:19:23 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D84673E4F25; Tue, 8 Sep 2020 06:19:23 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Blw3H5MYRz4KVC; Tue, 8 Sep 2020 06:19:23 +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 9C861C115; Tue, 8 Sep 2020 06:19:23 +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 0886JNot025807; Tue, 8 Sep 2020 06:19:23 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0886JNiA025806; Tue, 8 Sep 2020 06:19:23 GMT (envelope-from avg@FreeBSD.org) Message-Id: <202009080619.0886JNiA025806@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Tue, 8 Sep 2020 06:19:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365447 - head/sys/cam/mmc X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/sys/cam/mmc X-SVN-Commit-Revision: 365447 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.33 Precedence: list List-Id: "SVN commit messages 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, 08 Sep 2020 06:19:23 -0000 Author: avg Date: Tue Sep 8 06:19:23 2020 New Revision: 365447 URL: https://svnweb.freebsd.org/changeset/base/365447 Log: mmc_da: universally use uint8_t for the partition index Also, assert in sdda_init_switch_part() that the index is within the defined range. MFC after: 1 week Modified: head/sys/cam/mmc/mmc_da.c Modified: head/sys/cam/mmc/mmc_da.c ============================================================================== --- head/sys/cam/mmc/mmc_da.c Tue Sep 8 06:18:34 2020 (r365446) +++ head/sys/cam/mmc/mmc_da.c Tue Sep 8 06:19:23 2020 (r365447) @@ -182,7 +182,6 @@ static void sdda_start_init(void *context, union ccb * static void sdda_start_init_task(void *context, int pending); static void sdda_process_mmc_partitions(struct cam_periph *periph, union ccb *start_ccb); static uint32_t sdda_get_host_caps(struct cam_periph *periph, union ccb *ccb); -static void sdda_init_switch_part(struct cam_periph *periph, union ccb *start_ccb, u_int part); static int mmc_select_card(struct cam_periph *periph, union ccb *ccb, uint32_t rca); static inline uint32_t mmc_get_sector_size(struct cam_periph *periph) {return MMC_SECTOR_SIZE;} @@ -1770,10 +1769,13 @@ sdda_process_mmc_partitions(struct cam_periph *periph, * This function cannot fail, instead check switch errors in sddadone(). */ static void -sdda_init_switch_part(struct cam_periph *periph, union ccb *start_ccb, u_int part) { +sdda_init_switch_part(struct cam_periph *periph, union ccb *start_ccb, + uint8_t part) +{ struct sdda_softc *sc = (struct sdda_softc *)periph->softc; uint8_t value; + KASSERT(part < MMC_PART_MAX, ("%s: invalid partition index", __func__)); sc->part_requested = part; value = (sc->raw_ext_csd[EXT_CSD_PART_CONFIG] & @@ -1797,7 +1799,7 @@ sddastart(struct cam_periph *periph, union ccb *start_ struct sdda_softc *softc = (struct sdda_softc *)periph->softc; struct sdda_part *part; struct mmc_params *mmcp = &periph->path->device->mmc_ident_data; - int part_index; + uint8_t part_index; CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("sddastart\n")); From owner-svn-src-all@freebsd.org Tue Sep 8 07:10:27 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2D6DA3E5C27; Tue, 8 Sep 2020 07:10:27 +0000 (UTC) (envelope-from agapon@gmail.com) Received: from mail-lf1-f48.google.com (mail-lf1-f48.google.com [209.85.167.48]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BlxBB263Lz4M5d; Tue, 8 Sep 2020 07:10:26 +0000 (UTC) (envelope-from agapon@gmail.com) Received: by mail-lf1-f48.google.com with SMTP id y2so8575746lfy.10; Tue, 08 Sep 2020 00:10:26 -0700 (PDT) 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=hwtTN7dz0zCy1+HhUNsOwkqjbdD4zmif6id5I9OmQbI=; b=t8isFXf7ubfPN24BQPAERhjAVHBaDVzQf2eSmKJhbiDBNuWrsxfQiddqQpx1oGxcNT RSWSVZVs+BZjW2F+qe+zLRvB1uaoUaMBHoADHnnQm61RjovlXlATWLJ8p2fk9ILvDCod jdy1rRVZmY4nOfyKnDxX1MenRlp3ICDsxqg2qeL/AdnrcO5fJZ0jSFqwkmQpVLqrCK8F OnFje+u0Ol4uGJNR0kz4PYNy8DXhf5F0JX9T7vjJYKqu5oxIFZXb+ZUuDbXO5hoLcmUC hw9MAzc9QJ0IELTFa83FvxZ0R3M1cXZCeevi1o9Vs+cLHeRXFgzomCGGbXM52FpEQL24 OX6w== X-Gm-Message-State: AOAM5319hK+oTsMXD6lhyXCAQV5lkC9a70UkSf6I3BrTs0OXDeezuAxK BkZHA9S2Peb6X/tkIX54FWlF4TocffA= X-Google-Smtp-Source: ABdhPJyAwuLSQ15A0s1sT93pnXoKW50EYcwvBijBfU8n8hCYCy+BZUJiTK0AM/EIvM48wetu4tbfSg== X-Received: by 2002:ac2:4142:: with SMTP id c2mr6085312lfi.55.1599549024178; Tue, 08 Sep 2020 00:10:24 -0700 (PDT) Received: from [192.168.0.88] (east.meadow.volia.net. [93.72.151.96]) by smtp.googlemail.com with ESMTPSA id u17sm9451051lfi.2.2020.09.08.00.10.23 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 08 Sep 2020 00:10:23 -0700 (PDT) Subject: Re: svn commit: r365445 - head/sys/cam/mmc To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202009080546.0885kAgk006783@repo.freebsd.org> From: Andriy Gapon Openpgp: preference=signencrypt Autocrypt: addr=avg@FreeBSD.org; prefer-encrypt=mutual; keydata= mQINBFm4LIgBEADNB/3lT7f15UKeQ52xCFQx/GqHkSxEdVyLFZTmY3KyNPQGBtyvVyBfprJ7 mAeXZWfhat6cKNRAGZcL5EmewdQuUfQfBdYmKjbw3a9GFDsDNuhDA2QwFt8BmkiVMRYyvI7l N0eVzszWCUgdc3qqM6qqcgBaqsVmJluwpvwp4ZBXmch5BgDDDb1MPO8AZ2QZfIQmplkj8Y6Z AiNMknkmgaekIINSJX8IzRzKD5WwMsin70psE8dpL/iBsA2cpJGzWMObVTtCxeDKlBCNqM1i gTXta1ukdUT7JgLEFZk9ceYQQMJJtUwzWu1UHfZn0Fs29HTqawfWPSZVbulbrnu5q55R4PlQ /xURkWQUTyDpqUvb4JK371zhepXiXDwrrpnyyZABm3SFLkk2bHlheeKU6Yql4pcmSVym1AS4 dV8y0oHAfdlSCF6tpOPf2+K9nW1CFA8b/tw4oJBTtfZ1kxXOMdyZU5fiG7xb1qDgpQKgHUX8 7Rd2T1UVLVeuhYlXNw2F+a2ucY+cMoqz3LtpksUiBppJhw099gEXehcN2JbUZ2TueJdt1FdS ztnZmsHUXLxrRBtGwqnFL7GSd6snpGIKuuL305iaOGODbb9c7ne1JqBbkw1wh8ci6vvwGlzx rexzimRaBzJxlkjNfMx8WpCvYebGMydNoeEtkWldtjTNVsUAtQARAQABtB5BbmRyaXkgR2Fw b24gPGF2Z0BGcmVlQlNELm9yZz6JAlQEEwEIAD4WIQS+LEO7ngQnXA4Bjr538m7TUc1yjwUC WbgsiAIbIwUJBaOagAULCQgHAgYVCAkKCwIEFgIDAQIeAQIXgAAKCRB38m7TUc1yj+JAEACV l9AK/nOWAt/9cufV2fRj0hdOqB1aCshtSrwHk/exXsDa4/FkmegxXQGY+3GWX3deIyesbVRL rYdtdK0dqJyT1SBqXK1h3/at9rxr9GQA6KWOxTjUFURsU7ok/6SIlm8uLRPNKO+yq0GDjgaO LzN+xykuBA0FlhQAXJnpZLcVfPJdWv7sSHGedL5ln8P8rxR+XnmsA5TUaaPcbhTB+mG+iKFj GghASDSfGqLWFPBlX/fpXikBDZ1gvOr8nyMY9nXhgfXpq3B6QCRYKPy58ChrZ5weeJZ29b7/ QdEO8NFNWHjSD9meiLdWQaqo9Y7uUxN3wySc/YUZxtS0bhAd8zJdNPsJYG8sXgKjeBQMVGuT eCAJFEYJqbwWvIXMfVWop4+O4xB+z2YE3jAbG/9tB/GSnQdVSj3G8MS80iLS58frnt+RSEw/ psahrfh0dh6SFHttE049xYiC+cM8J27Aaf0i9RflyITq57NuJm+AHJoU9SQUkIF0nc6lfA+o JRiyRlHZHKoRQkIg4aiKaZSWjQYRl5Txl0IZUP1dSWMX4s3XTMurC/pnja45dge/4ESOtJ9R 8XuIWg45Oq6MeIWdjKddGhRj3OohsltKgkEU3eLKYtB6qRTQypHHUawCXz88uYt5e3w4V16H lCpSTZV/EVHnNe45FVBlvK7k7HFfDDkryLkCDQRZuCyIARAAlq0slcsVboY/+IUJdcbEiJRW be9HKVz4SUchq0z9MZPX/0dcnvz/gkyYA+OuM78dNS7Mbby5dTvOqfpLJfCuhaNYOhlE0wY+ 1T6Tf1f4c/uA3U/YiadukQ3+6TJuYGAdRZD5EqYFIkreARTVWg87N9g0fT9BEqLw9lJtEGDY EWUE7L++B8o4uu3LQFEYxcrb4K/WKmgtmFcm77s0IKDrfcX4doV92QTIpLiRxcOmCC/OCYuO jB1oaaqXQzZrCutXRK0L5XN1Y1PYjIrEzHMIXmCDlLYnpFkK+itlXwlE2ZQxkfMruCWdQXye syl2fynAe8hvp7Mms9qU2r2K9EcJiR5N1t1C2/kTKNUhcRv7Yd/vwusK7BqJbhlng5ZgRx0m WxdntU/JLEntz3QBsBsWM9Y9wf2V4tLv6/DuDBta781RsCB/UrU2zNuOEkSixlUiHxw1dccI 6CVlaWkkJBxmHX22GdDFrcjvwMNIbbyfQLuBq6IOh8nvu9vuItup7qemDG3Ms6TVwA7BD3j+ 3fGprtyW8Fd/RR2bW2+LWkMrqHffAr6Y6V3h5kd2G9Q8ZWpEJk+LG6Mk3fhZhmCnHhDu6CwN MeUvxXDVO+fqc3JjFm5OxhmfVeJKrbCEUJyM8ESWLoNHLqjywdZga4Q7P12g8DUQ1mRxYg/L HgZY3zfKOqcAEQEAAYkCPAQYAQgAJhYhBL4sQ7ueBCdcDgGOvnfybtNRzXKPBQJZuCyIAhsM BQkFo5qAAAoJEHfybtNRzXKPBVwQAKfFy9P7N3OsLDMB56A4Kf+ZT+d5cIx0Yiaf4n6w7m3i ImHHHk9FIetI4Xe54a2IXh4Bq5UkAGY0667eIs+Z1Ea6I2i27Sdo7DxGwq09Qnm/Y65ADvXs 3aBvokCcm7FsM1wky395m8xUos1681oV5oxgqeRI8/76qy0hD9WR65UW+HQgZRIcIjSel9vR XDaD2HLGPTTGr7u4v00UeTMs6qvPsa2PJagogrKY8RXdFtXvweQFz78NbXhluwix2Tb9ETPk LIpDrtzV73CaE2aqBG/KrboXT2C67BgFtnk7T7Y7iKq4/XvEdDWscz2wws91BOXuMMd4c/c4 OmGW9m3RBLufFrOag1q5yUS9QbFfyqL6dftJP3Zq/xe+mr7sbWbhPVCQFrH3r26mpmy841ym dwQnNcsbIGiBASBSKksOvIDYKa2Wy8htPmWFTEOPRpFXdGQ27awcjjnB42nngyCK5ukZDHi6 w0qK5DNQQCkiweevCIC6wc3p67jl1EMFY5+z+zdTPb3h7LeVnGqW0qBQl99vVFgzLxchKcl0 R/paSFgwqXCZhAKMuUHncJuynDOP7z5LirUeFI8qsBAJi1rXpQoLJTVcW72swZ42IdPiboqx NbTMiNOiE36GqMcTPfKylCbF45JNX4nF9ElM0E+Y8gi4cizJYBRr2FBJgay0b9Cp Message-ID: <34826ee7-12a9-d309-1fee-cd2e95744603@FreeBSD.org> Date: Tue, 8 Sep 2020 10:10:22 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Firefox/60.0 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <202009080546.0885kAgk006783@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4BlxBB263Lz4M5d X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of agapon@gmail.com designates 209.85.167.48 as permitted sender) smtp.mailfrom=agapon@gmail.com X-Spamd-Result: default: False [-1.51 / 15.00]; RCVD_TLS_ALL(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; ARC_NA(0.00)[]; DMARC_NA(0.00)[FreeBSD.org]; NEURAL_HAM_LONG(-0.15)[-0.150]; RCVD_COUNT_THREE(0.00)[3]; NEURAL_HAM_MEDIUM(-0.67)[-0.669]; NEURAL_HAM_SHORT(-0.69)[-0.687]; RCVD_IN_DNSWL_NONE(0.00)[209.85.167.48:from]; RECEIVED_SPAMHAUS_PBL(0.00)[93.72.151.96:received]; FORGED_SENDER(0.30)[avg@FreeBSD.org,agapon@gmail.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.167.48:from]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; MIME_TRACE(0.00)[0:+]; FROM_NEQ_ENVFROM(0.00)[avg@FreeBSD.org,agapon@gmail.com]; MAILMAN_DEST(0.00)[svn-src-head,svn-src-all] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 08 Sep 2020 07:10:27 -0000 On 08/09/2020 08:46, Andriy Gapon wrote: > Author: avg > Date: Tue Sep 8 05:46:10 2020 > New Revision: 365445 > URL: https://svnweb.freebsd.org/changeset/base/365445 > > Log: > mmc_da: make sure that part_index is not used uninitialized in sddastart [snip] > Modified: head/sys/cam/mmc/mmc_da.c > ============================================================================== > --- head/sys/cam/mmc/mmc_da.c Tue Sep 8 04:44:37 2020 (r365444) > +++ head/sys/cam/mmc/mmc_da.c Tue Sep 8 05:46:10 2020 (r365445) > @@ -1808,6 +1808,7 @@ sddastart(struct cam_periph *periph, union ccb *start_ > } > > /* Find partition that has outstanding commands. Prefer current partition. */ > + part_index = softc->part_curr; > part = softc->part[softc->part_curr]; > bp = bioq_first(&part->bio_queue); > if (bp == NULL) { > One thing that concerns me is that it was obvious (to a human) that part_index could be used uninitialized if bp was not NULL. Yet, there was no warning or error from the compiler when I built that code for armv7. I wonder if we disable some relevant warnings for that architecture. Or if the compiler (clang 11) could not figure that out. -- Andriy Gapon From owner-svn-src-all@freebsd.org Tue Sep 8 07:24:08 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 10E233E5EB7; Tue, 8 Sep 2020 07:24:08 +0000 (UTC) (envelope-from agapon@gmail.com) Received: from mail-lj1-f194.google.com (mail-lj1-f194.google.com [209.85.208.194]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BlxTy6qY8z4MyY; Tue, 8 Sep 2020 07:24:06 +0000 (UTC) (envelope-from agapon@gmail.com) Received: by mail-lj1-f194.google.com with SMTP id t23so18732130ljc.3; Tue, 08 Sep 2020 00:24:06 -0700 (PDT) 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=VZyHQXnsGA/jAzqhDDS9+oRwMFpeYNIvcSeH1jwPrUk=; b=lNrFBeiCSLfNzgPVmH5p1LXhOPIQwvBZCD35WvPrZR5pj7MgvpQ0vaJKL8qX8vib9x 2PRNXLshQiQEVhHrP+dmNp7psIP39pHsgmj8F+Rk5fYlGN3rcP8jlritEC6PMRf+w5mz pyVa1PicOgRIpJ8l1RnFK1VhomIxxRTS+bCOWBrHXgMcMl7MMYdCbAhwT7gjSZmySgcT VWwU+pUcIzzO/AN/WqfsXrl9G4N2WMRLH9JMUuzgzD1MksKR8nbmQF2zcwG0iDnlhB0p CHqJG2vmuBp1KtIBDELfLl8ikaRrp/W+oycYMAvlfOT6M2CAr6An0JQ3CAm22AuxvEXC FAPA== X-Gm-Message-State: AOAM533jmkCn1xZDKmxsuIm8wQ4A9V53ieQsNayPu6DSVW+HlPw+HmCL dUbQl0H5SctfNnH09S9PM+jGLy5OZjE= X-Google-Smtp-Source: ABdhPJyERfU5bOrZhciLdBJmAYAnHSNh61KKieHngXH9mxe9zTOI1PQeW7gHx96OhP15qVNRoIJvVw== X-Received: by 2002:a2e:6a04:: with SMTP id f4mr11201239ljc.119.1599549844903; Tue, 08 Sep 2020 00:24:04 -0700 (PDT) Received: from [192.168.0.88] (east.meadow.volia.net. [93.72.151.96]) by smtp.googlemail.com with ESMTPSA id t4sm9478006ljh.122.2020.09.08.00.24.03 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 08 Sep 2020 00:24:04 -0700 (PDT) Subject: Re: svn commit: r365445 - head/sys/cam/mmc To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202009080546.0885kAgk006783@repo.freebsd.org> <34826ee7-12a9-d309-1fee-cd2e95744603@FreeBSD.org> From: Andriy Gapon Openpgp: preference=signencrypt Autocrypt: addr=avg@FreeBSD.org; prefer-encrypt=mutual; keydata= mQINBFm4LIgBEADNB/3lT7f15UKeQ52xCFQx/GqHkSxEdVyLFZTmY3KyNPQGBtyvVyBfprJ7 mAeXZWfhat6cKNRAGZcL5EmewdQuUfQfBdYmKjbw3a9GFDsDNuhDA2QwFt8BmkiVMRYyvI7l N0eVzszWCUgdc3qqM6qqcgBaqsVmJluwpvwp4ZBXmch5BgDDDb1MPO8AZ2QZfIQmplkj8Y6Z AiNMknkmgaekIINSJX8IzRzKD5WwMsin70psE8dpL/iBsA2cpJGzWMObVTtCxeDKlBCNqM1i gTXta1ukdUT7JgLEFZk9ceYQQMJJtUwzWu1UHfZn0Fs29HTqawfWPSZVbulbrnu5q55R4PlQ /xURkWQUTyDpqUvb4JK371zhepXiXDwrrpnyyZABm3SFLkk2bHlheeKU6Yql4pcmSVym1AS4 dV8y0oHAfdlSCF6tpOPf2+K9nW1CFA8b/tw4oJBTtfZ1kxXOMdyZU5fiG7xb1qDgpQKgHUX8 7Rd2T1UVLVeuhYlXNw2F+a2ucY+cMoqz3LtpksUiBppJhw099gEXehcN2JbUZ2TueJdt1FdS ztnZmsHUXLxrRBtGwqnFL7GSd6snpGIKuuL305iaOGODbb9c7ne1JqBbkw1wh8ci6vvwGlzx rexzimRaBzJxlkjNfMx8WpCvYebGMydNoeEtkWldtjTNVsUAtQARAQABtB5BbmRyaXkgR2Fw b24gPGF2Z0BGcmVlQlNELm9yZz6JAlQEEwEIAD4WIQS+LEO7ngQnXA4Bjr538m7TUc1yjwUC WbgsiAIbIwUJBaOagAULCQgHAgYVCAkKCwIEFgIDAQIeAQIXgAAKCRB38m7TUc1yj+JAEACV l9AK/nOWAt/9cufV2fRj0hdOqB1aCshtSrwHk/exXsDa4/FkmegxXQGY+3GWX3deIyesbVRL rYdtdK0dqJyT1SBqXK1h3/at9rxr9GQA6KWOxTjUFURsU7ok/6SIlm8uLRPNKO+yq0GDjgaO LzN+xykuBA0FlhQAXJnpZLcVfPJdWv7sSHGedL5ln8P8rxR+XnmsA5TUaaPcbhTB+mG+iKFj GghASDSfGqLWFPBlX/fpXikBDZ1gvOr8nyMY9nXhgfXpq3B6QCRYKPy58ChrZ5weeJZ29b7/ QdEO8NFNWHjSD9meiLdWQaqo9Y7uUxN3wySc/YUZxtS0bhAd8zJdNPsJYG8sXgKjeBQMVGuT eCAJFEYJqbwWvIXMfVWop4+O4xB+z2YE3jAbG/9tB/GSnQdVSj3G8MS80iLS58frnt+RSEw/ psahrfh0dh6SFHttE049xYiC+cM8J27Aaf0i9RflyITq57NuJm+AHJoU9SQUkIF0nc6lfA+o JRiyRlHZHKoRQkIg4aiKaZSWjQYRl5Txl0IZUP1dSWMX4s3XTMurC/pnja45dge/4ESOtJ9R 8XuIWg45Oq6MeIWdjKddGhRj3OohsltKgkEU3eLKYtB6qRTQypHHUawCXz88uYt5e3w4V16H lCpSTZV/EVHnNe45FVBlvK7k7HFfDDkryLkCDQRZuCyIARAAlq0slcsVboY/+IUJdcbEiJRW be9HKVz4SUchq0z9MZPX/0dcnvz/gkyYA+OuM78dNS7Mbby5dTvOqfpLJfCuhaNYOhlE0wY+ 1T6Tf1f4c/uA3U/YiadukQ3+6TJuYGAdRZD5EqYFIkreARTVWg87N9g0fT9BEqLw9lJtEGDY EWUE7L++B8o4uu3LQFEYxcrb4K/WKmgtmFcm77s0IKDrfcX4doV92QTIpLiRxcOmCC/OCYuO jB1oaaqXQzZrCutXRK0L5XN1Y1PYjIrEzHMIXmCDlLYnpFkK+itlXwlE2ZQxkfMruCWdQXye syl2fynAe8hvp7Mms9qU2r2K9EcJiR5N1t1C2/kTKNUhcRv7Yd/vwusK7BqJbhlng5ZgRx0m WxdntU/JLEntz3QBsBsWM9Y9wf2V4tLv6/DuDBta781RsCB/UrU2zNuOEkSixlUiHxw1dccI 6CVlaWkkJBxmHX22GdDFrcjvwMNIbbyfQLuBq6IOh8nvu9vuItup7qemDG3Ms6TVwA7BD3j+ 3fGprtyW8Fd/RR2bW2+LWkMrqHffAr6Y6V3h5kd2G9Q8ZWpEJk+LG6Mk3fhZhmCnHhDu6CwN MeUvxXDVO+fqc3JjFm5OxhmfVeJKrbCEUJyM8ESWLoNHLqjywdZga4Q7P12g8DUQ1mRxYg/L HgZY3zfKOqcAEQEAAYkCPAQYAQgAJhYhBL4sQ7ueBCdcDgGOvnfybtNRzXKPBQJZuCyIAhsM BQkFo5qAAAoJEHfybtNRzXKPBVwQAKfFy9P7N3OsLDMB56A4Kf+ZT+d5cIx0Yiaf4n6w7m3i ImHHHk9FIetI4Xe54a2IXh4Bq5UkAGY0667eIs+Z1Ea6I2i27Sdo7DxGwq09Qnm/Y65ADvXs 3aBvokCcm7FsM1wky395m8xUos1681oV5oxgqeRI8/76qy0hD9WR65UW+HQgZRIcIjSel9vR XDaD2HLGPTTGr7u4v00UeTMs6qvPsa2PJagogrKY8RXdFtXvweQFz78NbXhluwix2Tb9ETPk LIpDrtzV73CaE2aqBG/KrboXT2C67BgFtnk7T7Y7iKq4/XvEdDWscz2wws91BOXuMMd4c/c4 OmGW9m3RBLufFrOag1q5yUS9QbFfyqL6dftJP3Zq/xe+mr7sbWbhPVCQFrH3r26mpmy841ym dwQnNcsbIGiBASBSKksOvIDYKa2Wy8htPmWFTEOPRpFXdGQ27awcjjnB42nngyCK5ukZDHi6 w0qK5DNQQCkiweevCIC6wc3p67jl1EMFY5+z+zdTPb3h7LeVnGqW0qBQl99vVFgzLxchKcl0 R/paSFgwqXCZhAKMuUHncJuynDOP7z5LirUeFI8qsBAJi1rXpQoLJTVcW72swZ42IdPiboqx NbTMiNOiE36GqMcTPfKylCbF45JNX4nF9ElM0E+Y8gi4cizJYBRr2FBJgay0b9Cp Message-ID: <5ab214be-37fd-30e3-4035-a53b9723e61d@FreeBSD.org> Date: Tue, 8 Sep 2020 10:24:03 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Firefox/60.0 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <34826ee7-12a9-d309-1fee-cd2e95744603@FreeBSD.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4BlxTy6qY8z4MyY X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of agapon@gmail.com designates 209.85.208.194 as permitted sender) smtp.mailfrom=agapon@gmail.com X-Spamd-Result: default: False [-1.63 / 15.00]; RCVD_TLS_ALL(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; ARC_NA(0.00)[]; DMARC_NA(0.00)[FreeBSD.org]; NEURAL_HAM_LONG(-0.23)[-0.232]; RCVD_COUNT_THREE(0.00)[3]; NEURAL_HAM_MEDIUM(-0.69)[-0.688]; NEURAL_HAM_SHORT(-0.71)[-0.706]; RCVD_IN_DNSWL_NONE(0.00)[209.85.208.194:from]; RECEIVED_SPAMHAUS_PBL(0.00)[93.72.151.96:received]; FORGED_SENDER(0.30)[avg@FreeBSD.org,agapon@gmail.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.208.194:from]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[avg@FreeBSD.org,agapon@gmail.com]; FREEMAIL_ENVFROM(0.00)[gmail.com]; MAILMAN_DEST(0.00)[svn-src-head,svn-src-all] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 08 Sep 2020 07:24:08 -0000 On 08/09/2020 10:10, Andriy Gapon wrote: > On 08/09/2020 08:46, Andriy Gapon wrote: >> Author: avg >> Date: Tue Sep 8 05:46:10 2020 >> New Revision: 365445 >> URL: https://svnweb.freebsd.org/changeset/base/365445 >> >> Log: >> mmc_da: make sure that part_index is not used uninitialized in sddastart > [snip] >> Modified: head/sys/cam/mmc/mmc_da.c >> ============================================================================== >> --- head/sys/cam/mmc/mmc_da.c Tue Sep 8 04:44:37 2020 (r365444) >> +++ head/sys/cam/mmc/mmc_da.c Tue Sep 8 05:46:10 2020 (r365445) >> @@ -1808,6 +1808,7 @@ sddastart(struct cam_periph *periph, union ccb *start_ >> } >> >> /* Find partition that has outstanding commands. Prefer current partition. */ >> + part_index = softc->part_curr; >> part = softc->part[softc->part_curr]; >> bp = bioq_first(&part->bio_queue); >> if (bp == NULL) { >> > > One thing that concerns me is that it was obvious (to a human) that part_index > could be used uninitialized if bp was not NULL. > Yet, there was no warning or error from the compiler when I built that code for > armv7. > > I wonder if we disable some relevant warnings for that architecture. > Or if the compiler (clang 11) could not figure that out. > FWIW, I've just tried GENERIC-MMCCAM on amd64 and didn't get any warning either (with a tree from before this commit). -- Andriy Gapon From owner-svn-src-all@freebsd.org Tue Sep 8 07:37:46 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 55D8D3E6569; Tue, 8 Sep 2020 07:37:46 +0000 (UTC) (envelope-from rew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Blxnk1P35z4NhT; Tue, 8 Sep 2020 07:37:46 +0000 (UTC) (envelope-from rew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 0F78ACB67; Tue, 8 Sep 2020 07:37:46 +0000 (UTC) (envelope-from rew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0887bjWk074807; Tue, 8 Sep 2020 07:37:45 GMT (envelope-from rew@FreeBSD.org) Received: (from rew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0887bjE8074806; Tue, 8 Sep 2020 07:37:45 GMT (envelope-from rew@FreeBSD.org) Message-Id: <202009080737.0887bjE8074806@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rew set sender to rew@FreeBSD.org using -f From: Robert Wing Date: Tue, 8 Sep 2020 07:37:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365448 - stable/12/sbin/bectl X-SVN-Group: stable-12 X-SVN-Commit-Author: rew X-SVN-Commit-Paths: stable/12/sbin/bectl X-SVN-Commit-Revision: 365448 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.33 Precedence: list List-Id: "SVN commit messages 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, 08 Sep 2020 07:37:46 -0000 Author: rew Date: Tue Sep 8 07:37:45 2020 New Revision: 365448 URL: https://svnweb.freebsd.org/changeset/base/365448 Log: MFC r364369: bectl(8): Fix output of 'bectl list' for the 'Mountpoint' column. PR: 241064 Modified: stable/12/sbin/bectl/bectl_list.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/bectl/bectl_list.c ============================================================================== --- stable/12/sbin/bectl/bectl_list.c Tue Sep 8 06:19:23 2020 (r365447) +++ stable/12/sbin/bectl/bectl_list.c Tue Sep 8 07:37:45 2020 (r365448) @@ -292,19 +292,23 @@ print_headers(nvlist_t *props, struct printc *pc) nvpair_t *cur; nvlist_t *dsprops; char *propstr; - size_t be_maxcol; + size_t be_maxcol, mount_colsz; if (pc->show_all_datasets || pc->show_snaps) chosen_be_header = HEADER_BEPLUS; else chosen_be_header = HEADER_BE; be_maxcol = strlen(chosen_be_header); + mount_colsz = strlen(HEADER_MOUNT); for (cur = nvlist_next_nvpair(props, NULL); cur != NULL; cur = nvlist_next_nvpair(props, cur)) { be_maxcol = MAX(be_maxcol, strlen(nvpair_name(cur))); + nvpair_value_nvlist(cur, &dsprops); + + if (nvlist_lookup_string(dsprops, "mounted", &propstr) == 0) + mount_colsz = MAX(mount_colsz, strlen(propstr)); if (!pc->show_all_datasets && !pc->show_snaps) continue; - nvpair_value_nvlist(cur, &dsprops); if (nvlist_lookup_string(dsprops, "dataset", &propstr) != 0) continue; be_maxcol = MAX(be_maxcol, strlen(propstr) + INDENT_INCREMENT); @@ -316,10 +320,10 @@ print_headers(nvlist_t *props, struct printc *pc) pc->be_colsz = be_maxcol; pc->active_colsz_def = strlen(HEADER_ACTIVE); - pc->mount_colsz = strlen(HEADER_MOUNT); + pc->mount_colsz = mount_colsz; pc->space_colsz = strlen(HEADER_SPACE); - printf("%*s %s %s %s %s\n", -pc->be_colsz, chosen_be_header, - HEADER_ACTIVE, HEADER_MOUNT, HEADER_SPACE, HEADER_CREATED); + printf("%*s %s %*s %s %s\n", -pc->be_colsz, chosen_be_header, + HEADER_ACTIVE, -pc->mount_colsz, HEADER_MOUNT, HEADER_SPACE, HEADER_CREATED); /* * All other invocations in which we aren't using the default header From owner-svn-src-all@freebsd.org Tue Sep 8 10:36:12 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 83392332975; Tue, 8 Sep 2020 10:36:12 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bm1lc3LK7z4YPg; Tue, 8 Sep 2020 10:36:12 +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 55D5AF127; Tue, 8 Sep 2020 10:36:12 +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 088AaCDn085097; Tue, 8 Sep 2020 10:36:12 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 088AaCk8085096; Tue, 8 Sep 2020 10:36:12 GMT (envelope-from ae@FreeBSD.org) Message-Id: <202009081036.088AaCk8085096@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Tue, 8 Sep 2020 10:36:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365449 - head/sbin/rcorder X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: head/sbin/rcorder X-SVN-Commit-Revision: 365449 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.33 Precedence: list List-Id: "SVN commit messages 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, 08 Sep 2020 10:36:12 -0000 Author: ae Date: Tue Sep 8 10:36:11 2020 New Revision: 365449 URL: https://svnweb.freebsd.org/changeset/base/365449 Log: Add a few features to rcorder: o Enhance dependency loop logging: print full chain instead of the last link competing the loop; o Add -g option to generate dependency graph suitable for GraphViz visualization, loops and other graph generation issues are highlighted automatically; o Add -p option that enables grouping items that can be processed in parallel. Submitted by: Boris Lytochkin Reviewed by: melifaro MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D25389 Modified: head/sbin/rcorder/rcorder.8 head/sbin/rcorder/rcorder.c Modified: head/sbin/rcorder/rcorder.8 ============================================================================== --- head/sbin/rcorder/rcorder.8 Tue Sep 8 07:37:45 2020 (r365448) +++ head/sbin/rcorder/rcorder.8 Tue Sep 8 10:36:11 2020 (r365449) @@ -31,7 +31,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 22, 2020 +.Dd September 8, 2020 .Dt RCORDER 8 .Os .Sh NAME @@ -39,6 +39,7 @@ .Nd print a dependency ordering of interdependent files .Sh SYNOPSIS .Nm +.Op Fl gp .Op Fl k Ar keep .Op Fl s Ar skip .Ar @@ -95,6 +96,9 @@ is reached, parsing stops. .Pp The options are as follows: .Bl -tag -width "-k keep" +.It Fl g +Produce a GraphViz (.dot) of the complete dependency graph instead of +plaintext calling order list. .It Fl k Ar keep Add the specified keyword to the .Dq "keep list" . @@ -102,6 +106,9 @@ If any .Fl k option is given, only those files containing the matching keyword are listed. This option can be specified multiple times. +.It Fl p +Generate ordering suitable for parallel startup, placing files that can be +executed simultaneously on the same line. .It Fl s Ar skip Add the specified keyword to the .Dq "skip list" . @@ -178,19 +185,46 @@ The utility may print one of the following error messages and exit with a non-zero status if it encounters an error while processing the file list. .Bl -diag -.It "Requirement %s has no providers, aborting." +.It "Requirement %s in file %s has no providers." No file has a .Ql PROVIDE line corresponding to a condition present in a .Ql REQUIRE line in another file. -.It "Circular dependency on provision %s, aborting." +.It "Circular dependency on provision %s in file %s." A set of files has a circular dependency which was detected while processing the stated condition. -.It "Circular dependency on file %s, aborting." +Loop visualization follows this message. +.It "Circular dependency on file %s." A set of files has a circular dependency which was detected while processing the stated file. +.It "%s was seen in circular dependencies for %d times." +Each node that was a part of circular dependency loops reports total number of +such encounters. +Start with files having biggest counter when fighting with broken dependencies. .El +.Sh DIAGNOSTICS WITH GRAPHVIZ +Direct dependency is drawn with solid line, +.Ql BEFORE +dependency is drawn as a dashed line. +Each node of a graph represents an item from +.Ql PROVIDE +lines. +In case there are more than one file providing an item, a list of filenames +shortened with +.Xr basename 3 +is shown. +Shortened filenames are also shown in case +.Ql PROVIDE +item does not match file name. +.Pp +Edges and nodes where circular dependencies were detected are drawn bold red. +If a file has an item in +.Ql REQUIRE +or in +.Ql BEFORE +that could not be provided, +this missing provider and the requirement will be drawn bold red as well. .Sh SEE ALSO .Xr acpiconf 8 , .Xr rc 8 , Modified: head/sbin/rcorder/rcorder.c ============================================================================== --- head/sbin/rcorder/rcorder.c Tue Sep 8 07:37:45 2020 (r365448) +++ head/sbin/rcorder/rcorder.c Tue Sep 8 10:36:11 2020 (r365449) @@ -9,6 +9,8 @@ * All rights reserved. * Copyright (c) 1998 * Perry E. Metzger. All rights reserved. + * Copyright (c) 2020 + * Boris N. Lytochkin. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -48,6 +50,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include "ealloc.h" #include "sprite.h" @@ -75,17 +79,21 @@ static int debug = 0; #define KEYWORDS_STR "# KEYWORDS:" #define KEYWORDS_LEN (sizeof(KEYWORDS_STR) - 1) +#define FAKE_PROV_NAME "fake_prov_" + static int exit_code; static int file_count; static char **file_list; -typedef int bool; #define TRUE 1 #define FALSE 0 typedef bool flag; #define SET TRUE #define RESET FALSE +static flag do_graphviz = false; +static flag do_parallel = false; + static Hash_Table provide_hash_s, *provide_hash; typedef struct provnode provnode; @@ -97,12 +105,14 @@ typedef struct strnodelist strnodelist; struct provnode { flag head; flag in_progress; + int sequence; filenode *fnode; provnode *next, *last; }; struct f_provnode { provnode *pnode; + Hash_Entry *entry; f_provnode *next; }; @@ -124,19 +134,23 @@ struct filenode { f_reqnode *req_list; f_provnode *prov_list; strnodelist *keyword_list; + int issues_count; + int sequence; }; -static filenode fn_head_s, *fn_head; +static filenode fn_head_s, *fn_head, **fn_seqlist; +static int max_sequence = 0; static strnodelist *bl_list; static strnodelist *keep_list; static strnodelist *skip_list; -static void do_file(filenode *fnode); +static void do_file(filenode *fnode, strnodelist *); static void strnode_add(strnodelist **, char *, filenode *); static int skip_ok(filenode *fnode); static int keep_ok(filenode *fnode); -static void satisfy_req(f_reqnode *rnode, char *filename); +static char *generate_loop_for_req(strnodelist *, provnode *, filenode *); +static void satisfy_req(f_reqnode *rnode, filenode *fnode, strnodelist *); static void crunch_file(char *); static void parse_require(filenode *, char *); static void parse_provide(filenode *, char *); @@ -151,6 +165,12 @@ static void insert_before(void); static Hash_Entry *make_fake_provision(filenode *); static void crunch_all_files(void); static void initialize(void); +static void generate_graphviz_header(void); +static void generate_graphviz_footer(void); +static void generate_graphviz_file_links(Hash_Entry *, filenode *); +static void generate_graphviz_providers(void); +static inline int is_fake_prov(const char *); +static int sequence_cmp(const void *, const void *); static void generate_ordering(void); int @@ -158,7 +178,7 @@ main(int argc, char *argv[]) { int ch; - while ((ch = getopt(argc, argv, "dk:s:")) != -1) + while ((ch = getopt(argc, argv, "dgk:ps:")) != -1) switch (ch) { case 'd': #ifdef DEBUG @@ -167,9 +187,15 @@ main(int argc, char *argv[]) warnx("debugging not compiled in, -d ignored"); #endif break; + case 'g': + do_graphviz = true; + break; case 'k': strnode_add(&keep_list, optarg, 0); break; + case 'p': + do_parallel = true; + break; case 's': strnode_add(&skip_list, optarg, 0); break; @@ -186,10 +212,13 @@ main(int argc, char *argv[]) DPRINTF((stderr, "parse_args\n")); initialize(); DPRINTF((stderr, "initialize\n")); + generate_graphviz_header(); crunch_all_files(); DPRINTF((stderr, "crunch_all_files\n")); + generate_graphviz_providers(); generate_ordering(); DPRINTF((stderr, "generate_ordering\n")); + generate_graphviz_footer(); exit(exit_code); } @@ -295,6 +324,7 @@ add_provide(filenode *fnode, char *s) head->head = SET; head->in_progress = RESET; head->fnode = NULL; + head->sequence = 0; head->last = head->next = NULL; Hash_SetValue(entry, head); } @@ -350,6 +380,7 @@ add_provide(filenode *fnode, char *s) f_pnode = emalloc(sizeof(*f_pnode)); f_pnode->pnode = pnode; + f_pnode->entry = entry; f_pnode->next = fnode->prov_list; fnode->prov_list = f_pnode; } @@ -522,7 +553,7 @@ make_fake_provision(filenode *node) char buffer[30]; do { - snprintf(buffer, sizeof buffer, "fake_prov_%08d", i++); + snprintf(buffer, sizeof buffer, FAKE_PROV_NAME "%08d", i++); entry = Hash_CreateEntry(provide_hash, buffer, &new); } while (new == 0); head = emalloc(sizeof(*head)); @@ -543,6 +574,7 @@ make_fake_provision(filenode *node) pnode->next->last = pnode; f_pnode = emalloc(sizeof(*f_pnode)); + f_pnode->entry = entry; f_pnode->pnode = pnode; f_pnode->next = node->prov_list; node->prov_list = f_pnode; @@ -575,6 +607,11 @@ insert_before(void) if (new == 1) warnx("file `%s' is before unknown provision `%s'", bl_list->node->filename, bl_list->s); + if (new == 1 && do_graphviz == true) + generate_graphviz_file_links( + Hash_FindEntry(provide_hash, bl_list->s), + bl_list->node); + for (pnode = Hash_GetValue(entry); pnode; pnode = pnode->next) { if (pnode->head) continue; @@ -605,7 +642,134 @@ crunch_all_files(void) insert_before(); } +static inline int +is_fake_prov(const char *name) +{ + + return (name == strstr(name, FAKE_PROV_NAME)); +} + +/* loop though provide list of vnode drawing all non-fake dependencies */ +static void +generate_graphviz_file_links(Hash_Entry *entry, filenode *fnode) +{ + char *dep_name, *fname; + provnode *head; + f_provnode *fpnode, *rfpnode; + int is_before = 0; + + dep_name = Hash_GetKey(entry); + if (is_fake_prov(dep_name)) + is_before = 1; + head = Hash_GetValue(entry); + + for (fpnode = fnode->prov_list; fpnode && fpnode->entry; + fpnode = fpnode->next) { + fname = Hash_GetKey(fpnode->entry); + if (is_fake_prov(fname)) + continue; + rfpnode = NULL; + do { + if (rfpnode) + dep_name = Hash_GetKey(rfpnode->entry); + else + dep_name = Hash_GetKey(entry); + + if (!is_fake_prov(dep_name)) { + printf("\"%s\" -> \"%s\" [%s%s];\n", + fname, dep_name, + /* edge style */ + (is_before ? "style=dashed" : "style=solid"), + /* circular dep? */ + ((head == NULL || + (head->next && head->in_progress == SET)) ? + ", color=red, penwidth=4" : "")); + if (rfpnode == NULL) + break; + } + /* dependency is solved already */ + if (head == NULL || head->next == NULL) + break; + + if (rfpnode == NULL) + rfpnode = head->next->fnode->prov_list; + else + rfpnode = rfpnode->next; + } while (rfpnode); + } +} + /* + * Walk the stack, find the looping point and generate traceback. + * NULL is returned on failure, otherwize pointer to a buffer holding + * text representation is returned, caller must run free(3) for the + * pointer. + */ +static char * +generate_loop_for_req(strnodelist *stack_tail, provnode *head, + filenode *fnode) +{ + provnode *pnode; + strnodelist *stack_ptr, *loop_entry; + char *buf, **revstack; + size_t bufsize; + int i, stack_depth; + + loop_entry = NULL; + /* fast forward stack to the component that is required now */ + for (pnode = head->next; pnode; pnode = pnode->next) { + if (loop_entry) + break; + stack_depth = 0; + for (stack_ptr = stack_tail; stack_ptr; + stack_ptr = stack_ptr->next) { + stack_depth++; + if (stack_ptr->node == pnode->fnode) { + loop_entry = stack_ptr; + break; + } + } + } + + if (loop_entry == NULL) + return (NULL); + + stack_depth += 2; /* fnode + loop_entry */ + revstack = emalloc(sizeof(char *) * stack_depth); + bzero(revstack, (sizeof(char *) * stack_depth)); + + /* reverse stack and estimate buffer size to allocate */ + bufsize = 1; /* tralining \0 */ + + revstack[stack_depth - 1] = loop_entry->node->filename; + bufsize += strlen(revstack[stack_depth - 1]); + + revstack[stack_depth - 2] = fnode->filename; + bufsize += strlen(revstack[stack_depth - 2]); + fnode->issues_count++; + + stack_ptr = stack_tail; + for (i = stack_depth - 3; i >= 0; i--) { + revstack[i] = stack_ptr->node->filename; + stack_ptr->node->issues_count++; + stack_ptr = stack_ptr->next; + bufsize += strlen(revstack[i]); + } + bufsize += strlen(" -> ") * (stack_depth - 1); + + buf = emalloc(bufsize); + bzero(buf, bufsize); + + for (i = 0; i < stack_depth; i++) { + strlcat(buf, revstack[i], bufsize); + if (i < stack_depth - 1) + strlcat(buf, " -> ", bufsize); + } + + free(revstack); + return (buf); +} +/* * below are the functions that traverse the graphs we have built * finding out the desired ordering, printing each file in turn. * if missing requirements, or cyclic graphs are detected, a @@ -621,17 +785,22 @@ crunch_all_files(void) * provision. */ static void -satisfy_req(f_reqnode *rnode, char *filename) +satisfy_req(f_reqnode *rnode, filenode *fnode, strnodelist *stack_ptr) { Hash_Entry *entry; provnode *head; + strnodelist stack_item; + char *buf; entry = rnode->entry; head = Hash_GetValue(entry); + if (do_graphviz == true) + generate_graphviz_file_links(entry, fnode); + if (head == NULL) { warnx("requirement `%s' in file `%s' has no providers.", - Hash_GetKey(entry), filename); + Hash_GetKey(entry), fnode->filename); exit_code = 1; return; } @@ -645,20 +814,34 @@ satisfy_req(f_reqnode *rnode, char *filename) * print that there is a circular dependency on it and abort */ if (head->in_progress == SET) { - warnx("Circular dependency on provision `%s' in file `%s'.", - Hash_GetKey(entry), filename); exit_code = 1; + buf = generate_loop_for_req(stack_ptr, head, + fnode); + + if (buf == NULL) { + warnx("Circular dependency on provision `%s' in " + "file `%s' (tracing has failed).", + Hash_GetKey(entry), fnode->filename); + return; + } + + warnx("Circular dependency on provision `%s': %s.", + Hash_GetKey(entry), buf); + free(buf); return; } head->in_progress = SET; + stack_item.next = stack_ptr; + stack_item.node = fnode; + /* * while provision_list is not empty * do_file(first_member_of(provision_list)); */ while (head->next != NULL) - do_file(head->next->fnode); + do_file(head->next->fnode, &stack_item); } static int @@ -701,12 +884,13 @@ keep_ok(filenode *fnode) * Circular dependencies will cause problems if we do. */ static void -do_file(filenode *fnode) +do_file(filenode *fnode, strnodelist *stack_ptr) { f_reqnode *r; f_provnode *p, *p_tmp; - provnode *pnode; + provnode *pnode, *head; int was_set; + char *dep_name; DPRINTF((stderr, "do_file on %s.\n", fnode->filename)); @@ -729,18 +913,44 @@ do_file(filenode *fnode) * satisfy_req(r, filename) */ r = fnode->req_list; + fnode->sequence = 0; while (r != NULL) { - satisfy_req(r, fnode->filename); + satisfy_req(r, fnode, stack_ptr); + /* find sequence number where all requirements are satisfied */ + head = Hash_GetValue(r->entry); + if (head && head->sequence > fnode->sequence) + fnode->sequence = head->sequence; r = r->next; } fnode->req_list = NULL; + fnode->sequence++; + /* if we've seen issues with this file - put it to the tail */ + if (fnode->issues_count) + fnode->sequence = max_sequence + 1; + + if (max_sequence < fnode->sequence) + max_sequence = fnode->sequence; + /* * for each provision of fnode -> p * remove fnode from provision list for p in hash table */ p = fnode->prov_list; while (p != NULL) { + /* mark all troublemakers on graphviz */ + if (do_graphviz == true && fnode->issues_count) { + dep_name = Hash_GetKey(p->entry); + if (!is_fake_prov(dep_name)) + printf("\"%s\" [ color=red, penwidth=4 ];\n", + dep_name); + } + + /* update sequence when provided requirements are satisfied */ + head = Hash_GetValue(p->entry); + if (head->sequence < fnode->sequence) + head->sequence = fnode->sequence; + p_tmp = p; pnode = p->pnode; if (pnode->next != NULL) { @@ -759,8 +969,11 @@ do_file(filenode *fnode) DPRINTF((stderr, "next do: ")); /* if we were already in progress, don't print again */ - if (was_set == 0 && skip_ok(fnode) && keep_ok(fnode)) - printf("%s\n", fnode->filename); + if (do_graphviz != true && was_set == 0 && skip_ok(fnode) && + keep_ok(fnode)) { + *fn_seqlist = fnode; + fn_seqlist++; + } if (fnode->next != NULL) { fnode->next->last = fnode->last; @@ -769,19 +982,103 @@ do_file(filenode *fnode) fnode->last->next = fnode->next; } + if (fnode->issues_count) + warnx("`%s' was seen in circular dependencies for %d times.", + fnode->filename, fnode->issues_count); + DPRINTF((stderr, "nuking %s\n", fnode->filename)); -#if 0 - if (was_set == 0) { - free(fnode->filename); - free(fnode); - } -#endif } static void +generate_graphviz_header() +{ + + if (do_graphviz != true) + return; + + printf("digraph rcorder {\n" + "rankdir=\"BT\";\n" + "node [style=rounded, shape=record];\n" + "graph [overlap = false];\n"); +} + +static void +generate_graphviz_footer() +{ + + if (do_graphviz == true) + printf("}\n"); +} + +static void +generate_graphviz_providers() +{ + Hash_Entry *entry; + Hash_Search psearch; + provnode *head, *pnode; + char *dep_name; + + if (do_graphviz != true) + return; + + entry = Hash_EnumFirst(provide_hash, &psearch); + if (entry == NULL) + return; + + do { + dep_name = Hash_GetKey(entry); + if (is_fake_prov(dep_name)) + continue; + head = Hash_GetValue(entry); + /* no providers for this requirement */ + if (head == NULL || head->next == NULL) { + printf("\"%s\" [label=\"{ %s | ENOENT }\", " + "style=\"rounded,filled\", color=red];\n", + dep_name, dep_name); + continue; + } + /* one PROVIDE word for one file that matches */ + if (head->next->next == NULL && + strcmp(dep_name, + basename(head->next->fnode->filename)) == 0) { + continue; + } + printf("\"%s\" [label=\"{ %s | ", dep_name, dep_name); + for (pnode = head->next; pnode; pnode = pnode->next) + printf("%s\\n", basename(pnode->fnode->filename)); + + printf("}\"];\n"); + } while (NULL != (entry = Hash_EnumNext(&psearch))); +} + +static int +sequence_cmp(const void *a, const void *b) +{ + const filenode *fna = *((const filenode * const *)a); + const filenode *fnb = *((const filenode * const *)b); + int left, right; + + /* push phantom files to the end */ + if (fna == NULL || fnb == NULL) + return ((fna < fnb) - (fna > fnb)); + + left = fna->sequence; + right = fnb->sequence; + + return ((left > right) - (left < right)); +} + +static void generate_ordering(void) { + filenode **seqlist, **psl; + int last_seq = 0; + /* Prepare order buffer, use an additional one as a list terminator */ + seqlist = emalloc(sizeof(filenode *) * (file_count + 1)); + bzero(seqlist, sizeof(filenode *) * (file_count + 1)); + fn_seqlist = seqlist; + /* * while there remain undone files{f}, * pick an arbitrary f, and do_file(f) @@ -798,6 +1095,24 @@ generate_ordering(void) */ while (fn_head->next != NULL) { DPRINTF((stderr, "generate on %s\n", fn_head->next->filename)); - do_file(fn_head->next); + do_file(fn_head->next, NULL); } + + /* Sort filenode list based on sequence */ + qsort(seqlist, file_count, sizeof(filenode *), sequence_cmp); + + for (psl = seqlist; *psl; psl++) { + printf("%s%s", + (last_seq == 0 ? "" : + (do_parallel != true || last_seq != (*psl)->sequence) ? + "\n" : " "), + (*psl)->filename); + last_seq = (*psl)->sequence; + free((*psl)->filename); + free(*psl); + } + if (last_seq) + printf("\n"); + + free(seqlist); } From owner-svn-src-all@freebsd.org Tue Sep 8 11:35:37 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9AE21333DE3; Tue, 8 Sep 2020 11:35:37 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bm34941b2z4bbD; Tue, 8 Sep 2020 11:35:37 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 52B59FD53; Tue, 8 Sep 2020 11:35:37 +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 088BZbB1021107; Tue, 8 Sep 2020 11:35:37 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 088BZath021101; Tue, 8 Sep 2020 11:35:36 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <202009081135.088BZath021101@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 8 Sep 2020 11:35:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365450 - in head/sys: arm64/conf conf dev/gpio X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: in head/sys: arm64/conf conf dev/gpio X-SVN-Commit-Revision: 365450 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.33 Precedence: list List-Id: "SVN commit messages 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, 08 Sep 2020 11:35:37 -0000 Author: andrew Date: Tue Sep 8 11:35:35 2020 New Revision: 365450 URL: https://svnweb.freebsd.org/changeset/base/365450 Log: Add a GPIO driver for the Arm pl061 controller A PL061 is a simple 8 pin GPIO controller. This GPIO device is used to signal an internal request for shutdown on some virtual machines including Arm-based Amazon EC2 instances. Submitted by: Ali Saidi (previouss version) Reviewed by: Ali Saidi, manu Differential Revision: https://reviews.freebsd.org/D24065 Added: head/sys/dev/gpio/pl061.c (contents, props changed) head/sys/dev/gpio/pl061.h (contents, props changed) head/sys/dev/gpio/pl061_acpi.c (contents, props changed) head/sys/dev/gpio/pl061_fdt.c (contents, props changed) Modified: head/sys/arm64/conf/GENERIC head/sys/conf/files.arm64 Modified: head/sys/arm64/conf/GENERIC ============================================================================== --- head/sys/arm64/conf/GENERIC Tue Sep 8 10:36:11 2020 (r365449) +++ head/sys/arm64/conf/GENERIC Tue Sep 8 11:35:35 2020 (r365450) @@ -257,6 +257,7 @@ device gpioregulator device ls1046_gpio # LS1046A GPIO controller device mv_gpio # Marvell GPIO controller device mvebu_pinctrl # Marvell Pinmux Controller +device pl061 # Arm PL061 GPIO controller device rk_gpio # RockChip GPIO Controller device rk_pinctrl # RockChip Pinmux Controller Modified: head/sys/conf/files.arm64 ============================================================================== --- head/sys/conf/files.arm64 Tue Sep 8 10:36:11 2020 (r365449) +++ head/sys/conf/files.arm64 Tue Sep 8 11:35:35 2020 (r365450) @@ -305,6 +305,9 @@ dev/iicbus/sy8106a.c optional sy8106a fdt dev/iicbus/twsi/mv_twsi.c optional twsi fdt dev/iicbus/twsi/a10_twsi.c optional twsi fdt dev/iicbus/twsi/twsi.c optional twsi fdt +dev/gpio/pl061.c optional pl061 gpio +dev/gpio/pl061_acpi.c optional pl061 gpio acpi +dev/gpio/pl061_fdt.c optional pl061 gpio fdt dev/hwpmc/hwpmc_arm64.c optional hwpmc dev/hwpmc/hwpmc_arm64_md.c optional hwpmc dev/mbox/mbox_if.m optional soc_brcm_bcm2837 Added: head/sys/dev/gpio/pl061.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/gpio/pl061.c Tue Sep 8 11:35:35 2020 (r365450) @@ -0,0 +1,580 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2020 Amazon.com, Inc. or its affiliates. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include + +#include "pl061.h" + +#include "gpio_if.h" +#include "pic_if.h" + +#define PL061_LOCK(_sc) mtx_lock_spin(&(_sc)->sc_mtx) +#define PL061_UNLOCK(_sc) mtx_unlock_spin(&(_sc)->sc_mtx) +#define PL061_LOCK_DESTROY(_sc) mtx_destroy(&(_sc)->sc_mtx) +#define PL061_ASSERT_LOCKED(_sc) mtx_assert(&(_sc)->sc_mtx, MA_OWNED) +#define PL061_ASSERT_UNLOCKED(_sc) mtx_assert(&(_sc)->sc_mtx, MA_NOTOWNED) + +#if 0 +#define dprintf(fmt, args...) do { \ + printf(fmt, ##args); \ +} while (0) +#else +#define dprintf(fmt, args...) +#endif + +#define PL061_PIN_TO_ADDR(pin) (1 << (pin + 2)) +#define PL061_DATA 0x3FC +#define PL061_DIR 0x400 +#define PL061_INTSENSE 0x404 +#define PL061_INTBOTHEDGES 0x408 +#define PL061_INTEVENT 0x40C +#define PL061_INTMASK 0x410 +#define PL061_RAWSTATUS 0x414 +#define PL061_STATUS 0x418 +#define PL061_INTCLR 0x41C +#define PL061_MODECTRL 0x420 + +#define PL061_ALLOWED_CAPS (GPIO_PIN_INPUT | GPIO_PIN_OUTPUT | GPIO_INTR_EDGE_BOTH | \ + GPIO_INTR_EDGE_RISING | GPIO_INTR_EDGE_FALLING | \ + GPIO_INTR_LEVEL_HIGH | GPIO_INTR_LEVEL_LOW ) + +#define PIC_INTR_ISRC(sc, irq) (&(sc->sc_isrcs[irq].isrc)) + +static device_t +pl061_get_bus(device_t dev) +{ + struct pl061_softc *sc; + + sc = device_get_softc(dev); + return (sc->sc_busdev); +} + +static int +pl061_pin_max(device_t dev, int *maxpin) +{ + *maxpin = PL061_NUM_GPIO - 1; + return (0); +} + +static int +pl061_pin_getname(device_t dev, uint32_t pin, char *name) +{ + struct pl061_softc *sc; + + sc = device_get_softc(dev); + if (pin >= PL061_NUM_GPIO) + return (EINVAL); + + snprintf(name, GPIOMAXNAME, "p%u", pin); + name[GPIOMAXNAME - 1] = '\0'; + + return (0); +} + +static int +pl061_pin_getflags(device_t dev, uint32_t pin, uint32_t *flags) +{ + struct pl061_softc *sc; + uint8_t mask = 1 << pin; + + sc = device_get_softc(dev); + if (pin >= PL061_NUM_GPIO) + return (EINVAL); + + PL061_LOCK(sc); + *flags = 0; + + if (mask & bus_read_1(sc->sc_mem_res, PL061_DIR)) + *flags |= GPIO_PIN_OUTPUT; + else + *flags |= GPIO_PIN_INPUT; + + PL061_UNLOCK(sc); + return (0); +} + +static int +pl061_pin_getcaps(device_t dev, uint32_t pin, uint32_t *caps) +{ + struct pl061_softc *sc; + + sc = device_get_softc(dev); + if (pin >= PL061_NUM_GPIO) + return (EINVAL); + + *caps = PL061_ALLOWED_CAPS; + + return (0); +} + +static void +mask_and_set(struct pl061_softc *sc, long a, uint8_t m, uint8_t b) +{ + uint8_t tmp; + + tmp = bus_read_1(sc->sc_mem_res, a); + tmp &= ~m; + tmp |= b; + bus_write_1(sc->sc_mem_res, a, tmp); + dprintf("%s: writing %#x to register %#lx\n", __func__, tmp, a); +} + +static int +pl061_pin_setflags(device_t dev, uint32_t pin, uint32_t flags) +{ + struct pl061_softc *sc; + uint8_t mask = 1 << pin; + const uint32_t in_out = (GPIO_PIN_INPUT | GPIO_PIN_OUTPUT); + + sc = device_get_softc(dev); + if (pin >= PL061_NUM_GPIO) + return (EINVAL); + + if (flags & ~PL061_ALLOWED_CAPS) + return (EINVAL); + + /* can't be both input and output */ + if ((flags & in_out) == in_out) + return (EINVAL); + + + PL061_LOCK(sc); + mask_and_set(sc, PL061_DIR, mask, flags & GPIO_PIN_OUTPUT ? mask : 0); + PL061_UNLOCK(sc); + return (0); +} + +static int +pl061_pin_get(device_t dev, uint32_t pin, uint32_t *value) +{ + struct pl061_softc *sc; + + sc = device_get_softc(dev); + if (pin >= PL061_NUM_GPIO) + return (EINVAL); + + PL061_LOCK(sc); + if (bus_read_1(sc->sc_mem_res, PL061_PIN_TO_ADDR(pin))) + *value = GPIO_PIN_HIGH; + else + *value = GPIO_PIN_LOW; + PL061_UNLOCK(sc); + + return (0); +} + +static int +pl061_pin_set(device_t dev, uint32_t pin, uint32_t value) +{ + struct pl061_softc *sc; + uint8_t d = (value == GPIO_PIN_HIGH) ? 0xff : 0x00; + + sc = device_get_softc(dev); + if (pin >= PL061_NUM_GPIO) + return (EINVAL); + + PL061_LOCK(sc); + bus_write_1(sc->sc_mem_res, PL061_PIN_TO_ADDR(pin), d); + PL061_UNLOCK(sc); + + return (0); +} + +static int +pl061_pin_toggle(device_t dev, uint32_t pin) +{ + struct pl061_softc *sc; + uint8_t d; + + sc = device_get_softc(dev); + if (pin >= PL061_NUM_GPIO) + return (EINVAL); + + PL061_LOCK(sc); + d = ~bus_read_1(sc->sc_mem_res, PL061_PIN_TO_ADDR(pin)); + bus_write_1(sc->sc_mem_res, PL061_PIN_TO_ADDR(pin), d); + PL061_UNLOCK(sc); + + return (0); +} + +static void +pl061_pic_disable_intr(device_t dev, struct intr_irqsrc *isrc) +{ + struct pl061_softc *sc; + uint8_t mask; + + sc = device_get_softc(dev); + mask = 1 << ((struct pl061_pin_irqsrc *)isrc)->irq; + + dprintf("%s: calling disable interrupt %#x\n", __func__, mask); + PL061_LOCK(sc); + mask_and_set(sc, PL061_INTMASK, mask, 0); + PL061_UNLOCK(sc); +} + + + +static void +pl061_pic_enable_intr(device_t dev, struct intr_irqsrc *isrc) +{ + struct pl061_softc *sc; + uint8_t mask; + + sc = device_get_softc(dev); + mask = 1 << ((struct pl061_pin_irqsrc *)isrc)->irq; + + + dprintf("%s: calling enable interrupt %#x\n", __func__, mask); + PL061_LOCK(sc); + mask_and_set(sc, PL061_INTMASK, mask, mask); + PL061_UNLOCK(sc); +} + +static int +pl061_pic_map_intr(device_t dev, struct intr_map_data *data, + struct intr_irqsrc **isrcp) +{ + struct pl061_softc *sc; + struct intr_map_data_gpio *gdata; + uint32_t irq; + + sc = device_get_softc(dev); + if (data->type != INTR_MAP_DATA_GPIO) + return (ENOTSUP); + + gdata = (struct intr_map_data_gpio *)data; + irq = gdata->gpio_pin_num; + if (irq >= PL061_NUM_GPIO) { + device_printf(dev, "invalid interrupt number %u\n", irq); + return (EINVAL); + } + + dprintf("%s: calling map interrupt %u\n", __func__, irq); + *isrcp = PIC_INTR_ISRC(sc, irq); + + return (0); +} + +static int +pl061_pic_setup_intr(device_t dev, struct intr_irqsrc *isrc, + struct resource *res, struct intr_map_data *data) +{ + struct pl061_softc *sc; + struct intr_map_data_gpio *gdata; + struct pl061_pin_irqsrc *irqsrc; + uint32_t mode; + uint8_t mask; + + if (data == NULL) + return (ENOTSUP); + + sc = device_get_softc(dev); + gdata = (struct intr_map_data_gpio *)data; + irqsrc = (struct pl061_pin_irqsrc *)isrc; + + mode = gdata->gpio_intr_mode; + mask = 1 << gdata->gpio_pin_num; + + dprintf("%s: calling setup interrupt %u mode %#x\n", __func__, + irqsrc->irq, mode); + if (irqsrc->irq != gdata->gpio_pin_num) { + dprintf("%s: interrupts don't match\n", __func__); + return (EINVAL); + } + + if (isrc->isrc_handlers != 0) { + dprintf("%s: handler already attached\n", __func__); + return (irqsrc->mode == mode ? 0 : EINVAL); + } + irqsrc->mode = mode; + + PL061_LOCK(sc); + + if (mask & GPIO_INTR_EDGE_BOTH) { + mask_and_set(sc, PL061_INTBOTHEDGES, mask, mask); + mask_and_set(sc, PL061_INTSENSE, mask, 0); + } else if (mask & GPIO_INTR_EDGE_RISING) { + mask_and_set(sc, PL061_INTBOTHEDGES, mask, 0); + mask_and_set(sc, PL061_INTSENSE, mask, 0); + mask_and_set(sc, PL061_INTEVENT, mask, mask); + } else if (mask & GPIO_INTR_EDGE_FALLING) { + mask_and_set(sc, PL061_INTBOTHEDGES, mask, 0); + mask_and_set(sc, PL061_INTSENSE, mask, 0); + mask_and_set(sc, PL061_INTEVENT, mask, 0); + } else if (mask & GPIO_INTR_LEVEL_HIGH) { + mask_and_set(sc, PL061_INTBOTHEDGES, mask, 0); + mask_and_set(sc, PL061_INTSENSE, mask, mask); + mask_and_set(sc, PL061_INTEVENT, mask, mask); + } else if (mask & GPIO_INTR_LEVEL_LOW) { + mask_and_set(sc, PL061_INTBOTHEDGES, mask, 0); + mask_and_set(sc, PL061_INTSENSE, mask, mask); + mask_and_set(sc, PL061_INTEVENT, mask, 0); + } + PL061_UNLOCK(sc); + return (0); +} + +static int +pl061_pic_teardown_intr(device_t dev, struct intr_irqsrc *isrc, + struct resource *res, struct intr_map_data *data) +{ + struct pl061_softc *sc; + struct pl061_pin_irqsrc *irqsrc; + uint8_t mask; + + irqsrc = (struct pl061_pin_irqsrc *)isrc; + mask = 1 << irqsrc->irq; + dprintf("%s: calling teardown interrupt %#x\n", __func__, mask); + + sc = device_get_softc(dev); + if (isrc->isrc_handlers == 0) { + irqsrc->mode = GPIO_INTR_CONFORM; + PL061_LOCK(sc); + mask_and_set(sc, PL061_INTMASK, mask, 0); + PL061_UNLOCK(sc); + } + return (0); +} + +static void +pl061_pic_post_filter(device_t dev, struct intr_irqsrc *isrc) +{ + struct pl061_softc *sc; + uint8_t mask; + + sc = device_get_softc(dev); + mask = 1 << ((struct pl061_pin_irqsrc *)isrc)->irq; + dprintf("%s: calling post filter %#x\n", __func__, mask); + + bus_write_1(sc->sc_mem_res, PL061_INTCLR, mask); +} + +static void +pl061_pic_post_ithread(device_t dev, struct intr_irqsrc *isrc) +{ + struct pl061_softc *sc; + uint8_t mask; + + sc = device_get_softc(dev); + mask = 1 << ((struct pl061_pin_irqsrc *)isrc)->irq; + dprintf("%s: calling post ithread %#x\n", __func__, mask); + bus_write_1(sc->sc_mem_res, PL061_INTCLR, mask); + + pl061_pic_enable_intr(dev, isrc); +} + +static void +pl061_pic_pre_ithread(device_t dev, struct intr_irqsrc *isrc) +{ + pl061_pic_disable_intr(dev, isrc); +} + +static int +pl061_intr(void *arg) +{ + struct pl061_softc *sc; + struct trapframe *tf; + uint8_t status; + int pin; + + sc = (struct pl061_softc *)arg; + tf = curthread->td_intr_frame; + + status = bus_read_1(sc->sc_mem_res, PL061_STATUS); + + while (status != 0) { + pin = ffs(status) - 1; + status &= ~(1 << pin); + + if (intr_isrc_dispatch(PIC_INTR_ISRC(sc, pin), tf) != 0) + device_printf(sc->sc_dev, "spurious interrupt %d\n", + pin); + + dprintf("got IRQ on %d\n", pin); + + } + return (FILTER_HANDLED); +} + +int +pl061_attach(device_t dev) +{ + struct pl061_softc *sc; + int ret; + int irq; + const char *name; + + sc = device_get_softc(dev); + sc->sc_dev = dev; + + sc->sc_mem_rid = 0; + sc->sc_mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, + &sc->sc_mem_rid, RF_ACTIVE); + if (sc->sc_mem_res == NULL) { + device_printf(dev, "can't allocate memory resource\n"); + return (ENXIO); + } + + sc->sc_irq_rid = 0; + sc->sc_irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, + &sc->sc_irq_rid, RF_ACTIVE); + + if (sc->sc_irq_res == NULL) { + device_printf(dev, "can't allocate IRQ resource\n"); + goto free_mem; + } + + ret = bus_setup_intr(dev, sc->sc_irq_res, INTR_TYPE_MISC | INTR_MPSAFE, + pl061_intr, NULL, sc, &sc->sc_irq_hdlr); + if (ret) { + device_printf(dev, "can't setup IRQ\n"); + goto free_pic; + } + + name = device_get_nameunit(dev); + + for (irq = 0; irq < PL061_NUM_GPIO; irq++) { + if (bootverbose) { + device_printf(dev, + "trying to register pin %d name %s\n", irq, name); + } + sc->sc_isrcs[irq].irq = irq; + sc->sc_isrcs[irq].mode = GPIO_INTR_CONFORM; + ret = intr_isrc_register(PIC_INTR_ISRC(sc, irq), dev, 0, + "%s", name); + if (ret) { + device_printf(dev, "can't register isrc %d\n", ret); + goto free_isrc; + } + } + + sc->sc_busdev = gpiobus_attach_bus(dev); + if (sc->sc_busdev == NULL) { + device_printf(dev, "couldn't attach gpio bus\n"); + goto free_isrc; + } + + mtx_init(&sc->sc_mtx, device_get_nameunit(dev), "pl061", MTX_SPIN); + + return (0); + +free_isrc: + /* + * XXX isrc_release_counters() not implemented + * for (irq = 0; irq < PL061_NUM_GPIO; irq++) + * intr_isrc_deregister(PIC_INTR_ISRC(sc, irq)); + */ + bus_release_resource(dev, SYS_RES_IRQ, sc->sc_irq_rid, + sc->sc_irq_res); +free_pic: + /* + * XXX intr_pic_deregister: not implemented + * intr_pic_deregister(dev, 0); + */ + +free_mem: + bus_release_resource(dev, SYS_RES_MEMORY, sc->sc_mem_rid, + sc->sc_mem_res); + + return (ENXIO); + +} + +int +pl061_detach(device_t dev) +{ + struct pl061_softc *sc; + sc = device_get_softc(dev); + + if (sc->sc_busdev) + gpiobus_detach_bus(dev); + + if (sc->sc_irq_hdlr != NULL) + bus_teardown_intr(dev, sc->sc_irq_res, sc->sc_irq_hdlr); + + if (sc->sc_irq_res != NULL) + bus_release_resource(dev, SYS_RES_IRQ, sc->sc_irq_rid, + sc->sc_irq_res); + + if (sc->sc_mem_res != NULL) + bus_release_resource(dev, SYS_RES_MEMORY, sc->sc_mem_rid, + sc->sc_mem_res); + PL061_LOCK_DESTROY(sc); + return (0); +} + +static device_method_t pl061_methods[] = { + /* Device interface */ + DEVMETHOD(device_attach, pl061_attach), + DEVMETHOD(device_detach, pl061_detach), + + /* GPIO protocol */ + DEVMETHOD(gpio_get_bus, pl061_get_bus), + DEVMETHOD(gpio_pin_max, pl061_pin_max), + DEVMETHOD(gpio_pin_getname, pl061_pin_getname), + DEVMETHOD(gpio_pin_getflags, pl061_pin_getflags), + DEVMETHOD(gpio_pin_getcaps, pl061_pin_getcaps), + DEVMETHOD(gpio_pin_setflags, pl061_pin_setflags), + DEVMETHOD(gpio_pin_get, pl061_pin_get), + DEVMETHOD(gpio_pin_set, pl061_pin_set), + DEVMETHOD(gpio_pin_toggle, pl061_pin_toggle), + + /* Interrupt controller interface */ + DEVMETHOD(pic_disable_intr, pl061_pic_disable_intr), + DEVMETHOD(pic_enable_intr, pl061_pic_enable_intr), + DEVMETHOD(pic_map_intr, pl061_pic_map_intr), + DEVMETHOD(pic_setup_intr, pl061_pic_setup_intr), + DEVMETHOD(pic_teardown_intr, pl061_pic_teardown_intr), + DEVMETHOD(pic_post_filter, pl061_pic_post_filter), + DEVMETHOD(pic_post_ithread, pl061_pic_post_ithread), + DEVMETHOD(pic_pre_ithread, pl061_pic_pre_ithread), + + DEVMETHOD_END +}; + +DEFINE_CLASS_0(pl061, pl061_driver, pl061_methods, sizeof(struct pl061_softc)); Added: head/sys/dev/gpio/pl061.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/gpio/pl061.h Tue Sep 8 11:35:35 2020 (r365450) @@ -0,0 +1,59 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2020 Amazon.com, Inc. or its affiliates. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef __DEV_PL061_H__ +#define __DEV_PL061_H__ + +DECLARE_CLASS(pl061_driver); + +#define PL061_NUM_GPIO 8 + +struct pl061_pin_irqsrc { + struct intr_irqsrc isrc; + uint32_t irq; + uint32_t mode; +}; + +struct pl061_softc { + device_t sc_dev; + device_t sc_busdev; + struct mtx sc_mtx; + struct resource *sc_mem_res; + struct resource *sc_irq_res; + void *sc_irq_hdlr; + int sc_mem_rid; + int sc_irq_rid; + struct pl061_pin_irqsrc sc_isrcs[PL061_NUM_GPIO]; +}; + +int pl061_attach(device_t); +int pl061_detach(device_t); + +#endif /* __DEV_PL061_H__ */ Added: head/sys/dev/gpio/pl061_acpi.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/gpio/pl061_acpi.c Tue Sep 8 11:35:35 2020 (r365450) @@ -0,0 +1,103 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2020 Amazon.com, Inc. or its affiliates. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include "opt_acpi.h" + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include + +#include +#include + +#include "pl061.h" + +static char *gpio_ids[] = { "ARMH0061", NULL }; + +static int +pl061_acpi_probe(device_t dev) +{ + int rv; + + if (acpi_disabled("gpio")) + return (ENXIO); + + rv = ACPI_ID_PROBE(device_get_parent(dev), dev, gpio_ids, NULL); + + if (rv <= 0) + device_set_desc(dev, "Arm PL061 GPIO Controller"); + + return (rv); +} + +static int +pl061_acpi_attach(device_t dev) +{ + int error; + + error = pl061_attach(dev); + if (error != 0) + return (error); + + if (!intr_pic_register(dev, ACPI_INTR_XREF)) { + device_printf(dev, "couldn't register PIC\n"); + pl061_detach(dev); + error = ENXIO; + } + + return (error); +} + +static device_method_t pl061_acpi_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, pl061_acpi_probe), + DEVMETHOD(device_attach, pl061_acpi_attach), + + DEVMETHOD_END +}; + +DEFINE_CLASS_1(pl061, pl061_acpi_driver, pl061_acpi_methods, + sizeof(struct pl061_softc), pl061_driver); + +static devclass_t pl061_devclass; + +DRIVER_MODULE(pl061, acpi, pl061_driver, pl061_devclass, NULL, NULL); +MODULE_DEPEND(pl061, acpi, 1, 1, 1); +MODULE_DEPEND(pl061, gpiobus, 1, 1, 1); Added: head/sys/dev/gpio/pl061_fdt.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/gpio/pl061_fdt.c Tue Sep 8 11:35:35 2020 (r365450) @@ -0,0 +1,97 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2020 Andrew Turner + * + * This work was supported by Innovate UK project 105694, "Digital Security + * by Design (DSbD) Technology Platform Prototype". + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include + +#include "pl061.h" + +static int +pl061_fdt_probe(device_t dev) +{ + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (!ofw_bus_is_compatible(dev, "arm,pl061")) + return (ENXIO); + + device_set_desc(dev, "Arm PL061 GPIO Controller"); + + return (BUS_PROBE_DEFAULT); +} + +static int +pl061_fdt_attach(device_t dev) +{ + int error; + + error = pl061_attach(dev); + if (error != 0) + return (error); + + if (!intr_pic_register(dev, OF_xref_from_node(ofw_bus_get_node(dev)))) { + device_printf(dev, "couldn't register PIC\n"); + pl061_detach(dev); + error = ENXIO; + } + + return (error); +} + +static device_method_t pl061_fdt_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, pl061_fdt_probe), + DEVMETHOD(device_attach, pl061_fdt_attach), + + DEVMETHOD_END +}; + +DEFINE_CLASS_1(gpio, pl061_fdt_driver, pl061_fdt_methods, + sizeof(struct pl061_softc), pl061_driver); + +static devclass_t pl061_devclass; + +EARLY_DRIVER_MODULE(pl061, ofwbus, pl061_fdt_driver, pl061_devclass, NULL, NULL, + BUS_PASS_INTERRUPT + BUS_PASS_ORDER_LATE); +MODULE_DEPEND(pl061, gpiobus, 1, 1, 1); From owner-svn-src-all@freebsd.org Tue Sep 8 11:46:33 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EBE64334688; Tue, 8 Sep 2020 11:46:33 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bm3Jn5wl0z4cJ2; Tue, 8 Sep 2020 11:46:33 +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 AA67CFBD9; Tue, 8 Sep 2020 11:46:33 +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 088BkXWq027525; Tue, 8 Sep 2020 11:46:33 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 088BkXYs027524; Tue, 8 Sep 2020 11:46:33 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <202009081146.088BkXYs027524@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 8 Sep 2020 11:46:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365451 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 365451 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.33 Precedence: list List-Id: "SVN commit messages 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, 08 Sep 2020 11:46:34 -0000 Author: andrew Date: Tue Sep 8 11:46:33 2020 New Revision: 365451 URL: https://svnweb.freebsd.org/changeset/base/365451 Log: Move gpio and hwpmc to the correct place in files.arm64 Sponsored by: Innovate UK Modified: head/sys/conf/files.arm64 Modified: head/sys/conf/files.arm64 ============================================================================== --- head/sys/conf/files.arm64 Tue Sep 8 11:35:35 2020 (r365450) +++ head/sys/conf/files.arm64 Tue Sep 8 11:46:33 2020 (r365451) @@ -255,6 +255,11 @@ dev/axgbe/xgbe-dev.c optional axgbe dev/axgbe/xgbe-drv.c optional axgbe dev/axgbe/xgbe-mdio.c optional axgbe dev/cpufreq/cpufreq_dt.c optional cpufreq fdt +dev/gpio/pl061.c optional pl061 gpio +dev/gpio/pl061_acpi.c optional pl061 gpio acpi +dev/gpio/pl061_fdt.c optional pl061 gpio fdt +dev/hwpmc/hwpmc_arm64.c optional hwpmc +dev/hwpmc/hwpmc_arm64_md.c optional hwpmc dev/ice/if_ice_iflib.c optional ice pci \ compile-with "${NORMAL_C} -I$S/dev/ice" dev/ice/ice_lib.c optional ice pci \ @@ -305,11 +310,6 @@ dev/iicbus/sy8106a.c optional sy8106a fdt dev/iicbus/twsi/mv_twsi.c optional twsi fdt dev/iicbus/twsi/a10_twsi.c optional twsi fdt dev/iicbus/twsi/twsi.c optional twsi fdt -dev/gpio/pl061.c optional pl061 gpio -dev/gpio/pl061_acpi.c optional pl061 gpio acpi -dev/gpio/pl061_fdt.c optional pl061 gpio fdt -dev/hwpmc/hwpmc_arm64.c optional hwpmc -dev/hwpmc/hwpmc_arm64_md.c optional hwpmc dev/mbox/mbox_if.m optional soc_brcm_bcm2837 dev/mmc/host/dwmmc.c optional dwmmc fdt dev/mmc/host/dwmmc_altera.c optional dwmmc dwmmc_altera fdt From owner-svn-src-all@freebsd.org Tue Sep 8 12:01:30 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A4F79335DCA; Tue, 8 Sep 2020 12:01:30 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:13b:39f::9f:25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mx1.sbone.de", Issuer "SBone.DE" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bm3f21lRzz4dWM; Tue, 8 Sep 2020 12:01:29 +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 B14438D4A162; Tue, 8 Sep 2020 12:01:27 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id 27FB1E7082A; Tue, 8 Sep 2020 12:01:27 +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 oPvCMEGPwKyx; Tue, 8 Sep 2020 12:01:25 +0000 (UTC) Received: from [127.0.0.1] (unknown [IPv6:fde9:577b:c1a9:4902:c9f0:b44d:bc76:2e61]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 6A7D4E707AC; Tue, 8 Sep 2020 12:01:25 +0000 (UTC) From: "Bjoern A. Zeeb" To: "Andriy Gapon" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r365445 - head/sys/cam/mmc Date: Tue, 08 Sep 2020 12:01:24 +0000 X-Mailer: MailMate (2.0BETAr6151) Message-ID: In-Reply-To: <34826ee7-12a9-d309-1fee-cd2e95744603@FreeBSD.org> References: <202009080546.0885kAgk006783@repo.freebsd.org> <34826ee7-12a9-d309-1fee-cd2e95744603@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; format=flowed Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 4Bm3f21lRzz4dWM X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:24940, ipnet:2a01:4f8::/29, country:DE] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 08 Sep 2020 12:01:30 -0000 On 8 Sep 2020, at 7:10, Andriy Gapon wrote: > On 08/09/2020 08:46, Andriy Gapon wrote: >> Author: avg >> Date: Tue Sep 8 05:46:10 2020 >> New Revision: 365445 >> URL: https://svnweb.freebsd.org/changeset/base/365445 >> >> Log: >> mmc_da: make sure that part_index is not used uninitialized in = >> sddastart > [snip] >> Modified: head/sys/cam/mmc/mmc_da.c >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> --- head/sys/cam/mmc/mmc_da.c Tue Sep 8 04:44:37 2020 (r365444) >> +++ head/sys/cam/mmc/mmc_da.c Tue Sep 8 05:46:10 2020 (r365445) >> @@ -1808,6 +1808,7 @@ sddastart(struct cam_periph *periph, union ccb = >> *start_ >> } >> >> /* Find partition that has outstanding commands. Prefer current = >> partition. */ >> + part_index =3D softc->part_curr; >> part =3D softc->part[softc->part_curr]; >> bp =3D bioq_first(&part->bio_queue); >> if (bp =3D=3D NULL) { >> > > One thing that concerns me is that it was obvious (to a human) that = > part_index > could be used uninitialized if bp was not NULL. > Yet, there was no warning or error from the compiler when I built that = > code for > armv7. > > I wonder if we disable some relevant warnings for that architecture. > Or if the compiler (clang 11) could not figure that out. I had just finished dissecting my hang in g_waitidle on boot on the = nanopi-m4v2/arm64 this morning and when I saw your commits as I came = back home .. guess what: 364132 boots 364219 boots 364263 boots 364274 boots 364283 boots 364284 no << = https://svnweb.freebsd.org/base?view=3Drevision&revision=3D364284 (clang= = merge) 364285 no 364307 no 364482 no 364657 no 365335 no 365364 no 365448 boots /bz From owner-svn-src-all@freebsd.org Tue Sep 8 12:25:01 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3A332336D66; Tue, 8 Sep 2020 12:25:01 +0000 (UTC) (envelope-from meloun.michal@gmail.com) Received: from mail-wr1-x444.google.com (mail-wr1-x444.google.com [IPv6:2a00:1450:4864:20::444]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bm4983Lm7z4fx4; Tue, 8 Sep 2020 12:25:00 +0000 (UTC) (envelope-from meloun.michal@gmail.com) Received: by mail-wr1-x444.google.com with SMTP id g4so18914297wrs.5; Tue, 08 Sep 2020 05:25:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:reply-to:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=lngJ+zRVvWmschStWlbc4woopJANLTqa8Jcy7yh4uVw=; b=o3zss6EImeKmtKREagGdN9eRAIsAvPU2drXpbD4m1FDB4fqGJPPHfuA7ZPh69XilVx F5n1XBl92u8uxvBne1BpoP9+6gjLsByq8tNBWg1y21RSnfb8Xu2xSi9X35jc3kSQHDYY UGjSHUl9D8LKzNu6r/Z/ctXEbZmC5SrQdq8cpE+gPpY/NejJfAmRwBXGyZSVPUnswCLM KKpXY+4dLCuRfT5IIWvyXVK0Hz+p9+S7hFB2dLSp/K8u1x6Q3e3vVMoX00ynirLnn2G5 a5Iw0Z7jm5t7WmFncVxQjM3nPb9XU6RSrdsOXfG8QABEzlLfHgiwkfmZvUg/LY/DuUyl nAhg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:reply-to:subject:to:references:from :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=lngJ+zRVvWmschStWlbc4woopJANLTqa8Jcy7yh4uVw=; b=b+5I90d0JcBXyHYGwL5944tGw0FJdj/1939yWDKSr8bq3UNZtlTIm9MgFmg+h6kPzc fDyM4zp5BjQxVQ6mKVhC4pMrgZL3sggatl2gY+wDHBd113daNk4FlVzpxAnOCq26vnyY zW+eIDfdaee1LYJbO/y19Sd+WflA82qqfqT8HQNmxNeIQpHURO4aBMjfFJDlibkyO51E 0i5HVf0YsYMODXPW6SegZ709CsBununkc4j3I04UAwgoOxzuWfVdZhulWf8AOBIHFdKT 0bQM95z0vEZ3Seh0LXXBQw3/GS0D3PUzSPe6KR5b16QtpzOk+ky8mLHvHXE9BwEDRcgp OfjQ== X-Gm-Message-State: AOAM530OGfT9d4TFA4lq+dmPIroXx5Lp/IQ+sDVH936zBjnK8mi7D8N/ QtsbnyCt3p4HShd1nnzWKHiU+pXbpRt4aw== X-Google-Smtp-Source: ABdhPJytnaaspMP4twdP0/GG68rw4eC/u2R/uDJCX7veeKtKvUFhQs3cokUnTjZ5TYY3Fz0QUwposg== X-Received: by 2002:adf:e54f:: with SMTP id z15mr25434726wrm.136.1599567897979; Tue, 08 Sep 2020 05:24:57 -0700 (PDT) Received: from [88.208.79.100] (halouny.humusoft.cz. [88.208.79.100]) by smtp.gmail.com with ESMTPSA id z9sm32619727wmg.46.2020.09.08.05.24.56 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 08 Sep 2020 05:24:57 -0700 (PDT) Sender: Michal Meloun Reply-To: meloun.michal@gmail.com Subject: Re: svn commit: r365445 - head/sys/cam/mmc To: Andriy Gapon , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202009080546.0885kAgk006783@repo.freebsd.org> <34826ee7-12a9-d309-1fee-cd2e95744603@FreeBSD.org> From: Michal Meloun Message-ID: <67be7fa5-30dd-b7ee-1076-9c29195d83d3@gmail.com> Date: Tue, 8 Sep 2020 14:24:59 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: <34826ee7-12a9-d309-1fee-cd2e95744603@FreeBSD.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4Bm4983Lm7z4fx4 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=o3zss6EI; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of melounmichal@gmail.com designates 2a00:1450:4864:20::444 as permitted sender) smtp.mailfrom=melounmichal@gmail.com X-Spamd-Result: default: False [-2.54 / 15.00]; HAS_REPLYTO(0.00)[meloun.michal@gmail.com]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36:c]; FREEMAIL_FROM(0.00)[gmail.com]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; MID_RHS_MATCH_FROM(0.00)[]; TAGGED_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.99)[-0.990]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-0.998]; MIME_GOOD(-0.10)[text/plain]; FREEMAIL_REPLYTO(0.00)[gmail.com]; REPLYTO_DOM_EQ_FROM_DOM(0.00)[]; NEURAL_SPAM_SHORT(0.45)[0.451]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::444:from]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[svn-src-head,svn-src-all] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 08 Sep 2020 12:25:01 -0000 On 08.09.2020 9:10, Andriy Gapon wrote: > On 08/09/2020 08:46, Andriy Gapon wrote: >> Author: avg >> Date: Tue Sep 8 05:46:10 2020 >> New Revision: 365445 >> URL: https://svnweb.freebsd.org/changeset/base/365445 >> >> Log: >> mmc_da: make sure that part_index is not used uninitialized in sddastart > [snip] >> Modified: head/sys/cam/mmc/mmc_da.c >> ============================================================================== >> --- head/sys/cam/mmc/mmc_da.c Tue Sep 8 04:44:37 2020 (r365444) >> +++ head/sys/cam/mmc/mmc_da.c Tue Sep 8 05:46:10 2020 (r365445) >> @@ -1808,6 +1808,7 @@ sddastart(struct cam_periph *periph, union ccb *start_ >> } >> >> /* Find partition that has outstanding commands. Prefer current partition. */ >> + part_index = softc->part_curr; >> part = softc->part[softc->part_curr]; >> bp = bioq_first(&part->bio_queue); >> if (bp == NULL) { >> > > One thing that concerns me is that it was obvious (to a human) that part_index > could be used uninitialized if bp was not NULL. > Yet, there was no warning or error from the compiler when I built that code for > armv7. > > I wonder if we disable some relevant warnings for that architecture. > Or if the compiler (clang 11) could not figure that out. > Hmm, for this in kernel code : int foo(void); int foo(void) { int rv; return (rv); } warning is reported for both armv7 and arm64 for native or cross compile. It seems that clang11 doesn't emit warnings only for more complicated cases... I writing this because i just found another usage of uninitialized variable, in this case in much more complicated abort_handler() function in arm/trap-v6.c again without warning emitted. Michal From owner-svn-src-all@freebsd.org Tue Sep 8 12:37:19 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 46E48337543; Tue, 8 Sep 2020 12:37:19 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bm4RM14qDz3S7p; Tue, 8 Sep 2020 12:37:19 +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 0830C10748; Tue, 8 Sep 2020 12:37:19 +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 088CbI6B058076; Tue, 8 Sep 2020 12:37:18 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 088CbITP058075; Tue, 8 Sep 2020 12:37:18 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202009081237.088CbITP058075@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 8 Sep 2020 12:37:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365452 - stable/12/cddl/lib/libdtrace X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/cddl/lib/libdtrace X-SVN-Commit-Revision: 365452 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.33 Precedence: list List-Id: "SVN commit messages 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, 08 Sep 2020 12:37:19 -0000 Author: markj Date: Tue Sep 8 12:37:18 2020 New Revision: 365452 URL: https://svnweb.freebsd.org/changeset/base/365452 Log: MFC r365047: Correct the D definition for EINTEGRITY. Modified: stable/12/cddl/lib/libdtrace/errno.d Directory Properties: stable/12/ (props changed) Modified: stable/12/cddl/lib/libdtrace/errno.d ============================================================================== --- stable/12/cddl/lib/libdtrace/errno.d Tue Sep 8 11:46:33 2020 (r365451) +++ stable/12/cddl/lib/libdtrace/errno.d Tue Sep 8 12:37:18 2020 (r365452) @@ -225,7 +225,7 @@ inline int ENOTRECOVERABLE = 95; #pragma D binding "1.13" ENOTRECOVERABLE inline int EOWNERDEAD = 96; #pragma D binding "1.13" EOWNERDEAD -inline int EINTEGRITY = 96; +inline int EINTEGRITY = 97; #pragma D binding "1.13" EINTEGRITY inline int ELAST = 97; #pragma D binding "1.0" ELAST From owner-svn-src-all@freebsd.org Tue Sep 8 12:37:49 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 254363373FD; Tue, 8 Sep 2020 12:37: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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bm4Rv1W0Pz3SV8; Tue, 8 Sep 2020 12:37:47 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A824E10661; Tue, 8 Sep 2020 12:37:46 +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 088Cbk0e058243; Tue, 8 Sep 2020 12:37:46 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 088Cbktc058242; Tue, 8 Sep 2020 12:37:46 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202009081237.088Cbktc058242@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 8 Sep 2020 12:37:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365453 - stable/12/sys/cddl/dev/dtrace/amd64 X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/cddl/dev/dtrace/amd64 X-SVN-Commit-Revision: 365453 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.33 Precedence: list List-Id: "SVN commit messages 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, 08 Sep 2020 12:37:51 -0000 Author: markj Date: Tue Sep 8 12:37:46 2020 New Revision: 365453 URL: https://svnweb.freebsd.org/changeset/base/365453 Log: MFC r365048: Tighten frame pointer checking in DTrace's amd64 stack unwinder. Modified: stable/12/sys/cddl/dev/dtrace/amd64/dtrace_isa.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/cddl/dev/dtrace/amd64/dtrace_isa.c ============================================================================== --- stable/12/sys/cddl/dev/dtrace/amd64/dtrace_isa.c Tue Sep 8 12:37:18 2020 (r365452) +++ stable/12/sys/cddl/dev/dtrace/amd64/dtrace_isa.c Tue Sep 8 12:37:46 2020 (r365453) @@ -56,6 +56,7 @@ void dtrace_getpcstack(pc_t *pcstack, int pcstack_limit, int aframes, uint32_t *intrpc) { + struct thread *td; int depth = 0; register_t rbp; struct amd64_frame *frame; @@ -70,10 +71,16 @@ dtrace_getpcstack(pc_t *pcstack, int pcstack_limit, in __asm __volatile("movq %%rbp,%0" : "=r" (rbp)); frame = (struct amd64_frame *)rbp; + td = curthread; while (depth < pcstack_limit) { if (!INKERNEL((long) frame)) break; + if ((vm_offset_t)frame >= + td->td_kstack + ptoa(td->td_kstack_pages) || + (vm_offset_t)frame < td->td_kstack) + break; + callpc = frame->f_retaddr; if (!INKERNEL(callpc)) @@ -84,14 +91,11 @@ dtrace_getpcstack(pc_t *pcstack, int pcstack_limit, in if ((aframes == 0) && (caller != 0)) { pcstack[depth++] = caller; } - } - else { + } else { pcstack[depth++] = callpc; } - if (frame->f_frame <= frame || - (vm_offset_t)frame->f_frame >= curthread->td_kstack + - curthread->td_kstack_pages * PAGE_SIZE) + if ((vm_offset_t)frame->f_frame <= (vm_offset_t)frame) break; frame = frame->f_frame; } From owner-svn-src-all@freebsd.org Tue Sep 8 12:38:36 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5A671337736; Tue, 8 Sep 2020 12:38:36 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bm4Sr1pwLz3SSw; Tue, 8 Sep 2020 12:38:36 +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 218CC1098F; Tue, 8 Sep 2020 12:38:36 +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 088CcZBh058332; Tue, 8 Sep 2020 12:38:35 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 088CcZll058328; Tue, 8 Sep 2020 12:38:35 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202009081238.088CcZll058328@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 8 Sep 2020 12:38:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365454 - stable/12/usr.sbin/pw X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/usr.sbin/pw X-SVN-Commit-Revision: 365454 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.33 Precedence: list List-Id: "SVN commit messages 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, 08 Sep 2020 12:38:36 -0000 Author: markj Date: Tue Sep 8 12:38:34 2020 New Revision: 365454 URL: https://svnweb.freebsd.org/changeset/base/365454 Log: MFC r365043-r365046: pw: Coverity fixes. Modified: stable/12/usr.sbin/pw/pw_group.c stable/12/usr.sbin/pw/pw_user.c stable/12/usr.sbin/pw/rm_r.c stable/12/usr.sbin/pw/strtounum.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/pw/pw_group.c ============================================================================== --- stable/12/usr.sbin/pw/pw_group.c Tue Sep 8 12:37:46 2020 (r365453) +++ stable/12/usr.sbin/pw/pw_group.c Tue Sep 8 12:38:34 2020 (r365454) @@ -66,13 +66,18 @@ grp_set_passwd(struct group *grp, bool update, int fd, } if ((istty = isatty(fd))) { - n = t; - /* Disable echo */ - n.c_lflag &= ~(ECHO); - tcsetattr(fd, TCSANOW, &n); - printf("%sassword for group %s:", update ? "New p" : "P", - grp->gr_name); - fflush(stdout); + if (tcgetattr(fd, &t) == -1) + istty = 0; + else { + n = t; + /* Disable echo */ + n.c_lflag &= ~(ECHO); + tcsetattr(fd, TCSANOW, &n); + printf("%sassword for group %s:", + update ? "New p" : "P", + grp->gr_name); + fflush(stdout); + } } b = read(fd, line, sizeof(line) - 1); if (istty) { /* Restore state */ Modified: stable/12/usr.sbin/pw/pw_user.c ============================================================================== --- stable/12/usr.sbin/pw/pw_user.c Tue Sep 8 12:37:46 2020 (r365453) +++ stable/12/usr.sbin/pw/pw_user.c Tue Sep 8 12:38:34 2020 (r365454) @@ -712,24 +712,24 @@ rmopie(char const * name) { char tmp[1014]; FILE *fp; - int fd; size_t len; - off_t atofs = 0; - + long atofs; + int fd; + if ((fd = openat(conf.rootfd, "etc/opiekeys", O_RDWR)) == -1) return; fp = fdopen(fd, "r+"); len = strlen(name); - while (fgets(tmp, sizeof(tmp), fp) != NULL) { + for (atofs = 0; fgets(tmp, sizeof(tmp), fp) != NULL && atofs >= 0; + atofs = ftell(fp)) { if (strncmp(name, tmp, len) == 0 && tmp[len]==' ') { /* Comment username out */ if (fseek(fp, atofs, SEEK_SET) == 0) fwrite("#", 1, 1, fp); break; } - atofs = ftell(fp); } /* * If we got an error of any sort, don't update! Modified: stable/12/usr.sbin/pw/rm_r.c ============================================================================== --- stable/12/usr.sbin/pw/rm_r.c Tue Sep 8 12:37:46 2020 (r365453) +++ stable/12/usr.sbin/pw/rm_r.c Tue Sep 8 12:38:34 2020 (r365454) @@ -57,6 +57,10 @@ rm_r(int rootfd, const char *path, uid_t uid) } d = fdopendir(dirfd); + if (d == NULL) { + (void)close(dirfd); + return; + } while ((e = readdir(d)) != NULL) { if (strcmp(e->d_name, ".") == 0 || strcmp(e->d_name, "..") == 0) continue; Modified: stable/12/usr.sbin/pw/strtounum.c ============================================================================== --- stable/12/usr.sbin/pw/strtounum.c Tue Sep 8 12:37:46 2020 (r365453) +++ stable/12/usr.sbin/pw/strtounum.c Tue Sep 8 12:38:34 2020 (r365454) @@ -44,28 +44,24 @@ strtounum(const char * __restrict np, uintmax_t minval *errpp = NULL; if (minval > maxval) { errno = EINVAL; - if (errpp != NULL) - *errpp = "invalid"; + *errpp = "invalid"; return (0); } errno = 0; ret = strtoumax(np, &endp, 10); if (endp == np || *endp != '\0') { errno = EINVAL; - if (errpp != NULL) - *errpp = "invalid"; + *errpp = "invalid"; return (0); } if (ret < minval) { errno = ERANGE; - if (errpp != NULL) - *errpp = "too small"; + *errpp = "too small"; return (0); } if (errno == ERANGE || ret > maxval) { errno = ERANGE; - if (errpp != NULL) - *errpp = "too large"; + *errpp = "too large"; return (0); } return (ret); From owner-svn-src-all@freebsd.org Tue Sep 8 12:48:53 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DAE8D337A61; Tue, 8 Sep 2020 12:48:53 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qt1-x841.google.com (mail-qt1-x841.google.com [IPv6:2607:f8b0:4864:20::841]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bm4hh2njMz3T84; Tue, 8 Sep 2020 12:48:52 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-qt1-x841.google.com with SMTP id z2so11701979qtv.12; Tue, 08 Sep 2020 05:48:52 -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; bh=wSsLOe5Lyn7H7ifVAKEYuRl4ZOhT8g45K/m16x4i8eA=; b=bUtuKyrnSLyiNyKqpuXML4x6VriDYRSyNiUFeFIqcxYMW2PHJ8piUOpUcwuR1O/yyU +2qH76TVr+CvsuYkdlaGyKapbFyCwbzvt4LSppNg0tzstZmDno5S42YggssmE77I3zSs IXlbwd4JRSfOqxuLbcLvErVRbZaVMPSgsnUjt4HcOIv/AAAQskR2ZjdTcmFhpxlqflcG J5iWFpF8EU7hWjs58U4jho7MluXS6EUxG38vF6MrmlXcHtdOhPBgpY6bRPtW4QbU8rhC qgvqnzAHiLkrbZvAI6D/SfOgb+AtduYdUjFbPKujzOsB+iP2Efv/9KsVCc2unSMad/D6 TZ1g== 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; bh=wSsLOe5Lyn7H7ifVAKEYuRl4ZOhT8g45K/m16x4i8eA=; b=gti6Gva/qUZ53m2VNrCNj8SZOwMUzZhvAFR9r5tUFi5LKlslY9Fhm44CeGty8Lrq44 C3oPxgt9PPIbjpqg8mOFKOgCzVNUx+zkM82jCtNre10Zmfx97dr7hP1MnZolc7fCbQVD IPtyn9AFGNdGDDtabRrSv8+fTFGDy4I9PJfDt4nxupP2RKClOZiPyvxqnIM+MJ8CPo2d TxT7g9jlLqa4QebFDk63Y1Z+xjX8IMtQC/aJjUJnRBy0eiJUL22q/cXeHdsd33CyZ3bS z3M+8rYmN8cPXP1AW2Uy/3AnciYODoXDVAA2vB3TKyWNuuVOEiOczBsmWIkf1fpaT2ks Glsg== X-Gm-Message-State: AOAM531UONqI3dpq9pjGKncZC/CKQKlrpemQj07GGz5kBKtzV2Lrr4l7 vVBK2A6bK6eadnertYZvq3Q= X-Google-Smtp-Source: ABdhPJyqOkDDOxvMTotXiLhcRt9CtFFEoU/JkdteniSv1WOiDe0pB97SpoQOP3LXSrd/GQ60kMoniA== X-Received: by 2002:ac8:5488:: with SMTP id h8mr24349811qtq.250.1599569331214; Tue, 08 Sep 2020 05:48:51 -0700 (PDT) Received: from raichu (toroon0560w-lp130-08-67-71-176-35.dsl.bell.ca. [67.71.176.35]) by smtp.gmail.com with ESMTPSA id p29sm9115155qtu.68.2020.09.08.05.48.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Sep 2020 05:48:50 -0700 (PDT) Sender: Mark Johnston Date: Tue, 8 Sep 2020 08:48:48 -0400 From: Mark Johnston To: Michal Meloun Cc: Andriy Gapon , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r365445 - head/sys/cam/mmc Message-ID: <20200908124848.GB66031@raichu> References: <202009080546.0885kAgk006783@repo.freebsd.org> <34826ee7-12a9-d309-1fee-cd2e95744603@FreeBSD.org> <67be7fa5-30dd-b7ee-1076-9c29195d83d3@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <67be7fa5-30dd-b7ee-1076-9c29195d83d3@gmail.com> X-Rspamd-Queue-Id: 4Bm4hh2njMz3T84 X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=bUtuKyrn; dmarc=none; spf=pass (mx1.freebsd.org: domain of markjdb@gmail.com designates 2607:f8b0:4864:20::841 as permitted sender) smtp.mailfrom=markjdb@gmail.com X-Spamd-Result: default: False [-1.34 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; RCPT_COUNT_FIVE(0.00)[5]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[gmail.com:+]; FREEMAIL_TO(0.00)[gmail.com]; FORGED_SENDER(0.30)[markj@freebsd.org,markjdb@gmail.com]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[markj@freebsd.org,markjdb@gmail.com]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.99)[-0.989]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; NEURAL_SPAM_SHORT(0.32)[0.320]; NEURAL_HAM_LONG(-0.97)[-0.973]; TAGGED_RCPT(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[freebsd.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::841:from]; MID_RHS_NOT_FQDN(0.50)[]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[svn-src-all,svn-src-head] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 08 Sep 2020 12:48:53 -0000 On Tue, Sep 08, 2020 at 02:24:59PM +0200, Michal Meloun wrote: > On 08.09.2020 9:10, Andriy Gapon wrote: > > On 08/09/2020 08:46, Andriy Gapon wrote: > >> Author: avg > >> Date: Tue Sep 8 05:46:10 2020 > >> New Revision: 365445 > >> URL: https://svnweb.freebsd.org/changeset/base/365445 > >> > >> Log: > >> mmc_da: make sure that part_index is not used uninitialized in sddastart > > [snip] > >> Modified: head/sys/cam/mmc/mmc_da.c > >> ============================================================================== > >> --- head/sys/cam/mmc/mmc_da.c Tue Sep 8 04:44:37 2020 (r365444) > >> +++ head/sys/cam/mmc/mmc_da.c Tue Sep 8 05:46:10 2020 (r365445) > >> @@ -1808,6 +1808,7 @@ sddastart(struct cam_periph *periph, union ccb *start_ > >> } > >> > >> /* Find partition that has outstanding commands. Prefer current partition. */ > >> + part_index = softc->part_curr; > >> part = softc->part[softc->part_curr]; > >> bp = bioq_first(&part->bio_queue); > >> if (bp == NULL) { > >> > > > > One thing that concerns me is that it was obvious (to a human) that part_index > > could be used uninitialized if bp was not NULL. > > Yet, there was no warning or error from the compiler when I built that code for > > armv7. > > > > I wonder if we disable some relevant warnings for that architecture. > > Or if the compiler (clang 11) could not figure that out. > > > Hmm, for this in kernel code : > int foo(void); > int foo(void) > { > int rv; > > return (rv); > } > > warning is reported for both armv7 and arm64 for native or cross compile. > > It seems that clang11 doesn't emit warnings only for more complicated > cases... > > I writing this because i just found another usage of uninitialized > variable, in this case in much more complicated abort_handler() function > in arm/trap-v6.c again without warning emitted. I observed the same thing recently as well: the compiler catches uninitialized variables only in simple cases. In my case, any uses of goto within the function seemed to silence the warning, even if they appeared after the uninitialized reference. From owner-svn-src-all@freebsd.org Tue Sep 8 13:21:15 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4C76C3C8F03; Tue, 8 Sep 2020 13:21:15 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bm5Q31LcKz3Vnp; Tue, 8 Sep 2020 13:21:15 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 12D4711051; Tue, 8 Sep 2020 13:21:15 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 088DLEA2084596; Tue, 8 Sep 2020 13:21:14 GMT (envelope-from mhorne@FreeBSD.org) Received: (from mhorne@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 088DLDm9084590; Tue, 8 Sep 2020 13:21:13 GMT (envelope-from mhorne@FreeBSD.org) Message-Id: <202009081321.088DLDm9084590@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mhorne set sender to mhorne@FreeBSD.org using -f From: Mitchell Horne Date: Tue, 8 Sep 2020 13:21:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365455 - in head/sys: dev/xilinx riscv/riscv X-SVN-Group: head X-SVN-Commit-Author: mhorne X-SVN-Commit-Paths: in head/sys: dev/xilinx riscv/riscv X-SVN-Commit-Revision: 365455 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.33 Precedence: list List-Id: "SVN commit messages 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, 08 Sep 2020 13:21:15 -0000 Author: mhorne Date: Tue Sep 8 13:21:13 2020 New Revision: 365455 URL: https://svnweb.freebsd.org/changeset/base/365455 Log: RISC-V: fix some mismatched format specifiers RISC-V is currently built with -Wno-format, which is how these went undetected. Address them now before re-enabling those warnings. Differential Revision: https://reviews.freebsd.org/D26319 Modified: head/sys/dev/xilinx/axidma.c head/sys/riscv/riscv/db_disasm.c head/sys/riscv/riscv/intr_machdep.c head/sys/riscv/riscv/pmap.c head/sys/riscv/riscv/sbi.c head/sys/riscv/riscv/trap.c Modified: head/sys/dev/xilinx/axidma.c ============================================================================== --- head/sys/dev/xilinx/axidma.c Tue Sep 8 12:38:34 2020 (r365454) +++ head/sys/dev/xilinx/axidma.c Tue Sep 8 13:21:13 2020 (r365455) @@ -363,7 +363,7 @@ axidma_desc_alloc(struct axidma_softc *sc, struct xdma chan->mem_vaddr = kva_alloc(chan->mem_size); pmap_kenter_device(chan->mem_vaddr, chan->mem_size, chan->mem_paddr); - device_printf(sc->dev, "Allocated chunk %lx %d\n", + device_printf(sc->dev, "Allocated chunk %lx %lu\n", chan->mem_paddr, chan->mem_size); for (i = 0; i < nsegments; i++) { Modified: head/sys/riscv/riscv/db_disasm.c ============================================================================== --- head/sys/riscv/riscv/db_disasm.c Tue Sep 8 12:38:34 2020 (r365454) +++ head/sys/riscv/riscv/db_disasm.c Tue Sep 8 13:21:13 2020 (r365455) @@ -416,7 +416,7 @@ oprint(struct riscv_op *op, vm_offset_t loc, int insn) imm |= ((insn >> 12) & 0x1) << 5; if (imm & (1 << 5)) imm |= (0x7ffffff << 5); /* sign ext */ - db_printf("0x%lx", imm); + db_printf("0x%x", imm); break; case 'o': imm = ((insn >> 2) & 0x1f) << 0; @@ -524,7 +524,7 @@ oprint(struct riscv_op *op, vm_offset_t loc, int insn) imm = (insn >> 12) & 0xfffff; if (imm & (1 << 20)) imm |= (0xfff << 20); /* sign extend */ - db_printf("0x%lx", imm); + db_printf("0x%x", imm); break; case 'j': /* imm[11:0] << 20 */ Modified: head/sys/riscv/riscv/intr_machdep.c ============================================================================== --- head/sys/riscv/riscv/intr_machdep.c Tue Sep 8 12:38:34 2020 (r365454) +++ head/sys/riscv/riscv/intr_machdep.c Tue Sep 8 13:21:13 2020 (r365455) @@ -73,9 +73,9 @@ struct intc_irqsrc isrcs[INTC_NIRQS]; static void riscv_mask_irq(void *source) { - uintptr_t irq; + int irq; - irq = (uintptr_t)source; + irq = (int)(uintptr_t)source; switch (irq) { case IRQ_TIMER_SUPERVISOR: @@ -95,9 +95,9 @@ riscv_mask_irq(void *source) static void riscv_unmask_irq(void *source) { - uintptr_t irq; + int irq; - irq = (uintptr_t)source; + irq = (int)(uintptr_t)source; switch (irq) { case IRQ_TIMER_SUPERVISOR: Modified: head/sys/riscv/riscv/pmap.c ============================================================================== --- head/sys/riscv/riscv/pmap.c Tue Sep 8 12:38:34 2020 (r365454) +++ head/sys/riscv/riscv/pmap.c Tue Sep 8 13:21:13 2020 (r365455) @@ -590,7 +590,7 @@ pmap_bootstrap(vm_offset_t l1pt, vm_paddr_t kernstart, if (physmap[i + 1] > max_pa) max_pa = physmap[i + 1]; } - printf("physmap_idx %lx\n", physmap_idx); + printf("physmap_idx %u\n", physmap_idx); printf("min_pa %lx\n", min_pa); printf("max_pa %lx\n", max_pa); Modified: head/sys/riscv/riscv/sbi.c ============================================================================== --- head/sys/riscv/riscv/sbi.c Tue Sep 8 12:38:34 2020 (r365454) +++ head/sys/riscv/riscv/sbi.c Tue Sep 8 13:21:13 2020 (r365455) @@ -104,7 +104,7 @@ sbi_print_version(void) switch (sbi_impl_id) { case (SBI_IMPL_ID_BBL): - printf("SBI: Berkely Boot Loader %u\n", sbi_impl_version); + printf("SBI: Berkely Boot Loader %lu\n", sbi_impl_version); break; case (SBI_IMPL_ID_OPENSBI): major = sbi_impl_version >> OPENSBI_VERSION_MAJOR_OFFSET; @@ -112,7 +112,7 @@ sbi_print_version(void) printf("SBI: OpenSBI v%u.%u\n", major, minor); break; default: - printf("SBI: Unrecognized Implementation: %u\n", sbi_impl_id); + printf("SBI: Unrecognized Implementation: %lu\n", sbi_impl_id); break; } Modified: head/sys/riscv/riscv/trap.c ============================================================================== --- head/sys/riscv/riscv/trap.c Tue Sep 8 12:38:34 2020 (r365454) +++ head/sys/riscv/riscv/trap.c Tue Sep 8 13:21:13 2020 (r365455) @@ -306,7 +306,7 @@ do_trap_supervisor(struct trapframe *frame) break; default: dump_regs(frame); - panic("Unknown kernel exception %x trap value %lx\n", + panic("Unknown kernel exception %lx trap value %lx\n", exception, frame->tf_stval); } } @@ -375,7 +375,7 @@ do_trap_user(struct trapframe *frame) break; default: dump_regs(frame); - panic("Unknown userland exception %x, trap value %lx\n", + panic("Unknown userland exception %lx, trap value %lx\n", exception, frame->tf_stval); } } From owner-svn-src-all@freebsd.org Tue Sep 8 13:24:45 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 385ED3C90BA; Tue, 8 Sep 2020 13:24:45 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bm5V50nfKz3VwD; Tue, 8 Sep 2020 13:24:45 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 F31631139F; Tue, 8 Sep 2020 13:24:44 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 088DOibF088597; Tue, 8 Sep 2020 13:24:44 GMT (envelope-from mhorne@FreeBSD.org) Received: (from mhorne@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 088DOi1Z088596; Tue, 8 Sep 2020 13:24:44 GMT (envelope-from mhorne@FreeBSD.org) Message-Id: <202009081324.088DOi1Z088596@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mhorne set sender to mhorne@FreeBSD.org using -f From: Mitchell Horne Date: Tue, 8 Sep 2020 13:24:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365456 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: mhorne X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 365456 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.33 Precedence: list List-Id: "SVN commit messages 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, 08 Sep 2020 13:24:45 -0000 Author: mhorne Date: Tue Sep 8 13:24:44 2020 New Revision: 365456 URL: https://svnweb.freebsd.org/changeset/base/365456 Log: RISC-V: enable MK_FORMAT_EXTENSIONS This option was marked as broken because our riscv64-xtoolchain-gcc package lacked support. Since we are moving away from xtoolchain gcc in favor of freebsd-gcc9, there should be no issue in enabling this option by default. Notably, this enables -Wformat errors. Reviewed by: kp, jhb Differential Revision: https://reviews.freebsd.org/D26320 Modified: head/sys/conf/kern.opts.mk Modified: head/sys/conf/kern.opts.mk ============================================================================== --- head/sys/conf/kern.opts.mk Tue Sep 8 13:21:13 2020 (r365455) +++ head/sys/conf/kern.opts.mk Tue Sep 8 13:24:44 2020 (r365456) @@ -80,10 +80,6 @@ BROKEN_OPTIONS+= CDDL ZFS SSP BROKEN_OPTIONS+= ZFS .endif -.if ${MACHINE_CPUARCH} == "riscv" -BROKEN_OPTIONS+= FORMAT_EXTENSIONS -.endif - # Things that don't work because the kernel doesn't have the support # for them. .if ${MACHINE} != "i386" && ${MACHINE} != "amd64" From owner-svn-src-all@freebsd.org Tue Sep 8 14:20:33 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A863F3CA7EE; Tue, 8 Sep 2020 14:20:33 +0000 (UTC) (envelope-from mhorne@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bm6kT4NtPz3Yjn; Tue, 8 Sep 2020 14:20:33 +0000 (UTC) (envelope-from mhorne@freebsd.org) Received: from mail-yb1-f175.google.com (mail-yb1-f175.google.com [209.85.219.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: mhorne) by smtp.freebsd.org (Postfix) with ESMTPSA id 7115723DDC; Tue, 8 Sep 2020 14:20:33 +0000 (UTC) (envelope-from mhorne@freebsd.org) Received: by mail-yb1-f175.google.com with SMTP id h206so11363032ybc.11; Tue, 08 Sep 2020 07:20:33 -0700 (PDT) X-Gm-Message-State: AOAM531kirHj/Flpm0qcl891mGFD8S37wTHdwUZJzfpau++Ojxck/tbA 6BuKHRM6yu/8esxrXMKIxUMAml2cmio5GLkcyBo= X-Google-Smtp-Source: ABdhPJxXrZfrTmWQa5y0c1Kd9vRLcea6hoCgstjQGdf6ULTm93jAuv7+Mft51gjcSWxqchkaRqdVr29rlJOEOotHlEM= X-Received: by 2002:a25:d304:: with SMTP id e4mr34641852ybf.226.1599574832152; Tue, 08 Sep 2020 07:20:32 -0700 (PDT) MIME-Version: 1.0 References: <202009081036.088AaCk8085096@repo.freebsd.org> In-Reply-To: <202009081036.088AaCk8085096@repo.freebsd.org> From: Mitchell Horne Date: Tue, 8 Sep 2020 11:20:21 -0300 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r365449 - head/sbin/rcorder To: "Andrey V. Elsukov" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 08 Sep 2020 14:20:33 -0000 Hi, I think this change warrants an entry in RELNOTES. Cheers, Mitchell On Tue, Sep 8, 2020 at 7:36 AM Andrey V. Elsukov wrote: > > Author: ae > Date: Tue Sep 8 10:36:11 2020 > New Revision: 365449 > URL: https://svnweb.freebsd.org/changeset/base/365449 > > Log: > Add a few features to rcorder: > > o Enhance dependency loop logging: print full chain instead of the > last link competing the loop; > o Add -g option to generate dependency graph suitable for GraphViz > visualization, loops and other graph generation issues are highlighted > automatically; > o Add -p option that enables grouping items that can be processed in > parallel. > > Submitted by: Boris Lytochkin > Reviewed by: melifaro > MFC after: 1 week > Differential Revision: https://reviews.freebsd.org/D25389 > > Modified: > head/sbin/rcorder/rcorder.8 > head/sbin/rcorder/rcorder.c > > Modified: head/sbin/rcorder/rcorder.8 > ============================================================================== > --- head/sbin/rcorder/rcorder.8 Tue Sep 8 07:37:45 2020 (r365448) > +++ head/sbin/rcorder/rcorder.8 Tue Sep 8 10:36:11 2020 (r365449) > @@ -31,7 +31,7 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd June 22, 2020 > +.Dd September 8, 2020 > .Dt RCORDER 8 > .Os > .Sh NAME > @@ -39,6 +39,7 @@ > .Nd print a dependency ordering of interdependent files > .Sh SYNOPSIS > .Nm > +.Op Fl gp > .Op Fl k Ar keep > .Op Fl s Ar skip > .Ar > @@ -95,6 +96,9 @@ is reached, parsing stops. > .Pp > The options are as follows: > .Bl -tag -width "-k keep" > +.It Fl g > +Produce a GraphViz (.dot) of the complete dependency graph instead of > +plaintext calling order list. > .It Fl k Ar keep > Add the specified keyword to the > .Dq "keep list" . > @@ -102,6 +106,9 @@ If any > .Fl k > option is given, only those files containing the matching keyword are listed. > This option can be specified multiple times. > +.It Fl p > +Generate ordering suitable for parallel startup, placing files that can be > +executed simultaneously on the same line. > .It Fl s Ar skip > Add the specified keyword to the > .Dq "skip list" . > @@ -178,19 +185,46 @@ The > utility may print one of the following error messages and exit with a non-zero > status if it encounters an error while processing the file list. > .Bl -diag > -.It "Requirement %s has no providers, aborting." > +.It "Requirement %s in file %s has no providers." > No file has a > .Ql PROVIDE > line corresponding to a condition present in a > .Ql REQUIRE > line in another file. > -.It "Circular dependency on provision %s, aborting." > +.It "Circular dependency on provision %s in file %s." > A set of files has a circular dependency which was detected while > processing the stated condition. > -.It "Circular dependency on file %s, aborting." > +Loop visualization follows this message. > +.It "Circular dependency on file %s." > A set of files has a circular dependency which was detected while > processing the stated file. > +.It "%s was seen in circular dependencies for %d times." > +Each node that was a part of circular dependency loops reports total number of > +such encounters. > +Start with files having biggest counter when fighting with broken dependencies. > .El > +.Sh DIAGNOSTICS WITH GRAPHVIZ > +Direct dependency is drawn with solid line, > +.Ql BEFORE > +dependency is drawn as a dashed line. > +Each node of a graph represents an item from > +.Ql PROVIDE > +lines. > +In case there are more than one file providing an item, a list of filenames > +shortened with > +.Xr basename 3 > +is shown. > +Shortened filenames are also shown in case > +.Ql PROVIDE > +item does not match file name. > +.Pp > +Edges and nodes where circular dependencies were detected are drawn bold red. > +If a file has an item in > +.Ql REQUIRE > +or in > +.Ql BEFORE > +that could not be provided, > +this missing provider and the requirement will be drawn bold red as well. > .Sh SEE ALSO > .Xr acpiconf 8 , > .Xr rc 8 , > > Modified: head/sbin/rcorder/rcorder.c > ============================================================================== > --- head/sbin/rcorder/rcorder.c Tue Sep 8 07:37:45 2020 (r365448) > +++ head/sbin/rcorder/rcorder.c Tue Sep 8 10:36:11 2020 (r365449) > @@ -9,6 +9,8 @@ > * All rights reserved. > * Copyright (c) 1998 > * Perry E. Metzger. All rights reserved. > + * Copyright (c) 2020 > + * Boris N. Lytochkin. All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > * modification, are permitted provided that the following conditions > @@ -48,6 +50,8 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > +#include > > #include "ealloc.h" > #include "sprite.h" > @@ -75,17 +79,21 @@ static int debug = 0; > #define KEYWORDS_STR "# KEYWORDS:" > #define KEYWORDS_LEN (sizeof(KEYWORDS_STR) - 1) > > +#define FAKE_PROV_NAME "fake_prov_" > + > static int exit_code; > static int file_count; > static char **file_list; > > -typedef int bool; > #define TRUE 1 > #define FALSE 0 > typedef bool flag; > #define SET TRUE > #define RESET FALSE > > +static flag do_graphviz = false; > +static flag do_parallel = false; > + > static Hash_Table provide_hash_s, *provide_hash; > > typedef struct provnode provnode; > @@ -97,12 +105,14 @@ typedef struct strnodelist strnodelist; > struct provnode { > flag head; > flag in_progress; > + int sequence; > filenode *fnode; > provnode *next, *last; > }; > > struct f_provnode { > provnode *pnode; > + Hash_Entry *entry; > f_provnode *next; > }; > > @@ -124,19 +134,23 @@ struct filenode { > f_reqnode *req_list; > f_provnode *prov_list; > strnodelist *keyword_list; > + int issues_count; > + int sequence; > }; > > -static filenode fn_head_s, *fn_head; > +static filenode fn_head_s, *fn_head, **fn_seqlist; > +static int max_sequence = 0; > > static strnodelist *bl_list; > static strnodelist *keep_list; > static strnodelist *skip_list; > > -static void do_file(filenode *fnode); > +static void do_file(filenode *fnode, strnodelist *); > static void strnode_add(strnodelist **, char *, filenode *); > static int skip_ok(filenode *fnode); > static int keep_ok(filenode *fnode); > -static void satisfy_req(f_reqnode *rnode, char *filename); > +static char *generate_loop_for_req(strnodelist *, provnode *, filenode *); > +static void satisfy_req(f_reqnode *rnode, filenode *fnode, strnodelist *); > static void crunch_file(char *); > static void parse_require(filenode *, char *); > static void parse_provide(filenode *, char *); > @@ -151,6 +165,12 @@ static void insert_before(void); > static Hash_Entry *make_fake_provision(filenode *); > static void crunch_all_files(void); > static void initialize(void); > +static void generate_graphviz_header(void); > +static void generate_graphviz_footer(void); > +static void generate_graphviz_file_links(Hash_Entry *, filenode *); > +static void generate_graphviz_providers(void); > +static inline int is_fake_prov(const char *); > +static int sequence_cmp(const void *, const void *); > static void generate_ordering(void); > > int > @@ -158,7 +178,7 @@ main(int argc, char *argv[]) > { > int ch; > > - while ((ch = getopt(argc, argv, "dk:s:")) != -1) > + while ((ch = getopt(argc, argv, "dgk:ps:")) != -1) > switch (ch) { > case 'd': > #ifdef DEBUG > @@ -167,9 +187,15 @@ main(int argc, char *argv[]) > warnx("debugging not compiled in, -d ignored"); > #endif > break; > + case 'g': > + do_graphviz = true; > + break; > case 'k': > strnode_add(&keep_list, optarg, 0); > break; > + case 'p': > + do_parallel = true; > + break; > case 's': > strnode_add(&skip_list, optarg, 0); > break; > @@ -186,10 +212,13 @@ main(int argc, char *argv[]) > DPRINTF((stderr, "parse_args\n")); > initialize(); > DPRINTF((stderr, "initialize\n")); > + generate_graphviz_header(); > crunch_all_files(); > DPRINTF((stderr, "crunch_all_files\n")); > + generate_graphviz_providers(); > generate_ordering(); > DPRINTF((stderr, "generate_ordering\n")); > + generate_graphviz_footer(); > > exit(exit_code); > } > @@ -295,6 +324,7 @@ add_provide(filenode *fnode, char *s) > head->head = SET; > head->in_progress = RESET; > head->fnode = NULL; > + head->sequence = 0; > head->last = head->next = NULL; > Hash_SetValue(entry, head); > } > @@ -350,6 +380,7 @@ add_provide(filenode *fnode, char *s) > > f_pnode = emalloc(sizeof(*f_pnode)); > f_pnode->pnode = pnode; > + f_pnode->entry = entry; > f_pnode->next = fnode->prov_list; > fnode->prov_list = f_pnode; > } > @@ -522,7 +553,7 @@ make_fake_provision(filenode *node) > char buffer[30]; > > do { > - snprintf(buffer, sizeof buffer, "fake_prov_%08d", i++); > + snprintf(buffer, sizeof buffer, FAKE_PROV_NAME "%08d", i++); > entry = Hash_CreateEntry(provide_hash, buffer, &new); > } while (new == 0); > head = emalloc(sizeof(*head)); > @@ -543,6 +574,7 @@ make_fake_provision(filenode *node) > pnode->next->last = pnode; > > f_pnode = emalloc(sizeof(*f_pnode)); > + f_pnode->entry = entry; > f_pnode->pnode = pnode; > f_pnode->next = node->prov_list; > node->prov_list = f_pnode; > @@ -575,6 +607,11 @@ insert_before(void) > if (new == 1) > warnx("file `%s' is before unknown provision `%s'", bl_list->node->filename, bl_list->s); > > + if (new == 1 && do_graphviz == true) > + generate_graphviz_file_links( > + Hash_FindEntry(provide_hash, bl_list->s), > + bl_list->node); > + > for (pnode = Hash_GetValue(entry); pnode; pnode = pnode->next) { > if (pnode->head) > continue; > @@ -605,7 +642,134 @@ crunch_all_files(void) > insert_before(); > } > > +static inline int > +is_fake_prov(const char *name) > +{ > + > + return (name == strstr(name, FAKE_PROV_NAME)); > +} > + > +/* loop though provide list of vnode drawing all non-fake dependencies */ > +static void > +generate_graphviz_file_links(Hash_Entry *entry, filenode *fnode) > +{ > + char *dep_name, *fname; > + provnode *head; > + f_provnode *fpnode, *rfpnode; > + int is_before = 0; > + > + dep_name = Hash_GetKey(entry); > + if (is_fake_prov(dep_name)) > + is_before = 1; > + head = Hash_GetValue(entry); > + > + for (fpnode = fnode->prov_list; fpnode && fpnode->entry; > + fpnode = fpnode->next) { > + fname = Hash_GetKey(fpnode->entry); > + if (is_fake_prov(fname)) > + continue; > + rfpnode = NULL; > + do { > + if (rfpnode) > + dep_name = Hash_GetKey(rfpnode->entry); > + else > + dep_name = Hash_GetKey(entry); > + > + if (!is_fake_prov(dep_name)) { > + printf("\"%s\" -> \"%s\" [%s%s];\n", > + fname, dep_name, > + /* edge style */ > + (is_before ? "style=dashed" : "style=solid"), > + /* circular dep? */ > + ((head == NULL || > + (head->next && head->in_progress == SET)) ? > + ", color=red, penwidth=4" : "")); > + if (rfpnode == NULL) > + break; > + } > + /* dependency is solved already */ > + if (head == NULL || head->next == NULL) > + break; > + > + if (rfpnode == NULL) > + rfpnode = head->next->fnode->prov_list; > + else > + rfpnode = rfpnode->next; > + } while (rfpnode); > + } > +} > + > /* > + * Walk the stack, find the looping point and generate traceback. > + * NULL is returned on failure, otherwize pointer to a buffer holding > + * text representation is returned, caller must run free(3) for the > + * pointer. > + */ > +static char * > +generate_loop_for_req(strnodelist *stack_tail, provnode *head, > + filenode *fnode) > +{ > + provnode *pnode; > + strnodelist *stack_ptr, *loop_entry; > + char *buf, **revstack; > + size_t bufsize; > + int i, stack_depth; > + > + loop_entry = NULL; > + /* fast forward stack to the component that is required now */ > + for (pnode = head->next; pnode; pnode = pnode->next) { > + if (loop_entry) > + break; > + stack_depth = 0; > + for (stack_ptr = stack_tail; stack_ptr; > + stack_ptr = stack_ptr->next) { > + stack_depth++; > + if (stack_ptr->node == pnode->fnode) { > + loop_entry = stack_ptr; > + break; > + } > + } > + } > + > + if (loop_entry == NULL) > + return (NULL); > + > + stack_depth += 2; /* fnode + loop_entry */ > + revstack = emalloc(sizeof(char *) * stack_depth); > + bzero(revstack, (sizeof(char *) * stack_depth)); > + > + /* reverse stack and estimate buffer size to allocate */ > + bufsize = 1; /* tralining \0 */ > + > + revstack[stack_depth - 1] = loop_entry->node->filename; > + bufsize += strlen(revstack[stack_depth - 1]); > + > + revstack[stack_depth - 2] = fnode->filename; > + bufsize += strlen(revstack[stack_depth - 2]); > + fnode->issues_count++; > + > + stack_ptr = stack_tail; > + for (i = stack_depth - 3; i >= 0; i--) { > + revstack[i] = stack_ptr->node->filename; > + stack_ptr->node->issues_count++; > + stack_ptr = stack_ptr->next; > + bufsize += strlen(revstack[i]); > + } > + bufsize += strlen(" -> ") * (stack_depth - 1); > + > + buf = emalloc(bufsize); > + bzero(buf, bufsize); > + > + for (i = 0; i < stack_depth; i++) { > + strlcat(buf, revstack[i], bufsize); > + if (i < stack_depth - 1) > + strlcat(buf, " -> ", bufsize); > + } > + > + free(revstack); > + return (buf); > +} > +/* > * below are the functions that traverse the graphs we have built > * finding out the desired ordering, printing each file in turn. > * if missing requirements, or cyclic graphs are detected, a > @@ -621,17 +785,22 @@ crunch_all_files(void) > * provision. > */ > static void > -satisfy_req(f_reqnode *rnode, char *filename) > +satisfy_req(f_reqnode *rnode, filenode *fnode, strnodelist *stack_ptr) > { > Hash_Entry *entry; > provnode *head; > + strnodelist stack_item; > + char *buf; > > entry = rnode->entry; > head = Hash_GetValue(entry); > > + if (do_graphviz == true) > + generate_graphviz_file_links(entry, fnode); > + > if (head == NULL) { > warnx("requirement `%s' in file `%s' has no providers.", > - Hash_GetKey(entry), filename); > + Hash_GetKey(entry), fnode->filename); > exit_code = 1; > return; > } > @@ -645,20 +814,34 @@ satisfy_req(f_reqnode *rnode, char *filename) > * print that there is a circular dependency on it and abort > */ > if (head->in_progress == SET) { > - warnx("Circular dependency on provision `%s' in file `%s'.", > - Hash_GetKey(entry), filename); > exit_code = 1; > + buf = generate_loop_for_req(stack_ptr, head, > + fnode); > + > + if (buf == NULL) { > + warnx("Circular dependency on provision `%s' in " > + "file `%s' (tracing has failed).", > + Hash_GetKey(entry), fnode->filename); > + return; > + } > + > + warnx("Circular dependency on provision `%s': %s.", > + Hash_GetKey(entry), buf); > + free(buf); > return; > } > > head->in_progress = SET; > > + stack_item.next = stack_ptr; > + stack_item.node = fnode; > + > /* > * while provision_list is not empty > * do_file(first_member_of(provision_list)); > */ > while (head->next != NULL) > - do_file(head->next->fnode); > + do_file(head->next->fnode, &stack_item); > } > > static int > @@ -701,12 +884,13 @@ keep_ok(filenode *fnode) > * Circular dependencies will cause problems if we do. > */ > static void > -do_file(filenode *fnode) > +do_file(filenode *fnode, strnodelist *stack_ptr) > { > f_reqnode *r; > f_provnode *p, *p_tmp; > - provnode *pnode; > + provnode *pnode, *head; > int was_set; > + char *dep_name; > > DPRINTF((stderr, "do_file on %s.\n", fnode->filename)); > > @@ -729,18 +913,44 @@ do_file(filenode *fnode) > * satisfy_req(r, filename) > */ > r = fnode->req_list; > + fnode->sequence = 0; > while (r != NULL) { > - satisfy_req(r, fnode->filename); > + satisfy_req(r, fnode, stack_ptr); > + /* find sequence number where all requirements are satisfied */ > + head = Hash_GetValue(r->entry); > + if (head && head->sequence > fnode->sequence) > + fnode->sequence = head->sequence; > r = r->next; > } > fnode->req_list = NULL; > + fnode->sequence++; > > + /* if we've seen issues with this file - put it to the tail */ > + if (fnode->issues_count) > + fnode->sequence = max_sequence + 1; > + > + if (max_sequence < fnode->sequence) > + max_sequence = fnode->sequence; > + > /* > * for each provision of fnode -> p > * remove fnode from provision list for p in hash table > */ > p = fnode->prov_list; > while (p != NULL) { > + /* mark all troublemakers on graphviz */ > + if (do_graphviz == true && fnode->issues_count) { > + dep_name = Hash_GetKey(p->entry); > + if (!is_fake_prov(dep_name)) > + printf("\"%s\" [ color=red, penwidth=4 ];\n", > + dep_name); > + } > + > + /* update sequence when provided requirements are satisfied */ > + head = Hash_GetValue(p->entry); > + if (head->sequence < fnode->sequence) > + head->sequence = fnode->sequence; > + > p_tmp = p; > pnode = p->pnode; > if (pnode->next != NULL) { > @@ -759,8 +969,11 @@ do_file(filenode *fnode) > DPRINTF((stderr, "next do: ")); > > /* if we were already in progress, don't print again */ > - if (was_set == 0 && skip_ok(fnode) && keep_ok(fnode)) > - printf("%s\n", fnode->filename); > + if (do_graphviz != true && was_set == 0 && skip_ok(fnode) && > + keep_ok(fnode)) { > + *fn_seqlist = fnode; > + fn_seqlist++; > + } > > if (fnode->next != NULL) { > fnode->next->last = fnode->last; > @@ -769,19 +982,103 @@ do_file(filenode *fnode) > fnode->last->next = fnode->next; > } > > + if (fnode->issues_count) > + warnx("`%s' was seen in circular dependencies for %d times.", > + fnode->filename, fnode->issues_count); > + > DPRINTF((stderr, "nuking %s\n", fnode->filename)); > -#if 0 > - if (was_set == 0) { > - free(fnode->filename); > - free(fnode); > - } > -#endif > } > > static void > +generate_graphviz_header() > +{ > + > + if (do_graphviz != true) > + return; > + > + printf("digraph rcorder {\n" > + "rankdir=\"BT\";\n" > + "node [style=rounded, shape=record];\n" > + "graph [overlap = false];\n"); > +} > + > +static void > +generate_graphviz_footer() > +{ > + > + if (do_graphviz == true) > + printf("}\n"); > +} > + > +static void > +generate_graphviz_providers() > +{ > + Hash_Entry *entry; > + Hash_Search psearch; > + provnode *head, *pnode; > + char *dep_name; > + > + if (do_graphviz != true) > + return; > + > + entry = Hash_EnumFirst(provide_hash, &psearch); > + if (entry == NULL) > + return; > + > + do { > + dep_name = Hash_GetKey(entry); > + if (is_fake_prov(dep_name)) > + continue; > + head = Hash_GetValue(entry); > + /* no providers for this requirement */ > + if (head == NULL || head->next == NULL) { > + printf("\"%s\" [label=\"{ %s | ENOENT }\", " > + "style=\"rounded,filled\", color=red];\n", > + dep_name, dep_name); > + continue; > + } > + /* one PROVIDE word for one file that matches */ > + if (head->next->next == NULL && > + strcmp(dep_name, > + basename(head->next->fnode->filename)) == 0) { > + continue; > + } > + printf("\"%s\" [label=\"{ %s | ", dep_name, dep_name); > + for (pnode = head->next; pnode; pnode = pnode->next) > + printf("%s\\n", basename(pnode->fnode->filename)); > + > + printf("}\"];\n"); > + } while (NULL != (entry = Hash_EnumNext(&psearch))); > +} > + > +static int > +sequence_cmp(const void *a, const void *b) > +{ > + const filenode *fna = *((const filenode * const *)a); > + const filenode *fnb = *((const filenode * const *)b); > + int left, right; > + > + /* push phantom files to the end */ > + if (fna == NULL || fnb == NULL) > + return ((fna < fnb) - (fna > fnb)); > + > + left = fna->sequence; > + right = fnb->sequence; > + > + return ((left > right) - (left < right)); > +} > + > +static void > generate_ordering(void) > { > + filenode **seqlist, **psl; > + int last_seq = 0; > > + /* Prepare order buffer, use an additional one as a list terminator */ > + seqlist = emalloc(sizeof(filenode *) * (file_count + 1)); > + bzero(seqlist, sizeof(filenode *) * (file_count + 1)); > + fn_seqlist = seqlist; > + > /* > * while there remain undone files{f}, > * pick an arbitrary f, and do_file(f) > @@ -798,6 +1095,24 @@ generate_ordering(void) > */ > while (fn_head->next != NULL) { > DPRINTF((stderr, "generate on %s\n", fn_head->next->filename)); > - do_file(fn_head->next); > + do_file(fn_head->next, NULL); > } > + > + /* Sort filenode list based on sequence */ > + qsort(seqlist, file_count, sizeof(filenode *), sequence_cmp); > + > + for (psl = seqlist; *psl; psl++) { > + printf("%s%s", > + (last_seq == 0 ? "" : > + (do_parallel != true || last_seq != (*psl)->sequence) ? > + "\n" : " "), > + (*psl)->filename); > + last_seq = (*psl)->sequence; > + free((*psl)->filename); > + free(*psl); > + } > + if (last_seq) > + printf("\n"); > + > + free(seqlist); > } From owner-svn-src-all@freebsd.org Tue Sep 8 14:54:11 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7405A3CC162; Tue, 8 Sep 2020 14:54:11 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bm7TH2Vfnz3bws; Tue, 8 Sep 2020 14:54:11 +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 3A86D12337; Tue, 8 Sep 2020 14:54:11 +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 088EsB8k044473; Tue, 8 Sep 2020 14:54:11 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 088EsAkf044471; Tue, 8 Sep 2020 14:54:10 GMT (envelope-from kp@FreeBSD.org) Message-Id: <202009081454.088EsAkf044471@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Tue, 8 Sep 2020 14:54:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365457 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 365457 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.33 Precedence: list List-Id: "SVN commit messages 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, 08 Sep 2020 14:54:11 -0000 Author: kp Date: Tue Sep 8 14:54:10 2020 New Revision: 365457 URL: https://svnweb.freebsd.org/changeset/base/365457 Log: net: mitigate vnet / epair cleanup races There's a race where dying vnets move their interfaces back to their original vnet, and if_epair cleanup (where deleting one interface also deletes the other end of the epair). This is commonly triggered by the pf tests, but also by cleanup of vnet jails. As we've not yet been able to fix the root cause of the issue work around the panic by not dereferencing a NULL softc in epair_qflush() and by not re-attaching DYING interfaces. This isn't a full fix, but makes a very common panic far less likely. PR: 244703, 238870 Reviewed by: lutz_donnerhacke.de MFC after: 4 days Differential Revision: https://reviews.freebsd.org/D26324 Modified: head/sys/net/if.c head/sys/net/if_epair.c Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Tue Sep 8 13:24:44 2020 (r365456) +++ head/sys/net/if.c Tue Sep 8 14:54:10 2020 (r365457) @@ -1298,6 +1298,11 @@ if_vmove(struct ifnet *ifp, struct vnet *new_vnet) ifindex_free_locked(ifp->if_index); IFNET_WUNLOCK(); + + /* Don't re-attach DYING interfaces. */ + if (ifp->if_flags & IFF_DYING) + return (0); + /* * Perform interface-specific reassignment tasks, if provided by * the driver. Modified: head/sys/net/if_epair.c ============================================================================== --- head/sys/net/if_epair.c Tue Sep 8 13:24:44 2020 (r365456) +++ head/sys/net/if_epair.c Tue Sep 8 14:54:10 2020 (r365457) @@ -611,8 +611,14 @@ epair_qflush(struct ifnet *ifp) struct epair_softc *sc; sc = ifp->if_softc; - KASSERT(sc != NULL, ("%s: ifp=%p, epair_softc gone? sc=%p\n", - __func__, ifp, sc)); + + /* + * See epair_clone_destroy(), we can end up getting called twice. + * Don't do anything on the second call. + */ + if (sc == NULL) + return; + /* * Remove this ifp from all backpointer lists. The interface will not * usable for flushing anyway nor should it have anything to flush From owner-svn-src-all@freebsd.org Tue Sep 8 15:01:50 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 955F23CC509; Tue, 8 Sep 2020 15:01:50 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bm7f63X6jz3cWQ; Tue, 8 Sep 2020 15:01:50 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 5DAA4124A5; Tue, 8 Sep 2020 15:01:50 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 088F1oxM048441; Tue, 8 Sep 2020 15:01:50 GMT (envelope-from gbe@FreeBSD.org) Received: (from gbe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 088F1oj8048440; Tue, 8 Sep 2020 15:01:50 GMT (envelope-from gbe@FreeBSD.org) Message-Id: <202009081501.088F1oj8048440@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gbe set sender to gbe@FreeBSD.org using -f From: Gordon Bergling Date: Tue, 8 Sep 2020 15:01:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365458 - head/usr.bin/sort X-SVN-Group: head X-SVN-Commit-Author: gbe X-SVN-Commit-Paths: head/usr.bin/sort X-SVN-Commit-Revision: 365458 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.33 Precedence: list List-Id: "SVN commit messages 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, 08 Sep 2020 15:01:50 -0000 Author: gbe (doc committer) Date: Tue Sep 8 15:01:49 2020 New Revision: 365458 URL: https://svnweb.freebsd.org/changeset/base/365458 Log: sort(1): Remove duplicate option check Reviewed by: lwhsu, emaste Approved by: emaste Obtained from: DragonFlyBSD MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D23892 Modified: head/usr.bin/sort/file.c Modified: head/usr.bin/sort/file.c ============================================================================== --- head/usr.bin/sort/file.c Tue Sep 8 14:54:10 2020 (r365457) +++ head/usr.bin/sort/file.c Tue Sep 8 15:01:49 2020 (r365458) @@ -1236,7 +1236,7 @@ sort_list_to_file(struct sort_list *list, const char * { struct sort_mods *sm = &(keys[0].sm); - if (!(sm->Mflag) && !(sm->Rflag) && !(sm->Vflag) && !(sm->Vflag) && + if (!(sm->Mflag) && !(sm->Rflag) && !(sm->Vflag) && !(sm->gflag) && !(sm->hflag) && !(sm->nflag)) { if ((sort_opts_vals.sort_method == SORT_DEFAULT) && byte_sort) sort_opts_vals.sort_method = SORT_RADIXSORT; From owner-svn-src-all@freebsd.org Tue Sep 8 15:08:21 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4A0193CC830; Tue, 8 Sep 2020 15:08:21 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bm7nd19Mnz3cfR; Tue, 8 Sep 2020 15:08:21 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 0B3AB1256A; Tue, 8 Sep 2020 15:08:21 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 088F8K8G051161; Tue, 8 Sep 2020 15:08:20 GMT (envelope-from mhorne@FreeBSD.org) Received: (from mhorne@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 088F8KOm051159; Tue, 8 Sep 2020 15:08:20 GMT (envelope-from mhorne@FreeBSD.org) Message-Id: <202009081508.088F8KOm051159@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mhorne set sender to mhorne@FreeBSD.org using -f From: Mitchell Horne Date: Tue, 8 Sep 2020 15:08:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365459 - in head/sys: arm64/include sys X-SVN-Group: head X-SVN-Commit-Author: mhorne X-SVN-Commit-Paths: in head/sys: arm64/include sys X-SVN-Commit-Revision: 365459 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.33 Precedence: list List-Id: "SVN commit messages 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, 08 Sep 2020 15:08:21 -0000 Author: mhorne Date: Tue Sep 8 15:08:20 2020 New Revision: 365459 URL: https://svnweb.freebsd.org/changeset/base/365459 Log: arm64: fix incorrect HWCAP definitions FreeBSD exports CPU features as bits in the AT_HWCAP and AT_HWCAP2 vectors via elf_aux_info(3). This interface is similar to getauxval(3) on Linux, and for simplicity to consumers we try to maintain an identical set of feature flags on arm64. The first batch of AT_HWCAP flags were added in r350166, corresponding to definitions that already existed in Linux. Unfortunately, one flag was missed, and a portion of the values are shifted one bit to the right as a result. Add the missing definition for HWCAP_ASIMDHP, and adjust the affected values to match their Linux counterparts. Although this is an ABI-breaking change, there is no plan to provide compat code for old binaries. An audit of our ports tree and other software via Debian code search indicates that there are not yet any consumers of this interface for FreeBSD/arm64. Bump __FreeBSD_version to be on the safe side, in case compat code needs to be added in the future. Reviewed by: emaste, manu MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D26329 Modified: head/sys/arm64/include/elf.h head/sys/sys/param.h Modified: head/sys/arm64/include/elf.h ============================================================================== --- head/sys/arm64/include/elf.h Tue Sep 8 15:01:49 2020 (r365458) +++ head/sys/arm64/include/elf.h Tue Sep 8 15:08:20 2020 (r365459) @@ -102,25 +102,29 @@ __ElfType(Auxinfo); #define HWCAP_CRC32 0x00000080 #define HWCAP_ATOMICS 0x00000100 #define HWCAP_FPHP 0x00000200 -/* XXX: The following bits don't match the Linux definitions */ -#define HWCAP_CPUID 0x00000400 -#define HWCAP_ASIMDRDM 0x00000800 -#define HWCAP_JSCVT 0x00001000 -#define HWCAP_FCMA 0x00002000 -#define HWCAP_LRCPC 0x00004000 -#define HWCAP_DCPOP 0x00008000 -#define HWCAP_SHA3 0x00010000 -#define HWCAP_SM3 0x00020000 -#define HWCAP_SM4 0x00040000 -#define HWCAP_ASIMDDP 0x00080000 -#define HWCAP_SHA512 0x00100000 -#define HWCAP_SVE 0x00200000 -#define HWCAP_ASIMDFHM 0x00400000 -#define HWCAP_DIT 0x00800000 -#define HWCAP_USCAT 0x01000000 -#define HWCAP_ILRCPC 0x02000000 -#define HWCAP_FLAGM 0x04000000 -/* XXX: end of incorrect definitions */ +#define HWCAP_ASIMDHP 0x00000400 +/* + * XXX: The following bits (from CPUID to FLAGM) were originally incorrect, + * but later changed to match the Linux definitions. No compatibility code is + * provided, as the fix was expected to result in near-zero fallout. + */ +#define HWCAP_CPUID 0x00000800 +#define HWCAP_ASIMDRDM 0x00001000 +#define HWCAP_JSCVT 0x00002000 +#define HWCAP_FCMA 0x00004000 +#define HWCAP_LRCPC 0x00008000 +#define HWCAP_DCPOP 0x00010000 +#define HWCAP_SHA3 0x00020000 +#define HWCAP_SM3 0x00040000 +#define HWCAP_SM4 0x00080000 +#define HWCAP_ASIMDDP 0x00100000 +#define HWCAP_SHA512 0x00200000 +#define HWCAP_SVE 0x00400000 +#define HWCAP_ASIMDFHM 0x00800000 +#define HWCAP_DIT 0x01000000 +#define HWCAP_USCAT 0x02000000 +#define HWCAP_ILRCPC 0x04000000 +#define HWCAP_FLAGM 0x08000000 #define HWCAP_SSBS 0x10000000 #define HWCAP_SB 0x20000000 #define HWCAP_PACA 0x40000000 Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Tue Sep 8 15:01:49 2020 (r365458) +++ head/sys/sys/param.h Tue Sep 8 15:08:20 2020 (r365459) @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1300113 /* Master, propagated to newvers */ +#define __FreeBSD_version 1300114 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-all@freebsd.org Tue Sep 8 15:36:39 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A9B493CCEBD; Tue, 8 Sep 2020 15:36:39 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bm8QH46Twz3fH5; Tue, 8 Sep 2020 15:36:39 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 70D92127FA; Tue, 8 Sep 2020 15:36:39 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 088FadlY069763; Tue, 8 Sep 2020 15:36:39 GMT (envelope-from mhorne@FreeBSD.org) Received: (from mhorne@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 088FacpU069760; Tue, 8 Sep 2020 15:36:38 GMT (envelope-from mhorne@FreeBSD.org) Message-Id: <202009081536.088FacpU069760@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mhorne set sender to mhorne@FreeBSD.org using -f From: Mitchell Horne Date: Tue, 8 Sep 2020 15:36:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365460 - in head/sys/arm64: arm64 include X-SVN-Group: head X-SVN-Commit-Author: mhorne X-SVN-Commit-Paths: in head/sys/arm64: arm64 include X-SVN-Commit-Revision: 365460 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.33 Precedence: list List-Id: "SVN commit messages 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, 08 Sep 2020 15:36:39 -0000 Author: mhorne Date: Tue Sep 8 15:36:38 2020 New Revision: 365460 URL: https://svnweb.freebsd.org/changeset/base/365460 Log: arm64: export new HWCAP features Expose some of the new HWCAP features added in r65304. This includes the addition of elf_hwcap2 into the sysvec, and a separate function to parse for those features. This only exposes features which require no further configuration, e.g. indicating the presence of certain instructions. Larger features (SVE) will not be advertised until we actually support them. The exact list of features/extensions this patch exposes is: - ARMv8.0-DGH - ARMv8.0-SB - ARMv8.2-BF16 - ARMv8.2-DCCVADP - ARMv8.2-I8MM - ARMv8.4-LRCPC - ARMv8.5-CondM - ARMv8.5-FRINT - ARMv8.5-RNG - PSTATE.SSBS While here, annotate elf_hwcap and elf_hwcap2 as __read_frequently, and move the declarations to the machine/md_var.h header. Submitted by: mikael@ (D22314 portion) MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D26031 Differential Revision: https://reviews.freebsd.org/D22314 Modified: head/sys/arm64/arm64/elf_machdep.c head/sys/arm64/arm64/identcpu.c head/sys/arm64/include/md_var.h Modified: head/sys/arm64/arm64/elf_machdep.c ============================================================================== --- head/sys/arm64/arm64/elf_machdep.c Tue Sep 8 15:08:20 2020 (r365459) +++ head/sys/arm64/arm64/elf_machdep.c Tue Sep 8 15:36:38 2020 (r365460) @@ -55,7 +55,8 @@ __FBSDID("$FreeBSD$"); #include "linker_if.h" -u_long elf_hwcap; +u_long __read_frequently elf_hwcap; +u_long __read_frequently elf_hwcap2; static struct sysentvec elf64_freebsd_sysvec = { .sv_size = SYS_MAXSYSCALL, @@ -92,6 +93,7 @@ static struct sysentvec elf64_freebsd_sysvec = { .sv_thread_detach = NULL, .sv_trap = NULL, .sv_hwcap = &elf_hwcap, + .sv_hwcap2 = &elf_hwcap2, }; INIT_SYSENTVEC(elf64_sysvec, &elf64_freebsd_sysvec); Modified: head/sys/arm64/arm64/identcpu.c ============================================================================== --- head/sys/arm64/arm64/identcpu.c Tue Sep 8 15:08:20 2020 (r365459) +++ head/sys/arm64/arm64/identcpu.c Tue Sep 8 15:36:38 2020 (r365460) @@ -43,11 +43,13 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include +#include +#include static void print_cpu_features(u_int cpu); static u_long parse_cpu_features_hwcap(void); +static u_long parse_cpu_features_hwcap2(void); char machine[] = "arm64"; @@ -869,7 +871,7 @@ static struct mrs_field_value id_aa64pfr1_mte[] = { static struct mrs_field id_aa64pfr1_fields[] = { MRS_FIELD(ID_AA64PFR1, BT, false, MRS_EXACT, id_aa64pfr1_bt), - MRS_FIELD(ID_AA64PFR1, SSBS, false, MRS_EXACT, id_aa64pfr1_ssbs), + MRS_FIELD(ID_AA64PFR1, SSBS, false, MRS_LOWER, id_aa64pfr1_ssbs), MRS_FIELD(ID_AA64PFR1, MTE, false, MRS_EXACT, id_aa64pfr1_mte), MRS_FIELD_END, }; @@ -1126,7 +1128,6 @@ update_special_regs(u_int cpu) } /* HWCAP */ -extern u_long elf_hwcap; bool __read_frequently lse_supported = false; bool __read_frequently icache_aliasing = false; @@ -1156,8 +1157,9 @@ identify_cpu_sysinit(void *dummy __unused) idc = false; } - /* Exposed to userspace as AT_HWCAP */ + /* Exposed to userspace as AT_HWCAP and AT_HWCAP2 */ elf_hwcap = parse_cpu_features_hwcap(); + elf_hwcap2 = parse_cpu_features_hwcap2(); if (dic && idc) { arm64_icache_sync_range = &arm64_dic_idc_icache_sync_range; @@ -1194,6 +1196,15 @@ parse_cpu_features_hwcap(void) { u_long hwcap = 0; + switch (ID_AA64ISAR0_TS_VAL(user_cpu_desc.id_aa64isar0)) { + case ID_AA64ISAR0_TS_CondM_8_4: + case ID_AA64ISAR0_TS_CondM_8_5: + hwcap |= HWCAP_FLAGM; + break; + default: + break; + } + if (ID_AA64ISAR0_DP_VAL(user_cpu_desc.id_aa64isar0) == ID_AA64ISAR0_DP_IMPL) hwcap |= HWCAP_ASIMDDP; @@ -1206,6 +1217,10 @@ parse_cpu_features_hwcap(void) ID_AA64ISAR0_SM3_IMPL) hwcap |= HWCAP_SM3; + if (ID_AA64ISAR0_SHA3_VAL(user_cpu_desc.id_aa64isar0) == + ID_AA64ISAR0_SHA3_IMPL) + hwcap |= HWCAP_SHA3; + if (ID_AA64ISAR0_RDM_VAL(user_cpu_desc.id_aa64isar0) == ID_AA64ISAR0_RDM_IMPL) hwcap |= HWCAP_ASIMDRDM; @@ -1229,7 +1244,8 @@ parse_cpu_features_hwcap(void) break; } - if (ID_AA64ISAR0_SHA1_VAL(user_cpu_desc.id_aa64isar0)) + if (ID_AA64ISAR0_SHA1_VAL(user_cpu_desc.id_aa64isar0) == + ID_AA64ISAR0_SHA1_BASE) hwcap |= HWCAP_SHA1; switch (ID_AA64ISAR0_AES_VAL(user_cpu_desc.id_aa64isar0)) { @@ -1243,9 +1259,20 @@ parse_cpu_features_hwcap(void) break; } - if (ID_AA64ISAR1_LRCPC_VAL(user_cpu_desc.id_aa64isar1) == - ID_AA64ISAR1_LRCPC_RCPC_8_3) + if (ID_AA64ISAR1_SB_VAL(user_cpu_desc.id_aa64isar1) == + ID_AA64ISAR1_SB_IMPL) + hwcap |= HWCAP_SB; + + switch (ID_AA64ISAR1_LRCPC_VAL(user_cpu_desc.id_aa64isar1)) { + case ID_AA64ISAR1_LRCPC_RCPC_8_3: hwcap |= HWCAP_LRCPC; + break; + case ID_AA64ISAR1_LRCPC_RCPC_8_4: + hwcap |= HWCAP_LRCPC | HWCAP_ILRCPC; + break; + default: + break; + } if (ID_AA64ISAR1_FCMA_VAL(user_cpu_desc.id_aa64isar1) == ID_AA64ISAR1_FCMA_IMPL) @@ -1285,7 +1312,51 @@ parse_cpu_features_hwcap(void) break; } + if (ID_AA64PFR1_SSBS_VAL(user_cpu_desc.id_aa64pfr1) == + ID_AA64PFR1_SSBS_PSTATE_MSR) + hwcap |= HWCAP_SSBS; + return (hwcap); +} + +static u_long +parse_cpu_features_hwcap2(void) +{ + u_long hwcap2 = 0; + + if (ID_AA64ISAR0_RNDR_VAL(user_cpu_desc.id_aa64isar0) == + ID_AA64ISAR0_RNDR_IMPL) + hwcap2 |= HWCAP2_RNG; + + if (ID_AA64ISAR0_TS_VAL(user_cpu_desc.id_aa64isar0) == + ID_AA64ISAR0_TS_CondM_8_5) + hwcap2 |= HWCAP2_FLAGM2; + + if (ID_AA64ISAR1_I8MM_VAL(user_cpu_desc.id_aa64isar1) == + ID_AA64ISAR1_I8MM_IMPL) + hwcap2 |= HWCAP2_I8MM; + + if (ID_AA64ISAR1_DGH_VAL(user_cpu_desc.id_aa64isar1) == + ID_AA64ISAR1_DGH_IMPL) + hwcap2 |= HWCAP2_DGH; + + if (ID_AA64ISAR1_BF16_VAL(user_cpu_desc.id_aa64isar1) == + ID_AA64ISAR1_BF16_IMPL) + hwcap2 |= HWCAP2_BF16; + + if (ID_AA64ISAR1_FRINTTS_VAL(user_cpu_desc.id_aa64isar1) == + ID_AA64ISAR1_FRINTTS_IMPL) + hwcap2 |= HWCAP2_FRINT; + + if (ID_AA64ISAR1_DPB_VAL(user_cpu_desc.id_aa64isar1) == + ID_AA64ISAR1_DPB_DCCVADP) + hwcap2 |= HWCAP2_DCPODP; + + if (ID_AA64PFR1_BT_VAL(user_cpu_desc.id_aa64pfr1) == + ID_AA64PFR1_BT_IMPL) + hwcap2 |= HWCAP2_BTI; + + return (hwcap2); } static void Modified: head/sys/arm64/include/md_var.h ============================================================================== --- head/sys/arm64/include/md_var.h Tue Sep 8 15:08:20 2020 (r365459) +++ head/sys/arm64/include/md_var.h Tue Sep 8 15:36:38 2020 (r365460) @@ -38,6 +38,8 @@ extern char sigcode[]; extern int szsigcode; extern uint64_t *vm_page_dump; extern int vm_page_dump_size; +extern u_long elf_hwcap; +extern u_long elf_hwcap2; struct dumperinfo; From owner-svn-src-all@freebsd.org Tue Sep 8 15:39:20 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 754963CD2CD; Tue, 8 Sep 2020 15:39:20 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bm8TN2Wvsz3fbq; Tue, 8 Sep 2020 15:39:20 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 3B437128D7; Tue, 8 Sep 2020 15:39:20 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 088FdKgP069914; Tue, 8 Sep 2020 15:39:20 GMT (envelope-from mhorne@FreeBSD.org) Received: (from mhorne@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 088FdKuX069913; Tue, 8 Sep 2020 15:39:20 GMT (envelope-from mhorne@FreeBSD.org) Message-Id: <202009081539.088FdKuX069913@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mhorne set sender to mhorne@FreeBSD.org using -f From: Mitchell Horne Date: Tue, 8 Sep 2020 15:39:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365461 - head/sys/libkern X-SVN-Group: head X-SVN-Commit-Author: mhorne X-SVN-Commit-Paths: head/sys/libkern X-SVN-Commit-Revision: 365461 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.33 Precedence: list List-Id: "SVN commit messages 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, 08 Sep 2020 15:39:20 -0000 Author: mhorne Date: Tue Sep 8 15:39:19 2020 New Revision: 365461 URL: https://svnweb.freebsd.org/changeset/base/365461 Log: arm64: check for CRC32 support via HWCAP Doing it this way eliminates the assumption about homogeneous support for the feature, since HWCAP values are only set if support is present on all CPUs. Reviewed by: tuexen, markj MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D26032 Modified: head/sys/libkern/gsb_crc32.c Modified: head/sys/libkern/gsb_crc32.c ============================================================================== --- head/sys/libkern/gsb_crc32.c Tue Sep 8 15:36:38 2020 (r365460) +++ head/sys/libkern/gsb_crc32.c Tue Sep 8 15:39:19 2020 (r365461) @@ -58,7 +58,8 @@ __FBSDID("$FreeBSD$"); #endif #if defined(__aarch64__) -#include +#include +#include #endif #endif /* _KERNEL */ @@ -755,14 +756,7 @@ calculate_crc32c(uint32_t crc32c, } else #endif #if defined(__aarch64__) - uint64_t reg; - - /* - * We only test for CRC32 support on the CPU with index 0 assuming that - * this applies to all CPUs. - */ - reg = READ_SPECIALREG(id_aa64isar0_el1); - if (ID_AA64ISAR0_CRC32_VAL(reg) != ID_AA64ISAR0_CRC32_NONE) { + if ((elf_hwcap & HWCAP_CRC32) != 0) { return (armv8_crc32c(crc32c, buffer, length)); } else #endif From owner-svn-src-all@freebsd.org Tue Sep 8 15:42:16 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8AF953CD176; Tue, 8 Sep 2020 15:42:16 +0000 (UTC) (envelope-from mhorne@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bm8Xm37ygz3g2J; Tue, 8 Sep 2020 15:42:16 +0000 (UTC) (envelope-from mhorne@freebsd.org) Received: from mail-yb1-f182.google.com (mail-yb1-f182.google.com [209.85.219.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: mhorne) by smtp.freebsd.org (Postfix) with ESMTPSA id 4A49D24C63; Tue, 8 Sep 2020 15:42:16 +0000 (UTC) (envelope-from mhorne@freebsd.org) Received: by mail-yb1-f182.google.com with SMTP id h206so11535232ybc.11; Tue, 08 Sep 2020 08:42:16 -0700 (PDT) X-Gm-Message-State: AOAM531NNVwIFOkyblTCrhYMQsM/GW1r8iC8RrQC0P3rqtflKif2iWbr y1GcK6MrfzqG1f6F03n6+QOy/J7YrXOXEdTarp8= X-Google-Smtp-Source: ABdhPJz1Qd7uel8kNH1pA9+rkgkZi2SnxCUtjSNaq4GMMJA8/x8D4f4r4mmVNq7TeDz26Zik1koz+kdKXd8CO/BPm1Y= X-Received: by 2002:a25:1d5:: with SMTP id 204mr349403ybb.212.1599579735781; Tue, 08 Sep 2020 08:42:15 -0700 (PDT) MIME-Version: 1.0 References: <202009081536.088FacpU069760@repo.freebsd.org> In-Reply-To: <202009081536.088FacpU069760@repo.freebsd.org> From: Mitchell Horne Date: Tue, 8 Sep 2020 12:42:04 -0300 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r365460 - in head/sys/arm64: arm64 include To: Mitchell Horne Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 08 Sep 2020 15:42:16 -0000 On Tue, Sep 8, 2020 at 12:36 PM Mitchell Horne wrote: > > Author: mhorne > Date: Tue Sep 8 15:36:38 2020 > New Revision: 365460 > URL: https://svnweb.freebsd.org/changeset/base/365460 > > Log: > arm64: export new HWCAP features > > Expose some of the new HWCAP features added in r65304. This includes the Small typo, this should be r365304. > addition of elf_hwcap2 into the sysvec, and a separate function to parse > for those features. > > This only exposes features which require no further configuration, e.g. > indicating the presence of certain instructions. Larger features (SVE) > will not be advertised until we actually support them. The exact list of > features/extensions this patch exposes is: > - ARMv8.0-DGH > - ARMv8.0-SB > - ARMv8.2-BF16 > - ARMv8.2-DCCVADP > - ARMv8.2-I8MM > - ARMv8.4-LRCPC > - ARMv8.5-CondM > - ARMv8.5-FRINT > - ARMv8.5-RNG > - PSTATE.SSBS > > While here, annotate elf_hwcap and elf_hwcap2 as __read_frequently, and > move the declarations to the machine/md_var.h header. > > Submitted by: mikael@ (D22314 portion) > MFC after: 2 weeks > Sponsored by: The FreeBSD Foundation > Differential Revision: https://reviews.freebsd.org/D26031 > Differential Revision: https://reviews.freebsd.org/D22314 > > Modified: > head/sys/arm64/arm64/elf_machdep.c > head/sys/arm64/arm64/identcpu.c > head/sys/arm64/include/md_var.h > > Modified: head/sys/arm64/arm64/elf_machdep.c > ============================================================================== > --- head/sys/arm64/arm64/elf_machdep.c Tue Sep 8 15:08:20 2020 (r365459) > +++ head/sys/arm64/arm64/elf_machdep.c Tue Sep 8 15:36:38 2020 (r365460) > @@ -55,7 +55,8 @@ __FBSDID("$FreeBSD$"); > > #include "linker_if.h" > > -u_long elf_hwcap; > +u_long __read_frequently elf_hwcap; > +u_long __read_frequently elf_hwcap2; > > static struct sysentvec elf64_freebsd_sysvec = { > .sv_size = SYS_MAXSYSCALL, > @@ -92,6 +93,7 @@ static struct sysentvec elf64_freebsd_sysvec = { > .sv_thread_detach = NULL, > .sv_trap = NULL, > .sv_hwcap = &elf_hwcap, > + .sv_hwcap2 = &elf_hwcap2, > }; > INIT_SYSENTVEC(elf64_sysvec, &elf64_freebsd_sysvec); > > > Modified: head/sys/arm64/arm64/identcpu.c > ============================================================================== > --- head/sys/arm64/arm64/identcpu.c Tue Sep 8 15:08:20 2020 (r365459) > +++ head/sys/arm64/arm64/identcpu.c Tue Sep 8 15:36:38 2020 (r365460) > @@ -43,11 +43,13 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > -#include > #include > +#include > +#include > > static void print_cpu_features(u_int cpu); > static u_long parse_cpu_features_hwcap(void); > +static u_long parse_cpu_features_hwcap2(void); > > char machine[] = "arm64"; > > @@ -869,7 +871,7 @@ static struct mrs_field_value id_aa64pfr1_mte[] = { > > static struct mrs_field id_aa64pfr1_fields[] = { > MRS_FIELD(ID_AA64PFR1, BT, false, MRS_EXACT, id_aa64pfr1_bt), > - MRS_FIELD(ID_AA64PFR1, SSBS, false, MRS_EXACT, id_aa64pfr1_ssbs), > + MRS_FIELD(ID_AA64PFR1, SSBS, false, MRS_LOWER, id_aa64pfr1_ssbs), > MRS_FIELD(ID_AA64PFR1, MTE, false, MRS_EXACT, id_aa64pfr1_mte), > MRS_FIELD_END, > }; > @@ -1126,7 +1128,6 @@ update_special_regs(u_int cpu) > } > > /* HWCAP */ > -extern u_long elf_hwcap; > bool __read_frequently lse_supported = false; > > bool __read_frequently icache_aliasing = false; > @@ -1156,8 +1157,9 @@ identify_cpu_sysinit(void *dummy __unused) > idc = false; > } > > - /* Exposed to userspace as AT_HWCAP */ > + /* Exposed to userspace as AT_HWCAP and AT_HWCAP2 */ > elf_hwcap = parse_cpu_features_hwcap(); > + elf_hwcap2 = parse_cpu_features_hwcap2(); > > if (dic && idc) { > arm64_icache_sync_range = &arm64_dic_idc_icache_sync_range; > @@ -1194,6 +1196,15 @@ parse_cpu_features_hwcap(void) > { > u_long hwcap = 0; > > + switch (ID_AA64ISAR0_TS_VAL(user_cpu_desc.id_aa64isar0)) { > + case ID_AA64ISAR0_TS_CondM_8_4: > + case ID_AA64ISAR0_TS_CondM_8_5: > + hwcap |= HWCAP_FLAGM; > + break; > + default: > + break; > + } > + > if (ID_AA64ISAR0_DP_VAL(user_cpu_desc.id_aa64isar0) == > ID_AA64ISAR0_DP_IMPL) > hwcap |= HWCAP_ASIMDDP; > @@ -1206,6 +1217,10 @@ parse_cpu_features_hwcap(void) > ID_AA64ISAR0_SM3_IMPL) > hwcap |= HWCAP_SM3; > > + if (ID_AA64ISAR0_SHA3_VAL(user_cpu_desc.id_aa64isar0) == > + ID_AA64ISAR0_SHA3_IMPL) > + hwcap |= HWCAP_SHA3; > + > if (ID_AA64ISAR0_RDM_VAL(user_cpu_desc.id_aa64isar0) == > ID_AA64ISAR0_RDM_IMPL) > hwcap |= HWCAP_ASIMDRDM; > @@ -1229,7 +1244,8 @@ parse_cpu_features_hwcap(void) > break; > } > > - if (ID_AA64ISAR0_SHA1_VAL(user_cpu_desc.id_aa64isar0)) > + if (ID_AA64ISAR0_SHA1_VAL(user_cpu_desc.id_aa64isar0) == > + ID_AA64ISAR0_SHA1_BASE) > hwcap |= HWCAP_SHA1; > > switch (ID_AA64ISAR0_AES_VAL(user_cpu_desc.id_aa64isar0)) { > @@ -1243,9 +1259,20 @@ parse_cpu_features_hwcap(void) > break; > } > > - if (ID_AA64ISAR1_LRCPC_VAL(user_cpu_desc.id_aa64isar1) == > - ID_AA64ISAR1_LRCPC_RCPC_8_3) > + if (ID_AA64ISAR1_SB_VAL(user_cpu_desc.id_aa64isar1) == > + ID_AA64ISAR1_SB_IMPL) > + hwcap |= HWCAP_SB; > + > + switch (ID_AA64ISAR1_LRCPC_VAL(user_cpu_desc.id_aa64isar1)) { > + case ID_AA64ISAR1_LRCPC_RCPC_8_3: > hwcap |= HWCAP_LRCPC; > + break; > + case ID_AA64ISAR1_LRCPC_RCPC_8_4: > + hwcap |= HWCAP_LRCPC | HWCAP_ILRCPC; > + break; > + default: > + break; > + } > > if (ID_AA64ISAR1_FCMA_VAL(user_cpu_desc.id_aa64isar1) == > ID_AA64ISAR1_FCMA_IMPL) > @@ -1285,7 +1312,51 @@ parse_cpu_features_hwcap(void) > break; > } > > + if (ID_AA64PFR1_SSBS_VAL(user_cpu_desc.id_aa64pfr1) == > + ID_AA64PFR1_SSBS_PSTATE_MSR) > + hwcap |= HWCAP_SSBS; > + > return (hwcap); > +} > + > +static u_long > +parse_cpu_features_hwcap2(void) > +{ > + u_long hwcap2 = 0; > + > + if (ID_AA64ISAR0_RNDR_VAL(user_cpu_desc.id_aa64isar0) == > + ID_AA64ISAR0_RNDR_IMPL) > + hwcap2 |= HWCAP2_RNG; > + > + if (ID_AA64ISAR0_TS_VAL(user_cpu_desc.id_aa64isar0) == > + ID_AA64ISAR0_TS_CondM_8_5) > + hwcap2 |= HWCAP2_FLAGM2; > + > + if (ID_AA64ISAR1_I8MM_VAL(user_cpu_desc.id_aa64isar1) == > + ID_AA64ISAR1_I8MM_IMPL) > + hwcap2 |= HWCAP2_I8MM; > + > + if (ID_AA64ISAR1_DGH_VAL(user_cpu_desc.id_aa64isar1) == > + ID_AA64ISAR1_DGH_IMPL) > + hwcap2 |= HWCAP2_DGH; > + > + if (ID_AA64ISAR1_BF16_VAL(user_cpu_desc.id_aa64isar1) == > + ID_AA64ISAR1_BF16_IMPL) > + hwcap2 |= HWCAP2_BF16; > + > + if (ID_AA64ISAR1_FRINTTS_VAL(user_cpu_desc.id_aa64isar1) == > + ID_AA64ISAR1_FRINTTS_IMPL) > + hwcap2 |= HWCAP2_FRINT; > + > + if (ID_AA64ISAR1_DPB_VAL(user_cpu_desc.id_aa64isar1) == > + ID_AA64ISAR1_DPB_DCCVADP) > + hwcap2 |= HWCAP2_DCPODP; > + > + if (ID_AA64PFR1_BT_VAL(user_cpu_desc.id_aa64pfr1) == > + ID_AA64PFR1_BT_IMPL) > + hwcap2 |= HWCAP2_BTI; > + > + return (hwcap2); > } > > static void > > Modified: head/sys/arm64/include/md_var.h > ============================================================================== > --- head/sys/arm64/include/md_var.h Tue Sep 8 15:08:20 2020 (r365459) > +++ head/sys/arm64/include/md_var.h Tue Sep 8 15:36:38 2020 (r365460) > @@ -38,6 +38,8 @@ extern char sigcode[]; > extern int szsigcode; > extern uint64_t *vm_page_dump; > extern int vm_page_dump_size; > +extern u_long elf_hwcap; > +extern u_long elf_hwcap2; > > struct dumperinfo; > From owner-svn-src-all@freebsd.org Tue Sep 8 16:06:26 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AF86C3CDEB6; Tue, 8 Sep 2020 16:06:26 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bm94f4CZKz3xZn; Tue, 8 Sep 2020 16:06:26 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 73F3F1328B; Tue, 8 Sep 2020 16:06:26 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 088G6QT6087631; Tue, 8 Sep 2020 16:06:26 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 088G6QMB087630; Tue, 8 Sep 2020 16:06:26 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202009081606.088G6QMB087630@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Tue, 8 Sep 2020 16:06:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365462 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 365462 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.33 Precedence: list List-Id: "SVN commit messages 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, 08 Sep 2020 16:06:26 -0000 Author: mjg Date: Tue Sep 8 16:06:26 2020 New Revision: 365462 URL: https://svnweb.freebsd.org/changeset/base/365462 Log: vfs: drop a write-only var in vfs_periodic_msync_inactive Modified: head/sys/kern/vfs_subr.c Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Tue Sep 8 15:39:19 2020 (r365461) +++ head/sys/kern/vfs_subr.c Tue Sep 8 16:06:26 2020 (r365462) @@ -4668,11 +4668,8 @@ vfs_periodic_msync_inactive(struct mount *mp, int flag { struct vnode *vp, *mvp; struct vm_object *obj; - struct thread *td; int lkflags, objflags; bool seen_defer; - - td = curthread; lkflags = LK_EXCLUSIVE | LK_INTERLOCK; if (flags != MNT_WAIT) { From owner-svn-src-all@freebsd.org Tue Sep 8 16:06:46 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EBB823CE0F2; Tue, 8 Sep 2020 16:06:46 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bm9525zPlz3yBM; Tue, 8 Sep 2020 16:06:46 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B1C4A13131; Tue, 8 Sep 2020 16:06:46 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 088G6kq1087697; Tue, 8 Sep 2020 16:06:46 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 088G6kBJ087696; Tue, 8 Sep 2020 16:06:46 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202009081606.088G6kBJ087696@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Tue, 8 Sep 2020 16:06:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365463 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 365463 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.33 Precedence: list List-Id: "SVN commit messages 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, 08 Sep 2020 16:06:47 -0000 Author: mjg Date: Tue Sep 8 16:06:46 2020 New Revision: 365463 URL: https://svnweb.freebsd.org/changeset/base/365463 Log: cache: drop write-only tvp_seqc vars Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Tue Sep 8 16:06:26 2020 (r365462) +++ head/sys/kern/vfs_cache.c Tue Sep 8 16:06:46 2020 (r365463) @@ -3714,14 +3714,13 @@ cache_fplookup_final_withparent(struct cache_fpl *fpl) struct componentname *cnp; enum vgetstate dvs, tvs; struct vnode *dvp, *tvp; - seqc_t dvp_seqc, tvp_seqc; + seqc_t dvp_seqc; int error; cnp = fpl->cnp; dvp = fpl->dvp; dvp_seqc = fpl->dvp_seqc; tvp = fpl->tvp; - tvp_seqc = fpl->tvp_seqc; MPASS((cnp->cn_flags & (LOCKPARENT|WANTPARENT)) != 0); @@ -3780,13 +3779,12 @@ cache_fplookup_final(struct cache_fpl *fpl) struct componentname *cnp; enum vgetstate tvs; struct vnode *dvp, *tvp; - seqc_t dvp_seqc, tvp_seqc; + seqc_t dvp_seqc; cnp = fpl->cnp; dvp = fpl->dvp; dvp_seqc = fpl->dvp_seqc; tvp = fpl->tvp; - tvp_seqc = fpl->tvp_seqc; VNPASS(cache_fplookup_vnode_supported(dvp), dvp); From owner-svn-src-all@freebsd.org Tue Sep 8 16:07:47 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BDA493CE131; Tue, 8 Sep 2020 16:07:47 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bm96C4hSNz3yCb; Tue, 8 Sep 2020 16:07:47 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 845B512BBC; Tue, 8 Sep 2020 16:07:47 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 088G7lvY087805; Tue, 8 Sep 2020 16:07:47 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 088G7lhb087804; Tue, 8 Sep 2020 16:07:47 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <202009081607.088G7lhb087804@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Tue, 8 Sep 2020 16:07:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365464 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 365464 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.33 Precedence: list List-Id: "SVN commit messages 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, 08 Sep 2020 16:07:47 -0000 Author: mjg Date: Tue Sep 8 16:07:47 2020 New Revision: 365464 URL: https://svnweb.freebsd.org/changeset/base/365464 Log: fd: fix fhold on an uninitialized var in fdcopy_remapped Reported by: gcc9 Modified: head/sys/kern/kern_descrip.c Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Tue Sep 8 16:06:46 2020 (r365463) +++ head/sys/kern/kern_descrip.c Tue Sep 8 16:07:47 2020 (r365464) @@ -2213,7 +2213,7 @@ fdcopy_remapped(struct filedesc *fdp, const int *fds, error = EINVAL; goto bad; } - if (!fhold(nfde->fde_file)) { + if (!fhold(ofde->fde_file)) { error = EBADF; goto bad; } From owner-svn-src-all@freebsd.org Tue Sep 8 16:43:33 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 759673CF2E2; Tue, 8 Sep 2020 16:43:33 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bm9vT2VWJz414d; Tue, 8 Sep 2020 16:43:33 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 392521385C; Tue, 8 Sep 2020 16:43:33 +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 088GhXeA012084; Tue, 8 Sep 2020 16:43:33 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 088GhWEV012082; Tue, 8 Sep 2020 16:43:32 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202009081643.088GhWEV012082@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 8 Sep 2020 16:43:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365465 - in stable: 11/share/mk 11/sys/conf 12/share/mk 12/sys/conf X-SVN-Group: stable-12 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable: 11/share/mk 11/sys/conf 12/share/mk 12/sys/conf X-SVN-Commit-Revision: 365465 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.33 Precedence: list List-Id: "SVN commit messages 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, 08 Sep 2020 16:43:33 -0000 Author: jhb Date: Tue Sep 8 16:43:32 2020 New Revision: 365465 URL: https://svnweb.freebsd.org/changeset/base/365465 Log: MFC 354970: Add a kmod.opts.mk. This Makefile sets KERN_OPTS. This permits kernel module Makefiles to use KERN_OPTS to control the value of variables such as SRCS that are used by bsd.kmod.mk for KERN_OPTS values that honor WITH/WITHOUT options for standalone builds. Added: stable/12/share/mk/kmod.opts.mk - copied unchanged from r354970, head/share/mk/kmod.opts.mk stable/12/sys/conf/kmod.opts.mk - copied unchanged from r354970, head/sys/conf/kmod.opts.mk Modified: stable/12/sys/conf/kmod.mk Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Added: stable/11/share/mk/kmod.opts.mk - copied unchanged from r354970, head/share/mk/kmod.opts.mk stable/11/sys/conf/kmod.opts.mk - copied unchanged from r354970, head/sys/conf/kmod.opts.mk Modified: stable/11/sys/conf/kmod.mk Directory Properties: stable/11/ (props changed) Copied: stable/12/share/mk/kmod.opts.mk (from r354970, head/share/mk/kmod.opts.mk) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/share/mk/kmod.opts.mk Tue Sep 8 16:43:32 2020 (r365465, copy of r354970, head/share/mk/kmod.opts.mk) @@ -0,0 +1,4 @@ +# $FreeBSD$ + +.include +.include "${SYSDIR}/conf/kmod.opts.mk" Modified: stable/12/sys/conf/kmod.mk ============================================================================== --- stable/12/sys/conf/kmod.mk Tue Sep 8 16:07:47 2020 (r365464) +++ stable/12/sys/conf/kmod.mk Tue Sep 8 16:43:32 2020 (r365465) @@ -73,12 +73,7 @@ KMODUNLOAD?= /sbin/kldunload KMODISLOADED?= /sbin/kldstat -q -n OBJCOPY?= objcopy -.include -# Grab all the options for a kernel build. For backwards compat, we need to -# do this after bsd.own.mk. -.include "kern.opts.mk" -.include -.include "config.mk" +.include "kmod.opts.mk" # Search for kernel source tree in standard places. .if empty(KERNBUILDDIR) Copied: stable/12/sys/conf/kmod.opts.mk (from r354970, head/sys/conf/kmod.opts.mk) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/sys/conf/kmod.opts.mk Tue Sep 8 16:43:32 2020 (r365465, copy of r354970, head/sys/conf/kmod.opts.mk) @@ -0,0 +1,16 @@ +# $FreeBSD$ +# +# Handle options (KERN_OPTS) for kernel module options. This can be included earlier in a kmod Makefile +# to allow KERN_OPTS to control SRCS, etc. + +.if !target(____) +____: + +.include +# Grab all the options for a kernel build. For backwards compat, we need to +# do this after bsd.own.mk. +.include "kern.opts.mk" +.include +.include "config.mk" + +.endif # !target(____) From owner-svn-src-all@freebsd.org Tue Sep 8 16:43:34 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2C8DC3CF484; Tue, 8 Sep 2020 16:43:34 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bm9vV0CJKz41GB; Tue, 8 Sep 2020 16:43:34 +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 DE87A137D1; Tue, 8 Sep 2020 16:43:33 +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 088GhXxZ012092; Tue, 8 Sep 2020 16:43:33 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 088GhXAC012090; Tue, 8 Sep 2020 16:43:33 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202009081643.088GhXAC012090@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 8 Sep 2020 16:43: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: r365465 - in stable: 11/share/mk 11/sys/conf 12/share/mk 12/sys/conf X-SVN-Group: stable-11 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable: 11/share/mk 11/sys/conf 12/share/mk 12/sys/conf X-SVN-Commit-Revision: 365465 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.33 Precedence: list List-Id: "SVN commit messages 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, 08 Sep 2020 16:43:34 -0000 Author: jhb Date: Tue Sep 8 16:43:32 2020 New Revision: 365465 URL: https://svnweb.freebsd.org/changeset/base/365465 Log: MFC 354970: Add a kmod.opts.mk. This Makefile sets KERN_OPTS. This permits kernel module Makefiles to use KERN_OPTS to control the value of variables such as SRCS that are used by bsd.kmod.mk for KERN_OPTS values that honor WITH/WITHOUT options for standalone builds. Added: stable/11/share/mk/kmod.opts.mk - copied unchanged from r354970, head/share/mk/kmod.opts.mk stable/11/sys/conf/kmod.opts.mk - copied unchanged from r354970, head/sys/conf/kmod.opts.mk Modified: stable/11/sys/conf/kmod.mk Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Added: stable/12/share/mk/kmod.opts.mk - copied unchanged from r354970, head/share/mk/kmod.opts.mk stable/12/sys/conf/kmod.opts.mk - copied unchanged from r354970, head/sys/conf/kmod.opts.mk Modified: stable/12/sys/conf/kmod.mk Directory Properties: stable/12/ (props changed) Copied: stable/11/share/mk/kmod.opts.mk (from r354970, head/share/mk/kmod.opts.mk) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/share/mk/kmod.opts.mk Tue Sep 8 16:43:32 2020 (r365465, copy of r354970, head/share/mk/kmod.opts.mk) @@ -0,0 +1,4 @@ +# $FreeBSD$ + +.include +.include "${SYSDIR}/conf/kmod.opts.mk" Modified: stable/11/sys/conf/kmod.mk ============================================================================== --- stable/11/sys/conf/kmod.mk Tue Sep 8 16:07:47 2020 (r365464) +++ stable/11/sys/conf/kmod.mk Tue Sep 8 16:43:32 2020 (r365465) @@ -69,12 +69,7 @@ KMODUNLOAD?= /sbin/kldunload KMODISLOADED?= /sbin/kldstat -q -n OBJCOPY?= objcopy -.include -# Grab all the options for a kernel build. For backwards compat, we need to -# do this after bsd.own.mk. -.include "kern.opts.mk" -.include -.include "config.mk" +.include "kmod.opts.mk" # Search for kernel source tree in standard places. .for _dir in ${.CURDIR}/../.. ${.CURDIR}/../../.. /sys /usr/src/sys Copied: stable/11/sys/conf/kmod.opts.mk (from r354970, head/sys/conf/kmod.opts.mk) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/sys/conf/kmod.opts.mk Tue Sep 8 16:43:32 2020 (r365465, copy of r354970, head/sys/conf/kmod.opts.mk) @@ -0,0 +1,16 @@ +# $FreeBSD$ +# +# Handle options (KERN_OPTS) for kernel module options. This can be included earlier in a kmod Makefile +# to allow KERN_OPTS to control SRCS, etc. + +.if !target(____) +____: + +.include +# Grab all the options for a kernel build. For backwards compat, we need to +# do this after bsd.own.mk. +.include "kern.opts.mk" +.include +.include "config.mk" + +.endif # !target(____) From owner-svn-src-all@freebsd.org Tue Sep 8 17:47:31 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E2C853D127B; Tue, 8 Sep 2020 17:47:31 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BmCKH3RvWz468M; Tue, 8 Sep 2020 17:47:31 +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 4883114739; Tue, 8 Sep 2020 17:47:31 +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 088HlVSH050531; Tue, 8 Sep 2020 17:47:31 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 088HlVqO050530; Tue, 8 Sep 2020 17:47:31 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <202009081747.088HlVqO050530@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Tue, 8 Sep 2020 17:47:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365466 - head/sys/modules/zfs X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/modules/zfs X-SVN-Commit-Revision: 365466 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.33 Precedence: list List-Id: "SVN commit messages 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, 08 Sep 2020 17:47:32 -0000 Author: mmacy Date: Tue Sep 8 17:47:30 2020 New Revision: 365466 URL: https://svnweb.freebsd.org/changeset/base/365466 Log: ZFS: remove some extra defines When merging a number of defines that are needed in the standalone build made it in to the module makefile. Reported by: markj@ Modified: head/sys/modules/zfs/Makefile Modified: head/sys/modules/zfs/Makefile ============================================================================== --- head/sys/modules/zfs/Makefile Tue Sep 8 16:43:32 2020 (r365465) +++ head/sys/modules/zfs/Makefile Tue Sep 8 17:47:30 2020 (r365466) @@ -27,21 +27,12 @@ CFLAGS+= -include ${INCDIR}/os/freebsd/spl/sys/ccompil CFLAGS+= -include ${SRCTOP}/sys/modules/zfs/static_ccompile.h CFLAGS+= -I${.CURDIR} -CFLAGS+= -D__KERNEL__ -DFREEBSD_NAMECACHE -DBUILDING_ZFS -D__BSD_VISIBLE=1 \ +CFLAGS+= -D__KERNEL__ -DFREEBSD_NAMECACHE -DBUILDING_ZFS \ -DHAVE_UIO_ZEROCOPY -DWITHOUT_NETDUMP -D__KERNEL -D_SYS_CONDVAR_H_ \ - -D_SYS_VMEM_H_ -DKDTRACE_HOOKS -DSMP -DIN_FREEBSD_BASE -DHAVE_KSID + -D_SYS_VMEM_H_ -DIN_FREEBSD_BASE -DHAVE_KSID .if ${MACHINE_ARCH} == "amd64" CFLAGS+= -DHAVE_AVX2 -DHAVE_AVX -D__x86_64 -DHAVE_SSE2 -DHAVE_AVX512F -DHAVE_AVX512BW -DHAVE_SSSE3 -.endif - -.if defined(WITH_VFS_DEBUG) && ${WITH_VFS_DEBUG} == "true" -# kernel must also be built with this option for this to work -CFLAGS+= -DDEBUG_VFS_LOCKS -.endif - -.if defined(WITH_GCOV) && ${WITH_GCOV} == "true" -CFLAGS+= -fprofile-arcs -ftest-coverage .endif .if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "powerpc" || \ From owner-svn-src-all@freebsd.org Tue Sep 8 18:29:21 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 47E513D2D1C; Tue, 8 Sep 2020 18:29:21 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BmDFY1Fy9z4FSM; Tue, 8 Sep 2020 18:29:21 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0E5D614A5B; Tue, 8 Sep 2020 18:29:21 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 088ITK8r079959; Tue, 8 Sep 2020 18:29:20 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 088ITKk0079958; Tue, 8 Sep 2020 18:29:20 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202009081829.088ITKk0079958@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 8 Sep 2020 18:29:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r365467 - in stable: 11/sys/modules/if_enc 12/sys/modules/if_enc X-SVN-Group: stable-11 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable: 11/sys/modules/if_enc 12/sys/modules/if_enc X-SVN-Commit-Revision: 365467 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.33 Precedence: list List-Id: "SVN commit messages 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, 08 Sep 2020 18:29:21 -0000 Author: jhb Date: Tue Sep 8 18:29:20 2020 New Revision: 365467 URL: https://svnweb.freebsd.org/changeset/base/365467 Log: MFC 361634: Add opt_ipsec.h to fix standalone builds after r361633. Modified: stable/11/sys/modules/if_enc/Makefile Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/sys/modules/if_enc/Makefile Directory Properties: stable/12/ (props changed) Modified: stable/11/sys/modules/if_enc/Makefile ============================================================================== --- stable/11/sys/modules/if_enc/Makefile Tue Sep 8 17:47:30 2020 (r365466) +++ stable/11/sys/modules/if_enc/Makefile Tue Sep 8 18:29:20 2020 (r365467) @@ -6,6 +6,6 @@ SYSDIR?=${SRCTOP}/sys .PATH: ${SYSDIR}/net KMOD= if_enc -SRCS= if_enc.c opt_inet.h opt_inet6.h +SRCS= if_enc.c opt_inet.h opt_inet6.h opt_ipsec.h .include From owner-svn-src-all@freebsd.org Tue Sep 8 18:29:20 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EA4703D2B75; Tue, 8 Sep 2020 18:29:20 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BmDFX5wszz4FC9; Tue, 8 Sep 2020 18:29:20 +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 AEFB714F17; Tue, 8 Sep 2020 18:29:20 +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 088ITKOL079953; Tue, 8 Sep 2020 18:29:20 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 088ITKje079952; Tue, 8 Sep 2020 18:29:20 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202009081829.088ITKje079952@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 8 Sep 2020 18:29:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365467 - in stable: 11/sys/modules/if_enc 12/sys/modules/if_enc X-SVN-Group: stable-12 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable: 11/sys/modules/if_enc 12/sys/modules/if_enc X-SVN-Commit-Revision: 365467 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.33 Precedence: list List-Id: "SVN commit messages 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, 08 Sep 2020 18:29:21 -0000 Author: jhb Date: Tue Sep 8 18:29:20 2020 New Revision: 365467 URL: https://svnweb.freebsd.org/changeset/base/365467 Log: MFC 361634: Add opt_ipsec.h to fix standalone builds after r361633. Modified: stable/12/sys/modules/if_enc/Makefile Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sys/modules/if_enc/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/12/sys/modules/if_enc/Makefile ============================================================================== --- stable/12/sys/modules/if_enc/Makefile Tue Sep 8 17:47:30 2020 (r365466) +++ stable/12/sys/modules/if_enc/Makefile Tue Sep 8 18:29:20 2020 (r365467) @@ -6,6 +6,6 @@ SYSDIR?=${SRCTOP}/sys .PATH: ${SYSDIR}/net KMOD= if_enc -SRCS= if_enc.c opt_inet.h opt_inet6.h +SRCS= if_enc.c opt_inet.h opt_inet6.h opt_ipsec.h .include From owner-svn-src-all@freebsd.org Tue Sep 8 18:33:43 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E98573D2E3C; Tue, 8 Sep 2020 18:33:43 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BmDLb4CVMz4FsW; Tue, 8 Sep 2020 18:33:43 +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 5F16014C52; Tue, 8 Sep 2020 18:33:42 +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 088IXgbp086147; Tue, 8 Sep 2020 18:33:42 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 088IXgNi086146; Tue, 8 Sep 2020 18:33:42 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202009081833.088IXgNi086146@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 8 Sep 2020 18:33:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365468 - stable/12/sys/modules/if_vlan X-SVN-Group: stable-12 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: stable/12/sys/modules/if_vlan X-SVN-Commit-Revision: 365468 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.33 Precedence: list List-Id: "SVN commit messages 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, 08 Sep 2020 18:33:44 -0000 Author: jhb Date: Tue Sep 8 18:33:41 2020 New Revision: 365468 URL: https://svnweb.freebsd.org/changeset/base/365468 Log: Partial MFC 357275: if_vlan grew a dependency on opt_inet6.h in r356993 Modified: stable/12/sys/modules/if_vlan/Makefile Modified: stable/12/sys/modules/if_vlan/Makefile ============================================================================== --- stable/12/sys/modules/if_vlan/Makefile Tue Sep 8 18:29:20 2020 (r365467) +++ stable/12/sys/modules/if_vlan/Makefile Tue Sep 8 18:33:41 2020 (r365468) @@ -4,6 +4,6 @@ KMOD= if_vlan SRCS= if_vlan.c -SRCS+= opt_inet.h opt_vlan.h opt_ratelimit.h +SRCS+= opt_inet.h opt_inet6.h opt_vlan.h opt_ratelimit.h .include From owner-svn-src-all@freebsd.org Tue Sep 8 18:49:59 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8D36B3D3630; Tue, 8 Sep 2020 18:49:59 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BmDjM3J2hz4Gcc; Tue, 8 Sep 2020 18:49:59 +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 50533150C2; Tue, 8 Sep 2020 18:49:59 +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 088InxSw092604; Tue, 8 Sep 2020 18:49:59 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 088InxoL092603; Tue, 8 Sep 2020 18:49:59 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202009081849.088InxoL092603@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 8 Sep 2020 18:49:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365469 - in stable: 11/sys/modules/tcp 12/sys/modules/tcp X-SVN-Group: stable-12 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable: 11/sys/modules/tcp 12/sys/modules/tcp X-SVN-Commit-Revision: 365469 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.33 Precedence: list List-Id: "SVN commit messages 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, 08 Sep 2020 18:49:59 -0000 Author: jhb Date: Tue Sep 8 18:49:58 2020 New Revision: 365469 URL: https://svnweb.freebsd.org/changeset/base/365469 Log: Use kmod.opts.mk in sys/modules/tcp/Makefile to fix standalone builds. This was included in the original commit to head that added use of KERN_OPTS (r361638) but was left out of the MFC since kmod.opts.mk hadn't been MFC'd at the time. It has since been merged. This is a direct commit to stable/11 and stable/12. Reported by: Eugene Grosbein Modified: stable/12/sys/modules/tcp/Makefile Changes in other areas also in this revision: Modified: stable/11/sys/modules/tcp/Makefile Modified: stable/12/sys/modules/tcp/Makefile ============================================================================== --- stable/12/sys/modules/tcp/Makefile Tue Sep 8 18:33:41 2020 (r365468) +++ stable/12/sys/modules/tcp/Makefile Tue Sep 8 18:49:58 2020 (r365469) @@ -2,8 +2,7 @@ # $FreeBSD$ # -SYSDIR?=${SRCTOP}/sys -.include "${SYSDIR}/conf/kern.opts.mk" +.include SUBDIR= \ ${_tcp_rack} \ From owner-svn-src-all@freebsd.org Tue Sep 8 18:49:59 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D5C4A3D3334; Tue, 8 Sep 2020 18:49:59 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BmDjM5Pqyz4Gtd; Tue, 8 Sep 2020 18:49:59 +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 9CA1E14FFE; Tue, 8 Sep 2020 18:49:59 +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 088InxHE092610; Tue, 8 Sep 2020 18:49:59 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 088InxlC092609; Tue, 8 Sep 2020 18:49:59 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202009081849.088InxlC092609@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 8 Sep 2020 18:49:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r365469 - in stable: 11/sys/modules/tcp 12/sys/modules/tcp X-SVN-Group: stable-11 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable: 11/sys/modules/tcp 12/sys/modules/tcp X-SVN-Commit-Revision: 365469 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.33 Precedence: list List-Id: "SVN commit messages 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, 08 Sep 2020 18:49:59 -0000 Author: jhb Date: Tue Sep 8 18:49:58 2020 New Revision: 365469 URL: https://svnweb.freebsd.org/changeset/base/365469 Log: Use kmod.opts.mk in sys/modules/tcp/Makefile to fix standalone builds. This was included in the original commit to head that added use of KERN_OPTS (r361638) but was left out of the MFC since kmod.opts.mk hadn't been MFC'd at the time. It has since been merged. This is a direct commit to stable/11 and stable/12. Reported by: Eugene Grosbein Modified: stable/11/sys/modules/tcp/Makefile Changes in other areas also in this revision: Modified: stable/12/sys/modules/tcp/Makefile Modified: stable/11/sys/modules/tcp/Makefile ============================================================================== --- stable/11/sys/modules/tcp/Makefile Tue Sep 8 18:33:41 2020 (r365468) +++ stable/11/sys/modules/tcp/Makefile Tue Sep 8 18:49:58 2020 (r365469) @@ -2,8 +2,7 @@ # $FreeBSD$ # -SYSDIR?=${SRCTOP}/sys -.include "${SYSDIR}/conf/kern.opts.mk" +.include SUBDIR= \ ${_tcp_fastpath} \ From owner-svn-src-all@freebsd.org Tue Sep 8 18:58:39 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 522313D3DA3; Tue, 8 Sep 2020 18:58:39 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BmDvM1Xc8z4Hl5; Tue, 8 Sep 2020 18:58:39 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1838914F78; Tue, 8 Sep 2020 18:58:39 +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 088IwcLf099087; Tue, 8 Sep 2020 18:58:38 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 088IwcjU099086; Tue, 8 Sep 2020 18:58:38 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202009081858.088IwcjU099086@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 8 Sep 2020 18: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: r365470 - in stable: 11/sys/modules/tcp 12/sys/modules/tcp X-SVN-Group: stable-11 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable: 11/sys/modules/tcp 12/sys/modules/tcp X-SVN-Commit-Revision: 365470 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.33 Precedence: list List-Id: "SVN commit messages 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, 08 Sep 2020 18:58:39 -0000 Author: jhb Date: Tue Sep 8 18:58:38 2020 New Revision: 365470 URL: https://svnweb.freebsd.org/changeset/base/365470 Log: MFC 361764: Revise r361712 to disable tcpmd5.ko for 'options TCP_SIGNATURE' Modified: stable/11/sys/modules/tcp/Makefile Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/sys/modules/tcp/Makefile Directory Properties: stable/12/ (props changed) Modified: stable/11/sys/modules/tcp/Makefile ============================================================================== --- stable/11/sys/modules/tcp/Makefile Tue Sep 8 18:49:58 2020 (r365469) +++ stable/11/sys/modules/tcp/Makefile Tue Sep 8 18:58:38 2020 (r365470) @@ -14,7 +14,7 @@ _tcp_fastpath= fastpath .if (${MK_INET_SUPPORT} != "no" || ${MK_INET6_SUPPORT} != "no") || \ defined(ALL_MODULES) -.if ${KERN_OPTS:MIPSEC_SUPPORT} && !${KERN_OPTS:MIPSEC} +.if ${KERN_OPTS:MIPSEC_SUPPORT} && !${KERN_OPTS:MTCP_SIGNATURE} _tcpmd5= tcpmd5 .endif .endif From owner-svn-src-all@freebsd.org Tue Sep 8 18:58:39 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F3C513D3BF7; Tue, 8 Sep 2020 18:58:38 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BmDvL6DFjz4J24; Tue, 8 Sep 2020 18:58:38 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BA46915271; Tue, 8 Sep 2020 18:58:38 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 088IwccH099081; Tue, 8 Sep 2020 18:58:38 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 088IwcHn099080; Tue, 8 Sep 2020 18:58:38 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202009081858.088IwcHn099080@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 8 Sep 2020 18:58:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365470 - in stable: 11/sys/modules/tcp 12/sys/modules/tcp X-SVN-Group: stable-12 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable: 11/sys/modules/tcp 12/sys/modules/tcp X-SVN-Commit-Revision: 365470 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.33 Precedence: list List-Id: "SVN commit messages 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, 08 Sep 2020 18:58:39 -0000 Author: jhb Date: Tue Sep 8 18:58:38 2020 New Revision: 365470 URL: https://svnweb.freebsd.org/changeset/base/365470 Log: MFC 361764: Revise r361712 to disable tcpmd5.ko for 'options TCP_SIGNATURE' Modified: stable/12/sys/modules/tcp/Makefile Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sys/modules/tcp/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/12/sys/modules/tcp/Makefile ============================================================================== --- stable/12/sys/modules/tcp/Makefile Tue Sep 8 18:49:58 2020 (r365469) +++ stable/12/sys/modules/tcp/Makefile Tue Sep 8 18:58:38 2020 (r365470) @@ -14,7 +14,7 @@ _tcp_rack= rack .if (${MK_INET_SUPPORT} != "no" || ${MK_INET6_SUPPORT} != "no") || \ defined(ALL_MODULES) -.if ${KERN_OPTS:MIPSEC_SUPPORT} && !${KERN_OPTS:MIPSEC} +.if ${KERN_OPTS:MIPSEC_SUPPORT} && !${KERN_OPTS:MTCP_SIGNATURE} _tcpmd5= tcpmd5 .endif .endif From owner-svn-src-all@freebsd.org Tue Sep 8 20:02:09 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4E7143D5D8C; Tue, 8 Sep 2020 20:02:09 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BmGJd1L7sz4Ms3; Tue, 8 Sep 2020 20:02:09 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 112A216175; Tue, 8 Sep 2020 20:02:09 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 088K28ge040371; Tue, 8 Sep 2020 20:02:08 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 088K28kF040369; Tue, 8 Sep 2020 20:02:08 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202009082002.088K28kF040369@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Tue, 8 Sep 2020 20:02:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365471 - in stable: 11/contrib/llvm-project/compiler-rt/lib/builtins 11/lib/libcompiler_rt 11/sys/sys 12/contrib/llvm-project/compiler-rt/lib/builtins 12/lib/libcompiler_rt 12/sys/sys X-SVN-Group: stable-12 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in stable: 11/contrib/llvm-project/compiler-rt/lib/builtins 11/lib/libcompiler_rt 11/sys/sys 12/contrib/llvm-project/compiler-rt/lib/builtins 12/lib/libcompiler_rt 12/sys/sys X-SVN-Commit-Revision: 365471 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.33 Precedence: list List-Id: "SVN commit messages 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, 08 Sep 2020 20:02:09 -0000 Author: dim Date: Tue Sep 8 20:02:08 2020 New Revision: 365471 URL: https://svnweb.freebsd.org/changeset/base/365471 Log: MFC r364753: Add atomic and bswap functions to libcompiler_rt There have been several mentions on our mailing lists about missing atomic functions in our system libraries (e.g. __atomic_load_8 and friends), and recently I saw __bswapdi2 and __bswapsi2 mentioned too. To address this, add implementations for the functions from compiler-rt to the system compiler support libraries, e.g. libcompiler_rt.a and and libgcc_s.so. This also needs a small fixup in compiler-rt's atomic.c, to ensure that 32-bit mips can build correctly. Bump __FreeBSD_version to make it easier for port maintainers to detect when these functions were added. PR: 230888 Differential Revision: https://reviews.freebsd.org/D26159 MFC r364782: After r364753, there should be no need to suppress -Watomic-alignment warnings anymore for compiler-rt's atomic.c. This occurred because the IS_LOCK_FREE_8 macro was not correctly defined to 0 for mips, and this caused the compiler to emit a runtime call to __atomic_is_lock_free(), and that triggers the warning. Modified: stable/12/contrib/llvm-project/compiler-rt/lib/builtins/atomic.c stable/12/lib/libcompiler_rt/Makefile.inc stable/12/sys/sys/param.h Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/contrib/llvm-project/compiler-rt/lib/builtins/atomic.c stable/11/lib/libcompiler_rt/Makefile.inc stable/11/sys/sys/param.h Directory Properties: stable/11/ (props changed) Modified: stable/12/contrib/llvm-project/compiler-rt/lib/builtins/atomic.c ============================================================================== --- stable/12/contrib/llvm-project/compiler-rt/lib/builtins/atomic.c Tue Sep 8 18:58:38 2020 (r365470) +++ stable/12/contrib/llvm-project/compiler-rt/lib/builtins/atomic.c Tue Sep 8 20:02:08 2020 (r365471) @@ -124,8 +124,8 @@ static __inline Lock *lock_for_pointer(void *ptr) { #define IS_LOCK_FREE_2 __c11_atomic_is_lock_free(2) #define IS_LOCK_FREE_4 __c11_atomic_is_lock_free(4) -/// 32 bit PowerPC doesn't support 8-byte lock_free atomics -#if !defined(__powerpc64__) && defined(__powerpc__) +/// 32 bit MIPS and PowerPC don't support 8-byte lock_free atomics +#if defined(__mips__) || (!defined(__powerpc64__) && defined(__powerpc__)) #define IS_LOCK_FREE_8 0 #else #define IS_LOCK_FREE_8 __c11_atomic_is_lock_free(8) Modified: stable/12/lib/libcompiler_rt/Makefile.inc ============================================================================== --- stable/12/lib/libcompiler_rt/Makefile.inc Tue Sep 8 18:58:38 2020 (r365470) +++ stable/12/lib/libcompiler_rt/Makefile.inc Tue Sep 8 20:02:08 2020 (r365471) @@ -18,6 +18,9 @@ SRCF+= ashldi3 SRCF+= ashlti3 SRCF+= ashrdi3 SRCF+= ashrti3 +SRCF+= atomic +SRCF+= bswapdi2 +SRCF+= bswapsi2 SRCF+= clear_cache SRCF+= clzdi2 SRCF+= clzsi2 @@ -213,12 +216,6 @@ CFLAGS+= -DEMIT_SYNC_ATOMICS SRCF+= stdatomic .endif -.if "${COMPILER_TYPE}" == "clang" && \ - (${MACHINE_ARCH} == "powerpc" || ${MACHINE_ARCH} == "powerpcspe") -SRCS+= atomic.c -CFLAGS.atomic.c+= -Wno-atomic-alignment -.endif - .for file in ${SRCF} .if ${MACHINE_ARCH:Marmv[67]*} && (!defined(CPUTYPE) || ${CPUTYPE:M*soft*} == "") \ && exists(${CRTSRC}/${CRTARCH}/${file}vfp.S) @@ -240,18 +237,9 @@ SRCS+= aeabi_memmove.S SRCS+= aeabi_memset.S SRCS+= aeabi_uidivmod.S SRCS+= aeabi_uldivmod.S -SRCS+= bswapdi2.S -SRCS+= bswapsi2.S SRCS+= switch16.S SRCS+= switch32.S SRCS+= switch8.S SRCS+= switchu8.S SRCS+= sync_synchronize.S -.endif - -# On some archs GCC-6.3 requires bswap32 built-in. -.if ${MACHINE_CPUARCH} == "mips" || ${MACHINE_CPUARCH} == "riscv" || \ - ${MACHINE_CPUARCH} == "sparc64" -SRCS+= bswapdi2.c -SRCS+= bswapsi2.c .endif Modified: stable/12/sys/sys/param.h ============================================================================== --- stable/12/sys/sys/param.h Tue Sep 8 18:58:38 2020 (r365470) +++ stable/12/sys/sys/param.h Tue Sep 8 20:02:08 2020 (r365471) @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1201524 /* Master, propagated to newvers */ +#define __FreeBSD_version 1201525 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-all@freebsd.org Tue Sep 8 20:02:10 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 22ACE3D5945; Tue, 8 Sep 2020 20:02:10 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BmGJd6zDLz4MdS; Tue, 8 Sep 2020 20:02:09 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D2AB616176; Tue, 8 Sep 2020 20:02:09 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 088K29QG040379; Tue, 8 Sep 2020 20:02:09 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 088K29sm040376; Tue, 8 Sep 2020 20:02:09 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202009082002.088K29sm040376@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Tue, 8 Sep 2020 20:02: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: r365471 - in stable: 11/contrib/llvm-project/compiler-rt/lib/builtins 11/lib/libcompiler_rt 11/sys/sys 12/contrib/llvm-project/compiler-rt/lib/builtins 12/lib/libcompiler_rt 12/sys/sys X-SVN-Group: stable-11 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in stable: 11/contrib/llvm-project/compiler-rt/lib/builtins 11/lib/libcompiler_rt 11/sys/sys 12/contrib/llvm-project/compiler-rt/lib/builtins 12/lib/libcompiler_rt 12/sys/sys X-SVN-Commit-Revision: 365471 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.33 Precedence: list List-Id: "SVN commit messages 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, 08 Sep 2020 20:02:10 -0000 Author: dim Date: Tue Sep 8 20:02:08 2020 New Revision: 365471 URL: https://svnweb.freebsd.org/changeset/base/365471 Log: MFC r364753: Add atomic and bswap functions to libcompiler_rt There have been several mentions on our mailing lists about missing atomic functions in our system libraries (e.g. __atomic_load_8 and friends), and recently I saw __bswapdi2 and __bswapsi2 mentioned too. To address this, add implementations for the functions from compiler-rt to the system compiler support libraries, e.g. libcompiler_rt.a and and libgcc_s.so. This also needs a small fixup in compiler-rt's atomic.c, to ensure that 32-bit mips can build correctly. Bump __FreeBSD_version to make it easier for port maintainers to detect when these functions were added. PR: 230888 Differential Revision: https://reviews.freebsd.org/D26159 MFC r364782: After r364753, there should be no need to suppress -Watomic-alignment warnings anymore for compiler-rt's atomic.c. This occurred because the IS_LOCK_FREE_8 macro was not correctly defined to 0 for mips, and this caused the compiler to emit a runtime call to __atomic_is_lock_free(), and that triggers the warning. Modified: stable/11/contrib/llvm-project/compiler-rt/lib/builtins/atomic.c stable/11/lib/libcompiler_rt/Makefile.inc stable/11/sys/sys/param.h Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/contrib/llvm-project/compiler-rt/lib/builtins/atomic.c stable/12/lib/libcompiler_rt/Makefile.inc stable/12/sys/sys/param.h Directory Properties: stable/12/ (props changed) Modified: stable/11/contrib/llvm-project/compiler-rt/lib/builtins/atomic.c ============================================================================== --- stable/11/contrib/llvm-project/compiler-rt/lib/builtins/atomic.c Tue Sep 8 18:58:38 2020 (r365470) +++ stable/11/contrib/llvm-project/compiler-rt/lib/builtins/atomic.c Tue Sep 8 20:02:08 2020 (r365471) @@ -124,8 +124,8 @@ static __inline Lock *lock_for_pointer(void *ptr) { #define IS_LOCK_FREE_2 __c11_atomic_is_lock_free(2) #define IS_LOCK_FREE_4 __c11_atomic_is_lock_free(4) -/// 32 bit PowerPC doesn't support 8-byte lock_free atomics -#if !defined(__powerpc64__) && defined(__powerpc__) +/// 32 bit MIPS and PowerPC don't support 8-byte lock_free atomics +#if defined(__mips__) || (!defined(__powerpc64__) && defined(__powerpc__)) #define IS_LOCK_FREE_8 0 #else #define IS_LOCK_FREE_8 __c11_atomic_is_lock_free(8) Modified: stable/11/lib/libcompiler_rt/Makefile.inc ============================================================================== --- stable/11/lib/libcompiler_rt/Makefile.inc Tue Sep 8 18:58:38 2020 (r365470) +++ stable/11/lib/libcompiler_rt/Makefile.inc Tue Sep 8 20:02:08 2020 (r365471) @@ -18,6 +18,9 @@ SRCF+= ashldi3 SRCF+= ashlti3 SRCF+= ashrdi3 SRCF+= ashrti3 +SRCF+= atomic +SRCF+= bswapdi2 +SRCF+= bswapsi2 SRCF+= clear_cache SRCF+= clzdi2 SRCF+= clzsi2 @@ -215,12 +218,6 @@ CFLAGS+= -DEMIT_SYNC_ATOMICS SRCF+= stdatomic .endif -.if "${COMPILER_TYPE}" == "clang" && \ - (${MACHINE_ARCH} == "powerpc" || ${MACHINE_ARCH} == "powerpcspe") -SRCS+= atomic.c -CFLAGS.atomic.c+= -Wno-atomic-alignment -.endif - .for file in ${SRCF} .if ${MACHINE_ARCH:Marmv6*} && (!defined(CPUTYPE) || ${CPUTYPE:M*soft*} == "") \ && exists(${CRTSRC}/${CRTARCH}/${file}vfp.S) @@ -242,18 +239,9 @@ SRCS+= aeabi_memmove.S SRCS+= aeabi_memset.S SRCS+= aeabi_uidivmod.S SRCS+= aeabi_uldivmod.S -SRCS+= bswapdi2.S -SRCS+= bswapsi2.S SRCS+= switch16.S SRCS+= switch32.S SRCS+= switch8.S SRCS+= switchu8.S SRCS+= sync_synchronize.S .endif - -# GCC-6.3 on mips32 requires bswap32 built-in. -.if ${MACHINE_CPUARCH} == "mips" -SRCS+= bswapdi2.c -SRCS+= bswapsi2.c -.endif - Modified: stable/11/sys/sys/param.h ============================================================================== --- stable/11/sys/sys/param.h Tue Sep 8 18:58:38 2020 (r365470) +++ stable/11/sys/sys/param.h Tue Sep 8 20:02:08 2020 (r365471) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1104505 /* Master, propagated to newvers */ +#define __FreeBSD_version 1104506 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-all@freebsd.org Tue Sep 8 20:03:41 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 493B53D5F9D; Tue, 8 Sep 2020 20:03:41 +0000 (UTC) (envelope-from agapon@gmail.com) Received: from mail-lf1-f65.google.com (mail-lf1-f65.google.com [209.85.167.65]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BmGLN3PhFz4NP6; Tue, 8 Sep 2020 20:03:40 +0000 (UTC) (envelope-from agapon@gmail.com) Received: by mail-lf1-f65.google.com with SMTP id y2so326227lfy.10; Tue, 08 Sep 2020 13:03:40 -0700 (PDT) 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=645SFa3otAjz2LDyzf6APonB6tRwJc2mXaHKDWmDiww=; b=cwvqyvd6ADLknm65a8n3m1VeUPe57MXHPmytNdsNlBmFG9+08UL3kz9I+2dtAQLyad C/fWW8YaQ9uXaN27Re//x+Yh9L5J797kDfodX+JxBAjZ3i1x2PpEMZjwKJOx6W9PAi8I LpqOCtBVHT/P2qSQVLZqq3/OxHPI25VT1FlJfK5fP6di9KftHzBfHRRzhqCP/ctFwXCT xw74yasFcBCQnAXHbc6Z94Tv3Tdsw/ujuPiZkaXP8l0/mokcwewQblagwPS4dguu23T3 QRNVYf/24mwn8ZpSm5mIl47UjgBOabuPewuVTucibug1lYGpxsMtBihpe3SuehWPZQLy FQTw== X-Gm-Message-State: AOAM5324cArcrPg8ruHj7Ibc8yQiWo8zSF7vCofcsiM8FyezFqzhIGeT JHUPjJY0TNjkayMXAyg0V+pUxxkYdNk= X-Google-Smtp-Source: ABdhPJzBI2Uqzc6FPDNA7euaeS5uTM35Mbe/pUjQUUEFmq7/cXrQTiVKZUJaL9b38SURc1n5oAHN4Q== X-Received: by 2002:a05:6512:1044:: with SMTP id c4mr297573lfb.77.1599595418124; Tue, 08 Sep 2020 13:03:38 -0700 (PDT) Received: from [192.168.0.88] (east.meadow.volia.net. [93.72.151.96]) by smtp.googlemail.com with ESMTPSA id i63sm193530lji.66.2020.09.08.13.03.36 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 08 Sep 2020 13:03:37 -0700 (PDT) Subject: Re: svn commit: r364465 - in head/sys: conf net net/route To: "Alexander V. Chernikov" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202008212134.07LLYq3K071532@repo.freebsd.org> From: Andriy Gapon Openpgp: preference=signencrypt Autocrypt: addr=avg@FreeBSD.org; prefer-encrypt=mutual; keydata= mQINBFm4LIgBEADNB/3lT7f15UKeQ52xCFQx/GqHkSxEdVyLFZTmY3KyNPQGBtyvVyBfprJ7 mAeXZWfhat6cKNRAGZcL5EmewdQuUfQfBdYmKjbw3a9GFDsDNuhDA2QwFt8BmkiVMRYyvI7l N0eVzszWCUgdc3qqM6qqcgBaqsVmJluwpvwp4ZBXmch5BgDDDb1MPO8AZ2QZfIQmplkj8Y6Z AiNMknkmgaekIINSJX8IzRzKD5WwMsin70psE8dpL/iBsA2cpJGzWMObVTtCxeDKlBCNqM1i gTXta1ukdUT7JgLEFZk9ceYQQMJJtUwzWu1UHfZn0Fs29HTqawfWPSZVbulbrnu5q55R4PlQ /xURkWQUTyDpqUvb4JK371zhepXiXDwrrpnyyZABm3SFLkk2bHlheeKU6Yql4pcmSVym1AS4 dV8y0oHAfdlSCF6tpOPf2+K9nW1CFA8b/tw4oJBTtfZ1kxXOMdyZU5fiG7xb1qDgpQKgHUX8 7Rd2T1UVLVeuhYlXNw2F+a2ucY+cMoqz3LtpksUiBppJhw099gEXehcN2JbUZ2TueJdt1FdS ztnZmsHUXLxrRBtGwqnFL7GSd6snpGIKuuL305iaOGODbb9c7ne1JqBbkw1wh8ci6vvwGlzx rexzimRaBzJxlkjNfMx8WpCvYebGMydNoeEtkWldtjTNVsUAtQARAQABtB5BbmRyaXkgR2Fw b24gPGF2Z0BGcmVlQlNELm9yZz6JAlQEEwEIAD4WIQS+LEO7ngQnXA4Bjr538m7TUc1yjwUC WbgsiAIbIwUJBaOagAULCQgHAgYVCAkKCwIEFgIDAQIeAQIXgAAKCRB38m7TUc1yj+JAEACV l9AK/nOWAt/9cufV2fRj0hdOqB1aCshtSrwHk/exXsDa4/FkmegxXQGY+3GWX3deIyesbVRL rYdtdK0dqJyT1SBqXK1h3/at9rxr9GQA6KWOxTjUFURsU7ok/6SIlm8uLRPNKO+yq0GDjgaO LzN+xykuBA0FlhQAXJnpZLcVfPJdWv7sSHGedL5ln8P8rxR+XnmsA5TUaaPcbhTB+mG+iKFj GghASDSfGqLWFPBlX/fpXikBDZ1gvOr8nyMY9nXhgfXpq3B6QCRYKPy58ChrZ5weeJZ29b7/ QdEO8NFNWHjSD9meiLdWQaqo9Y7uUxN3wySc/YUZxtS0bhAd8zJdNPsJYG8sXgKjeBQMVGuT eCAJFEYJqbwWvIXMfVWop4+O4xB+z2YE3jAbG/9tB/GSnQdVSj3G8MS80iLS58frnt+RSEw/ psahrfh0dh6SFHttE049xYiC+cM8J27Aaf0i9RflyITq57NuJm+AHJoU9SQUkIF0nc6lfA+o JRiyRlHZHKoRQkIg4aiKaZSWjQYRl5Txl0IZUP1dSWMX4s3XTMurC/pnja45dge/4ESOtJ9R 8XuIWg45Oq6MeIWdjKddGhRj3OohsltKgkEU3eLKYtB6qRTQypHHUawCXz88uYt5e3w4V16H lCpSTZV/EVHnNe45FVBlvK7k7HFfDDkryLkCDQRZuCyIARAAlq0slcsVboY/+IUJdcbEiJRW be9HKVz4SUchq0z9MZPX/0dcnvz/gkyYA+OuM78dNS7Mbby5dTvOqfpLJfCuhaNYOhlE0wY+ 1T6Tf1f4c/uA3U/YiadukQ3+6TJuYGAdRZD5EqYFIkreARTVWg87N9g0fT9BEqLw9lJtEGDY EWUE7L++B8o4uu3LQFEYxcrb4K/WKmgtmFcm77s0IKDrfcX4doV92QTIpLiRxcOmCC/OCYuO jB1oaaqXQzZrCutXRK0L5XN1Y1PYjIrEzHMIXmCDlLYnpFkK+itlXwlE2ZQxkfMruCWdQXye syl2fynAe8hvp7Mms9qU2r2K9EcJiR5N1t1C2/kTKNUhcRv7Yd/vwusK7BqJbhlng5ZgRx0m WxdntU/JLEntz3QBsBsWM9Y9wf2V4tLv6/DuDBta781RsCB/UrU2zNuOEkSixlUiHxw1dccI 6CVlaWkkJBxmHX22GdDFrcjvwMNIbbyfQLuBq6IOh8nvu9vuItup7qemDG3Ms6TVwA7BD3j+ 3fGprtyW8Fd/RR2bW2+LWkMrqHffAr6Y6V3h5kd2G9Q8ZWpEJk+LG6Mk3fhZhmCnHhDu6CwN MeUvxXDVO+fqc3JjFm5OxhmfVeJKrbCEUJyM8ESWLoNHLqjywdZga4Q7P12g8DUQ1mRxYg/L HgZY3zfKOqcAEQEAAYkCPAQYAQgAJhYhBL4sQ7ueBCdcDgGOvnfybtNRzXKPBQJZuCyIAhsM BQkFo5qAAAoJEHfybtNRzXKPBVwQAKfFy9P7N3OsLDMB56A4Kf+ZT+d5cIx0Yiaf4n6w7m3i ImHHHk9FIetI4Xe54a2IXh4Bq5UkAGY0667eIs+Z1Ea6I2i27Sdo7DxGwq09Qnm/Y65ADvXs 3aBvokCcm7FsM1wky395m8xUos1681oV5oxgqeRI8/76qy0hD9WR65UW+HQgZRIcIjSel9vR XDaD2HLGPTTGr7u4v00UeTMs6qvPsa2PJagogrKY8RXdFtXvweQFz78NbXhluwix2Tb9ETPk LIpDrtzV73CaE2aqBG/KrboXT2C67BgFtnk7T7Y7iKq4/XvEdDWscz2wws91BOXuMMd4c/c4 OmGW9m3RBLufFrOag1q5yUS9QbFfyqL6dftJP3Zq/xe+mr7sbWbhPVCQFrH3r26mpmy841ym dwQnNcsbIGiBASBSKksOvIDYKa2Wy8htPmWFTEOPRpFXdGQ27awcjjnB42nngyCK5ukZDHi6 w0qK5DNQQCkiweevCIC6wc3p67jl1EMFY5+z+zdTPb3h7LeVnGqW0qBQl99vVFgzLxchKcl0 R/paSFgwqXCZhAKMuUHncJuynDOP7z5LirUeFI8qsBAJi1rXpQoLJTVcW72swZ42IdPiboqx NbTMiNOiE36GqMcTPfKylCbF45JNX4nF9ElM0E+Y8gi4cizJYBRr2FBJgay0b9Cp Message-ID: <69399f59-4eca-ee29-7230-678a02cf6eff@FreeBSD.org> Date: Tue, 8 Sep 2020 23:03:36 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Firefox/60.0 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <202008212134.07LLYq3K071532@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4BmGLN3PhFz4NP6 X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of agapon@gmail.com designates 209.85.167.65 as permitted sender) smtp.mailfrom=agapon@gmail.com X-Spamd-Result: default: False [-1.59 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17:c]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[FreeBSD.org]; NEURAL_HAM_LONG(-0.93)[-0.933]; TO_DN_SOME(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; NEURAL_HAM_MEDIUM(-0.82)[-0.820]; NEURAL_SPAM_SHORT(0.16)[0.163]; RCVD_IN_DNSWL_NONE(0.00)[209.85.167.65:from]; RECEIVED_SPAMHAUS_PBL(0.00)[93.72.151.96:received]; FORGED_SENDER(0.30)[avg@FreeBSD.org,agapon@gmail.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.167.65:from]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; MIME_TRACE(0.00)[0:+]; FROM_NEQ_ENVFROM(0.00)[avg@FreeBSD.org,agapon@gmail.com]; MAILMAN_DEST(0.00)[svn-src-head,svn-src-all] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 08 Sep 2020 20:03:41 -0000 On 22/08/2020 00:34, Alexander V. Chernikov wrote: > Author: melifaro > Date: Fri Aug 21 21:34:52 2020 > New Revision: 364465 > URL: https://svnweb.freebsd.org/changeset/base/364465 > > Log: > Make net.fibs growable. > > Allow to dynamically grow the amount of fibs in each vnet. > > This change alters current behavior. Currently, if one defines > ROUTETABLES > 1 in the kernel config, each vnet will be created > with the number of fibs defined in the kernel config. > After this commit vnets will be created with fibs=1. > > Dynamic net.fibs is not compatible with net.add_addr_allfibs. > The plan is to deprecate the latter and make > net.add_addr_allfibs=0 default behaviour. > > Reviewed by: glebius > Relnotes: yes > Differential Revision: https://reviews.freebsd.org/D26062 I wonder why no one reported a problem that I am seeing after upgrading past this revision. Maybe because I do have net.fibs=2 in my loader.conf? The problem -- unfortunately I only have a screenshot -- but it's a page fault trap in this call chain: sysctl_register_all -> sysctl_load_tunable_by_oid_locked -> sysctl_fibs -> _sx_xlock. The crash is on the RTABLES_LOCK() line. And it's kind of obvious why. The tunables, including net.fibs which is declared as RWTUN, are set at SI_SUB_TUNABLES stage, but RTABLES_LOCK_INIT() is not called until SI_SUB_PROTO_DOMAIN much later. In other words, sysctal_fibs can be called earlier than vnet_rtables_init. I think that the best way to handle the problem would be to add CTLFLAG_NOFETCH to the sysctl declaration and then to add -- if necessary at all -- an explicit query of the kenv. -- Andriy Gapon From owner-svn-src-all@freebsd.org Tue Sep 8 20:28:39 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DBA2B3D6B8D; Tue, 8 Sep 2020 20:28:39 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BmGvC5XMdz4Q6D; Tue, 8 Sep 2020 20:28: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 A15F016261; Tue, 8 Sep 2020 20:28: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 088KSdIS054360; Tue, 8 Sep 2020 20:28:39 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 088KSdWY054359; Tue, 8 Sep 2020 20:28:39 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202009082028.088KSdWY054359@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Tue, 8 Sep 2020 20:28:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365472 - in stable: 11/contrib/llvm-project/compiler-rt/lib/builtins 11/lib/libcompiler_rt 12/contrib/llvm-project/compiler-rt/lib/builtins 12/lib/libcompiler_rt X-SVN-Group: stable-12 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in stable: 11/contrib/llvm-project/compiler-rt/lib/builtins 11/lib/libcompiler_rt 12/contrib/llvm-project/compiler-rt/lib/builtins 12/lib/libcompiler_rt X-SVN-Commit-Revision: 365472 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.33 Precedence: list List-Id: "SVN commit messages 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, 08 Sep 2020 20:28:39 -0000 Author: dim Date: Tue Sep 8 20:28:39 2020 New Revision: 365472 URL: https://svnweb.freebsd.org/changeset/base/365472 Log: Revert r365471 as it is breaking with old gcc on various arches: MFC r364753: Add atomic and bswap functions to libcompiler_rt There have been several mentions on our mailing lists about missing atomic functions in our system libraries (e.g. __atomic_load_8 and friends), and recently I saw __bswapdi2 and __bswapsi2 mentioned too. To address this, add implementations for the functions from compiler-rt to the system compiler support libraries, e.g. libcompiler_rt.a and and libgcc_s.so. This also needs a small fixup in compiler-rt's atomic.c, to ensure that 32-bit mips can build correctly. Bump __FreeBSD_version to make it easier for port maintainers to detect when these functions were added. PR: 230888 Differential Revision: https://reviews.freebsd.org/D26159 MFC r364782: After r364753, there should be no need to suppress -Watomic-alignment warnings anymore for compiler-rt's atomic.c. This occurred because the IS_LOCK_FREE_8 macro was not correctly defined to 0 for mips, and this caused the compiler to emit a runtime call to __atomic_is_lock_free(), and that triggers the warning. Modified: stable/12/contrib/llvm-project/compiler-rt/lib/builtins/atomic.c stable/12/lib/libcompiler_rt/Makefile.inc Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/contrib/llvm-project/compiler-rt/lib/builtins/atomic.c stable/11/lib/libcompiler_rt/Makefile.inc Directory Properties: stable/11/ (props changed) Modified: stable/12/contrib/llvm-project/compiler-rt/lib/builtins/atomic.c ============================================================================== --- stable/12/contrib/llvm-project/compiler-rt/lib/builtins/atomic.c Tue Sep 8 20:02:08 2020 (r365471) +++ stable/12/contrib/llvm-project/compiler-rt/lib/builtins/atomic.c Tue Sep 8 20:28:39 2020 (r365472) @@ -124,8 +124,8 @@ static __inline Lock *lock_for_pointer(void *ptr) { #define IS_LOCK_FREE_2 __c11_atomic_is_lock_free(2) #define IS_LOCK_FREE_4 __c11_atomic_is_lock_free(4) -/// 32 bit MIPS and PowerPC don't support 8-byte lock_free atomics -#if defined(__mips__) || (!defined(__powerpc64__) && defined(__powerpc__)) +/// 32 bit PowerPC doesn't support 8-byte lock_free atomics +#if !defined(__powerpc64__) && defined(__powerpc__) #define IS_LOCK_FREE_8 0 #else #define IS_LOCK_FREE_8 __c11_atomic_is_lock_free(8) Modified: stable/12/lib/libcompiler_rt/Makefile.inc ============================================================================== --- stable/12/lib/libcompiler_rt/Makefile.inc Tue Sep 8 20:02:08 2020 (r365471) +++ stable/12/lib/libcompiler_rt/Makefile.inc Tue Sep 8 20:28:39 2020 (r365472) @@ -18,9 +18,6 @@ SRCF+= ashldi3 SRCF+= ashlti3 SRCF+= ashrdi3 SRCF+= ashrti3 -SRCF+= atomic -SRCF+= bswapdi2 -SRCF+= bswapsi2 SRCF+= clear_cache SRCF+= clzdi2 SRCF+= clzsi2 @@ -216,6 +213,12 @@ CFLAGS+= -DEMIT_SYNC_ATOMICS SRCF+= stdatomic .endif +.if "${COMPILER_TYPE}" == "clang" && \ + (${MACHINE_ARCH} == "powerpc" || ${MACHINE_ARCH} == "powerpcspe") +SRCS+= atomic.c +CFLAGS.atomic.c+= -Wno-atomic-alignment +.endif + .for file in ${SRCF} .if ${MACHINE_ARCH:Marmv[67]*} && (!defined(CPUTYPE) || ${CPUTYPE:M*soft*} == "") \ && exists(${CRTSRC}/${CRTARCH}/${file}vfp.S) @@ -237,9 +240,18 @@ SRCS+= aeabi_memmove.S SRCS+= aeabi_memset.S SRCS+= aeabi_uidivmod.S SRCS+= aeabi_uldivmod.S +SRCS+= bswapdi2.S +SRCS+= bswapsi2.S SRCS+= switch16.S SRCS+= switch32.S SRCS+= switch8.S SRCS+= switchu8.S SRCS+= sync_synchronize.S +.endif + +# On some archs GCC-6.3 requires bswap32 built-in. +.if ${MACHINE_CPUARCH} == "mips" || ${MACHINE_CPUARCH} == "riscv" || \ + ${MACHINE_CPUARCH} == "sparc64" +SRCS+= bswapdi2.c +SRCS+= bswapsi2.c .endif From owner-svn-src-all@freebsd.org Tue Sep 8 20:28:40 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 71D353D6B54; Tue, 8 Sep 2020 20:28:40 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BmGvD2Scnz4Q6F; Tue, 8 Sep 2020 20:28:40 +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 37B8D16262; Tue, 8 Sep 2020 20:28:40 +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 088KSevp054367; Tue, 8 Sep 2020 20:28:40 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 088KSdHL054366; Tue, 8 Sep 2020 20:28:39 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202009082028.088KSdHL054366@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Tue, 8 Sep 2020 20:28: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: r365472 - in stable: 11/contrib/llvm-project/compiler-rt/lib/builtins 11/lib/libcompiler_rt 12/contrib/llvm-project/compiler-rt/lib/builtins 12/lib/libcompiler_rt X-SVN-Group: stable-11 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in stable: 11/contrib/llvm-project/compiler-rt/lib/builtins 11/lib/libcompiler_rt 12/contrib/llvm-project/compiler-rt/lib/builtins 12/lib/libcompiler_rt X-SVN-Commit-Revision: 365472 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.33 Precedence: list List-Id: "SVN commit messages 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, 08 Sep 2020 20:28:40 -0000 Author: dim Date: Tue Sep 8 20:28:39 2020 New Revision: 365472 URL: https://svnweb.freebsd.org/changeset/base/365472 Log: Revert r365471 as it is breaking with old gcc on various arches: MFC r364753: Add atomic and bswap functions to libcompiler_rt There have been several mentions on our mailing lists about missing atomic functions in our system libraries (e.g. __atomic_load_8 and friends), and recently I saw __bswapdi2 and __bswapsi2 mentioned too. To address this, add implementations for the functions from compiler-rt to the system compiler support libraries, e.g. libcompiler_rt.a and and libgcc_s.so. This also needs a small fixup in compiler-rt's atomic.c, to ensure that 32-bit mips can build correctly. Bump __FreeBSD_version to make it easier for port maintainers to detect when these functions were added. PR: 230888 Differential Revision: https://reviews.freebsd.org/D26159 MFC r364782: After r364753, there should be no need to suppress -Watomic-alignment warnings anymore for compiler-rt's atomic.c. This occurred because the IS_LOCK_FREE_8 macro was not correctly defined to 0 for mips, and this caused the compiler to emit a runtime call to __atomic_is_lock_free(), and that triggers the warning. Modified: stable/11/contrib/llvm-project/compiler-rt/lib/builtins/atomic.c stable/11/lib/libcompiler_rt/Makefile.inc Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/contrib/llvm-project/compiler-rt/lib/builtins/atomic.c stable/12/lib/libcompiler_rt/Makefile.inc Directory Properties: stable/12/ (props changed) Modified: stable/11/contrib/llvm-project/compiler-rt/lib/builtins/atomic.c ============================================================================== --- stable/11/contrib/llvm-project/compiler-rt/lib/builtins/atomic.c Tue Sep 8 20:02:08 2020 (r365471) +++ stable/11/contrib/llvm-project/compiler-rt/lib/builtins/atomic.c Tue Sep 8 20:28:39 2020 (r365472) @@ -124,8 +124,8 @@ static __inline Lock *lock_for_pointer(void *ptr) { #define IS_LOCK_FREE_2 __c11_atomic_is_lock_free(2) #define IS_LOCK_FREE_4 __c11_atomic_is_lock_free(4) -/// 32 bit MIPS and PowerPC don't support 8-byte lock_free atomics -#if defined(__mips__) || (!defined(__powerpc64__) && defined(__powerpc__)) +/// 32 bit PowerPC doesn't support 8-byte lock_free atomics +#if !defined(__powerpc64__) && defined(__powerpc__) #define IS_LOCK_FREE_8 0 #else #define IS_LOCK_FREE_8 __c11_atomic_is_lock_free(8) Modified: stable/11/lib/libcompiler_rt/Makefile.inc ============================================================================== --- stable/11/lib/libcompiler_rt/Makefile.inc Tue Sep 8 20:02:08 2020 (r365471) +++ stable/11/lib/libcompiler_rt/Makefile.inc Tue Sep 8 20:28:39 2020 (r365472) @@ -18,9 +18,6 @@ SRCF+= ashldi3 SRCF+= ashlti3 SRCF+= ashrdi3 SRCF+= ashrti3 -SRCF+= atomic -SRCF+= bswapdi2 -SRCF+= bswapsi2 SRCF+= clear_cache SRCF+= clzdi2 SRCF+= clzsi2 @@ -218,6 +215,12 @@ CFLAGS+= -DEMIT_SYNC_ATOMICS SRCF+= stdatomic .endif +.if "${COMPILER_TYPE}" == "clang" && \ + (${MACHINE_ARCH} == "powerpc" || ${MACHINE_ARCH} == "powerpcspe") +SRCS+= atomic.c +CFLAGS.atomic.c+= -Wno-atomic-alignment +.endif + .for file in ${SRCF} .if ${MACHINE_ARCH:Marmv6*} && (!defined(CPUTYPE) || ${CPUTYPE:M*soft*} == "") \ && exists(${CRTSRC}/${CRTARCH}/${file}vfp.S) @@ -239,9 +242,18 @@ SRCS+= aeabi_memmove.S SRCS+= aeabi_memset.S SRCS+= aeabi_uidivmod.S SRCS+= aeabi_uldivmod.S +SRCS+= bswapdi2.S +SRCS+= bswapsi2.S SRCS+= switch16.S SRCS+= switch32.S SRCS+= switch8.S SRCS+= switchu8.S SRCS+= sync_synchronize.S .endif + +# GCC-6.3 on mips32 requires bswap32 built-in. +.if ${MACHINE_CPUARCH} == "mips" +SRCS+= bswapdi2.c +SRCS+= bswapsi2.c +.endif + From owner-svn-src-all@freebsd.org Tue Sep 8 20:51:29 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CC3253D7890; Tue, 8 Sep 2020 20:51:29 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BmHPY5G4Xz4RQ8; Tue, 8 Sep 2020 20:51:29 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7E5291692E; Tue, 8 Sep 2020 20:51:29 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 088KpTeo070594; Tue, 8 Sep 2020 20:51:29 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 088KpJjw069873; Tue, 8 Sep 2020 20:51:19 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202009082051.088KpJjw069873@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 8 Sep 2020 20:51:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365473 - in stable/12: lib/libc/sys share/man/man9 X-SVN-Group: stable-12 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable/12: lib/libc/sys share/man/man9 X-SVN-Commit-Revision: 365473 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.33 Precedence: list List-Id: "SVN commit messages 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, 08 Sep 2020 20:51:29 -0000 Author: jhb Date: Tue Sep 8 20:51:19 2020 New Revision: 365473 URL: https://svnweb.freebsd.org/changeset/base/365473 Log: MFC 359465: Document EINTEGRITY errors for many system calls. EINTEGRITY was previously documented as a UFS-specific error for mount(2). This documents EINTEGRITY as a filesystem-independent error that may be reported by the backing store of a filesystem. While here, document EIO as a filesystem-independent error for both mount(2) and posix_fadvise(2). EIO was previously only documented for UFS for mount(2). Modified: stable/12/lib/libc/sys/access.2 stable/12/lib/libc/sys/acct.2 stable/12/lib/libc/sys/bind.2 stable/12/lib/libc/sys/chdir.2 stable/12/lib/libc/sys/chflags.2 stable/12/lib/libc/sys/chmod.2 stable/12/lib/libc/sys/chown.2 stable/12/lib/libc/sys/chroot.2 stable/12/lib/libc/sys/execve.2 stable/12/lib/libc/sys/fhlink.2 stable/12/lib/libc/sys/fhreadlink.2 stable/12/lib/libc/sys/fsync.2 stable/12/lib/libc/sys/getdirentries.2 stable/12/lib/libc/sys/getfh.2 stable/12/lib/libc/sys/getfsstat.2 stable/12/lib/libc/sys/ktrace.2 stable/12/lib/libc/sys/link.2 stable/12/lib/libc/sys/mkdir.2 stable/12/lib/libc/sys/mkfifo.2 stable/12/lib/libc/sys/mknod.2 stable/12/lib/libc/sys/mount.2 stable/12/lib/libc/sys/open.2 stable/12/lib/libc/sys/pathconf.2 stable/12/lib/libc/sys/posix_fadvise.2 stable/12/lib/libc/sys/posix_fallocate.2 stable/12/lib/libc/sys/quotactl.2 stable/12/lib/libc/sys/read.2 stable/12/lib/libc/sys/readlink.2 stable/12/lib/libc/sys/rename.2 stable/12/lib/libc/sys/rmdir.2 stable/12/lib/libc/sys/sendfile.2 stable/12/lib/libc/sys/stat.2 stable/12/lib/libc/sys/statfs.2 stable/12/lib/libc/sys/swapon.2 stable/12/lib/libc/sys/symlink.2 stable/12/lib/libc/sys/truncate.2 stable/12/lib/libc/sys/undelete.2 stable/12/lib/libc/sys/unlink.2 stable/12/lib/libc/sys/utimensat.2 stable/12/lib/libc/sys/utimes.2 stable/12/lib/libc/sys/write.2 stable/12/share/man/man9/VOP_READDIR.9 stable/12/share/man/man9/VOP_READLINK.9 stable/12/share/man/man9/g_data.9 Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/libc/sys/access.2 ============================================================================== --- stable/12/lib/libc/sys/access.2 Tue Sep 8 20:28:39 2020 (r365472) +++ stable/12/lib/libc/sys/access.2 Tue Sep 8 20:51:19 2020 (r365473) @@ -28,7 +28,7 @@ .\" @(#)access.2 8.2 (Berkeley) 4/1/94 .\" $FreeBSD$ .\" -.Dd September 15, 2014 +.Dd March 30, 2020 .Dt ACCESS 2 .Os .Sh NAME @@ -168,6 +168,8 @@ argument points outside the process's allocated address space. .It Bq Er EIO An I/O error occurred while reading from or writing to the file system. +.It Bq Er EINTEGRITY +Corrupted data was detected while reading from the file system. .El .Pp Also, the Modified: stable/12/lib/libc/sys/acct.2 ============================================================================== --- stable/12/lib/libc/sys/acct.2 Tue Sep 8 20:28:39 2020 (r365472) +++ stable/12/lib/libc/sys/acct.2 Tue Sep 8 20:51:19 2020 (r365473) @@ -28,7 +28,7 @@ .\" @(#)acct.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd April 17, 2004 +.Dd March 30, 2020 .Dt ACCT 2 .Os .Sh NAME @@ -119,6 +119,8 @@ argument points outside the process's allocated address space. .It Bq Er EIO An I/O error occurred while reading from or writing to the file system. +.It Bq Er EINTEGRITY +Corrupted data was detected while reading from the file system. .El .Sh SEE ALSO .Xr acct 5 , Modified: stable/12/lib/libc/sys/bind.2 ============================================================================== --- stable/12/lib/libc/sys/bind.2 Tue Sep 8 20:28:39 2020 (r365472) +++ stable/12/lib/libc/sys/bind.2 Tue Sep 8 20:51:19 2020 (r365473) @@ -28,7 +28,7 @@ .\" @(#)bind.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd August 18, 2016 +.Dd March 30, 2020 .Dt BIND 2 .Os .Sh NAME @@ -122,6 +122,8 @@ A prefix component of the path name does not exist. Too many symbolic links were encountered in translating the pathname. .It Bq Er EIO An I/O error occurred while making the directory entry or allocating the inode. +.It Bq Er EINTEGRITY +Corrupted data was detected while reading from the file system. .It Bq Er EROFS The name would reside on a read-only file system. .It Bq Er EISDIR Modified: stable/12/lib/libc/sys/chdir.2 ============================================================================== --- stable/12/lib/libc/sys/chdir.2 Tue Sep 8 20:28:39 2020 (r365472) +++ stable/12/lib/libc/sys/chdir.2 Tue Sep 8 20:51:19 2020 (r365473) @@ -28,7 +28,7 @@ .\" @(#)chdir.2 8.2 (Berkeley) 12/11/93 .\" $FreeBSD$ .\" -.Dd December 1, 2017 +.Dd March 30, 2020 .Dt CHDIR 2 .Os .Sh NAME @@ -96,6 +96,8 @@ argument points outside the process's allocated address space. .It Bq Er EIO An I/O error occurred while reading from or writing to the file system. +.It Bq Er EINTEGRITY +Corrupted data was detected while reading from the file system. .El .Pp The Modified: stable/12/lib/libc/sys/chflags.2 ============================================================================== --- stable/12/lib/libc/sys/chflags.2 Tue Sep 8 20:28:39 2020 (r365472) +++ stable/12/lib/libc/sys/chflags.2 Tue Sep 8 20:51:19 2020 (r365473) @@ -28,7 +28,7 @@ .\" @(#)chflags.2 8.3 (Berkeley) 5/2/95 .\" $FreeBSD$ .\" -.Dd March 22, 2013 +.Dd March 30, 2020 .Dt CHFLAGS 2 .Os .Sh NAME @@ -256,6 +256,8 @@ points outside the process's allocated address space. An .Tn I/O error occurred while reading from or writing to the file system. +.It Bq Er EINTEGRITY +Corrupted data was detected while reading from the file system. .It Bq Er EOPNOTSUPP The underlying file system does not support file flags, or does not support all of the flags set in @@ -298,6 +300,8 @@ The file resides on a read-only file system. An .Tn I/O error occurred while reading from or writing to the file system. +.It Bq Er EINTEGRITY +Corrupted data was detected while reading from the file system. .It Bq Er EOPNOTSUPP The underlying file system does not support file flags, or does not support all of the flags set in Modified: stable/12/lib/libc/sys/chmod.2 ============================================================================== --- stable/12/lib/libc/sys/chmod.2 Tue Sep 8 20:28:39 2020 (r365472) +++ stable/12/lib/libc/sys/chmod.2 Tue Sep 8 20:51:19 2020 (r365473) @@ -28,7 +28,7 @@ .\" @(#)chmod.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd December 1, 2017 +.Dd March 30, 2020 .Dt CHMOD 2 .Os .Sh NAME @@ -236,6 +236,8 @@ argument points outside the process's allocated address space. .It Bq Er EIO An I/O error occurred while reading from or writing to the file system. +.It Bq Er EINTEGRITY +Corrupted data was detected while reading from the file system. .It Bq Er EFTYPE The effective user ID is not the super-user, the mode includes the sticky bit .Dv ( S_ISVTX ) , @@ -257,6 +259,8 @@ refers to a socket, not to a file. The file resides on a read-only file system. .It Bq Er EIO An I/O error occurred while reading from or writing to the file system. +.It Bq Er EINTEGRITY +Corrupted data was detected while reading from the file system. .El .Pp In addition to the Modified: stable/12/lib/libc/sys/chown.2 ============================================================================== --- stable/12/lib/libc/sys/chown.2 Tue Sep 8 20:28:39 2020 (r365472) +++ stable/12/lib/libc/sys/chown.2 Tue Sep 8 20:51:19 2020 (r365473) @@ -28,7 +28,7 @@ .\" @(#)chown.2 8.4 (Berkeley) 4/19/94 .\" $FreeBSD$ .\" -.Dd December 1, 2017 +.Dd March 30, 2020 .Dt CHOWN 2 .Os .Sh NAME @@ -175,6 +175,8 @@ argument points outside the process's allocated address space. .It Bq Er EIO An I/O error occurred while reading from or writing to the file system. +.It Bq Er EINTEGRITY +Corrupted data was detected while reading from the file system. .El .Pp The @@ -197,6 +199,8 @@ The effective user ID is not the super-user. The named file resides on a read-only file system. .It Bq Er EIO An I/O error occurred while reading from or writing to the file system. +.It Bq Er EINTEGRITY +Corrupted data was detected while reading from the file system. .El .Pp In addition to the errors specified for Modified: stable/12/lib/libc/sys/chroot.2 ============================================================================== --- stable/12/lib/libc/sys/chroot.2 Tue Sep 8 20:28:39 2020 (r365472) +++ stable/12/lib/libc/sys/chroot.2 Tue Sep 8 20:51:19 2020 (r365473) @@ -28,7 +28,7 @@ .\" @(#)chroot.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd January 3, 2012 +.Dd March 30, 2020 .Dt CHROOT 2 .Os .Sh NAME @@ -121,6 +121,8 @@ argument points outside the process's allocated address space. .It Bq Er EIO An I/O error occurred while reading from or writing to the file system. +.It Bq Er EINTEGRITY +Corrupted data was detected while reading from the file system. .El .Sh SEE ALSO .Xr chdir 2 , Modified: stable/12/lib/libc/sys/execve.2 ============================================================================== --- stable/12/lib/libc/sys/execve.2 Tue Sep 8 20:28:39 2020 (r365472) +++ stable/12/lib/libc/sys/execve.2 Tue Sep 8 20:51:19 2020 (r365473) @@ -28,7 +28,7 @@ .\" @(#)execve.2 8.5 (Berkeley) 6/1/94 .\" $FreeBSD$ .\" -.Dd September 21, 2010 +.Dd March 30, 2020 .Dt EXECVE 2 .Os .Sh NAME @@ -304,6 +304,8 @@ point to an illegal address. .It Bq Er EIO An I/O error occurred while reading from the file system. +.It Bq Er EINTEGRITY +Corrupted data was detected while reading from the file system. .El .Pp In addition, the Modified: stable/12/lib/libc/sys/fhlink.2 ============================================================================== --- stable/12/lib/libc/sys/fhlink.2 Tue Sep 8 20:28:39 2020 (r365472) +++ stable/12/lib/libc/sys/fhlink.2 Tue Sep 8 20:51:19 2020 (r365473) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 29, 2018 +.Dd March 30, 2020 .Dt FHLINK 2 .Os .Sh NAME @@ -219,6 +219,8 @@ containing the directory has been exhausted. .It Bq Er EIO An I/O error occurred while reading from or writing to the file system to make the directory entry. +.It Bq Er EINTEGRITY +Corrupted data was detected while reading from the file system. .It Bq Er EROFS The requested link requires writing in a directory on a read-only file system. Modified: stable/12/lib/libc/sys/fhreadlink.2 ============================================================================== --- stable/12/lib/libc/sys/fhreadlink.2 Tue Sep 8 20:28:39 2020 (r365472) +++ stable/12/lib/libc/sys/fhreadlink.2 Tue Sep 8 20:51:19 2020 (r365473) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 29, 2018 +.Dd March 30, 2020 .Dt FHREADLINK 2 .Os .Sh NAME @@ -76,6 +76,8 @@ Too many symbolic links were encountered in translatin The named file is not a symbolic link. .It Bq Er EIO An I/O error occurred while reading from the file system. +.It Bq Er EINTEGRITY +Corrupted data was detected while reading from the file system. .It Bq Er EFAULT The .Fa buf Modified: stable/12/lib/libc/sys/fsync.2 ============================================================================== --- stable/12/lib/libc/sys/fsync.2 Tue Sep 8 20:28:39 2020 (r365472) +++ stable/12/lib/libc/sys/fsync.2 Tue Sep 8 20:51:19 2020 (r365473) @@ -34,7 +34,7 @@ .\" @(#)fsync.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd February 6, 2018 +.Dd March 30, 2020 .Dt FSYNC 2 .Os .Sh NAME @@ -107,6 +107,8 @@ argument refers to a socket, not to a file. .It Bq Er EIO An I/O error occurred while reading from or writing to the file system. +.It Bq Er EINTEGRITY +Corrupted data was detected while reading from the file system. .El .Sh SEE ALSO .Xr fsync 1 , Modified: stable/12/lib/libc/sys/getdirentries.2 ============================================================================== --- stable/12/lib/libc/sys/getdirentries.2 Tue Sep 8 20:28:39 2020 (r365472) +++ stable/12/lib/libc/sys/getdirentries.2 Tue Sep 8 20:51:19 2020 (r365473) @@ -28,7 +28,7 @@ .\" @(#)getdirentries.2 8.2 (Berkeley) 5/3/95 .\" $FreeBSD$ .\" -.Dd Nov 14, 2018 +.Dd March 30, 2020 .Dt GETDIRENTRIES 2 .Os .Sh NAME @@ -189,6 +189,8 @@ or the current position pointer is invalid. An .Tn I/O error occurred while reading from or writing to the file system. +.It Bq Er EINTEGRITY +Corrupted data was detected while reading from the file system. .El .Sh SEE ALSO .Xr lseek 2 , Modified: stable/12/lib/libc/sys/getfh.2 ============================================================================== --- stable/12/lib/libc/sys/getfh.2 Tue Sep 8 20:28:39 2020 (r365472) +++ stable/12/lib/libc/sys/getfh.2 Tue Sep 8 20:51:19 2020 (r365473) @@ -29,7 +29,7 @@ .\" @(#)getfh.2 8.1 (Berkeley) 6/9/93 .\" $FreeBSD$ .\" -.Dd December 11, 2018 +.Dd March 30, 2020 .Dt GETFH 2 .Os .Sh NAME @@ -192,6 +192,8 @@ points to an invalid address. An .Tn I/O error occurred while reading from or writing to the file system. +.It Bq Er EINTEGRITY +Corrupted data was detected while reading from the file system. .It Bq Er ESTALE The file handle .Fa fhp Modified: stable/12/lib/libc/sys/getfsstat.2 ============================================================================== --- stable/12/lib/libc/sys/getfsstat.2 Tue Sep 8 20:28:39 2020 (r365472) +++ stable/12/lib/libc/sys/getfsstat.2 Tue Sep 8 20:51:19 2020 (r365473) @@ -28,7 +28,7 @@ .\" @(#)getfsstat.2 8.3 (Berkeley) 5/25/95 .\" $FreeBSD$ .\" -.Dd December 27, 2016 +.Dd March 30, 2020 .Dt GETFSSTAT 2 .Os .Sh NAME @@ -118,6 +118,8 @@ or An .Tn I/O error occurred while reading from or writing to the file system. +.It Bq Er EINTEGRITY +Corrupted data was detected while reading from the file system. .El .Sh SEE ALSO .Xr statfs 2 , Modified: stable/12/lib/libc/sys/ktrace.2 ============================================================================== --- stable/12/lib/libc/sys/ktrace.2 Tue Sep 8 20:28:39 2020 (r365472) +++ stable/12/lib/libc/sys/ktrace.2 Tue Sep 8 20:51:19 2020 (r365473) @@ -28,7 +28,7 @@ .\" @(#)ktrace.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd March 31, 2016 +.Dd March 30, 2020 .Dt KTRACE 2 .Os .Sh NAME @@ -177,6 +177,8 @@ Search permission is denied for a component of the pat Too many symbolic links were encountered in translating the pathname. .It Bq Er EIO An I/O error occurred while reading from or writing to the file system. +.It Bq Er EINTEGRITY +Corrupted data was detected while reading from the file system. .It Bq Er ENOSYS The kernel was not compiled with .Nm Modified: stable/12/lib/libc/sys/link.2 ============================================================================== --- stable/12/lib/libc/sys/link.2 Tue Sep 8 20:28:39 2020 (r365472) +++ stable/12/lib/libc/sys/link.2 Tue Sep 8 20:51:19 2020 (r365473) @@ -28,7 +28,7 @@ .\" @(#)link.2 8.3 (Berkeley) 1/12/94 .\" $FreeBSD$ .\" -.Dd December 1, 2017 +.Dd March 30, 2020 .Dt LINK 2 .Os .Sh NAME @@ -215,6 +215,8 @@ containing the directory has been exhausted. .It Bq Er EIO An I/O error occurred while reading from or writing to the file system to make the directory entry. +.It Bq Er EINTEGRITY +Corrupted data was detected while reading from the file system. .It Bq Er EROFS The requested link requires writing in a directory on a read-only file system. Modified: stable/12/lib/libc/sys/mkdir.2 ============================================================================== --- stable/12/lib/libc/sys/mkdir.2 Tue Sep 8 20:28:39 2020 (r365472) +++ stable/12/lib/libc/sys/mkdir.2 Tue Sep 8 20:51:19 2020 (r365473) @@ -28,7 +28,7 @@ .\" @(#)mkdir.2 8.2 (Berkeley) 12/11/93 .\" $FreeBSD$ .\" -.Dd June 26, 2008 +.Dd March 30, 2020 .Dt MKDIR 2 .Os .Sh NAME @@ -126,6 +126,8 @@ which the directory is being created has been exhauste An I/O error occurred while making the directory entry or allocating the inode. .It Bq Er EIO An I/O error occurred while reading from or writing to the file system. +.It Bq Er EINTEGRITY +Corrupted data was detected while reading from the file system. .It Bq Er EFAULT The .Fa path Modified: stable/12/lib/libc/sys/mkfifo.2 ============================================================================== --- stable/12/lib/libc/sys/mkfifo.2 Tue Sep 8 20:28:39 2020 (r365472) +++ stable/12/lib/libc/sys/mkfifo.2 Tue Sep 8 20:51:19 2020 (r365473) @@ -28,7 +28,7 @@ .\" @(#)mkfifo.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd April 10, 2008 +.Dd March 30, 2020 .Dt MKFIFO 2 .Os .Sh NAME @@ -134,6 +134,8 @@ error occurred while making the directory entry or all An .Tn I/O error occurred while reading from or writing to the file system. +.It Bq Er EINTEGRITY +Corrupted data was detected while reading from the file system. .It Bq Er EFAULT The .Fa path Modified: stable/12/lib/libc/sys/mknod.2 ============================================================================== --- stable/12/lib/libc/sys/mknod.2 Tue Sep 8 20:28:39 2020 (r365472) +++ stable/12/lib/libc/sys/mknod.2 Tue Sep 8 20:51:19 2020 (r365473) @@ -28,7 +28,7 @@ .\" @(#)mknod.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd December 1, 2017 +.Dd March 30, 2020 .Dt MKNOD 2 .Os .Sh NAME @@ -108,6 +108,8 @@ Too many symbolic links were encountered in translatin The process's effective user ID is not super-user. .It Bq Er EIO An I/O error occurred while making the directory entry or allocating the inode. +.It Bq Er EINTEGRITY +Corrupted data was detected while reading from the file system. .It Bq Er ENOSPC The directory in which the entry for the new node is being placed cannot be extended because there is no space left on the file Modified: stable/12/lib/libc/sys/mount.2 ============================================================================== --- stable/12/lib/libc/sys/mount.2 Tue Sep 8 20:28:39 2020 (r365472) +++ stable/12/lib/libc/sys/mount.2 Tue Sep 8 20:51:19 2020 (r365473) @@ -28,7 +28,7 @@ .\" @(#)mount.2 8.3 (Berkeley) 5/24/95 .\" $FreeBSD$ .\" -.Dd December 1, 2017 +.Dd March 30, 2020 .Dt MOUNT 2 .Os .Sh NAME @@ -265,6 +265,13 @@ The .Fa dir argument points outside the process's allocated address space. +.It Bq Er EIO +An I/O error occurred while reading data from +.Fa special . +.It Bq Er EINTEGRITY +The backing store for +.Fa special +detected corrupted data while reading. .El .Pp The following errors can occur for a Modified: stable/12/lib/libc/sys/open.2 ============================================================================== --- stable/12/lib/libc/sys/open.2 Tue Sep 8 20:28:39 2020 (r365472) +++ stable/12/lib/libc/sys/open.2 Tue Sep 8 20:51:19 2020 (r365473) @@ -28,7 +28,7 @@ .\" @(#)open.2 8.2 (Berkeley) 11/16/93 .\" $FreeBSD$ .\" -.Dd February 9, 2020 +.Dd March 30, 2020 .Dt OPEN 2 .Os .Sh NAME @@ -450,6 +450,8 @@ which the file is being created has been exhausted. An I/O error occurred while making the directory entry or allocating the inode for .Dv O_CREAT . +.It Bq Er EINTEGRITY +Corrupted data was detected while reading from the file system. .It Bq Er ETXTBSY The file is a pure procedure (shared text) file that is being executed and the Modified: stable/12/lib/libc/sys/pathconf.2 ============================================================================== --- stable/12/lib/libc/sys/pathconf.2 Tue Sep 8 20:28:39 2020 (r365472) +++ stable/12/lib/libc/sys/pathconf.2 Tue Sep 8 20:51:19 2020 (r365473) @@ -28,7 +28,7 @@ .\" @(#)pathconf.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd July 7, 2009 +.Dd March 30, 2020 .Dt PATHCONF 2 .Os .Sh NAME @@ -230,6 +230,8 @@ Search permission is denied for a component of the pat Too many symbolic links were encountered in translating the pathname. .It Bq Er EIO An I/O error occurred while reading from or writing to the file system. +.It Bq Er EINTEGRITY +Corrupted data was detected while reading from the file system. .El .Pp The @@ -244,6 +246,8 @@ argument is not a valid open file descriptor. .It Bq Er EIO An I/O error occurred while reading from or writing to the file system. +.It Bq Er EINTEGRITY +Corrupted data was detected while reading from the file system. .El .Sh SEE ALSO .Xr lseek 2 , Modified: stable/12/lib/libc/sys/posix_fadvise.2 ============================================================================== --- stable/12/lib/libc/sys/posix_fadvise.2 Tue Sep 8 20:28:39 2020 (r365472) +++ stable/12/lib/libc/sys/posix_fadvise.2 Tue Sep 8 20:51:19 2020 (r365473) @@ -28,7 +28,7 @@ .\" @(#)madvise.2 8.1 (Berkeley) 6/9/93 .\" $FreeBSD$ .\" -.Dd October 3, 2015 +.Dd March 30, 2020 .Dt POSIX_FADVISE 2 .Os .Sh NAME @@ -124,6 +124,10 @@ argument does not refer to a regular file. The .Fa fd argument is associated with a pipe or FIFO. +.It Bq Er EIO +An I/O error occurred while reading from or writing to a file system. +.It Bq Er EINTEGRITY +Corrupted data was detected while reading from the file system. .El .Sh SEE ALSO .Xr madvise 2 Modified: stable/12/lib/libc/sys/posix_fallocate.2 ============================================================================== --- stable/12/lib/libc/sys/posix_fallocate.2 Tue Sep 8 20:28:39 2020 (r365472) +++ stable/12/lib/libc/sys/posix_fallocate.2 Tue Sep 8 20:51:19 2020 (r365473) @@ -28,7 +28,7 @@ .\" @(#)open.2 8.2 (Berkeley) 11/16/93 .\" $FreeBSD$ .\" -.Dd November 4, 2017 +.Dd March 30, 2020 .Dt POSIX_FALLOCATE 2 .Os .Sh NAME @@ -112,6 +112,8 @@ argument was less than zero, or the operation is not supported by the file system. .It Bq Er EIO An I/O error occurred while reading from or writing to a file system. +.It Bq Er EINTEGRITY +Corrupted data was detected while reading from the file system. .It Bq Er ENODEV The .Fa fd Modified: stable/12/lib/libc/sys/quotactl.2 ============================================================================== --- stable/12/lib/libc/sys/quotactl.2 Tue Sep 8 20:28:39 2020 (r365472) +++ stable/12/lib/libc/sys/quotactl.2 Tue Sep 8 20:51:19 2020 (r365473) @@ -31,7 +31,7 @@ .\" @(#)quotactl.2 8.2 (Berkeley) 3/10/95 .\" $FreeBSD$ .\" -.Dd March 5, 1999 +.Dd March 30, 2020 .Dt QUOTACTL 2 .Os .Sh NAME @@ -228,6 +228,8 @@ An .Tn I/O error occurred while reading from or writing to a file containing quotas. +.It Bq Er EINTEGRITY +Corrupted data was detected while reading from the file system. .It Bq Er EFAULT An invalid .Fa addr Modified: stable/12/lib/libc/sys/read.2 ============================================================================== --- stable/12/lib/libc/sys/read.2 Tue Sep 8 20:28:39 2020 (r365472) +++ stable/12/lib/libc/sys/read.2 Tue Sep 8 20:51:19 2020 (r365473) @@ -28,7 +28,7 @@ .\" @(#)read.2 8.4 (Berkeley) 2/26/94 .\" $FreeBSD$ .\" -.Dd July 8, 2020 +.Dd March 30, 2020 .Dt READ 2 .Os .Sh NAME @@ -182,6 +182,8 @@ argument points outside the allocated address space. .It Bq Er EIO An I/O error occurred while reading from the file system. +.It Bq Er EINTEGRITY +Corrupted data was detected while reading from the file system. .It Bq Er EBUSY Failed to read from a file, e.g. /proc//regs while is not stopped .It Bq Er EINTR Modified: stable/12/lib/libc/sys/readlink.2 ============================================================================== --- stable/12/lib/libc/sys/readlink.2 Tue Sep 8 20:28:39 2020 (r365472) +++ stable/12/lib/libc/sys/readlink.2 Tue Sep 8 20:51:19 2020 (r365473) @@ -28,7 +28,7 @@ .\" @(#)readlink.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd April 10, 2008 +.Dd March 30, 2020 .Dt READLINK 2 .Os .Sh NAME @@ -108,6 +108,8 @@ Too many symbolic links were encountered in translatin The named file is not a symbolic link. .It Bq Er EIO An I/O error occurred while reading from the file system. +.It Bq Er EINTEGRITY +Corrupted data was detected while reading from the file system. .It Bq Er EFAULT The .Fa buf Modified: stable/12/lib/libc/sys/rename.2 ============================================================================== --- stable/12/lib/libc/sys/rename.2 Tue Sep 8 20:28:39 2020 (r365472) +++ stable/12/lib/libc/sys/rename.2 Tue Sep 8 20:51:19 2020 (r365473) @@ -28,7 +28,7 @@ .\" @(#)rename.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd June 21, 2018 +.Dd March 30, 2020 .Dt RENAME 2 .Os .Sh NAME @@ -240,6 +240,8 @@ user's quota of disk blocks on the file system containing the directory has been exhausted. .It Bq Er EIO An I/O error occurred while making or updating a directory entry. +.It Bq Er EINTEGRITY +Corrupted data was detected while reading from the file system. .It Bq Er EROFS The requested link requires writing in a directory on a read-only file system. Modified: stable/12/lib/libc/sys/rmdir.2 ============================================================================== --- stable/12/lib/libc/sys/rmdir.2 Tue Sep 8 20:28:39 2020 (r365472) +++ stable/12/lib/libc/sys/rmdir.2 Tue Sep 8 20:51:19 2020 (r365473) @@ -28,7 +28,7 @@ .\" @(#)rmdir.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd December 9, 2006 +.Dd March 30, 2020 .Dt RMDIR 2 .Os .Sh NAME @@ -100,6 +100,8 @@ for a mounted file system. .It Bq Er EIO An I/O error occurred while deleting the directory entry or deallocating the inode. +.It Bq Er EINTEGRITY +Corrupted data was detected while reading from the file system. .It Bq Er EROFS The directory entry to be removed resides on a read-only file system. .It Bq Er EFAULT Modified: stable/12/lib/libc/sys/sendfile.2 ============================================================================== --- stable/12/lib/libc/sys/sendfile.2 Tue Sep 8 20:28:39 2020 (r365472) +++ stable/12/lib/libc/sys/sendfile.2 Tue Sep 8 20:51:19 2020 (r365473) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 25, 2019 +.Dd March 30, 2020 .Dt SENDFILE 2 .Os .Sh NAME @@ -335,6 +335,9 @@ argument is negative. .It Bq Er EIO An error occurred while reading from +.Fa fd . +.It Bq Er EINTEGRITY +Corrupted data was detected while reading from .Fa fd . .It Bq Er ENOTCAPABLE The Modified: stable/12/lib/libc/sys/stat.2 ============================================================================== --- stable/12/lib/libc/sys/stat.2 Tue Sep 8 20:28:39 2020 (r365472) +++ stable/12/lib/libc/sys/stat.2 Tue Sep 8 20:51:19 2020 (r365473) @@ -28,7 +28,7 @@ .\" @(#)stat.2 8.4 (Berkeley) 5/1/95 .\" $FreeBSD$ .\" -.Dd December 5, 2018 +.Dd March 30, 2020 .Dt STAT 2 .Os .Sh NAME @@ -342,6 +342,8 @@ argument points to an invalid address. .It Bq Er EIO An I/O error occurred while reading from or writing to the file system. +.It Bq Er EINTEGRITY +Corrupted data was detected while reading from the file system. .It Bq Er ELOOP Too many symbolic links were encountered in translating the pathname. .It Bq Er ENAMETOOLONG @@ -373,6 +375,8 @@ argument points to an invalid address. .It Bq Er EIO An I/O error occurred while reading from or writing to the file system. +.It Bq Er EINTEGRITY +Corrupted data was detected while reading from the file system. .It Bq Er EOVERFLOW The file size in bytes cannot be represented correctly in the structure pointed to by Modified: stable/12/lib/libc/sys/statfs.2 ============================================================================== --- stable/12/lib/libc/sys/statfs.2 Tue Sep 8 20:28:39 2020 (r365472) +++ stable/12/lib/libc/sys/statfs.2 Tue Sep 8 20:51:19 2020 (r365473) @@ -28,7 +28,7 @@ .\" @(#)statfs.2 8.5 (Berkeley) 5/24/95 .\" $FreeBSD$ .\" -.Dd February 13, 2017 +.Dd March 30, 2020 .Dt STATFS 2 .Os .Sh NAME @@ -204,6 +204,8 @@ points to an invalid address. An .Tn I/O error occurred while reading from or writing to the file system. +.It Bq Er EINTEGRITY +Corrupted data was detected while reading from the file system. .El .Pp The @@ -225,6 +227,8 @@ points to an invalid address. An .Tn I/O error occurred while reading from or writing to the file system. +.It Bq Er EINTEGRITY +Corrupted data was detected while reading from the file system. .El .Sh SEE ALSO .Xr fhstatfs 2 , Modified: stable/12/lib/libc/sys/swapon.2 ============================================================================== --- stable/12/lib/libc/sys/swapon.2 Tue Sep 8 20:28:39 2020 (r365472) +++ stable/12/lib/libc/sys/swapon.2 Tue Sep 8 20:51:19 2020 (r365473) @@ -28,7 +28,7 @@ .\" @(#)swapon.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd October 4, 2013 +.Dd March 30, 2020 .Dt SWAPON 2 .Os .Sh NAME @@ -115,6 +115,9 @@ is out of range (this indicates no device driver exist for the associated hardware). .It Bq Er EIO An I/O error occurred while opening the swap device. +.It Bq Er EINTEGRITY +Corrupted data was detected while reading from the file system to open the +swap device. .El .Pp Lastly, Modified: stable/12/lib/libc/sys/symlink.2 ============================================================================== --- stable/12/lib/libc/sys/symlink.2 Tue Sep 8 20:28:39 2020 (r365472) +++ stable/12/lib/libc/sys/symlink.2 Tue Sep 8 20:51:19 2020 (r365473) @@ -28,7 +28,7 @@ .\" @(#)symlink.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd April 10, 2008 +.Dd March 30, 2020 .Dt SYMLINK 2 .Os .Sh NAME @@ -151,6 +151,8 @@ The user's quota of inodes on the file system on which the symbolic link is being created has been exhausted. .It Bq Er EIO An I/O error occurred while making the directory entry or allocating the inode. +.It Bq Er EINTEGRITY +Corrupted data was detected while reading from the file system. .It Bq Er EFAULT The .Fa name1 Modified: stable/12/lib/libc/sys/truncate.2 ============================================================================== --- stable/12/lib/libc/sys/truncate.2 Tue Sep 8 20:28:39 2020 (r365472) +++ stable/12/lib/libc/sys/truncate.2 Tue Sep 8 20:51:19 2020 (r365473) @@ -28,7 +28,7 @@ .\" @(#)truncate.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd May 4, 2015 +.Dd March 30, 2020 .Dt TRUNCATE 2 .Os .Sh NAME @@ -117,6 +117,8 @@ The argument was less than 0. .It Bq Er EIO An I/O error occurred updating the inode. +.It Bq Er EINTEGRITY +Corrupted data was detected while reading from the file system. .It Bq Er EFAULT The .Fa path Modified: stable/12/lib/libc/sys/undelete.2 ============================================================================== --- stable/12/lib/libc/sys/undelete.2 Tue Sep 8 20:28:39 2020 (r365472) +++ stable/12/lib/libc/sys/undelete.2 Tue Sep 8 20:51:19 2020 (r365473) @@ -29,7 +29,7 @@ .\" @(#)undelete.2 8.4 (Berkeley) 10/18/94 .\" $FreeBSD$ .\" -.Dd January 22, 2006 +.Dd March 30, 2020 .Dt UNDELETE 2 .Os .Sh NAME @@ -87,6 +87,8 @@ The last component of the path is .Ql .. . .It Bq Er EIO An I/O error occurred while updating the directory entry. +.It Bq Er EINTEGRITY +Corrupted data was detected while reading from the file system. .It Bq Er EROFS The name resides on a read-only file system. .It Bq Er EFAULT Modified: stable/12/lib/libc/sys/unlink.2 ============================================================================== --- stable/12/lib/libc/sys/unlink.2 Tue Sep 8 20:28:39 2020 (r365472) +++ stable/12/lib/libc/sys/unlink.2 Tue Sep 8 20:51:19 2020 (r365473) @@ -28,7 +28,7 @@ .\" @(#)unlink.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd December 1, 2017 +.Dd March 30, 2020 .Dt UNLINK 2 .Os .Sh NAME @@ -144,6 +144,8 @@ are owned by the effective user ID. .It Bq Er EIO An I/O error occurred while deleting the directory entry or deallocating the inode. +.It Bq Er EINTEGRITY +Corrupted data was detected while reading from the file system. .It Bq Er EROFS The named file resides on a read-only file system. .It Bq Er EFAULT Modified: stable/12/lib/libc/sys/utimensat.2 ============================================================================== --- stable/12/lib/libc/sys/utimensat.2 Tue Sep 8 20:28:39 2020 (r365472) +++ stable/12/lib/libc/sys/utimensat.2 Tue Sep 8 20:51:19 2020 (r365473) @@ -31,7 +31,7 @@ .\" @(#)utimes.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd June 7, 2017 +.Dd March 30, 2020 .Dt UTIMENSAT 2 .Os .Sh NAME @@ -192,6 +192,8 @@ or .Dv UTIME_OMIT . .It Bq Er EIO An I/O error occurred while reading or writing the affected inode. +.It Bq Er EINTEGRITY +Corrupted data was detected while reading from the file system. .It Bq Er EPERM The .Fa times Modified: stable/12/lib/libc/sys/utimes.2 ============================================================================== --- stable/12/lib/libc/sys/utimes.2 Tue Sep 8 20:28:39 2020 (r365472) +++ stable/12/lib/libc/sys/utimes.2 Tue Sep 8 20:51:19 2020 (r365473) @@ -30,7 +30,7 @@ .\" @(#)utimes.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd June 9, 2016 +.Dd March 30, 2020 .Dt UTIMES 2 .Os .Sh NAME @@ -165,6 +165,8 @@ component of at least one of the values specified by t argument has a value less than 0 or greater than 999999. .It Bq Er EIO An I/O error occurred while reading or writing the affected inode. +.It Bq Er EINTEGRITY +Corrupted data was detected while reading from the file system. .It Bq Er ELOOP Too many symbolic links were encountered in translating the pathname. .It Bq Er ENAMETOOLONG Modified: stable/12/lib/libc/sys/write.2 ============================================================================== --- stable/12/lib/libc/sys/write.2 Tue Sep 8 20:28:39 2020 (r365472) +++ stable/12/lib/libc/sys/write.2 Tue Sep 8 20:51:19 2020 (r365473) @@ -28,7 +28,7 @@ .\" @(#)write.2 8.5 (Berkeley) 4/2/94 .\" $FreeBSD$ .\" -.Dd December 1, 2017 +.Dd March 30, 2020 .Dt WRITE 2 .Os .Sh NAME @@ -205,6 +205,12 @@ is greater than if the sysctl .Va debug.iosize_max_clamp is non-zero). +.It Bq Er EINTEGRITY +The backing store for +.Fa fd +detected corrupted data while reading. +(For example, writing a partial filesystem block may require first reading +the existing block which may trigger this error.) .El .Pp In addition, Modified: stable/12/share/man/man9/VOP_READDIR.9 ============================================================================== --- stable/12/share/man/man9/VOP_READDIR.9 Tue Sep 8 20:28:39 2020 (r365472) +++ stable/12/share/man/man9/VOP_READDIR.9 Tue Sep 8 20:51:19 2020 (r365473) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 24, 1996 +.Dd March 30, 2020 .Dt VOP_READDIR 9 .Os .Sh NAME @@ -100,6 +100,8 @@ Memory for the cookies should be allocated using: An attempt was made to read from an illegal offset in the directory. .It Bq Er EIO A read error occurred while reading the directory. +.It Bq Er EINTEGRITY +Corrupted data was detected while reading the directory. .El .Sh SEE ALSO .Xr vnode 9 Modified: stable/12/share/man/man9/VOP_READLINK.9 ============================================================================== --- stable/12/share/man/man9/VOP_READLINK.9 Tue Sep 8 20:28:39 2020 (r365472) +++ stable/12/share/man/man9/VOP_READLINK.9 Tue Sep 8 20:51:19 2020 (r365473) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 24, 1996 +.Dd March 30, 2020 .Dt VOP_READLINK 9 .Os .Sh NAME @@ -58,6 +58,8 @@ Zero is returned on success, otherwise an error code i .Bl -tag -width Er .It Bq Er EIO A read error occurred while reading the contents of the symlink. +.It Bq Er EINTEGRITY +Corrupted data was detected while reading the contents of the symlink. .El .Sh SEE ALSO .Xr uiomove 9 , Modified: stable/12/share/man/man9/g_data.9 ============================================================================== --- stable/12/share/man/man9/g_data.9 Tue Sep 8 20:28:39 2020 (r365472) +++ stable/12/share/man/man9/g_data.9 Tue Sep 8 20:51:19 2020 (r365473) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 16, 2004 +.Dd March 30, 2020 .Dt G_DATA 9 .Os .Sh NAME @@ -103,6 +103,8 @@ Possible errors: .Bl -tag -width Er .It Bq Er EIO An I/O error occurred while reading from or writing to the consumer. +.It Bq Er EINTEGRITY +Corrupted data was detected while reading from the consumer. .El .Sh SEE ALSO .Xr geom 4 , From owner-svn-src-all@freebsd.org Tue Sep 8 20:53:45 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 843803D7832; Tue, 8 Sep 2020 20:53:45 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BmHS930MDz4S0H; Tue, 8 Sep 2020 20:53:45 +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 4A03B168C6; Tue, 8 Sep 2020 20:53:45 +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 088Krjjp072453; Tue, 8 Sep 2020 20:53:45 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 088Krivl072451; Tue, 8 Sep 2020 20:53:44 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202009082053.088Krivl072451@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 8 Sep 2020 20:53:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365474 - in stable: 11/lib/libc/sys 12/lib/libc/sys X-SVN-Group: stable-12 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable: 11/lib/libc/sys 12/lib/libc/sys X-SVN-Commit-Revision: 365474 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.33 Precedence: list List-Id: "SVN commit messages 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, 08 Sep 2020 20:53:45 -0000 Author: jhb Date: Tue Sep 8 20:53:44 2020 New Revision: 365474 URL: https://svnweb.freebsd.org/changeset/base/365474 Log: MFC 359467: Trim some duplicate EIO descriptions. While here, drop an extra conjunction from the list of error conditions for the remaining EIO description in symlink(2). Modified: stable/12/lib/libc/sys/mkfifo.2 stable/12/lib/libc/sys/symlink.2 Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/lib/libc/sys/mkfifo.2 stable/11/lib/libc/sys/symlink.2 Directory Properties: stable/11/ (props changed) Modified: stable/12/lib/libc/sys/mkfifo.2 ============================================================================== --- stable/12/lib/libc/sys/mkfifo.2 Tue Sep 8 20:51:19 2020 (r365473) +++ stable/12/lib/libc/sys/mkfifo.2 Tue Sep 8 20:53:44 2020 (r365474) @@ -130,10 +130,6 @@ which the fifo is being created has been exhausted. An .Tn I/O error occurred while making the directory entry or allocating the inode. -.It Bq Er EIO -An -.Tn I/O -error occurred while reading from or writing to the file system. .It Bq Er EINTEGRITY Corrupted data was detected while reading from the file system. .It Bq Er EFAULT Modified: stable/12/lib/libc/sys/symlink.2 ============================================================================== --- stable/12/lib/libc/sys/symlink.2 Tue Sep 8 20:51:19 2020 (r365473) +++ stable/12/lib/libc/sys/symlink.2 Tue Sep 8 20:53:44 2020 (r365474) @@ -118,7 +118,7 @@ manual page for more information. .It Bq Er EIO An I/O error occurred while making the directory entry for .Fa name2 , -or allocating the inode for +allocating the inode for .Fa name2 , or writing out the link contents of .Fa name2 . @@ -149,8 +149,6 @@ contain the symbolic link has been exhausted. .It Bq Er EDQUOT The user's quota of inodes on the file system on which the symbolic link is being created has been exhausted. -.It Bq Er EIO -An I/O error occurred while making the directory entry or allocating the inode. .It Bq Er EINTEGRITY Corrupted data was detected while reading from the file system. .It Bq Er EFAULT From owner-svn-src-all@freebsd.org Tue Sep 8 20:53:46 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 10FB63D7A08; Tue, 8 Sep 2020 20:53:46 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BmHS96m4Rz4S2c; Tue, 8 Sep 2020 20:53:45 +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 CB1E616C38; Tue, 8 Sep 2020 20:53:45 +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 088Krj3G072461; Tue, 8 Sep 2020 20:53:45 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 088Krjn4072459; Tue, 8 Sep 2020 20:53:45 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202009082053.088Krjn4072459@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 8 Sep 2020 20:53:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r365474 - in stable: 11/lib/libc/sys 12/lib/libc/sys X-SVN-Group: stable-11 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable: 11/lib/libc/sys 12/lib/libc/sys X-SVN-Commit-Revision: 365474 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.33 Precedence: list List-Id: "SVN commit messages 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, 08 Sep 2020 20:53:46 -0000 Author: jhb Date: Tue Sep 8 20:53:44 2020 New Revision: 365474 URL: https://svnweb.freebsd.org/changeset/base/365474 Log: MFC 359467: Trim some duplicate EIO descriptions. While here, drop an extra conjunction from the list of error conditions for the remaining EIO description in symlink(2). Modified: stable/11/lib/libc/sys/mkfifo.2 stable/11/lib/libc/sys/symlink.2 Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/lib/libc/sys/mkfifo.2 stable/12/lib/libc/sys/symlink.2 Directory Properties: stable/12/ (props changed) Modified: stable/11/lib/libc/sys/mkfifo.2 ============================================================================== --- stable/11/lib/libc/sys/mkfifo.2 Tue Sep 8 20:51:19 2020 (r365473) +++ stable/11/lib/libc/sys/mkfifo.2 Tue Sep 8 20:53:44 2020 (r365474) @@ -130,10 +130,6 @@ which the fifo is being created has been exhausted. An .Tn I/O error occurred while making the directory entry or allocating the inode. -.It Bq Er EIO -An -.Tn I/O -error occurred while reading from or writing to the file system. .It Bq Er EFAULT The .Fa path Modified: stable/11/lib/libc/sys/symlink.2 ============================================================================== --- stable/11/lib/libc/sys/symlink.2 Tue Sep 8 20:51:19 2020 (r365473) +++ stable/11/lib/libc/sys/symlink.2 Tue Sep 8 20:53:44 2020 (r365474) @@ -118,7 +118,7 @@ manual page for more information. .It Bq Er EIO An I/O error occurred while making the directory entry for .Fa name2 , -or allocating the inode for +allocating the inode for .Fa name2 , or writing out the link contents of .Fa name2 . @@ -149,8 +149,6 @@ contain the symbolic link has been exhausted. .It Bq Er EDQUOT The user's quota of inodes on the file system on which the symbolic link is being created has been exhausted. -.It Bq Er EIO -An I/O error occurred while making the directory entry or allocating the inode. .It Bq Er EFAULT The .Fa name1 From owner-svn-src-all@freebsd.org Tue Sep 8 21:39:35 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 258FD3D8CC1; Tue, 8 Sep 2020 21:39:35 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BmJT26WqTz4VSP; Tue, 8 Sep 2020 21:39:34 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 C4BC817381; Tue, 8 Sep 2020 21:39:34 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 088LdYBf097367; Tue, 8 Sep 2020 21:39:34 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 088LdYYe097366; Tue, 8 Sep 2020 21:39:34 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <202009082139.088LdYYe097366@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Tue, 8 Sep 2020 21:39:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365475 - head/sys/net/route X-SVN-Group: head X-SVN-Commit-Author: melifaro X-SVN-Commit-Paths: head/sys/net/route X-SVN-Commit-Revision: 365475 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.33 Precedence: list List-Id: "SVN commit messages 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, 08 Sep 2020 21:39:35 -0000 Author: melifaro Date: Tue Sep 8 21:39:34 2020 New Revision: 365475 URL: https://svnweb.freebsd.org/changeset/base/365475 Log: Fix panic with net.fibs tunable set in loader.conf. Fix by removing forgotten CTLFLAG_RWTUN flag from the sysctl, loader variable will be read later in vnet_rtables_init(). Reported by: mav Modified: head/sys/net/route/route_tables.c Modified: head/sys/net/route/route_tables.c ============================================================================== --- head/sys/net/route/route_tables.c Tue Sep 8 20:53:44 2020 (r365474) +++ head/sys/net/route/route_tables.c Tue Sep 8 21:39:34 2020 (r365475) @@ -140,7 +140,7 @@ sysctl_fibs(SYSCTL_HANDLER_ARGS) return (error); } SYSCTL_PROC(_net, OID_AUTO, fibs, - CTLFLAG_VNET | CTLTYPE_U32 | CTLFLAG_RWTUN | CTLFLAG_MPSAFE, NULL, 0, + CTLFLAG_VNET | CTLTYPE_U32 | CTLFLAG_MPSAFE, NULL, 0, &sysctl_fibs, "IU", "set number of fibs"); From owner-svn-src-all@freebsd.org Tue Sep 8 21:40:37 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3E03E3D8F1F; Tue, 8 Sep 2020 21:40:37 +0000 (UTC) (envelope-from melifaro@ipfw.ru) Received: from forward500p.mail.yandex.net (forward500p.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:110]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4BmJVC5n2Wz4VNV; Tue, 8 Sep 2020 21:40:35 +0000 (UTC) (envelope-from melifaro@ipfw.ru) Received: from mxback2j.mail.yandex.net (mxback2j.mail.yandex.net [IPv6:2a02:6b8:0:1619::10b]) by forward500p.mail.yandex.net (Yandex) with ESMTP id 6E1A39409D3; Wed, 9 Sep 2020 00:40:31 +0300 (MSK) Received: from localhost (localhost [::1]) by mxback2j.mail.yandex.net (mxback/Yandex) with ESMTP id TXW2ZuBEBy-eUICjwaX; Wed, 09 Sep 2020 00:40:30 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfw.ru; s=mail; t=1599601230; bh=SP/PD7bEdBpgDIRrap9Bw8GfOcwq6TQUvLMQxi+x4w4=; h=References:Date:Message-Id:Subject:In-Reply-To:To:From; b=cvc8bqIIKz01BF4EL8/jrYPOrcohZ+zwY+T+V3EfHcYlpxWfKkQGWGWDxAev1qcOu lWwJLiGzfzF71Dsi3Yu//E5FCFilGsyX6ZZr0PQXJcuHZfbptJ3untFAkBX8YrzdvI EIa3D5gaS+H13TyYRLbVGG8bayc+oArJN9SnTtzA= Received: by iva2-5f9649d2845f.qloud-c.yandex.net with HTTP; Wed, 09 Sep 2020 00:40:30 +0300 From: Alexander V. Chernikov To: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" In-Reply-To: <202009082139.088LdYYe097366@repo.freebsd.org> References: <202009082139.088LdYYe097366@repo.freebsd.org> Subject: Re: svn commit: r365475 - head/sys/net/route MIME-Version: 1.0 X-Mailer: Yamail [ http://yandex.ru ] 5.0 Date: Tue, 08 Sep 2020 22:40:30 +0100 Message-Id: <168011599601210@mail.yandex.ru> Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=utf-8 X-Rspamd-Queue-Id: 4BmJVC5n2Wz4VNV X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=ipfw.ru header.s=mail header.b=cvc8bqII; dmarc=none; spf=pass (mx1.freebsd.org: domain of melifaro@ipfw.ru designates 2a02:6b8:0:1472:2741:0:8b7:110 as permitted sender) smtp.mailfrom=melifaro@ipfw.ru X-Spamd-Result: default: False [-3.60 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.96)[-0.955]; R_DKIM_ALLOW(-0.20)[ipfw.ru:s=mail]; FREEFALL_USER(0.00)[melifaro]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2a02:6b8:0:1000::/52]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[ipfw.ru]; NEURAL_HAM_LONG(-0.99)[-0.987]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[ipfw.ru:+]; NEURAL_HAM_SHORT(-1.06)[-1.055]; TO_DN_EQ_ADDR_ALL(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:13238, ipnet:2a02:6b8::/32, country:RU]; MAILMAN_DEST(0.00)[svn-src-all,svn-src-head]; RCVD_IN_DNSWL_LOW(-0.10)[2a02:6b8:0:1472:2741:0:8b7:110:from] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 08 Sep 2020 21:40:37 -0000 08.09.2020, 22:39, "Alexander V. Chernikov" : > Author: melifaro > Date: Tue Sep 8 21:39:34 2020 > New Revision: 365475 > URL: https://svnweb.freebsd.org/changeset/base/365475 > > Log: >   Fix panic with net.fibs tunable set in loader.conf. > >   Fix by removing forgotten CTLFLAG_RWTUN flag from the sysctl, >    loader variable will be read later in vnet_rtables_init(). > >   Reported by: mav ^^ meant to be avg > > Modified: >   head/sys/net/route/route_tables.c > > Modified: head/sys/net/route/route_tables.c > ============================================================================== > --- head/sys/net/route/route_tables.c Tue Sep 8 20:53:44 2020 (r365474) > +++ head/sys/net/route/route_tables.c Tue Sep 8 21:39:34 2020 (r365475) > @@ -140,7 +140,7 @@ sysctl_fibs(SYSCTL_HANDLER_ARGS) >          return (error); >  } >  SYSCTL_PROC(_net, OID_AUTO, fibs, > - CTLFLAG_VNET | CTLTYPE_U32 | CTLFLAG_RWTUN | CTLFLAG_MPSAFE, NULL, 0, > + CTLFLAG_VNET | CTLTYPE_U32 | CTLFLAG_MPSAFE, NULL, 0, >      &sysctl_fibs, "IU", >      "set number of fibs"); From owner-svn-src-all@freebsd.org Tue Sep 8 21:50:40 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F01213D9589; Tue, 8 Sep 2020 21:50:40 +0000 (UTC) (envelope-from melifaro@ipfw.ru) Received: from forward501j.mail.yandex.net (forward501j.mail.yandex.net [IPv6:2a02:6b8:0:801:2::111]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4BmJjr4314z4WG3; Tue, 8 Sep 2020 21:50:40 +0000 (UTC) (envelope-from melifaro@ipfw.ru) Received: from mxback27j.mail.yandex.net (mxback27j.mail.yandex.net [IPv6:2a02:6b8:0:1619::227]) by forward501j.mail.yandex.net (Yandex) with ESMTP id D15AB33809BD; Wed, 9 Sep 2020 00:50:35 +0300 (MSK) Received: from localhost (localhost [::1]) by mxback27j.mail.yandex.net (mxback/Yandex) with ESMTP id Llu186fslX-oZiWSO7e; Wed, 09 Sep 2020 00:50:35 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfw.ru; s=mail; t=1599601835; bh=BKHwrlVKrCu96HS+5btyCR1X7NYYjjdlN5lJ0m/Fl9g=; h=Message-Id:Subject:In-Reply-To:Date:References:To:From; b=i+3OqUN2vaXQBBPxQrMCLpcHpYdpz8tuV2Oom7kt56MWlXOUQ4yawH2FvMUpdF8AC SVZleqBEP9cZ+PdgJ/Nd/jkrDUuAVzyeIJplwzjbJah2od/88fjb+5uH2X9DvwyK5m vTU04A88vgEwun0JGNero3vQz+/C34FdzzF3unQg= Received: by sas8-75f070ddfcf3.qloud-c.yandex.net with HTTP; Wed, 09 Sep 2020 00:50:34 +0300 From: Alexander V. Chernikov Envelope-From: melifaro@ipfw.ru To: Andriy Gapon , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" In-Reply-To: <69399f59-4eca-ee29-7230-678a02cf6eff@FreeBSD.org> References: <202008212134.07LLYq3K071532@repo.freebsd.org> <69399f59-4eca-ee29-7230-678a02cf6eff@FreeBSD.org> Subject: Re: svn commit: r364465 - in head/sys: conf net net/route MIME-Version: 1.0 X-Mailer: Yamail [ http://yandex.ru ] 5.0 Date: Tue, 08 Sep 2020 22:50:34 +0100 Message-Id: <93541599601730@mail.yandex.ru> Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=utf-8 X-Rspamd-Queue-Id: 4BmJjr4314z4WG3 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; ASN(0.00)[asn:13238, ipnet:2a02:6b8::/32, country:RU]; REPLY(-4.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 08 Sep 2020 21:50:41 -0000 08.09.2020, 21:03, "Andriy Gapon" : > On 22/08/2020 00:34, Alexander V. Chernikov wrote: >>  Author: melifaro >>  Date: Fri Aug 21 21:34:52 2020 >>  New Revision: 364465 >>  URL: https://svnweb.freebsd.org/changeset/base/364465 >> >>  Log: >>    Make net.fibs growable. >> >>    Allow to dynamically grow the amount of fibs in each vnet. >> >>    This change alters current behavior. Currently, if one defines >>     ROUTETABLES > 1 in the kernel config, each vnet will be created >>     with the number of fibs defined in the kernel config. >>     After this commit vnets will be created with fibs=1. >> >>    Dynamic net.fibs is not compatible with net.add_addr_allfibs. >>     The plan is to deprecate the latter and make >>     net.add_addr_allfibs=0 default behaviour. >> >>    Reviewed by: glebius >>    Relnotes: yes >>    Differential Revision: https://reviews.freebsd.org/D26062 > > I wonder why no one reported a problem that I am seeing after upgrading past > this revision. Maybe because I do have net.fibs=2 in my loader.conf? Hi Andriy, Does r365475 fix the problem for you? CTLFLAG_RWTUN flag got slipped through the cracks somewhere :-( > The problem -- unfortunately I only have a screenshot -- but it's a page fault > trap in this call chain: > sysctl_register_all -> sysctl_load_tunable_by_oid_locked -> sysctl_fibs -> > _sx_xlock. > > The crash is on the RTABLES_LOCK() line. > And it's kind of obvious why. > > The tunables, including net.fibs which is declared as RWTUN, are set at > SI_SUB_TUNABLES stage, but RTABLES_LOCK_INIT() is not called until > SI_SUB_PROTO_DOMAIN much later. In other words, sysctal_fibs can be called > earlier than vnet_rtables_init. > > I think that the best way to handle the problem would be to add CTLFLAG_NOFETCH > to the sysctl declaration and then to add -- if necessary at all -- an explicit > query of the kenv. > > -- > Andriy Gapon From owner-svn-src-all@freebsd.org Tue Sep 8 22:19:07 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E3E993D9A73; Tue, 8 Sep 2020 22:19:07 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BmKLg5nTGz4Xd4; Tue, 8 Sep 2020 22:19:07 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A9DC017756; Tue, 8 Sep 2020 22:19:07 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 088MJ7O0021934; Tue, 8 Sep 2020 22:19:07 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 088MJ7C6021933; Tue, 8 Sep 2020 22:19:07 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202009082219.088MJ7C6021933@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 8 Sep 2020 22:19:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r365476 - in stable: 11/sys/dev/uart 12/sys/dev/uart X-SVN-Group: stable-11 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable: 11/sys/dev/uart 12/sys/dev/uart X-SVN-Commit-Revision: 365476 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.33 Precedence: list List-Id: "SVN commit messages 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, 08 Sep 2020 22:19:08 -0000 Author: jhb Date: Tue Sep 8 22:19:06 2020 New Revision: 365476 URL: https://svnweb.freebsd.org/changeset/base/365476 Log: MFC 359899: Correct baud rate error calculation. Shifting right by 1 is not the same as dividing by 2 for signed values. In particular, dividing a signed value by 2 gives the integer ceiling of the (e.g. -5 / 2 == -2) whereas shifting right by 1 always gives the floor (-5 >> 1 == -3). An embedded board with a 25 Mhz base clock results in an error of -30.5% when used with a baud rate of 115200. Using division, this truncates to -30% and is permitted. Using the shift, this fails and is rejected causing TIOCSETA requests to fail with EINVAL and breaking getty(8). Using division gives the same error range for both over and under baud rates and also makes the code match the behavior documented in the existing comment about supporting boards with 25 Mhz clocks. Modified: stable/11/sys/dev/uart/uart_dev_ns8250.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/sys/dev/uart/uart_dev_ns8250.c Directory Properties: stable/12/ (props changed) Modified: stable/11/sys/dev/uart/uart_dev_ns8250.c ============================================================================== --- stable/11/sys/dev/uart/uart_dev_ns8250.c Tue Sep 8 21:39:34 2020 (r365475) +++ stable/11/sys/dev/uart/uart_dev_ns8250.c Tue Sep 8 22:19:06 2020 (r365476) @@ -136,7 +136,7 @@ ns8250_divisor(int rclk, int baudrate) actual_baud = rclk / (divisor << 4); /* 10 times error in percent: */ - error = ((actual_baud - baudrate) * 2000 / baudrate + 1) >> 1; + error = ((actual_baud - baudrate) * 2000 / baudrate + 1) / 2; /* enforce maximum error tolerance: */ if (error < -UART_DEV_TOLERANCE_PCT || error > UART_DEV_TOLERANCE_PCT) From owner-svn-src-all@freebsd.org Tue Sep 8 22:19:07 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 93D563D9AD4; Tue, 8 Sep 2020 22:19:07 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BmKLg3Mmrz4Xd3; Tue, 8 Sep 2020 22:19:07 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 56DB817755; Tue, 8 Sep 2020 22:19:07 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 088MJ7BM021928; Tue, 8 Sep 2020 22:19:07 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 088MJ7Cg021927; Tue, 8 Sep 2020 22:19:07 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202009082219.088MJ7Cg021927@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 8 Sep 2020 22:19:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365476 - in stable: 11/sys/dev/uart 12/sys/dev/uart X-SVN-Group: stable-12 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable: 11/sys/dev/uart 12/sys/dev/uart X-SVN-Commit-Revision: 365476 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.33 Precedence: list List-Id: "SVN commit messages 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, 08 Sep 2020 22:19:07 -0000 Author: jhb Date: Tue Sep 8 22:19:06 2020 New Revision: 365476 URL: https://svnweb.freebsd.org/changeset/base/365476 Log: MFC 359899: Correct baud rate error calculation. Shifting right by 1 is not the same as dividing by 2 for signed values. In particular, dividing a signed value by 2 gives the integer ceiling of the (e.g. -5 / 2 == -2) whereas shifting right by 1 always gives the floor (-5 >> 1 == -3). An embedded board with a 25 Mhz base clock results in an error of -30.5% when used with a baud rate of 115200. Using division, this truncates to -30% and is permitted. Using the shift, this fails and is rejected causing TIOCSETA requests to fail with EINVAL and breaking getty(8). Using division gives the same error range for both over and under baud rates and also makes the code match the behavior documented in the existing comment about supporting boards with 25 Mhz clocks. Modified: stable/12/sys/dev/uart/uart_dev_ns8250.c Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sys/dev/uart/uart_dev_ns8250.c Directory Properties: stable/11/ (props changed) Modified: stable/12/sys/dev/uart/uart_dev_ns8250.c ============================================================================== --- stable/12/sys/dev/uart/uart_dev_ns8250.c Tue Sep 8 21:39:34 2020 (r365475) +++ stable/12/sys/dev/uart/uart_dev_ns8250.c Tue Sep 8 22:19:06 2020 (r365476) @@ -139,7 +139,7 @@ ns8250_divisor(int rclk, int baudrate) actual_baud = rclk / (divisor << 4); /* 10 times error in percent: */ - error = ((actual_baud - baudrate) * 2000 / baudrate + 1) >> 1; + error = ((actual_baud - baudrate) * 2000 / baudrate + 1) / 2; /* enforce maximum error tolerance: */ if (error < -UART_DEV_TOLERANCE_PCT || error > UART_DEV_TOLERANCE_PCT) From owner-svn-src-all@freebsd.org Tue Sep 8 22:20:14 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D50903D9C71; Tue, 8 Sep 2020 22:20:14 +0000 (UTC) (envelope-from rysto32@gmail.com) Received: from mail-ej1-x62d.google.com (mail-ej1-x62d.google.com [IPv6:2a00:1450:4864:20::62d]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BmKMy3zrbz4XxT; Tue, 8 Sep 2020 22:20:14 +0000 (UTC) (envelope-from rysto32@gmail.com) Received: by mail-ej1-x62d.google.com with SMTP id gr14so681568ejb.1; Tue, 08 Sep 2020 15:20:14 -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=aNr329+51yyotlsJiagoptz20QObIBN8hkC3RcKVlTk=; b=dODdnJ+XFadFXvCvaLl+ogLPAq3D8qPIe4O1Odwza+usBIz8hAhXb7gvMByVR6NawT F3mJF1HWIw2TuMgbj4FHbGg2DoJ6h4LFJKfeg4V1z+Z5JNsFiqPELVcork6pT943grzC /eL080gxcsv4kJ0ig++Ko5jfUERkh98J9P48Pe6cfxsLW9IzFS8PkFdU8ByxSdNv2wW1 Sc3kR94k8LtcSomkQ4Qz1PgMNM9ewmWjcBnGS4/dDedLWS5hvWzXOyWxOK1nq4rPV4mW +i5VtBvOcCCKeoFV9ZaF8Gt+Sf0dYzVrIeKhKmKZerw8L5TRg26Pp7hMwEMDdoprzAhE pigQ== 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=aNr329+51yyotlsJiagoptz20QObIBN8hkC3RcKVlTk=; b=BSXPo6c/SvpBlCiozP2hZTuYFdGyYFzTZTmjMUDPbvCKLrk9ZaI3Khb/Tm/NIP0ZIt MSPLLjNWiN59OV0H/oyraqkJ/0QOEc1c9CQczQYCkmvBoo99r0jlZe/e//SqIyAL8hD9 x3xZf7qUAhcBUEbTa1Etxj0Bpt/9Vdxpg81NN8MQt/rn7rfuE5WB3xyd/624QgFVCv24 HT7mQmU6oRucfeaMO9EBTgflpNJekrnftsC2UJnHqWuNfQHw0M7napEd/wdSafBCf46W B0LnmPLCqIeimrlqUoq2nwlcoG/A4qgJTLb7RqIQQB4zjnuIBHrYPM3wAOT8H1mF/6i1 cNdA== X-Gm-Message-State: AOAM5305Vf62f6P8QNk4h5elRLhb8MsZAWheRHeXK+Uw8Rr6K87uWHpw q5MySD1aH/dcW3rG19BWhQKzZc6eIcnQtEwtzPc2wYfG X-Google-Smtp-Source: ABdhPJzemHI9x2TTVtrjLlA/x63OKws5Ga9mNpbGKxVoVqLEb+OT1g91DJSrJxHLQU9aquxQDQuQ2zERJ3ixsGn21Qw= X-Received: by 2002:a17:906:a251:: with SMTP id bi17mr631707ejb.526.1599603612987; Tue, 08 Sep 2020 15:20:12 -0700 (PDT) MIME-Version: 1.0 References: <202009082139.088LdYYe097366@repo.freebsd.org> In-Reply-To: <202009082139.088LdYYe097366@repo.freebsd.org> From: Ryan Stone Date: Tue, 8 Sep 2020 18:20:01 -0400 Message-ID: Subject: Re: svn commit: r365475 - head/sys/net/route To: "Alexander V. Chernikov" Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4BmKMy3zrbz4XxT X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 08 Sep 2020 22:20:14 -0000 On Tue, Sep 8, 2020 at 5:39 PM Alexander V. Chernikov wrote: > - CTLFLAG_VNET | CTLTYPE_U32 | CTLFLAG_RWTUN | CTLFLAG_MPSAFE, NULL, 0, > + CTLFLAG_VNET | CTLTYPE_U32 | CTLFLAG_MPSAFE, NULL, 0, Don't you still need CTLFLAG_RW? I don't believe that the sysctl is usable at all without it. From owner-svn-src-all@freebsd.org Tue Sep 8 22:23:54 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6FE973D9FB7; Tue, 8 Sep 2020 22:23:54 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BmKSB2L1Cz4YD9; Tue, 8 Sep 2020 22:23:54 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 345D4178CF; Tue, 8 Sep 2020 22:23:54 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 088MNsJs027572; Tue, 8 Sep 2020 22:23:54 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 088MNrdm027570; Tue, 8 Sep 2020 22:23:53 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <202009082223.088MNrdm027570@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Tue, 8 Sep 2020 22:23:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365477 - head/sys/geom/part X-SVN-Group: head X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: head/sys/geom/part X-SVN-Commit-Revision: 365477 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.33 Precedence: list List-Id: "SVN commit messages 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, 08 Sep 2020 22:23:54 -0000 Author: eugen Date: Tue Sep 8 22:23:53 2020 New Revision: 365477 URL: https://svnweb.freebsd.org/changeset/base/365477 Log: geom_part: extend kern.geom.part.check_integrity to work on GPT There are multiple USB/SATA bridges on the market that unconditionally cut some LBAs off connected media. This could be a problem for pre-partitioned drives so GEOM complains and does not create devices in /dev for slices/partitions preventing access to existing data. We have kern.geom.part.check_integrity that allows us to correct partitioning if changed from default 1 to 0 but it works for MBR only. If backup copy of GPT is unavailable due to decreases number of LBAs, kernel still does not give access to partitions and prints to dmesg: GEOM: md0: corrupt or invalid GPT detected. GEOM: md0: GPT rejected -- may not be recoverable. This change makes it work for GPT too, so it created partitions in /dev and prints to dmesg this instead: GEOM: md0: the secondary GPT table is corrupt or invalid. GEOM: md0: using the primary only -- recovery suggested. Then "gpart recover" re-created backup copy of GPT and allows further manipulations with partitions. This change is no-op for default configuration having kern.geom.part.check_integrity=1 Reported by: Alex Korchmar MFC after: 3 days. Modified: head/sys/geom/part/g_part.c head/sys/geom/part/g_part_gpt.c Modified: head/sys/geom/part/g_part.c ============================================================================== --- head/sys/geom/part/g_part.c Tue Sep 8 22:19:06 2020 (r365476) +++ head/sys/geom/part/g_part.c Tue Sep 8 22:23:53 2020 (r365477) @@ -140,9 +140,9 @@ struct g_part_alias_list { SYSCTL_DECL(_kern_geom); SYSCTL_NODE(_kern_geom, OID_AUTO, part, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "GEOM_PART stuff"); -static u_int check_integrity = 1; +u_int geom_part_check_integrity = 1; SYSCTL_UINT(_kern_geom_part, OID_AUTO, check_integrity, - CTLFLAG_RWTUN, &check_integrity, 1, + CTLFLAG_RWTUN, &geom_part_check_integrity, 1, "Enable integrity checking"); static u_int auto_resize = 1; SYSCTL_UINT(_kern_geom_part, OID_AUTO, auto_resize, @@ -428,7 +428,7 @@ g_part_check_integrity(struct g_part_table *table, str if (failed != 0) { printf("GEOM_PART: integrity check failed (%s, %s)\n", pp->name, table->gpt_scheme->name); - if (check_integrity != 0) + if (geom_part_check_integrity != 0) return (EINVAL); table->gpt_corrupt = 1; } Modified: head/sys/geom/part/g_part_gpt.c ============================================================================== --- head/sys/geom/part/g_part_gpt.c Tue Sep 8 22:19:06 2020 (r365476) +++ head/sys/geom/part/g_part_gpt.c Tue Sep 8 22:23:53 2020 (r365477) @@ -66,6 +66,8 @@ SYSCTL_UINT(_kern_geom_part_gpt, OID_AUTO, allow_nesti CTASSERT(offsetof(struct gpt_hdr, padding) == 92); CTASSERT(sizeof(struct gpt_ent) == 128); +extern u_int geom_part_check_integrity; + #define EQUUID(a,b) (memcmp(a, b, sizeof(struct uuid)) == 0) #define MBRSIZE 512 @@ -480,8 +482,9 @@ gpt_read_hdr(struct g_part_gpt_table *table, struct g_ if (hdr->hdr_lba_self != table->lba[elt]) goto fail; hdr->hdr_lba_alt = le64toh(buf->hdr_lba_alt); - if (hdr->hdr_lba_alt == hdr->hdr_lba_self || - hdr->hdr_lba_alt > last) + if (hdr->hdr_lba_alt == hdr->hdr_lba_self) + goto fail; + if (hdr->hdr_lba_alt > last && geom_part_check_integrity) goto fail; /* Check the managed area. */ From owner-svn-src-all@freebsd.org Tue Sep 8 22:41:36 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A50A93DA5CB; Tue, 8 Sep 2020 22:41:36 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BmKrc3vQJz4Z0X; Tue, 8 Sep 2020 22:41:36 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 69517178E9; Tue, 8 Sep 2020 22:41:36 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 088MfaPg037157; Tue, 8 Sep 2020 22:41:36 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 088MfZMH037152; Tue, 8 Sep 2020 22:41:35 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202009082241.088MfZMH037152@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 8 Sep 2020 22:41:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365478 - in head/sys: crypto/armv8 dev/hifn dev/safe X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head/sys: crypto/armv8 dev/hifn dev/safe X-SVN-Commit-Revision: 365478 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.33 Precedence: list List-Id: "SVN commit messages 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, 08 Sep 2020 22:41:36 -0000 Author: jhb Date: Tue Sep 8 22:41:35 2020 New Revision: 365478 URL: https://svnweb.freebsd.org/changeset/base/365478 Log: Don't return errors from the cryptodev_process() method. The cryptodev_process() method should either return 0 if it has completed a request, or ERESTART to defer the request until later. If a request encounters an error, the error should be reported via crp_etype before completing the request via crypto_done(). Fix a few more drivers noticed by asomers@ similar to the fix in r365389. This is an old bug, but went unnoticed since crypto requests did not start failing as a normal part of operation until digest verification was introduced which can fail requests with EBADMSG. PR: 247986 Reported by: asomers Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D26361 Modified: head/sys/crypto/armv8/armv8_crypto.c head/sys/dev/hifn/hifn7751.c head/sys/dev/safe/safe.c Modified: head/sys/crypto/armv8/armv8_crypto.c ============================================================================== --- head/sys/crypto/armv8/armv8_crypto.c Tue Sep 8 22:23:53 2020 (r365477) +++ head/sys/crypto/armv8/armv8_crypto.c Tue Sep 8 22:41:35 2020 (r365478) @@ -281,7 +281,7 @@ armv8_crypto_process(device_t dev, struct cryptop *crp out: crp->crp_etype = error; crypto_done(crp); - return (error); + return (0); } static uint8_t * Modified: head/sys/dev/hifn/hifn7751.c ============================================================================== --- head/sys/dev/hifn/hifn7751.c Tue Sep 8 22:23:53 2020 (r365477) +++ head/sys/dev/hifn/hifn7751.c Tue Sep 8 22:41:35 2020 (r365478) @@ -2517,7 +2517,7 @@ errout: hifnstats.hst_nomem++; crp->crp_etype = err; crypto_done(crp); - return (err); + return (0); } static void Modified: head/sys/dev/safe/safe.c ============================================================================== --- head/sys/dev/safe/safe.c Tue Sep 8 22:23:53 2020 (r365477) +++ head/sys/dev/safe/safe.c Tue Sep 8 22:41:35 2020 (r365478) @@ -1259,6 +1259,7 @@ errout: if (err != ERESTART) { crp->crp_etype = err; crypto_done(crp); + err = 0; } else { sc->sc_needwakeup |= CRYPTO_SYMQ; } From owner-svn-src-all@freebsd.org Tue Sep 8 22:42:42 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0EC1B3DA81F; Tue, 8 Sep 2020 22:42:42 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BmKss6dfzz4Z1x; Tue, 8 Sep 2020 22:42:41 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 C813F178FC; Tue, 8 Sep 2020 22:42:41 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 088MgfCs039864; Tue, 8 Sep 2020 22:42:41 GMT (envelope-from bdragon@FreeBSD.org) Received: (from bdragon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 088MgfrW039863; Tue, 8 Sep 2020 22:42:41 GMT (envelope-from bdragon@FreeBSD.org) Message-Id: <202009082242.088MgfrW039863@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdragon set sender to bdragon@FreeBSD.org using -f From: Brandon Bergren Date: Tue, 8 Sep 2020 22:42:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365479 - head/sys/powerpc/powerpc X-SVN-Group: head X-SVN-Commit-Author: bdragon X-SVN-Commit-Paths: head/sys/powerpc/powerpc X-SVN-Commit-Revision: 365479 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.33 Precedence: list List-Id: "SVN commit messages 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, 08 Sep 2020 22:42:42 -0000 Author: bdragon Date: Tue Sep 8 22:42:41 2020 New Revision: 365479 URL: https://svnweb.freebsd.org/changeset/base/365479 Log: [PowerPC] Add root_pic assertion. When enabling an interrupt, assert that we do in fact have a root PIC. This would have saved me some debugging effort. Sponsored by: Tag1 Consulting, Inc. Modified: head/sys/powerpc/powerpc/intr_machdep.c Modified: head/sys/powerpc/powerpc/intr_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/intr_machdep.c Tue Sep 8 22:41:35 2020 (r365478) +++ head/sys/powerpc/powerpc/intr_machdep.c Tue Sep 8 22:42:41 2020 (r365479) @@ -457,6 +457,8 @@ powerpc_enable_intr(void) if (root_pic == NULL) root_pic = piclist[0].dev; + KASSERT(root_pic != NULL, ("no root PIC!")); + #ifdef SMP /* Install an IPI handler. */ if (mp_ncpus > 1) { From owner-svn-src-all@freebsd.org Tue Sep 8 22:50:25 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 864623DAC66; Tue, 8 Sep 2020 22:50:25 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BmL2n2zrGz4ZsQ; Tue, 8 Sep 2020 22:50:25 +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 4AD7B17F11; Tue, 8 Sep 2020 22:50:25 +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 088MoP9x040308; Tue, 8 Sep 2020 22:50:25 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 088MoOll040306; Tue, 8 Sep 2020 22:50:24 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202009082250.088MoOll040306@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 8 Sep 2020 22:50:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365480 - in stable: 11/sys/dev/uart 12/sys/dev/uart X-SVN-Group: stable-12 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable: 11/sys/dev/uart 12/sys/dev/uart X-SVN-Commit-Revision: 365480 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.33 Precedence: list List-Id: "SVN commit messages 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, 08 Sep 2020 22:50:25 -0000 Author: jhb Date: Tue Sep 8 22:50:24 2020 New Revision: 365480 URL: https://svnweb.freebsd.org/changeset/base/365480 Log: MFC 359900: Export a sysctl count of RX FIFO overrun events. uart(4) backends currently detect RX FIFO overrun errors and report them to the uart(4) core layer. They are then reported to the generic TTY layer which promptly ignores them. As a result, there is currently no good way to determine if a uart is experiencing RX FIFO overruns. One could add a generic per-tty counter, but there did not appear to be a good way to export those. Instead, add a sysctl under the uart(4) sysctl tree to export the count of overruns. Modified: stable/12/sys/dev/uart/uart_bus.h stable/12/sys/dev/uart/uart_core.c Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sys/dev/uart/uart_bus.h stable/11/sys/dev/uart/uart_core.c Directory Properties: stable/11/ (props changed) Modified: stable/12/sys/dev/uart/uart_bus.h ============================================================================== --- stable/12/sys/dev/uart/uart_bus.h Tue Sep 8 22:42:41 2020 (r365479) +++ stable/12/sys/dev/uart/uart_bus.h Tue Sep 8 22:50:24 2020 (r365480) @@ -111,6 +111,7 @@ struct uart_softc { int sc_rxput; int sc_rxget; int sc_rxfifosz; /* Size of RX FIFO. */ + int sc_rxoverruns; /* Transmitter data. */ uint8_t *sc_txbuf; Modified: stable/12/sys/dev/uart/uart_core.c ============================================================================== --- stable/12/sys/dev/uart/uart_core.c Tue Sep 8 22:42:41 2020 (r365479) +++ stable/12/sys/dev/uart/uart_core.c Tue Sep 8 22:50:24 2020 (r365480) @@ -333,6 +333,7 @@ uart_intr_overrun(void *arg) sc->sc_rxbuf[sc->sc_rxput] = UART_STAT_OVERRUN; uart_sched_softih(sc, SER_INT_RXREADY); } + sc->sc_rxoverruns++; UART_FLUSH(sc, UART_FLUSH_RECEIVER); return (0); } @@ -740,6 +741,12 @@ uart_bus_attach(device_t dev) if (sc->sc_sysdev != NULL) sc->sc_sysdev->hwmtx = sc->sc_hwmtx; + + if (sc->sc_rxfifosz > 1) + SYSCTL_ADD_INT(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, + "rx_overruns", CTLFLAG_RD, &sc->sc_rxoverruns, 0, + "Receive overruns"); return (0); From owner-svn-src-all@freebsd.org Tue Sep 8 22:50:25 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E5C383DADDC; Tue, 8 Sep 2020 22:50:25 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BmL2n5rPlz4Zkc; Tue, 8 Sep 2020 22:50:25 +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 ABF8D18104; Tue, 8 Sep 2020 22:50:25 +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 088MoP4e040315; Tue, 8 Sep 2020 22:50:25 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 088MoP6T040314; Tue, 8 Sep 2020 22:50:25 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202009082250.088MoP6T040314@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 8 Sep 2020 22:50:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r365480 - in stable: 11/sys/dev/uart 12/sys/dev/uart X-SVN-Group: stable-11 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable: 11/sys/dev/uart 12/sys/dev/uart X-SVN-Commit-Revision: 365480 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.33 Precedence: list List-Id: "SVN commit messages 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, 08 Sep 2020 22:50:26 -0000 Author: jhb Date: Tue Sep 8 22:50:24 2020 New Revision: 365480 URL: https://svnweb.freebsd.org/changeset/base/365480 Log: MFC 359900: Export a sysctl count of RX FIFO overrun events. uart(4) backends currently detect RX FIFO overrun errors and report them to the uart(4) core layer. They are then reported to the generic TTY layer which promptly ignores them. As a result, there is currently no good way to determine if a uart is experiencing RX FIFO overruns. One could add a generic per-tty counter, but there did not appear to be a good way to export those. Instead, add a sysctl under the uart(4) sysctl tree to export the count of overruns. Modified: stable/11/sys/dev/uart/uart_bus.h stable/11/sys/dev/uart/uart_core.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/sys/dev/uart/uart_bus.h stable/12/sys/dev/uart/uart_core.c Directory Properties: stable/12/ (props changed) Modified: stable/11/sys/dev/uart/uart_bus.h ============================================================================== --- stable/11/sys/dev/uart/uart_bus.h Tue Sep 8 22:42:41 2020 (r365479) +++ stable/11/sys/dev/uart/uart_bus.h Tue Sep 8 22:50:24 2020 (r365480) @@ -108,6 +108,7 @@ struct uart_softc { int sc_rxput; int sc_rxget; int sc_rxfifosz; /* Size of RX FIFO. */ + int sc_rxoverruns; /* Transmitter data. */ uint8_t *sc_txbuf; Modified: stable/11/sys/dev/uart/uart_core.c ============================================================================== --- stable/11/sys/dev/uart/uart_core.c Tue Sep 8 22:42:41 2020 (r365479) +++ stable/11/sys/dev/uart/uart_core.c Tue Sep 8 22:50:24 2020 (r365480) @@ -327,6 +327,7 @@ uart_intr_overrun(void *arg) sc->sc_rxbuf[sc->sc_rxput] = UART_STAT_OVERRUN; uart_sched_softih(sc, SER_INT_RXREADY); } + sc->sc_rxoverruns++; UART_FLUSH(sc, UART_FLUSH_RECEIVER); return (0); } @@ -735,6 +736,12 @@ uart_bus_attach(device_t dev) if (sc->sc_sysdev != NULL) sc->sc_sysdev->hwmtx = sc->sc_hwmtx; + + if (sc->sc_rxfifosz > 1) + SYSCTL_ADD_INT(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, + "rx_overruns", CTLFLAG_RD, &sc->sc_rxoverruns, 0, + "Receive overruns"); return (0); From owner-svn-src-all@freebsd.org Tue Sep 8 22:59:44 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4F0B83DB4CA; Tue, 8 Sep 2020 22:59:44 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BmLFX1QyLz4blw; Tue, 8 Sep 2020 22:59:44 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 F0B711801E; Tue, 8 Sep 2020 22:59:43 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 088Mxhrh046313; Tue, 8 Sep 2020 22:59:43 GMT (envelope-from bdragon@FreeBSD.org) Received: (from bdragon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 088MxhIw046311; Tue, 8 Sep 2020 22:59:43 GMT (envelope-from bdragon@FreeBSD.org) Message-Id: <202009082259.088MxhIw046311@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdragon set sender to bdragon@FreeBSD.org using -f From: Brandon Bergren Date: Tue, 8 Sep 2020 22:59:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365481 - in head/sys/powerpc: aim powerpc X-SVN-Group: head X-SVN-Commit-Author: bdragon X-SVN-Commit-Paths: in head/sys/powerpc: aim powerpc X-SVN-Commit-Revision: 365481 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.33 Precedence: list List-Id: "SVN commit messages 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, 08 Sep 2020 22:59:44 -0000 Author: bdragon Date: Tue Sep 8 22:59:43 2020 New Revision: 365481 URL: https://svnweb.freebsd.org/changeset/base/365481 Log: [PowerPC64] Hide dssall instruction from llvm assembler When doing a build for a modern CPUTYPE, llvm will throw errors if obsolete instructions are used, even if they will never run due to runtime checks. Hiding the dssall instruction from the assembler fixes kernel build when overriding CPUTYPE, without having any effect on the generated binary. This has been in my local tree for over a year and is well tested across a variety of machines. Sponsored by: Tag1 Consulting, Inc. Modified: head/sys/powerpc/aim/aim_machdep.c head/sys/powerpc/powerpc/cpu.c Modified: head/sys/powerpc/aim/aim_machdep.c ============================================================================== --- head/sys/powerpc/aim/aim_machdep.c Tue Sep 8 22:50:24 2020 (r365480) +++ head/sys/powerpc/aim/aim_machdep.c Tue Sep 8 22:59:43 2020 (r365481) @@ -629,7 +629,8 @@ flush_disable_caches(void) mtspr(SPR_MSSCR0, msscr0); powerpc_sync(); isync(); - __asm__ __volatile__("dssall; sync"); + /* 7e00066c: dssall */ + __asm__ __volatile__(".long 0x7e00066c; sync"); powerpc_sync(); isync(); __asm__ __volatile__("dcbf 0,%0" :: "r"(0)); Modified: head/sys/powerpc/powerpc/cpu.c ============================================================================== --- head/sys/powerpc/powerpc/cpu.c Tue Sep 8 22:50:24 2020 (r365480) +++ head/sys/powerpc/powerpc/cpu.c Tue Sep 8 22:59:43 2020 (r365481) @@ -753,8 +753,9 @@ cpu_idle_60x(sbintime_t sbt) case MPC7450: case MPC7455: case MPC7457: + /* 0x7e00066c: dssall */ __asm __volatile("\ - dssall; sync; mtmsr %0; isync" + .long 0x7e00066c; sync; mtmsr %0; isync" :: "r"(msr | PSL_POW)); break; default: From owner-svn-src-all@freebsd.org Tue Sep 8 23:20:00 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A1D143DB97E; Tue, 8 Sep 2020 23:20:00 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BmLhw3rSnz4cvK; Tue, 8 Sep 2020 23:20:00 +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 68759185DA; Tue, 8 Sep 2020 23:20:00 +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 088NK0lW058848; Tue, 8 Sep 2020 23:20:00 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 088NK0e6058847; Tue, 8 Sep 2020 23:20:00 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202009082320.088NK0e6058847@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 8 Sep 2020 23:20:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365482 - stable/12/sys/crypto/aesni X-SVN-Group: stable-12 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: stable/12/sys/crypto/aesni X-SVN-Commit-Revision: 365482 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.33 Precedence: list List-Id: "SVN commit messages 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, 08 Sep 2020 23:20:00 -0000 Author: jhb Date: Tue Sep 8 23:19:59 2020 New Revision: 365482 URL: https://svnweb.freebsd.org/changeset/base/365482 Log: MFC 362123: Fix AES-CCM requests with an AAD size smaller than a single block. The amount to copy for the first block is the minimum of the size of the AAD region or the remaining space in the first block. Modified: stable/12/sys/crypto/aesni/aesni_ccm.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/crypto/aesni/aesni_ccm.c ============================================================================== --- stable/12/sys/crypto/aesni/aesni_ccm.c Tue Sep 8 22:59:43 2020 (r365481) +++ stable/12/sys/crypto/aesni/aesni_ccm.c Tue Sep 8 23:19:59 2020 (r365482) @@ -155,7 +155,7 @@ cbc_mac_start(const unsigned char *auth_data, size_t a * already partially filled, by auth_amt, so we need * to handle that. The last block needs to be zero padded. */ - copy_amt = MIN(auth_len - auth_amt, + copy_amt = MIN(auth_len, sizeof(staging_block) - auth_amt); byte_ptr = (uint8_t*)&staging_block; bcopy(auth_ptr, &byte_ptr[auth_amt], copy_amt); From owner-svn-src-all@freebsd.org Tue Sep 8 23:22:12 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 25E853DBC37; Tue, 8 Sep 2020 23:22:12 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BmLlS0Hmzz4dLQ; Tue, 8 Sep 2020 23:22:12 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 E1C1F18623; Tue, 8 Sep 2020 23:22:11 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 088NMB2A064060; Tue, 8 Sep 2020 23:22:11 GMT (envelope-from bdragon@FreeBSD.org) Received: (from bdragon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 088NMBPr064059; Tue, 8 Sep 2020 23:22:11 GMT (envelope-from bdragon@FreeBSD.org) Message-Id: <202009082322.088NMBPr064059@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdragon set sender to bdragon@FreeBSD.org using -f From: Brandon Bergren Date: Tue, 8 Sep 2020 23:22:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365483 - head/stand/libofw X-SVN-Group: head X-SVN-Commit-Author: bdragon X-SVN-Commit-Paths: head/stand/libofw X-SVN-Commit-Revision: 365483 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.33 Precedence: list List-Id: "SVN commit messages 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, 08 Sep 2020 23:22:12 -0000 Author: bdragon Date: Tue Sep 8 23:22:11 2020 New Revision: 365483 URL: https://svnweb.freebsd.org/changeset/base/365483 Log: Fix 64-bit build of libofw. Adjust a couple of printf() lines that deal with dumping out addresses to cast to uintmax_t. This allows building a 64-bit libofw for use in things like a future Petitboot loader for PowerPC64, and other FDT platforms that require a 64-bit loader binary and want to use forth. Sponsored by: Tag1 Consulting, Inc. Modified: head/stand/libofw/ofw_memory.c Modified: head/stand/libofw/ofw_memory.c ============================================================================== --- head/stand/libofw/ofw_memory.c Tue Sep 8 23:19:59 2020 (r365482) +++ head/stand/libofw/ofw_memory.c Tue Sep 8 23:22:11 2020 (r365483) @@ -80,11 +80,11 @@ ofw_memmap(int acells) "Physical Range", "#Pages", "Mode"); for (i = 0; i < nmapping; i++) { - sprintf(lbuf, "%08x-%08x\t%08x-%08x\t%8d\t%6x\n", - mapptr[i].va, - mapptr[i].va + mapptr[i].len, - mapptr[i].pa, - mapptr[i].pa + mapptr[i].len, + sprintf(lbuf, "%08jx-%08jx\t%08jx-%08jx\t%8d\t%6x\n", + (uintmax_t)mapptr[i].va, + (uintmax_t)mapptr[i].va + mapptr[i].len, + (uintmax_t)mapptr[i].pa, + (uintmax_t)mapptr[i].pa + mapptr[i].len, mapptr[i].len / 0x1000, mapptr[i].mode); if (pager_output(lbuf)) @@ -98,11 +98,11 @@ ofw_memmap(int acells) "Physical Range", "#Pages", "Mode"); for (i = 0; i < nmapping; i++) { - sprintf(lbuf, "%08x-%08x\t%08x-%08x\t%8d\t%6x\n", - mapptr2[i].va, - mapptr2[i].va + mapptr2[i].len, - mapptr2[i].pa_lo, - mapptr2[i].pa_lo + mapptr2[i].len, + sprintf(lbuf, "%08jx-%08jx\t%08jx-%08jx\t%8d\t%6x\n", + (uintmax_t)mapptr2[i].va, + (uintmax_t)mapptr2[i].va + mapptr2[i].len, + (uintmax_t)mapptr2[i].pa_lo, + (uintmax_t)mapptr2[i].pa_lo + mapptr2[i].len, mapptr2[i].len / 0x1000, mapptr2[i].mode); if (pager_output(lbuf)) From owner-svn-src-all@freebsd.org Tue Sep 8 23:28:11 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5B3683DBD6C; Tue, 8 Sep 2020 23:28: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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BmLtM1WGhz4dNC; Tue, 8 Sep 2020 23:28: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 17DA4183D6; Tue, 8 Sep 2020 23:28: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 088NSApn065343; Tue, 8 Sep 2020 23:28:10 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 088NSAuC065338; Tue, 8 Sep 2020 23:28:10 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202009082328.088NSAuC065338@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 8 Sep 2020 23:28:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365484 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 365484 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.33 Precedence: list List-Id: "SVN commit messages 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, 08 Sep 2020 23:28:11 -0000 Author: kib Date: Tue Sep 8 23:28:09 2020 New Revision: 365484 URL: https://svnweb.freebsd.org/changeset/base/365484 Log: Add interruptible variant of vm_wait(9), vm_wait_intr(9). Also add msleep flags argument to vm_wait_doms(9). Reviewed by: markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D24652 Modified: head/sys/vm/uma_core.c head/sys/vm/vm_domainset.c head/sys/vm/vm_domainset.h head/sys/vm/vm_glue.c head/sys/vm/vm_page.c head/sys/vm/vm_pageout.h Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Tue Sep 8 23:22:11 2020 (r365483) +++ head/sys/vm/uma_core.c Tue Sep 8 23:28:09 2020 (r365484) @@ -3611,7 +3611,7 @@ restart: break; if (rr && vm_domainset_iter_policy(&di, &domain) != 0) { if ((flags & M_WAITOK) != 0) { - vm_wait_doms(&keg->uk_dr.dr_policy->ds_mask); + vm_wait_doms(&keg->uk_dr.dr_policy->ds_mask, 0); goto restart; } break; @@ -4755,7 +4755,7 @@ uma_prealloc(uma_zone_t zone, int items) break; } if (vm_domainset_iter_policy(&di, &domain) != 0) - vm_wait_doms(&keg->uk_dr.dr_policy->ds_mask); + vm_wait_doms(&keg->uk_dr.dr_policy->ds_mask, 0); } } } Modified: head/sys/vm/vm_domainset.c ============================================================================== --- head/sys/vm/vm_domainset.c Tue Sep 8 23:22:11 2020 (r365483) +++ head/sys/vm/vm_domainset.c Tue Sep 8 23:28:09 2020 (r365484) @@ -245,7 +245,7 @@ vm_domainset_iter_page(struct vm_domainset_iter *di, s /* Wait for one of the domains to accumulate some free pages. */ if (obj != NULL) VM_OBJECT_WUNLOCK(obj); - vm_wait_doms(&di->di_domain->ds_mask); + vm_wait_doms(&di->di_domain->ds_mask, 0); if (obj != NULL) VM_OBJECT_WLOCK(obj); if ((di->di_flags & VM_ALLOC_WAITFAIL) != 0) @@ -310,7 +310,7 @@ vm_domainset_iter_policy(struct vm_domainset_iter *di, return (ENOMEM); /* Wait for one of the domains to accumulate some free pages. */ - vm_wait_doms(&di->di_domain->ds_mask); + vm_wait_doms(&di->di_domain->ds_mask, 0); /* Restart the search. */ vm_domainset_iter_first(di, domain); Modified: head/sys/vm/vm_domainset.h ============================================================================== --- head/sys/vm/vm_domainset.h Tue Sep 8 23:22:11 2020 (r365483) +++ head/sys/vm/vm_domainset.h Tue Sep 8 23:28:09 2020 (r365484) @@ -50,6 +50,6 @@ void vm_domainset_iter_policy_init(struct vm_domainset void vm_domainset_iter_policy_ref_init(struct vm_domainset_iter *, struct domainset_ref *, int *, int *); -void vm_wait_doms(const domainset_t *); +int vm_wait_doms(const domainset_t *, int mflags); #endif /* __VM_DOMAINSET_H__ */ Modified: head/sys/vm/vm_glue.c ============================================================================== --- head/sys/vm/vm_glue.c Tue Sep 8 23:22:11 2020 (r365483) +++ head/sys/vm/vm_glue.c Tue Sep 8 23:28:09 2020 (r365484) @@ -565,7 +565,7 @@ vm_forkproc(struct thread *td, struct proc *p2, struct } dset = td2->td_domain.dr_policy; while (vm_page_count_severe_set(&dset->ds_mask)) { - vm_wait_doms(&dset->ds_mask); + vm_wait_doms(&dset->ds_mask, 0); } if ((flags & RFMEM) == 0) { Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Tue Sep 8 23:22:11 2020 (r365483) +++ head/sys/vm/vm_page.c Tue Sep 8 23:28:09 2020 (r365484) @@ -3147,10 +3147,13 @@ vm_wait_count(void) return (vm_severe_waiters + vm_min_waiters + vm_pageproc_waiters); } -void -vm_wait_doms(const domainset_t *wdoms) +int +vm_wait_doms(const domainset_t *wdoms, int mflags) { + int error; + error = 0; + /* * We use racey wakeup synchronization to avoid expensive global * locking for the pageproc when sleeping with a non-specific vm_wait. @@ -3162,8 +3165,8 @@ vm_wait_doms(const domainset_t *wdoms) if (curproc == pageproc) { mtx_lock(&vm_domainset_lock); vm_pageproc_waiters++; - msleep(&vm_pageproc_waiters, &vm_domainset_lock, PVM | PDROP, - "pageprocwait", 1); + error = msleep(&vm_pageproc_waiters, &vm_domainset_lock, + PVM | PDROP | mflags, "pageprocwait", 1); } else { /* * XXX Ideally we would wait only until the allocation could @@ -3173,11 +3176,12 @@ vm_wait_doms(const domainset_t *wdoms) mtx_lock(&vm_domainset_lock); if (vm_page_count_min_set(wdoms)) { vm_min_waiters++; - msleep(&vm_min_domains, &vm_domainset_lock, - PVM | PDROP, "vmwait", 0); + error = msleep(&vm_min_domains, &vm_domainset_lock, + PVM | PDROP | mflags, "vmwait", 0); } else mtx_unlock(&vm_domainset_lock); } + return (error); } /* @@ -3208,20 +3212,12 @@ vm_wait_domain(int domain) panic("vm_wait in early boot"); DOMAINSET_ZERO(&wdom); DOMAINSET_SET(vmd->vmd_domain, &wdom); - vm_wait_doms(&wdom); + vm_wait_doms(&wdom, 0); } } -/* - * vm_wait: - * - * Sleep until free pages are available for allocation in the - * affinity domains of the obj. If obj is NULL, the domain set - * for the calling thread is used. - * Called in various places after failed memory allocations. - */ -void -vm_wait(vm_object_t obj) +static int +vm_wait_flags(vm_object_t obj, int mflags) { struct domainset *d; @@ -3236,7 +3232,27 @@ vm_wait(vm_object_t obj) if (d == NULL) d = curthread->td_domain.dr_policy; - vm_wait_doms(&d->ds_mask); + return (vm_wait_doms(&d->ds_mask, mflags)); +} + +/* + * vm_wait: + * + * Sleep until free pages are available for allocation in the + * affinity domains of the obj. If obj is NULL, the domain set + * for the calling thread is used. + * Called in various places after failed memory allocations. + */ +void +vm_wait(vm_object_t obj) +{ + (void)vm_wait_flags(obj, 0); +} + +int +vm_wait_intr(vm_object_t obj) +{ + return (vm_wait_flags(obj, PCATCH)); } /* Modified: head/sys/vm/vm_pageout.h ============================================================================== --- head/sys/vm/vm_pageout.h Tue Sep 8 23:22:11 2020 (r365483) +++ head/sys/vm/vm_pageout.h Tue Sep 8 23:28:09 2020 (r365484) @@ -97,6 +97,7 @@ extern int vm_pageout_page_count; */ void vm_wait(vm_object_t obj); +int vm_wait_intr(vm_object_t obj); void vm_waitpfault(struct domainset *, int timo); void vm_wait_domain(int domain); void vm_wait_min(void); From owner-svn-src-all@freebsd.org Tue Sep 8 23:38:50 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 77C263DC29E; Tue, 8 Sep 2020 23:38: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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BmM6f2YMjz4f81; Tue, 8 Sep 2020 23:38: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 220BE1891F; Tue, 8 Sep 2020 23:38: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 088Nco9Q071431; Tue, 8 Sep 2020 23:38:50 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 088Ncnwh071427; Tue, 8 Sep 2020 23:38:49 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202009082338.088Ncnwh071427@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 8 Sep 2020 23:38:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365485 - in head/sys: dev/ksyms dev/xen/gntdev kern X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys: dev/ksyms dev/xen/gntdev kern X-SVN-Commit-Revision: 365485 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.33 Precedence: list List-Id: "SVN commit messages 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, 08 Sep 2020 23:38:50 -0000 Author: kib Date: Tue Sep 8 23:38:49 2020 New Revision: 365485 URL: https://svnweb.freebsd.org/changeset/base/365485 Log: Convert allocations of the phys pager to vm_pager_allocate(). Future changes would require additional initialization of OBJT_PHYS objects, and vm_object_allocate() is not suitable for it. Reviewed by: markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D24652 Modified: head/sys/dev/ksyms/ksyms.c head/sys/dev/xen/gntdev/gntdev.c head/sys/kern/link_elf.c head/sys/kern/link_elf_obj.c Modified: head/sys/dev/ksyms/ksyms.c ============================================================================== --- head/sys/dev/ksyms/ksyms.c Tue Sep 8 23:28:09 2020 (r365484) +++ head/sys/dev/ksyms/ksyms.c Tue Sep 8 23:38:49 2020 (r365485) @@ -41,6 +41,7 @@ #include #include #include +#include #include #include #include @@ -51,6 +52,8 @@ #include #include #include +#include +#include #include "linker_if.h" @@ -442,8 +445,8 @@ ksyms_open(struct cdev *dev, int flags, int fmt __unus ksyms_size_calc(&ts); elfsz = sizeof(struct ksyms_hdr) + ts.ts_symsz + ts.ts_strsz; - object = vm_object_allocate(OBJT_PHYS, - OFF_TO_IDX(round_page(elfsz))); + object = vm_pager_allocate(OBJT_PHYS, NULL, round_page(elfsz), + VM_PROT_ALL, 0, td->td_ucred); sc->sc_obj = object; sc->sc_objsz = elfsz; Modified: head/sys/dev/xen/gntdev/gntdev.c ============================================================================== --- head/sys/dev/xen/gntdev/gntdev.c Tue Sep 8 23:28:09 2020 (r365484) +++ head/sys/dev/xen/gntdev/gntdev.c Tue Sep 8 23:38:49 2020 (r365485) @@ -1068,7 +1068,8 @@ mmap_gref(struct per_user_data *priv_user, struct gntd vm_object_t mem_obj; struct gntdev_gref *gref; - mem_obj = vm_object_allocate(OBJT_PHYS, size); + mem_obj = vm_pager_allocate(OBJT_PHYS, NULL, size, VM_PROT_ALL, 0, + curthread->td_ucred); if (mem_obj == NULL) return (ENOMEM); Modified: head/sys/kern/link_elf.c ============================================================================== --- head/sys/kern/link_elf.c Tue Sep 8 23:28:09 2020 (r365484) +++ head/sys/kern/link_elf.c Tue Sep 8 23:38:49 2020 (r365485) @@ -1106,7 +1106,8 @@ link_elf_load_file(linker_class_t cls, const char* fil ef = (elf_file_t) lf; #ifdef SPARSE_MAPPING - ef->object = vm_object_allocate(OBJT_PHYS, atop(mapsize)); + ef->object = vm_pager_allocate(OBJT_PHYS, NULL, mapsize, VM_PROT_ALL, + 0, thread0.td_ucred); if (ef->object == NULL) { error = ENOMEM; goto out; Modified: head/sys/kern/link_elf_obj.c ============================================================================== --- head/sys/kern/link_elf_obj.c Tue Sep 8 23:28:09 2020 (r365484) +++ head/sys/kern/link_elf_obj.c Tue Sep 8 23:38:49 2020 (r365485) @@ -34,16 +34,17 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include +#include #include #include -#include #include -#include +#include +#include #include -#include #include @@ -53,11 +54,13 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include -#include #include +#include +#include #include +#include +#include +#include #include @@ -905,7 +908,8 @@ link_elf_load_file(linker_class_t cls, const char *fil * This stuff needs to be in a single chunk so that profiling etc * can get the bounds and gdb can associate offsets with modules */ - ef->object = vm_object_allocate(OBJT_PHYS, atop(round_page(mapsize))); + ef->object = vm_pager_allocate(OBJT_PHYS, NULL, round_page(mapsize), + VM_PROT_ALL, 0, thread0.td_ucred); if (ef->object == NULL) { error = ENOMEM; goto out; From owner-svn-src-all@freebsd.org Tue Sep 8 23:48:19 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DBDB13DC888; Tue, 8 Sep 2020 23:48:19 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BmMKb5ZMpz4fVT; Tue, 8 Sep 2020 23:48:19 +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 A3C0418678; Tue, 8 Sep 2020 23:48:19 +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 088NmJqW077436; Tue, 8 Sep 2020 23:48:19 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 088NmJle077434; Tue, 8 Sep 2020 23:48:19 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202009082348.088NmJle077434@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 8 Sep 2020 23:48:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365486 - in head/sys: sys vm X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys: sys vm X-SVN-Commit-Revision: 365486 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.33 Precedence: list List-Id: "SVN commit messages 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, 08 Sep 2020 23:48:19 -0000 Author: kib Date: Tue Sep 8 23:48:19 2020 New Revision: 365486 URL: https://svnweb.freebsd.org/changeset/base/365486 Log: Add kern_mmap_racct_check(), a helper to verify limits in vm_mmap*(). Reviewed by: markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D24652 Modified: head/sys/sys/syscallsubr.h head/sys/vm/vm_mmap.c Modified: head/sys/sys/syscallsubr.h ============================================================================== --- head/sys/sys/syscallsubr.h Tue Sep 8 23:38:49 2020 (r365485) +++ head/sys/sys/syscallsubr.h Tue Sep 8 23:48:19 2020 (r365486) @@ -62,6 +62,7 @@ struct sockaddr; struct stat; struct thr_param; struct uio; +struct vm_map; typedef int (*mmap_check_fp_fn)(struct file *, int, int, int); @@ -197,8 +198,10 @@ int kern_mlock(struct proc *proc, struct ucred *cred, size_t len); int kern_mmap(struct thread *td, uintptr_t addr, size_t len, int prot, int flags, int fd, off_t pos); -int kern_mmap_req(struct thread *td, const struct mmap_req *mrp); +int kern_mmap_racct_check(struct thread *td, struct vm_map *map, + vm_size_t size); int kern_mmap_maxprot(struct proc *p, int prot); +int kern_mmap_req(struct thread *td, const struct mmap_req *mrp); int kern_mprotect(struct thread *td, uintptr_t addr, size_t size, int prot); int kern_msgctl(struct thread *, int, int, struct msqid_ds *); int kern_msgrcv(struct thread *, int, void *, size_t, long, int, long *); Modified: head/sys/vm/vm_mmap.c ============================================================================== --- head/sys/vm/vm_mmap.c Tue Sep 8 23:38:49 2020 (r365485) +++ head/sys/vm/vm_mmap.c Tue Sep 8 23:48:19 2020 (r365486) @@ -1509,6 +1509,39 @@ vm_mmap(vm_map_t map, vm_offset_t *addr, vm_size_t siz return (error); } +int +kern_mmap_racct_check(struct thread *td, vm_map_t map, vm_size_t size) +{ + int error; + + RACCT_PROC_LOCK(td->td_proc); + if (map->size + size > lim_cur(td, RLIMIT_VMEM)) { + RACCT_PROC_UNLOCK(td->td_proc); + return (ENOMEM); + } + if (racct_set(td->td_proc, RACCT_VMEM, map->size + size)) { + RACCT_PROC_UNLOCK(td->td_proc); + return (ENOMEM); + } + if (!old_mlock && map->flags & MAP_WIREFUTURE) { + if (ptoa(pmap_wired_count(map->pmap)) + size > + lim_cur(td, RLIMIT_MEMLOCK)) { + racct_set_force(td->td_proc, RACCT_VMEM, map->size); + RACCT_PROC_UNLOCK(td->td_proc); + return (ENOMEM); + } + error = racct_set(td->td_proc, RACCT_MEMLOCK, + ptoa(pmap_wired_count(map->pmap)) + size); + if (error != 0) { + racct_set_force(td->td_proc, RACCT_VMEM, map->size); + RACCT_PROC_UNLOCK(td->td_proc); + return (error); + } + } + RACCT_PROC_UNLOCK(td->td_proc); + return (0); +} + /* * Internal version of mmap that maps a specific VM object into an * map. Called by mmap for MAP_ANON, vm_mmap, shm_mmap, and vn_mmap. @@ -1518,39 +1551,15 @@ vm_mmap_object(vm_map_t map, vm_offset_t *addr, vm_siz vm_prot_t maxprot, int flags, vm_object_t object, vm_ooffset_t foff, boolean_t writecounted, struct thread *td) { - boolean_t curmap, fitit; vm_offset_t max_addr; int docow, error, findspace, rv; + bool curmap, fitit; curmap = map == &td->td_proc->p_vmspace->vm_map; if (curmap) { - RACCT_PROC_LOCK(td->td_proc); - if (map->size + size > lim_cur(td, RLIMIT_VMEM)) { - RACCT_PROC_UNLOCK(td->td_proc); - return (ENOMEM); - } - if (racct_set(td->td_proc, RACCT_VMEM, map->size + size)) { - RACCT_PROC_UNLOCK(td->td_proc); - return (ENOMEM); - } - if (!old_mlock && map->flags & MAP_WIREFUTURE) { - if (ptoa(pmap_wired_count(map->pmap)) + size > - lim_cur(td, RLIMIT_MEMLOCK)) { - racct_set_force(td->td_proc, RACCT_VMEM, - map->size); - RACCT_PROC_UNLOCK(td->td_proc); - return (ENOMEM); - } - error = racct_set(td->td_proc, RACCT_MEMLOCK, - ptoa(pmap_wired_count(map->pmap)) + size); - if (error != 0) { - racct_set_force(td->td_proc, RACCT_VMEM, - map->size); - RACCT_PROC_UNLOCK(td->td_proc); - return (error); - } - } - RACCT_PROC_UNLOCK(td->td_proc); + error = kern_mmap_racct_check(td, map, size); + if (error != 0) + return (error); } /* From owner-svn-src-all@freebsd.org Tue Sep 8 23:48:50 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 651773DC4D3; Tue, 8 Sep 2020 23:48:50 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BmMLB23m3z4g1K; Tue, 8 Sep 2020 23:48:50 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 28DFF18BB0; Tue, 8 Sep 2020 23:48:50 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 088Nmom0077524; Tue, 8 Sep 2020 23:48:50 GMT (envelope-from bdragon@FreeBSD.org) Received: (from bdragon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 088Nmo7r077523; Tue, 8 Sep 2020 23:48:50 GMT (envelope-from bdragon@FreeBSD.org) Message-Id: <202009082348.088Nmo7r077523@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdragon set sender to bdragon@FreeBSD.org using -f From: Brandon Bergren Date: Tue, 8 Sep 2020 23:48:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365487 - head/sys/powerpc/powernv X-SVN-Group: head X-SVN-Commit-Author: bdragon X-SVN-Commit-Paths: head/sys/powerpc/powernv X-SVN-Commit-Revision: 365487 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.33 Precedence: list List-Id: "SVN commit messages 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, 08 Sep 2020 23:48:50 -0000 Author: bdragon Date: Tue Sep 8 23:48:49 2020 New Revision: 365487 URL: https://svnweb.freebsd.org/changeset/base/365487 Log: [PowerPC64] Fix xive order calculation in qemu TCG When emulating a single thread system for testing reasons, mp_maxid can be 0. This trips up our math for calculating the order. Account for this to fix xive attachment when emulating a single-thread core on qemu powernv (a configuration that doesn't exist in the real world.) Sponsored by: Tag1 Consulting, Inc. Modified: head/sys/powerpc/powernv/xive.c Modified: head/sys/powerpc/powernv/xive.c ============================================================================== --- head/sys/powerpc/powernv/xive.c Tue Sep 8 23:48:19 2020 (r365486) +++ head/sys/powerpc/powernv/xive.c Tue Sep 8 23:48:49 2020 (r365487) @@ -341,7 +341,11 @@ xive_attach(device_t dev) mtx_init(&sc->sc_mtx, "XIVE", NULL, MTX_DEF); - order = fls(mp_maxid + (mp_maxid - 1)) - 1; + /* Workaround for qemu single-thread powernv */ + if (mp_maxid == 0) + order = 1; + else + order = fls(mp_maxid + (mp_maxid - 1)) - 1; do { vp_block = opal_call(OPAL_XIVE_ALLOCATE_VP_BLOCK, order); From owner-svn-src-all@freebsd.org Wed Sep 9 00:00:44 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D426B3DC76E; Wed, 9 Sep 2020 00:00:44 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BmMbw5K4Cz4gLJ; Wed, 9 Sep 2020 00:00:44 +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 9A8A5189B3; Wed, 9 Sep 2020 00:00:44 +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 08900iGW085383; Wed, 9 Sep 2020 00:00:44 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08900hdW085379; Wed, 9 Sep 2020 00:00:43 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202009090000.08900hdW085379@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 9 Sep 2020 00:00:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365488 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 365488 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.33 Precedence: list List-Id: "SVN commit messages 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, 09 Sep 2020 00:00:44 -0000 Author: kib Date: Wed Sep 9 00:00:43 2020 New Revision: 365488 URL: https://svnweb.freebsd.org/changeset/base/365488 Log: Allow consumer to customize physical pager. Add support for user-supplied callbacks into phys pager operations, providing custom getpages(), haspage(), and populate() methods implementations. Pager stores user data ptr/val in the object to provide context. Add phys_pager_allocate() helper that takes user ops table as one of the arguments. Current code for these methods is moved to the 'default' ops table, assigned automatically when vm_pager_alloc() is used. Reviewed by: markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D24652 Modified: head/sys/vm/phys_pager.c head/sys/vm/vm_object.c head/sys/vm/vm_object.h head/sys/vm/vm_pager.h Modified: head/sys/vm/phys_pager.c ============================================================================== --- head/sys/vm/phys_pager.c Tue Sep 8 23:48:49 2020 (r365487) +++ head/sys/vm/phys_pager.c Wed Sep 9 00:00:43 2020 (r365488) @@ -51,6 +51,20 @@ static struct pagerlst phys_pager_object_list; /* protect access to phys_pager_object_list */ static struct mtx phys_pager_mtx; +static int default_phys_pager_getpages(vm_object_t object, vm_page_t *m, + int count, int *rbehind, int *rahead); +static int default_phys_pager_populate(vm_object_t object, vm_pindex_t pidx, + int fault_type, vm_prot_t max_prot, vm_pindex_t *first, vm_pindex_t *last); +static boolean_t default_phys_pager_haspage(vm_object_t object, + vm_pindex_t pindex, int *before, int *after); +struct phys_pager_ops default_phys_pg_ops = { + .phys_pg_getpages = default_phys_pager_getpages, + .phys_pg_populate = default_phys_pager_populate, + .phys_pg_haspage = default_phys_pager_haspage, + .phys_pg_ctor = NULL, + .phys_pg_dtor = NULL, +}; + static void phys_pager_init(void) { @@ -59,12 +73,13 @@ phys_pager_init(void) mtx_init(&phys_pager_mtx, "phys_pager list", NULL, MTX_DEF); } -static vm_object_t -phys_pager_alloc(void *handle, vm_ooffset_t size, vm_prot_t prot, - vm_ooffset_t foff, struct ucred *cred) +vm_object_t +phys_pager_allocate(void *handle, struct phys_pager_ops *ops, void *data, + vm_ooffset_t size, vm_prot_t prot, vm_ooffset_t foff, struct ucred *cred) { vm_object_t object, object1; vm_pindex_t pindex; + bool init; /* * Offset should be page aligned. @@ -73,6 +88,7 @@ phys_pager_alloc(void *handle, vm_ooffset_t size, vm_p return (NULL); pindex = OFF_TO_IDX(foff + PAGE_MASK + size); + init = true; if (handle != NULL) { mtx_lock(&phys_pager_mtx); @@ -97,11 +113,15 @@ phys_pager_alloc(void *handle, vm_ooffset_t size, vm_p */ if (pindex > object->size) object->size = pindex; + init = false; } else { object = object1; object1 = NULL; object->handle = handle; - vm_object_set_flag(object, OBJ_POPULATE); + object->un_pager.phys.ops = ops; + object->un_pager.phys.data_ptr = data; + if (ops->phys_pg_populate != NULL) + vm_object_set_flag(object, OBJ_POPULATE); TAILQ_INSERT_TAIL(&phys_pager_object_list, object, pager_object_list); } @@ -113,12 +133,25 @@ phys_pager_alloc(void *handle, vm_ooffset_t size, vm_p vm_object_deallocate(object1); } else { object = vm_object_allocate(OBJT_PHYS, pindex); - vm_object_set_flag(object, OBJ_POPULATE); + object->un_pager.phys.ops = ops; + object->un_pager.phys.data_ptr = data; + if (ops->phys_pg_populate != NULL) + vm_object_set_flag(object, OBJ_POPULATE); } + if (init && ops->phys_pg_ctor != NULL) + ops->phys_pg_ctor(object, prot, foff, cred); return (object); } +static vm_object_t +phys_pager_alloc(void *handle, vm_ooffset_t size, vm_prot_t prot, + vm_ooffset_t foff, struct ucred *ucred) +{ + return (phys_pager_allocate(handle, &default_phys_pg_ops, NULL, + size, prot, foff, ucred)); +} + static void phys_pager_dealloc(vm_object_t object) { @@ -130,16 +163,18 @@ phys_pager_dealloc(vm_object_t object) mtx_unlock(&phys_pager_mtx); VM_OBJECT_WLOCK(object); } - object->handle = NULL; object->type = OBJT_DEAD; + if (object->un_pager.phys.ops->phys_pg_dtor != NULL) + object->un_pager.phys.ops->phys_pg_dtor(object); + object->handle = NULL; } /* * Fill as many pages as vm_fault has allocated for us. */ static int -phys_pager_getpages(vm_object_t object, vm_page_t *m, int count, int *rbehind, - int *rahead) +default_phys_pager_getpages(vm_object_t object, vm_page_t *m, int count, + int *rbehind, int *rahead) { int i; @@ -161,6 +196,14 @@ phys_pager_getpages(vm_object_t object, vm_page_t *m, return (VM_PAGER_OK); } +static int +phys_pager_getpages(vm_object_t object, vm_page_t *m, int count, int *rbehind, + int *rahead) +{ + return (object->un_pager.phys.ops->phys_pg_getpages(object, m, + count, rbehind, rahead)); +} + /* * Implement a pretty aggressive clustered getpages strategy. Hint that * everything in an entire 4MB window should be prefaulted at once. @@ -185,7 +228,7 @@ SYSCTL_INT(_vm, OID_AUTO, phys_pager_cluster, CTLFLAG_ #define PHYSALLOC 16 static int -phys_pager_populate(vm_object_t object, vm_pindex_t pidx, +default_phys_pager_populate(vm_object_t object, vm_pindex_t pidx, int fault_type __unused, vm_prot_t max_prot __unused, vm_pindex_t *first, vm_pindex_t *last) { @@ -216,6 +259,14 @@ phys_pager_populate(vm_object_t object, vm_pindex_t pi return (VM_PAGER_OK); } +static int +phys_pager_populate(vm_object_t object, vm_pindex_t pidx, int fault_type, + vm_prot_t max_prot, vm_pindex_t *first, vm_pindex_t *last) +{ + return (object->un_pager.phys.ops->phys_pg_populate(object, pidx, + fault_type, max_prot, first, last)); +} + static void phys_pager_putpages(vm_object_t object, vm_page_t *m, int count, boolean_t sync, int *rtvals) @@ -225,7 +276,7 @@ phys_pager_putpages(vm_object_t object, vm_page_t *m, } static boolean_t -phys_pager_haspage(vm_object_t object, vm_pindex_t pindex, int *before, +default_phys_pager_haspage(vm_object_t object, vm_pindex_t pindex, int *before, int *after) { vm_pindex_t base, end; @@ -237,6 +288,14 @@ phys_pager_haspage(vm_object_t object, vm_pindex_t pin if (after != NULL) *after = end - pindex; return (TRUE); +} + +static boolean_t +phys_pager_haspage(vm_object_t object, vm_pindex_t pindex, int *before, + int *after) +{ + return (object->un_pager.phys.ops->phys_pg_haspage(object, pindex, + before, after)); } struct pagerops physpagerops = { Modified: head/sys/vm/vm_object.c ============================================================================== --- head/sys/vm/vm_object.c Tue Sep 8 23:48:49 2020 (r365487) +++ head/sys/vm/vm_object.c Wed Sep 9 00:00:43 2020 (r365488) @@ -286,6 +286,7 @@ vm_object_init(void) kernel_object->flags |= OBJ_COLORED; kernel_object->pg_color = (u_short)atop(VM_MIN_KERNEL_ADDRESS); #endif + kernel_object->un_pager.phys.ops = &default_phys_pg_ops; /* * The lock portion of struct vm_object must be type stable due Modified: head/sys/vm/vm_object.h ============================================================================== --- head/sys/vm/vm_object.h Tue Sep 8 23:48:49 2020 (r365487) +++ head/sys/vm/vm_object.h Wed Sep 9 00:00:43 2020 (r365488) @@ -173,6 +173,17 @@ struct vm_object { struct pctrie swp_blks; vm_ooffset_t writemappings; } swp; + + /* + * Phys pager + */ + struct { + struct phys_pager_ops *ops; + union { + void *data_ptr; + uintptr_t data_val; + }; + } phys; } un_pager; struct ucred *cred; vm_ooffset_t charge; Modified: head/sys/vm/vm_pager.h ============================================================================== --- head/sys/vm/vm_pager.h Tue Sep 8 23:48:49 2020 (r365487) +++ head/sys/vm/vm_pager.h Wed Sep 9 00:00:43 2020 (r365488) @@ -227,5 +227,22 @@ vm_object_t cdev_pager_allocate(void *handle, enum obj vm_object_t cdev_pager_lookup(void *handle); void cdev_pager_free_page(vm_object_t object, vm_page_t m); +struct phys_pager_ops { + int (*phys_pg_getpages)(vm_object_t vm_obj, vm_page_t *m, int count, + int *rbehind, int *rahead); + int (*phys_pg_populate)(vm_object_t vm_obj, vm_pindex_t pidx, + int fault_type, vm_prot_t max_prot, vm_pindex_t *first, + vm_pindex_t *last); + boolean_t (*phys_pg_haspage)(vm_object_t obj, vm_pindex_t pindex, + int *before, int *after); + void (*phys_pg_ctor)(vm_object_t vm_obj, vm_prot_t prot, + vm_ooffset_t foff, struct ucred *cred); + void (*phys_pg_dtor)(vm_object_t vm_obj); +}; +extern struct phys_pager_ops default_phys_pg_ops; +vm_object_t phys_pager_allocate(void *handle, struct phys_pager_ops *ops, + void *data, vm_ooffset_t size, vm_prot_t prot, vm_ooffset_t foff, + struct ucred *cred); + #endif /* _KERNEL */ #endif /* _VM_PAGER_ */ From owner-svn-src-all@freebsd.org Wed Sep 9 00:06:35 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DF89E3DCDF4; Wed, 9 Sep 2020 00:06:35 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BmMkg5gKTz4h25; Wed, 9 Sep 2020 00:06:35 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 A676818C30; Wed, 9 Sep 2020 00:06:35 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08906ZLd089651; Wed, 9 Sep 2020 00:06:35 GMT (envelope-from bdragon@FreeBSD.org) Received: (from bdragon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08906ZE1089650; Wed, 9 Sep 2020 00:06:35 GMT (envelope-from bdragon@FreeBSD.org) Message-Id: <202009090006.08906ZE1089650@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdragon set sender to bdragon@FreeBSD.org using -f From: Brandon Bergren Date: Wed, 9 Sep 2020 00:06:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365489 - head/contrib/elftoolchain/libelf X-SVN-Group: head X-SVN-Commit-Author: bdragon X-SVN-Commit-Paths: head/contrib/elftoolchain/libelf X-SVN-Commit-Revision: 365489 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.33 Precedence: list List-Id: "SVN commit messages 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, 09 Sep 2020 00:06:35 -0000 Author: bdragon Date: Wed Sep 9 00:06:35 2020 New Revision: 365489 URL: https://svnweb.freebsd.org/changeset/base/365489 Log: [PowerPC64LE] PPC64LE support for libelf. Fix native detection when building on powerpc64le. I will be submitting this and r361104 upstream shortly. Sponsored by: Tag1 Consulting, Inc. Modified: head/contrib/elftoolchain/libelf/_libelf_config.h Modified: head/contrib/elftoolchain/libelf/_libelf_config.h ============================================================================== --- head/contrib/elftoolchain/libelf/_libelf_config.h Wed Sep 9 00:00:43 2020 (r365488) +++ head/contrib/elftoolchain/libelf/_libelf_config.h Wed Sep 9 00:06:35 2020 (r365489) @@ -94,7 +94,11 @@ #elif defined(__powerpc64__) #define LIBELF_ARCH EM_PPC64 +#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ +#define LIBELF_BYTEORDER ELFDATA2LSB +#else #define LIBELF_BYTEORDER ELFDATA2MSB +#endif #define LIBELF_CLASS ELFCLASS64 #elif defined(__powerpc__) From owner-svn-src-all@freebsd.org Wed Sep 9 00:39:48 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 94B803DE43C; Wed, 9 Sep 2020 00:39: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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BmNT02wzPz4jdc; Wed, 9 Sep 2020 00:39: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 47CD619513; Wed, 9 Sep 2020 00:39: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 0890dmuA008211; Wed, 9 Sep 2020 00:39:48 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0890dllX008207; Wed, 9 Sep 2020 00:39:47 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202009090039.0890dllX008207@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 9 Sep 2020 00:39:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365490 - in head: libexec libexec/phttpget tools/build/mk usr.sbin/portsnap usr.sbin/portsnap/phttpget X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head: libexec libexec/phttpget tools/build/mk usr.sbin/portsnap usr.sbin/portsnap/phttpget X-SVN-Commit-Revision: 365490 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.33 Precedence: list List-Id: "SVN commit messages 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, 09 Sep 2020 00:39:48 -0000 Author: kevans Date: Wed Sep 9 00:39:47 2020 New Revision: 365490 URL: https://svnweb.freebsd.org/changeset/base/365490 Log: phttpget: move out of portsnap Currently, WITHOUT_PORTSNAP forces WITHOUT_FREEBSD_UPDATE because the latter relies on phttpget, which lives inside the portsnap build bits. Remove the dependency between these two options by moving phttpget out into ^/libexec and building/installing it if either WITH_PORTSNAP or WITH_FREEBSD_UPDATE. Future work could remove the conditional if it's decided that users will use it independently of either the current in-base consumers. Reported by: swills Reviewed by: jilles, emaste MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D26255 Added: head/libexec/phttpget/ - copied from r365489, head/usr.sbin/portsnap/phttpget/ Deleted: head/usr.sbin/portsnap/phttpget/ Modified: head/libexec/Makefile head/libexec/phttpget/Makefile head/tools/build/mk/OptionalObsoleteFiles.inc head/usr.sbin/portsnap/Makefile Modified: head/libexec/Makefile ============================================================================== --- head/libexec/Makefile Wed Sep 9 00:06:35 2020 (r365489) +++ head/libexec/Makefile Wed Sep 9 00:39:47 2020 (r365490) @@ -13,6 +13,7 @@ SUBDIR= ${_atf} \ ${_mail.local} \ ${_makewhatis.local} \ ${_mknetid} \ + ${_phttpget} \ ${_pppoed} \ rc \ revnetgroup \ @@ -46,6 +47,10 @@ SUBDIR+= bootpd .if ${MK_FINGER} != "no" SUBDIR+= fingerd +.endif + +.if ${MK_FREEBSD_UPDATE} != "no" || ${MK_PORTSNAP} != "no" +_phttpget= phttpget .endif .if ${MK_FTP} != "no" Modified: head/libexec/phttpget/Makefile ============================================================================== --- head/usr.sbin/portsnap/phttpget/Makefile Wed Sep 9 00:06:35 2020 (r365489) +++ head/libexec/phttpget/Makefile Wed Sep 9 00:39:47 2020 (r365490) @@ -3,6 +3,4 @@ PROG= phttpget MAN= phttpget.8 -BINDIR= ${LIBEXECDIR} - .include Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Wed Sep 9 00:06:35 2020 (r365489) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Wed Sep 9 00:39:47 2020 (r365490) @@ -2043,6 +2043,11 @@ OLD_FILES+=usr/share/man/man5/freebsd-update.conf.5.gz OLD_FILES+=usr/share/man/man8/freebsd-update.8.gz .endif +.if ${MK_FREEBSD_UPDATE} == no && ${MK_PORTSNAP} == no +OLD_FILES+=usr/libexec/phttpget +OLD_FILES+=usr/share/man/man8/phttpget.8.gz +.endif + .if ${MK_GAMES} == no OLD_FILES+=usr/bin/caesar OLD_FILES+=usr/bin/factor @@ -7330,10 +7335,8 @@ OLD_FILES+=usr/share/man/man8/pmcstudy.8.gz .if ${MK_PORTSNAP} == no OLD_FILES+=etc/portsnap.conf OLD_FILES+=usr/libexec/make_index -OLD_FILES+=usr/libexec/phttpget OLD_FILES+=usr/sbin/portsnap OLD_FILES+=usr/share/examples/etc/portsnap.conf -OLD_FILES+=usr/share/man/man8/phttpget.8.gz OLD_FILES+=usr/share/man/man8/portsnap.8.gz .endif Modified: head/usr.sbin/portsnap/Makefile ============================================================================== --- head/usr.sbin/portsnap/Makefile Wed Sep 9 00:06:35 2020 (r365489) +++ head/usr.sbin/portsnap/Makefile Wed Sep 9 00:39:47 2020 (r365490) @@ -1,5 +1,5 @@ # $FreeBSD$ -SUBDIR= portsnap make_index phttpget +SUBDIR= portsnap make_index .include From owner-svn-src-all@freebsd.org Wed Sep 9 00:40:55 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AF7183DE17C; Wed, 9 Sep 2020 00:40:55 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BmNVH4Flzz4jj2; Wed, 9 Sep 2020 00:40:55 +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 756BB19161; Wed, 9 Sep 2020 00:40:55 +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 0890ethD011329; Wed, 9 Sep 2020 00:40:55 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0890etda011328; Wed, 9 Sep 2020 00:40:55 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202009090040.0890etda011328@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 9 Sep 2020 00:40:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365491 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 365491 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.33 Precedence: list List-Id: "SVN commit messages 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, 09 Sep 2020 00:40:55 -0000 Author: kevans Date: Wed Sep 9 00:40:54 2020 New Revision: 365491 URL: https://svnweb.freebsd.org/changeset/base/365491 Log: opts: FREEBSD_UPDATE no longer relies on PORTSNAP phttpget is no longer tied to the portsnap build as of r365490. MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D26255 Modified: head/share/mk/src.opts.mk Modified: head/share/mk/src.opts.mk ============================================================================== --- head/share/mk/src.opts.mk Wed Sep 9 00:39:47 2020 (r365490) +++ head/share/mk/src.opts.mk Wed Sep 9 00:40:54 2020 (r365491) @@ -462,11 +462,6 @@ MK_AUTHPF:= no MK_OFED_EXTRA:= no .endif -.if ${MK_PORTSNAP} == "no" -# freebsd-update depends on phttpget from portsnap -MK_FREEBSD_UPDATE:= no -.endif - .if ${MK_TESTS} == "no" MK_DTRACE_TESTS:= no .endif From owner-svn-src-all@freebsd.org Wed Sep 9 00:41:31 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C0A673DE533; Wed, 9 Sep 2020 00:41:31 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BmNVz4gkXz4k57; Wed, 9 Sep 2020 00:41:31 +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 83D5F19344; Wed, 9 Sep 2020 00:41:31 +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 0890fVkg013734; Wed, 9 Sep 2020 00:41:31 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0890fVXp013733; Wed, 9 Sep 2020 00:41:31 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202009090041.0890fVXp013733@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 9 Sep 2020 00:41:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365492 - head/share/man/man5 X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/share/man/man5 X-SVN-Commit-Revision: 365492 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.33 Precedence: list List-Id: "SVN commit messages 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, 09 Sep 2020 00:41:31 -0000 Author: kevans Date: Wed Sep 9 00:41:31 2020 New Revision: 365492 URL: https://svnweb.freebsd.org/changeset/base/365492 Log: src.conf(5): regen after r365491 Modified: head/share/man/man5/src.conf.5 Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Wed Sep 9 00:40:54 2020 (r365491) +++ head/share/man/man5/src.conf.5 Wed Sep 9 00:41:31 2020 (r365492) @@ -1,6 +1,6 @@ .\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman. .\" $FreeBSD$ -.Dd September 7, 2020 +.Dd September 8, 2020 .Dt SRC.CONF 5 .Os .Sh NAME @@ -1370,12 +1370,6 @@ and related programs. Set to not build or install .Xr portsnap 8 and related files. -When set, it enforces these options: -.Pp -.Bl -item -compact -.It -.Va WITHOUT_FREEBSD_UPDATE -.El .It Va WITHOUT_PPP Set to not build .Xr ppp 8 From owner-svn-src-all@freebsd.org Wed Sep 9 02:42:21 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C84A83E0BBB; Wed, 9 Sep 2020 02:42:21 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BmRBP4y8Dz4pqb; Wed, 9 Sep 2020 02:42:21 +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 8D7241AA2C; Wed, 9 Sep 2020 02:42:21 +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 0892gLqF086773; Wed, 9 Sep 2020 02:42:21 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0892gLWk086772; Wed, 9 Sep 2020 02:42:21 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202009090242.0892gLWk086772@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 9 Sep 2020 02:42:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365493 - head/lib/libc/tests/resolv X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/lib/libc/tests/resolv X-SVN-Commit-Revision: 365493 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.33 Precedence: list List-Id: "SVN commit messages 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, 09 Sep 2020 02:42:21 -0000 Author: kevans Date: Wed Sep 9 02:42:21 2020 New Revision: 365493 URL: https://svnweb.freebsd.org/changeset/base/365493 Log: libc/resolv: attempt to fix the test under WARNS=6 In a side-change that I'm working on to start defaulting src builds to WARNS=6 where WARNS isn't otherwise specified, GCC6 (and clang, to a lesser extent) pointed out a number of issues with the resolv tests: - Global method variable that gets shadowed in run_tests() - Signed/unsigned comparison between i in run_tests() and hosts->sl_cur The shadowed variable looks like it might actually be bogus as written, as we pass it to RUN_TESTS -> run_tests, but other parts use the global method instead. This change is mainly geared towards correcting that by removing the global and plumbing the method through from run_tests -> run into the new thread. For the signed/unsigned comparison, there's no compelling reason to not just switch i/nthreads/nhosts to size_t. The review also included a change to the load() function that was better addressed by jhb in r365302. Reviewed by: ngie, pstef MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D24844 Modified: head/lib/libc/tests/resolv/resolv_test.c Modified: head/lib/libc/tests/resolv/resolv_test.c ============================================================================== --- head/lib/libc/tests/resolv/resolv_test.c Wed Sep 9 00:41:31 2020 (r365492) +++ head/lib/libc/tests/resolv/resolv_test.c Wed Sep 9 02:42:21 2020 (r365493) @@ -34,6 +34,8 @@ __RCSID("$NetBSD: resolv.c,v 1.6 2004/05/23 16:59:11 c #include #include +#include +#include #include #include #include @@ -55,14 +57,13 @@ enum method { }; static StringList *hosts = NULL; -static enum method method = METHOD_GETADDRINFO; static int *ask = NULL; static int *got = NULL; static void load(const char *); -static void resolvone(int); +static void resolvone(int, enum method); static void *resolvloop(void *); -static void run(int *); +static void run(int *, enum method); static pthread_mutex_t stats = PTHREAD_MUTEX_INITIALIZER; @@ -173,18 +174,18 @@ resolv_getipnodeby(pthread_t self, char *host) } static void -resolvone(int n) +resolvone(int n, enum method method) { char buf[1024]; pthread_t self = pthread_self(); size_t i = (random() & 0x0fffffff) % hosts->sl_cur; char *host = hosts->sl_str[i]; - struct addrinfo hints, *res; int error, len; len = snprintf(buf, sizeof(buf), "%p: %d resolving %s %d\n", self, n, host, (int)i); (void)write(STDOUT_FILENO, buf, len); + error = 0; switch (method) { case METHOD_GETADDRINFO: error = resolv_getaddrinfo(self, host, i); @@ -196,6 +197,10 @@ resolvone(int n) error = resolv_getipnodeby(self, host); break; default: + /* UNREACHABLE */ + /* XXX Needs an __assert_unreachable() for userland. */ + assert(0 && "Unreachable segment reached"); + abort(); break; } pthread_mutex_lock(&stats); @@ -204,35 +209,53 @@ resolvone(int n) pthread_mutex_unlock(&stats); } +struct resolvloop_args { + int *nhosts; + enum method method; +}; + static void * resolvloop(void *p) { - int *nhosts = (int *)p; - if (*nhosts == 0) + struct resolvloop_args *args = p; + + if (*args->nhosts == 0) { + free(args); return NULL; + } + do - resolvone(*nhosts); - while (--(*nhosts)); + resolvone(*args->nhosts, args->method); + while (--(*args->nhosts)); + free(args); return NULL; } static void -run(int *nhosts) +run(int *nhosts, enum method method) { pthread_t self; int rc; + struct resolvloop_args *args; + /* Created thread is responsible for free(). */ + args = malloc(sizeof(*args)); + ATF_REQUIRE(args != NULL); + + args->nhosts = nhosts; + args->method = method; self = pthread_self(); - rc = pthread_create(&self, NULL, resolvloop, nhosts); + rc = pthread_create(&self, NULL, resolvloop, args); ATF_REQUIRE_MSG(rc == 0, "pthread_create failed: %s", strerror(rc)); } static int run_tests(const char *hostlist_file, enum method method) { - int nthreads = NTHREADS; - int nhosts = NHOSTS; - int i, c, done, *nleft; + size_t nthreads = NTHREADS; + size_t nhosts = NHOSTS; + size_t i; + int c, done, *nleft; hosts = sl_init(); srandom(1234); @@ -252,7 +275,7 @@ run_tests(const char *hostlist_file, enum method metho for (i = 0; i < nthreads; i++) { nleft[i] = nhosts; - run(&nleft[i]); + run(&nleft[i], method); } for (done = 0; !done;) { From owner-svn-src-all@freebsd.org Wed Sep 9 02:45:47 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C78C63E100E; Wed, 9 Sep 2020 02:45:47 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BmRGM4t6cz4qBX; Wed, 9 Sep 2020 02: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 8B0561AC2C; Wed, 9 Sep 2020 02: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 0892jlWX086998; Wed, 9 Sep 2020 02:45:47 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0892jlhZ086997; Wed, 9 Sep 2020 02:45:47 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202009090245.0892jlhZ086997@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 9 Sep 2020 02:45:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365494 - head/lib/libc/tests/stdlib/dynthr_mod X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/lib/libc/tests/stdlib/dynthr_mod X-SVN-Commit-Revision: 365494 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.33 Precedence: list List-Id: "SVN commit messages 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, 09 Sep 2020 02:45:47 -0000 Author: kevans Date: Wed Sep 9 02:45:47 2020 New Revision: 365494 URL: https://svnweb.freebsd.org/changeset/base/365494 Log: libc tests: dynthr_mod: fix some WARNS issues This is being addressed as part of a side-patch I'm working on that builds all the things with WARNS=6, instead of relying on it being supplied in just shallow parts of the build with higher-level Makefile.inc. Provide a prototype for mod_main and annotate the thread function argument as unused. MFC after: 1 week Modified: head/lib/libc/tests/stdlib/dynthr_mod/dynthr_mod.c Modified: head/lib/libc/tests/stdlib/dynthr_mod/dynthr_mod.c ============================================================================== --- head/lib/libc/tests/stdlib/dynthr_mod/dynthr_mod.c Wed Sep 9 02:42:21 2020 (r365493) +++ head/lib/libc/tests/stdlib/dynthr_mod/dynthr_mod.c Wed Sep 9 02:45:47 2020 (r365494) @@ -41,10 +41,12 @@ __FBSDID("$FreeBSD$"); #include #include +void mod_main(int op); + static pthread_t thr; static void * -mod_thread(void *ptr) +mod_thread(void *ptr __unused) { char *volatile dummy; From owner-svn-src-all@freebsd.org Wed Sep 9 05:49:07 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6DAED3E5917; Wed, 9 Sep 2020 05:49:07 +0000 (UTC) (envelope-from agapon@gmail.com) Received: from mail-lj1-f182.google.com (mail-lj1-f182.google.com [209.85.208.182]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BmWKt11q3z3W59; Wed, 9 Sep 2020 05:49:05 +0000 (UTC) (envelope-from agapon@gmail.com) Received: by mail-lj1-f182.google.com with SMTP id k25so1925480ljk.0; Tue, 08 Sep 2020 22:49:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:openpgp:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=+Ab78g4/Z7hxmCoY1gWvrmOQNpVkcDy/d10oMnnk5us=; b=KBDTGKJrEpOR1QuKoxVB2jPzV2J6gYCq0UlXCXNLWLlv4pPusCcNdKUqZT99boPLai P9n/0ZAPKKV4xPadJj9UFTGuoTLafMGSfzkJyjaV4VaGRGgpIuFaKsEZOe0Ym7cXOJKC TBpsnX3/345c79NHnAgXuswoxKaZ/sVxJFGzxBHgVkoR06pGEi4zMYMP3uc0D6XaiQkA WxlsQ8GBi2D1kV+FnENTcCyxi3XHkNWD3GYn4pRZaox/hvJQDR/te6gAJunUwBW3JVNt ROghR5EZw8mlN9jnr3/n+d1D+3O8HQ6QTEixNWlZ6ZRRbtpiALxg1ZceNazhSdQXLjhN ACGg== X-Gm-Message-State: AOAM532Tvw2uhA1loOUd83YtRQfPsjAkRmxx3URptmgm8d2x7PtvyqY3 QXzQPC6Z5RdtdVfa9dVfyirfztDmEgM= X-Google-Smtp-Source: ABdhPJwVuUardA5iWPi6DhOUtIQoZrFqe/Ez9IXcye8TKpvCaGBls7UVrH8+tiN42I3NtCEiGTlSPg== X-Received: by 2002:a2e:3013:: with SMTP id w19mr924470ljw.339.1599630543350; Tue, 08 Sep 2020 22:49:03 -0700 (PDT) Received: from [192.168.0.88] (east.meadow.volia.net. [93.72.151.96]) by smtp.googlemail.com with ESMTPSA id 144sm339130lfj.35.2020.09.08.22.49.02 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 08 Sep 2020 22:49:02 -0700 (PDT) Subject: uninitialized variables [Was: svn commit: r365445 - head/sys/cam/mmc] To: Mark Johnston , Michal Meloun Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202009080546.0885kAgk006783@repo.freebsd.org> <34826ee7-12a9-d309-1fee-cd2e95744603@FreeBSD.org> <67be7fa5-30dd-b7ee-1076-9c29195d83d3@gmail.com> <20200908124848.GB66031@raichu> From: Andriy Gapon Openpgp: preference=signencrypt Autocrypt: addr=avg@FreeBSD.org; prefer-encrypt=mutual; keydata= mQINBFm4LIgBEADNB/3lT7f15UKeQ52xCFQx/GqHkSxEdVyLFZTmY3KyNPQGBtyvVyBfprJ7 mAeXZWfhat6cKNRAGZcL5EmewdQuUfQfBdYmKjbw3a9GFDsDNuhDA2QwFt8BmkiVMRYyvI7l N0eVzszWCUgdc3qqM6qqcgBaqsVmJluwpvwp4ZBXmch5BgDDDb1MPO8AZ2QZfIQmplkj8Y6Z AiNMknkmgaekIINSJX8IzRzKD5WwMsin70psE8dpL/iBsA2cpJGzWMObVTtCxeDKlBCNqM1i gTXta1ukdUT7JgLEFZk9ceYQQMJJtUwzWu1UHfZn0Fs29HTqawfWPSZVbulbrnu5q55R4PlQ /xURkWQUTyDpqUvb4JK371zhepXiXDwrrpnyyZABm3SFLkk2bHlheeKU6Yql4pcmSVym1AS4 dV8y0oHAfdlSCF6tpOPf2+K9nW1CFA8b/tw4oJBTtfZ1kxXOMdyZU5fiG7xb1qDgpQKgHUX8 7Rd2T1UVLVeuhYlXNw2F+a2ucY+cMoqz3LtpksUiBppJhw099gEXehcN2JbUZ2TueJdt1FdS ztnZmsHUXLxrRBtGwqnFL7GSd6snpGIKuuL305iaOGODbb9c7ne1JqBbkw1wh8ci6vvwGlzx rexzimRaBzJxlkjNfMx8WpCvYebGMydNoeEtkWldtjTNVsUAtQARAQABtB5BbmRyaXkgR2Fw b24gPGF2Z0BGcmVlQlNELm9yZz6JAlQEEwEIAD4WIQS+LEO7ngQnXA4Bjr538m7TUc1yjwUC WbgsiAIbIwUJBaOagAULCQgHAgYVCAkKCwIEFgIDAQIeAQIXgAAKCRB38m7TUc1yj+JAEACV l9AK/nOWAt/9cufV2fRj0hdOqB1aCshtSrwHk/exXsDa4/FkmegxXQGY+3GWX3deIyesbVRL rYdtdK0dqJyT1SBqXK1h3/at9rxr9GQA6KWOxTjUFURsU7ok/6SIlm8uLRPNKO+yq0GDjgaO LzN+xykuBA0FlhQAXJnpZLcVfPJdWv7sSHGedL5ln8P8rxR+XnmsA5TUaaPcbhTB+mG+iKFj GghASDSfGqLWFPBlX/fpXikBDZ1gvOr8nyMY9nXhgfXpq3B6QCRYKPy58ChrZ5weeJZ29b7/ QdEO8NFNWHjSD9meiLdWQaqo9Y7uUxN3wySc/YUZxtS0bhAd8zJdNPsJYG8sXgKjeBQMVGuT eCAJFEYJqbwWvIXMfVWop4+O4xB+z2YE3jAbG/9tB/GSnQdVSj3G8MS80iLS58frnt+RSEw/ psahrfh0dh6SFHttE049xYiC+cM8J27Aaf0i9RflyITq57NuJm+AHJoU9SQUkIF0nc6lfA+o JRiyRlHZHKoRQkIg4aiKaZSWjQYRl5Txl0IZUP1dSWMX4s3XTMurC/pnja45dge/4ESOtJ9R 8XuIWg45Oq6MeIWdjKddGhRj3OohsltKgkEU3eLKYtB6qRTQypHHUawCXz88uYt5e3w4V16H lCpSTZV/EVHnNe45FVBlvK7k7HFfDDkryLkCDQRZuCyIARAAlq0slcsVboY/+IUJdcbEiJRW be9HKVz4SUchq0z9MZPX/0dcnvz/gkyYA+OuM78dNS7Mbby5dTvOqfpLJfCuhaNYOhlE0wY+ 1T6Tf1f4c/uA3U/YiadukQ3+6TJuYGAdRZD5EqYFIkreARTVWg87N9g0fT9BEqLw9lJtEGDY EWUE7L++B8o4uu3LQFEYxcrb4K/WKmgtmFcm77s0IKDrfcX4doV92QTIpLiRxcOmCC/OCYuO jB1oaaqXQzZrCutXRK0L5XN1Y1PYjIrEzHMIXmCDlLYnpFkK+itlXwlE2ZQxkfMruCWdQXye syl2fynAe8hvp7Mms9qU2r2K9EcJiR5N1t1C2/kTKNUhcRv7Yd/vwusK7BqJbhlng5ZgRx0m WxdntU/JLEntz3QBsBsWM9Y9wf2V4tLv6/DuDBta781RsCB/UrU2zNuOEkSixlUiHxw1dccI 6CVlaWkkJBxmHX22GdDFrcjvwMNIbbyfQLuBq6IOh8nvu9vuItup7qemDG3Ms6TVwA7BD3j+ 3fGprtyW8Fd/RR2bW2+LWkMrqHffAr6Y6V3h5kd2G9Q8ZWpEJk+LG6Mk3fhZhmCnHhDu6CwN MeUvxXDVO+fqc3JjFm5OxhmfVeJKrbCEUJyM8ESWLoNHLqjywdZga4Q7P12g8DUQ1mRxYg/L HgZY3zfKOqcAEQEAAYkCPAQYAQgAJhYhBL4sQ7ueBCdcDgGOvnfybtNRzXKPBQJZuCyIAhsM BQkFo5qAAAoJEHfybtNRzXKPBVwQAKfFy9P7N3OsLDMB56A4Kf+ZT+d5cIx0Yiaf4n6w7m3i ImHHHk9FIetI4Xe54a2IXh4Bq5UkAGY0667eIs+Z1Ea6I2i27Sdo7DxGwq09Qnm/Y65ADvXs 3aBvokCcm7FsM1wky395m8xUos1681oV5oxgqeRI8/76qy0hD9WR65UW+HQgZRIcIjSel9vR XDaD2HLGPTTGr7u4v00UeTMs6qvPsa2PJagogrKY8RXdFtXvweQFz78NbXhluwix2Tb9ETPk LIpDrtzV73CaE2aqBG/KrboXT2C67BgFtnk7T7Y7iKq4/XvEdDWscz2wws91BOXuMMd4c/c4 OmGW9m3RBLufFrOag1q5yUS9QbFfyqL6dftJP3Zq/xe+mr7sbWbhPVCQFrH3r26mpmy841ym dwQnNcsbIGiBASBSKksOvIDYKa2Wy8htPmWFTEOPRpFXdGQ27awcjjnB42nngyCK5ukZDHi6 w0qK5DNQQCkiweevCIC6wc3p67jl1EMFY5+z+zdTPb3h7LeVnGqW0qBQl99vVFgzLxchKcl0 R/paSFgwqXCZhAKMuUHncJuynDOP7z5LirUeFI8qsBAJi1rXpQoLJTVcW72swZ42IdPiboqx NbTMiNOiE36GqMcTPfKylCbF45JNX4nF9ElM0E+Y8gi4cizJYBRr2FBJgay0b9Cp Message-ID: <6b18b5ef-a743-3d5e-8dd2-24640614ec88@FreeBSD.org> Date: Wed, 9 Sep 2020 08:49:01 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Firefox/60.0 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <20200908124848.GB66031@raichu> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4BmWKt11q3z3W59 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of agapon@gmail.com designates 209.85.208.182 as permitted sender) smtp.mailfrom=agapon@gmail.com X-Spamd-Result: default: False [-2.28 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; RCPT_COUNT_FIVE(0.00)[5]; RCVD_COUNT_THREE(0.00)[3]; NEURAL_HAM_SHORT(-0.39)[-0.385]; FREEMAIL_TO(0.00)[freebsd.org,gmail.com]; FORGED_SENDER(0.30)[avg@FreeBSD.org,agapon@gmail.com]; RECEIVED_SPAMHAUS_PBL(0.00)[93.72.151.96:received]; MIME_TRACE(0.00)[0:+]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; MID_RHS_MATCH_FROM(0.00)[]; FROM_NEQ_ENVFROM(0.00)[avg@FreeBSD.org,agapon@gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.96)[-0.956]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-0.94)[-0.936]; TAGGED_RCPT(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[FreeBSD.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[209.85.208.182:from]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.208.182:from]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[svn-src-head,svn-src-all] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 09 Sep 2020 05:49:07 -0000 On 08/09/2020 15:48, Mark Johnston wrote: > I observed the same thing recently as well: the compiler catches > uninitialized variables only in simple cases. In my case, any uses of > goto within the function seemed to silence the warning, even if they > appeared after the uninitialized reference. I am running a kernel build now with this addition (for clang): CWARNEXTRA+= -Wconditional-uninitialized -Wno-error-conditional-uninitialized It produces a ton of warnings. Some of them are probably false positives, but some look quite reasonable. E.g.: sys/cam/cam_periph.c:314:19: warning: variable 'p_drv' may be uninitialized when used here [-Wconditional-uninitialized] TAILQ_REMOVE(&(*p_drv)->units, periph, unit_links); Indeed, there is a conditional 'goto failure' before a first assignment to p_drv and the line is after the label. So, maybe the situation is impossible, but it is reasonable to warn about it. But the number of false positives (and "possible but impossible" situations) is too overwhelming. -- Andriy Gapon From owner-svn-src-all@freebsd.org Wed Sep 9 05:51:57 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9CBFA3E585A; Wed, 9 Sep 2020 05:51:57 +0000 (UTC) (envelope-from agapon@gmail.com) Received: from mail-lf1-f65.google.com (mail-lf1-f65.google.com [209.85.167.65]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BmWP85tyVz3WVw; Wed, 9 Sep 2020 05:51:56 +0000 (UTC) (envelope-from agapon@gmail.com) Received: by mail-lf1-f65.google.com with SMTP id z19so930826lfr.4; Tue, 08 Sep 2020 22:51:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:cc:references:openpgp:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=GCIJbHXghhZmEHkJ9hAm9QdHy8gMS1xPA1GJlyAJdZI=; b=hUe2G+NIvh/YpqmBdxylgUqggblxmdxRxCk0ydPdlcEwzzv6Sx+ezSaUo2Dxd1gwc3 ROOLnlrs26wOmZNdSmyC38LrVFWnf70UKG+cMRDvjIv2Zvi/ID96TvcLhO3WFJfm3KKl iPk5nkEw4Zolk48Bbw1Y3cmrCJ5DjqdUawP9moDNLIbb0Jqn63goqPsxisD+OpryTIwc FO4P5T8WdzyeGEecUDEewnU/KZTsdoCpxrUm/jtUI+bdTBBM6qJAcQITYUMLN4JttdYx hr5b3GqDdwzJVPVzp7FRgm223g4byGL0R/xyoSXreAlncjGkT1961fANUammZVPQ2z93 3yqg== X-Gm-Message-State: AOAM531x2IxWc/XkslhpfIWDGYuR4F5hiE1uelRWZLEwwAmemgeh9rQj uaBHWt4KMcbIOcHeLllFQIPPXtMkka8= X-Google-Smtp-Source: ABdhPJwEySaQyQR4AsBCqawBB+zQuItoj4gb5GoMs5ggmZ3DFcUge1j/r4/kB7L/J53pmOXifjka+g== X-Received: by 2002:a19:c91:: with SMTP id 139mr1168004lfm.40.1599630714760; Tue, 08 Sep 2020 22:51:54 -0700 (PDT) Received: from [192.168.0.88] (east.meadow.volia.net. [93.72.151.96]) by smtp.googlemail.com with ESMTPSA id q22sm339967lfp.40.2020.09.08.22.51.53 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 08 Sep 2020 22:51:54 -0700 (PDT) Subject: Re: uninitialized variables [Was: svn commit: r365445 - head/sys/cam/mmc] From: Andriy Gapon To: Mark Johnston , Michal Meloun Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202009080546.0885kAgk006783@repo.freebsd.org> <34826ee7-12a9-d309-1fee-cd2e95744603@FreeBSD.org> <67be7fa5-30dd-b7ee-1076-9c29195d83d3@gmail.com> <20200908124848.GB66031@raichu> <6b18b5ef-a743-3d5e-8dd2-24640614ec88@FreeBSD.org> Openpgp: preference=signencrypt Autocrypt: addr=avg@FreeBSD.org; prefer-encrypt=mutual; keydata= mQINBFm4LIgBEADNB/3lT7f15UKeQ52xCFQx/GqHkSxEdVyLFZTmY3KyNPQGBtyvVyBfprJ7 mAeXZWfhat6cKNRAGZcL5EmewdQuUfQfBdYmKjbw3a9GFDsDNuhDA2QwFt8BmkiVMRYyvI7l N0eVzszWCUgdc3qqM6qqcgBaqsVmJluwpvwp4ZBXmch5BgDDDb1MPO8AZ2QZfIQmplkj8Y6Z AiNMknkmgaekIINSJX8IzRzKD5WwMsin70psE8dpL/iBsA2cpJGzWMObVTtCxeDKlBCNqM1i gTXta1ukdUT7JgLEFZk9ceYQQMJJtUwzWu1UHfZn0Fs29HTqawfWPSZVbulbrnu5q55R4PlQ /xURkWQUTyDpqUvb4JK371zhepXiXDwrrpnyyZABm3SFLkk2bHlheeKU6Yql4pcmSVym1AS4 dV8y0oHAfdlSCF6tpOPf2+K9nW1CFA8b/tw4oJBTtfZ1kxXOMdyZU5fiG7xb1qDgpQKgHUX8 7Rd2T1UVLVeuhYlXNw2F+a2ucY+cMoqz3LtpksUiBppJhw099gEXehcN2JbUZ2TueJdt1FdS ztnZmsHUXLxrRBtGwqnFL7GSd6snpGIKuuL305iaOGODbb9c7ne1JqBbkw1wh8ci6vvwGlzx rexzimRaBzJxlkjNfMx8WpCvYebGMydNoeEtkWldtjTNVsUAtQARAQABtB5BbmRyaXkgR2Fw b24gPGF2Z0BGcmVlQlNELm9yZz6JAlQEEwEIAD4WIQS+LEO7ngQnXA4Bjr538m7TUc1yjwUC WbgsiAIbIwUJBaOagAULCQgHAgYVCAkKCwIEFgIDAQIeAQIXgAAKCRB38m7TUc1yj+JAEACV l9AK/nOWAt/9cufV2fRj0hdOqB1aCshtSrwHk/exXsDa4/FkmegxXQGY+3GWX3deIyesbVRL rYdtdK0dqJyT1SBqXK1h3/at9rxr9GQA6KWOxTjUFURsU7ok/6SIlm8uLRPNKO+yq0GDjgaO LzN+xykuBA0FlhQAXJnpZLcVfPJdWv7sSHGedL5ln8P8rxR+XnmsA5TUaaPcbhTB+mG+iKFj GghASDSfGqLWFPBlX/fpXikBDZ1gvOr8nyMY9nXhgfXpq3B6QCRYKPy58ChrZ5weeJZ29b7/ QdEO8NFNWHjSD9meiLdWQaqo9Y7uUxN3wySc/YUZxtS0bhAd8zJdNPsJYG8sXgKjeBQMVGuT eCAJFEYJqbwWvIXMfVWop4+O4xB+z2YE3jAbG/9tB/GSnQdVSj3G8MS80iLS58frnt+RSEw/ psahrfh0dh6SFHttE049xYiC+cM8J27Aaf0i9RflyITq57NuJm+AHJoU9SQUkIF0nc6lfA+o JRiyRlHZHKoRQkIg4aiKaZSWjQYRl5Txl0IZUP1dSWMX4s3XTMurC/pnja45dge/4ESOtJ9R 8XuIWg45Oq6MeIWdjKddGhRj3OohsltKgkEU3eLKYtB6qRTQypHHUawCXz88uYt5e3w4V16H lCpSTZV/EVHnNe45FVBlvK7k7HFfDDkryLkCDQRZuCyIARAAlq0slcsVboY/+IUJdcbEiJRW be9HKVz4SUchq0z9MZPX/0dcnvz/gkyYA+OuM78dNS7Mbby5dTvOqfpLJfCuhaNYOhlE0wY+ 1T6Tf1f4c/uA3U/YiadukQ3+6TJuYGAdRZD5EqYFIkreARTVWg87N9g0fT9BEqLw9lJtEGDY EWUE7L++B8o4uu3LQFEYxcrb4K/WKmgtmFcm77s0IKDrfcX4doV92QTIpLiRxcOmCC/OCYuO jB1oaaqXQzZrCutXRK0L5XN1Y1PYjIrEzHMIXmCDlLYnpFkK+itlXwlE2ZQxkfMruCWdQXye syl2fynAe8hvp7Mms9qU2r2K9EcJiR5N1t1C2/kTKNUhcRv7Yd/vwusK7BqJbhlng5ZgRx0m WxdntU/JLEntz3QBsBsWM9Y9wf2V4tLv6/DuDBta781RsCB/UrU2zNuOEkSixlUiHxw1dccI 6CVlaWkkJBxmHX22GdDFrcjvwMNIbbyfQLuBq6IOh8nvu9vuItup7qemDG3Ms6TVwA7BD3j+ 3fGprtyW8Fd/RR2bW2+LWkMrqHffAr6Y6V3h5kd2G9Q8ZWpEJk+LG6Mk3fhZhmCnHhDu6CwN MeUvxXDVO+fqc3JjFm5OxhmfVeJKrbCEUJyM8ESWLoNHLqjywdZga4Q7P12g8DUQ1mRxYg/L HgZY3zfKOqcAEQEAAYkCPAQYAQgAJhYhBL4sQ7ueBCdcDgGOvnfybtNRzXKPBQJZuCyIAhsM BQkFo5qAAAoJEHfybtNRzXKPBVwQAKfFy9P7N3OsLDMB56A4Kf+ZT+d5cIx0Yiaf4n6w7m3i ImHHHk9FIetI4Xe54a2IXh4Bq5UkAGY0667eIs+Z1Ea6I2i27Sdo7DxGwq09Qnm/Y65ADvXs 3aBvokCcm7FsM1wky395m8xUos1681oV5oxgqeRI8/76qy0hD9WR65UW+HQgZRIcIjSel9vR XDaD2HLGPTTGr7u4v00UeTMs6qvPsa2PJagogrKY8RXdFtXvweQFz78NbXhluwix2Tb9ETPk LIpDrtzV73CaE2aqBG/KrboXT2C67BgFtnk7T7Y7iKq4/XvEdDWscz2wws91BOXuMMd4c/c4 OmGW9m3RBLufFrOag1q5yUS9QbFfyqL6dftJP3Zq/xe+mr7sbWbhPVCQFrH3r26mpmy841ym dwQnNcsbIGiBASBSKksOvIDYKa2Wy8htPmWFTEOPRpFXdGQ27awcjjnB42nngyCK5ukZDHi6 w0qK5DNQQCkiweevCIC6wc3p67jl1EMFY5+z+zdTPb3h7LeVnGqW0qBQl99vVFgzLxchKcl0 R/paSFgwqXCZhAKMuUHncJuynDOP7z5LirUeFI8qsBAJi1rXpQoLJTVcW72swZ42IdPiboqx NbTMiNOiE36GqMcTPfKylCbF45JNX4nF9ElM0E+Y8gi4cizJYBRr2FBJgay0b9Cp Message-ID: <0cef8e0b-f2eb-465e-8afe-0e0113aee621@FreeBSD.org> Date: Wed, 9 Sep 2020 08:51:53 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Firefox/60.0 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <6b18b5ef-a743-3d5e-8dd2-24640614ec88@FreeBSD.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4BmWP85tyVz3WVw X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of agapon@gmail.com designates 209.85.167.65 as permitted sender) smtp.mailfrom=agapon@gmail.com X-Spamd-Result: default: False [-2.29 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17:c]; RCPT_COUNT_FIVE(0.00)[5]; RCVD_COUNT_THREE(0.00)[3]; NEURAL_HAM_SHORT(-0.40)[-0.396]; FREEMAIL_TO(0.00)[freebsd.org,gmail.com]; FORGED_SENDER(0.30)[avg@FreeBSD.org,agapon@gmail.com]; RECEIVED_SPAMHAUS_PBL(0.00)[93.72.151.96:received]; MIME_TRACE(0.00)[0:+]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; MID_RHS_MATCH_FROM(0.00)[]; FROM_NEQ_ENVFROM(0.00)[avg@FreeBSD.org,agapon@gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.95)[-0.954]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-0.94)[-0.939]; TAGGED_RCPT(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[FreeBSD.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[209.85.167.65:from]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.167.65:from]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[svn-src-head,svn-src-all] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 09 Sep 2020 05:51:57 -0000 On 09/09/2020 08:49, Andriy Gapon wrote: > On 08/09/2020 15:48, Mark Johnston wrote: >> I observed the same thing recently as well: the compiler catches >> uninitialized variables only in simple cases. In my case, any uses of >> goto within the function seemed to silence the warning, even if they >> appeared after the uninitialized reference. > > I am running a kernel build now with this addition (for clang): > CWARNEXTRA+= -Wconditional-uninitialized -Wno-error-conditional-uninitialized > > It produces a ton of warnings. > Some of them are probably false positives, but some look quite reasonable. > > E.g.: > sys/cam/cam_periph.c:314:19: warning: variable 'p_drv' may be uninitialized when > used here [-Wconditional-uninitialized] > TAILQ_REMOVE(&(*p_drv)->units, periph, unit_links); > > Indeed, there is a conditional 'goto failure' before a first assignment to p_drv > and the line is after the label. So, maybe the situation is impossible, but it > is reasonable to warn about it. > > But the number of false positives (and "possible but impossible" situations) is > too overwhelming. But but: /usr/devel/git//sys/cam/mmc/mmc_da.c:1824:6: warning: variable 'part_index' may be uninitialized when used here [-Wconditional-uninitialized] if (part_index != softc->part_curr) { ^~~~~~~~~~ /usr/devel/git//sys/cam/mmc/mmc_da.c:1800:16: note: initialize the variable 'part_index' to silence this warning int part_index; ^ = 0 1 warning generated. There are useful true positives as well. -- Andriy Gapon From owner-svn-src-all@freebsd.org Wed Sep 9 06:13:50 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 258793E5DE2; Wed, 9 Sep 2020 06:13:50 +0000 (UTC) (envelope-from agapon@gmail.com) Received: from mail-lj1-f194.google.com (mail-lj1-f194.google.com [209.85.208.194]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BmWtP0Xbnz3XTn; Wed, 9 Sep 2020 06:13:48 +0000 (UTC) (envelope-from agapon@gmail.com) Received: by mail-lj1-f194.google.com with SMTP id s205so1949536lja.7; Tue, 08 Sep 2020 23:13:48 -0700 (PDT) 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=oD8lHbqhQnyDTHwjbcWJ6Fhi9MCv740LUDC+wYCvibU=; b=Od2TkDbYP2AbN/ZXmrmKMqMZVNgSoJWRLAa20ldsnQA/Ghjve+UUX52heevSMrKXm0 0Xt9q793L9KGttGPuYUobL+VjlVuIGutUIfv7/ZyRkFVvW9Dd8hYPy9L4QJfTVuQbzut z3LZEhYsiIeAOpLjyl05L6lOL8TJZ5algECAZziwi1me9aBYDKrJXBjp0FWRRoBQBi4N RnK45wMSlQFLvveiH2zFuWq8LgRKkN51PR/zZ+TqgsnVekcql43xZ61cF5vFZDfmDUL8 nI5SYJ3ChwtD5DCtjbxBoLRFTwhMesnjH9l83UNqMItMwj7yt13ZBsQIvEv7rOkK4qWP RRvg== X-Gm-Message-State: AOAM533xAyhvm96x4ZHOEzD6lQCSL1fVJ9rwBP0Hwz3k4GFilVXit/cx 2kbJ1VLRxuohLHW+RjxRZrEfyAVT8rM= X-Google-Smtp-Source: ABdhPJyNg/QzSe6s26JaECSaxevLKF/9eTgNJkajEn3kxPdBegVdAcISsXNYk6nFjcE1CRiz/ttI8Q== X-Received: by 2002:a2e:b530:: with SMTP id z16mr1111818ljm.143.1599632026935; Tue, 08 Sep 2020 23:13:46 -0700 (PDT) Received: from [192.168.0.88] (east.meadow.volia.net. [93.72.151.96]) by smtp.googlemail.com with ESMTPSA id w17sm354887lfr.31.2020.09.08.23.13.45 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 08 Sep 2020 23:13:46 -0700 (PDT) Subject: Re: svn commit: r364465 - in head/sys: conf net net/route To: "Alexander V. Chernikov" , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" References: <202008212134.07LLYq3K071532@repo.freebsd.org> <69399f59-4eca-ee29-7230-678a02cf6eff@FreeBSD.org> <93541599601730@mail.yandex.ru> From: Andriy Gapon Openpgp: preference=signencrypt Autocrypt: addr=avg@FreeBSD.org; prefer-encrypt=mutual; keydata= mQINBFm4LIgBEADNB/3lT7f15UKeQ52xCFQx/GqHkSxEdVyLFZTmY3KyNPQGBtyvVyBfprJ7 mAeXZWfhat6cKNRAGZcL5EmewdQuUfQfBdYmKjbw3a9GFDsDNuhDA2QwFt8BmkiVMRYyvI7l N0eVzszWCUgdc3qqM6qqcgBaqsVmJluwpvwp4ZBXmch5BgDDDb1MPO8AZ2QZfIQmplkj8Y6Z AiNMknkmgaekIINSJX8IzRzKD5WwMsin70psE8dpL/iBsA2cpJGzWMObVTtCxeDKlBCNqM1i gTXta1ukdUT7JgLEFZk9ceYQQMJJtUwzWu1UHfZn0Fs29HTqawfWPSZVbulbrnu5q55R4PlQ /xURkWQUTyDpqUvb4JK371zhepXiXDwrrpnyyZABm3SFLkk2bHlheeKU6Yql4pcmSVym1AS4 dV8y0oHAfdlSCF6tpOPf2+K9nW1CFA8b/tw4oJBTtfZ1kxXOMdyZU5fiG7xb1qDgpQKgHUX8 7Rd2T1UVLVeuhYlXNw2F+a2ucY+cMoqz3LtpksUiBppJhw099gEXehcN2JbUZ2TueJdt1FdS ztnZmsHUXLxrRBtGwqnFL7GSd6snpGIKuuL305iaOGODbb9c7ne1JqBbkw1wh8ci6vvwGlzx rexzimRaBzJxlkjNfMx8WpCvYebGMydNoeEtkWldtjTNVsUAtQARAQABtB5BbmRyaXkgR2Fw b24gPGF2Z0BGcmVlQlNELm9yZz6JAlQEEwEIAD4WIQS+LEO7ngQnXA4Bjr538m7TUc1yjwUC WbgsiAIbIwUJBaOagAULCQgHAgYVCAkKCwIEFgIDAQIeAQIXgAAKCRB38m7TUc1yj+JAEACV l9AK/nOWAt/9cufV2fRj0hdOqB1aCshtSrwHk/exXsDa4/FkmegxXQGY+3GWX3deIyesbVRL rYdtdK0dqJyT1SBqXK1h3/at9rxr9GQA6KWOxTjUFURsU7ok/6SIlm8uLRPNKO+yq0GDjgaO LzN+xykuBA0FlhQAXJnpZLcVfPJdWv7sSHGedL5ln8P8rxR+XnmsA5TUaaPcbhTB+mG+iKFj GghASDSfGqLWFPBlX/fpXikBDZ1gvOr8nyMY9nXhgfXpq3B6QCRYKPy58ChrZ5weeJZ29b7/ QdEO8NFNWHjSD9meiLdWQaqo9Y7uUxN3wySc/YUZxtS0bhAd8zJdNPsJYG8sXgKjeBQMVGuT eCAJFEYJqbwWvIXMfVWop4+O4xB+z2YE3jAbG/9tB/GSnQdVSj3G8MS80iLS58frnt+RSEw/ psahrfh0dh6SFHttE049xYiC+cM8J27Aaf0i9RflyITq57NuJm+AHJoU9SQUkIF0nc6lfA+o JRiyRlHZHKoRQkIg4aiKaZSWjQYRl5Txl0IZUP1dSWMX4s3XTMurC/pnja45dge/4ESOtJ9R 8XuIWg45Oq6MeIWdjKddGhRj3OohsltKgkEU3eLKYtB6qRTQypHHUawCXz88uYt5e3w4V16H lCpSTZV/EVHnNe45FVBlvK7k7HFfDDkryLkCDQRZuCyIARAAlq0slcsVboY/+IUJdcbEiJRW be9HKVz4SUchq0z9MZPX/0dcnvz/gkyYA+OuM78dNS7Mbby5dTvOqfpLJfCuhaNYOhlE0wY+ 1T6Tf1f4c/uA3U/YiadukQ3+6TJuYGAdRZD5EqYFIkreARTVWg87N9g0fT9BEqLw9lJtEGDY EWUE7L++B8o4uu3LQFEYxcrb4K/WKmgtmFcm77s0IKDrfcX4doV92QTIpLiRxcOmCC/OCYuO jB1oaaqXQzZrCutXRK0L5XN1Y1PYjIrEzHMIXmCDlLYnpFkK+itlXwlE2ZQxkfMruCWdQXye syl2fynAe8hvp7Mms9qU2r2K9EcJiR5N1t1C2/kTKNUhcRv7Yd/vwusK7BqJbhlng5ZgRx0m WxdntU/JLEntz3QBsBsWM9Y9wf2V4tLv6/DuDBta781RsCB/UrU2zNuOEkSixlUiHxw1dccI 6CVlaWkkJBxmHX22GdDFrcjvwMNIbbyfQLuBq6IOh8nvu9vuItup7qemDG3Ms6TVwA7BD3j+ 3fGprtyW8Fd/RR2bW2+LWkMrqHffAr6Y6V3h5kd2G9Q8ZWpEJk+LG6Mk3fhZhmCnHhDu6CwN MeUvxXDVO+fqc3JjFm5OxhmfVeJKrbCEUJyM8ESWLoNHLqjywdZga4Q7P12g8DUQ1mRxYg/L HgZY3zfKOqcAEQEAAYkCPAQYAQgAJhYhBL4sQ7ueBCdcDgGOvnfybtNRzXKPBQJZuCyIAhsM BQkFo5qAAAoJEHfybtNRzXKPBVwQAKfFy9P7N3OsLDMB56A4Kf+ZT+d5cIx0Yiaf4n6w7m3i ImHHHk9FIetI4Xe54a2IXh4Bq5UkAGY0667eIs+Z1Ea6I2i27Sdo7DxGwq09Qnm/Y65ADvXs 3aBvokCcm7FsM1wky395m8xUos1681oV5oxgqeRI8/76qy0hD9WR65UW+HQgZRIcIjSel9vR XDaD2HLGPTTGr7u4v00UeTMs6qvPsa2PJagogrKY8RXdFtXvweQFz78NbXhluwix2Tb9ETPk LIpDrtzV73CaE2aqBG/KrboXT2C67BgFtnk7T7Y7iKq4/XvEdDWscz2wws91BOXuMMd4c/c4 OmGW9m3RBLufFrOag1q5yUS9QbFfyqL6dftJP3Zq/xe+mr7sbWbhPVCQFrH3r26mpmy841ym dwQnNcsbIGiBASBSKksOvIDYKa2Wy8htPmWFTEOPRpFXdGQ27awcjjnB42nngyCK5ukZDHi6 w0qK5DNQQCkiweevCIC6wc3p67jl1EMFY5+z+zdTPb3h7LeVnGqW0qBQl99vVFgzLxchKcl0 R/paSFgwqXCZhAKMuUHncJuynDOP7z5LirUeFI8qsBAJi1rXpQoLJTVcW72swZ42IdPiboqx NbTMiNOiE36GqMcTPfKylCbF45JNX4nF9ElM0E+Y8gi4cizJYBRr2FBJgay0b9Cp Message-ID: <05bfa3f4-8c95-3ad4-80b5-c5e48cd6370d@FreeBSD.org> Date: Wed, 9 Sep 2020 09:13:45 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Firefox/60.0 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <93541599601730@mail.yandex.ru> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4BmWtP0Xbnz3XTn X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of agapon@gmail.com designates 209.85.208.194 as permitted sender) smtp.mailfrom=agapon@gmail.com X-Spamd-Result: default: False [-2.20 / 15.00]; TO_DN_EQ_ADDR_SOME(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; RCVD_COUNT_THREE(0.00)[3]; NEURAL_HAM_SHORT(-0.35)[-0.355]; FORGED_SENDER(0.30)[avg@FreeBSD.org,agapon@gmail.com]; RECEIVED_SPAMHAUS_PBL(0.00)[93.72.151.96:received]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; R_DKIM_NA(0.00)[]; FROM_NEQ_ENVFROM(0.00)[avg@FreeBSD.org,agapon@gmail.com]; MID_RHS_MATCH_FROM(0.00)[]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.89)[-0.887]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-0.96)[-0.959]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[FreeBSD.org]; RCVD_IN_DNSWL_NONE(0.00)[209.85.208.194:from]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.208.194:from]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[svn-src-head,svn-src-all] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 09 Sep 2020 06:13:50 -0000 On 09/09/2020 00:50, Alexander V. Chernikov wrote: > 08.09.2020, 21:03, "Andriy Gapon" : >> On 22/08/2020 00:34, Alexander V. Chernikov wrote: >>>  Author: melifaro >>>  Date: Fri Aug 21 21:34:52 2020 >>>  New Revision: 364465 >>>  URL: https://svnweb.freebsd.org/changeset/base/364465 >>> >>>  Log: >>>    Make net.fibs growable. >>> >>>    Allow to dynamically grow the amount of fibs in each vnet. >>> >>>    This change alters current behavior. Currently, if one defines >>>     ROUTETABLES > 1 in the kernel config, each vnet will be created >>>     with the number of fibs defined in the kernel config. >>>     After this commit vnets will be created with fibs=1. >>> >>>    Dynamic net.fibs is not compatible with net.add_addr_allfibs. >>>     The plan is to deprecate the latter and make >>>     net.add_addr_allfibs=0 default behaviour. >>> >>>    Reviewed by: glebius >>>    Relnotes: yes >>>    Differential Revision: https://reviews.freebsd.org/D26062 >> >> I wonder why no one reported a problem that I am seeing after upgrading past >> this revision. Maybe because I do have net.fibs=2 in my loader.conf? > Hi Andriy, > > Does r365475 fix the problem for you? > CTLFLAG_RWTUN flag got slipped through the cracks somewhere :-( I am not sure that it does, I haven't tried it, but I agree with Ryan's comment. In general, I would keep CTLFLAG_RWTUN as the knob is a tunable indeed and some tools query that flag. So, I would like to re-iterate my earlier suggestion to use CTLFLAG_NOFETCH paired with explicit TUNABLE_INT_FETCH (which seems to be there already). >> The problem -- unfortunately I only have a screenshot -- but it's a page fault >> trap in this call chain: >> sysctl_register_all -> sysctl_load_tunable_by_oid_locked -> sysctl_fibs -> >> _sx_xlock. >> >> The crash is on the RTABLES_LOCK() line. >> And it's kind of obvious why. >> >> The tunables, including net.fibs which is declared as RWTUN, are set at >> SI_SUB_TUNABLES stage, but RTABLES_LOCK_INIT() is not called until >> SI_SUB_PROTO_DOMAIN much later. In other words, sysctal_fibs can be called >> earlier than vnet_rtables_init. >> >> I think that the best way to handle the problem would be to add CTLFLAG_NOFETCH >> to the sysctl declaration and then to add -- if necessary at all -- an explicit >> query of the kenv. >> >> -- >> Andriy Gapon -- Andriy Gapon From owner-svn-src-all@freebsd.org Wed Sep 9 06:45:56 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B76D93E6AA1; Wed, 9 Sep 2020 06:45:56 +0000 (UTC) (envelope-from ruslanngaripov@gmail.com) Received: from mail-lj1-x243.google.com (mail-lj1-x243.google.com [IPv6:2a00:1450:4864:20::243]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BmXbQ6TNCz3YRV; Wed, 9 Sep 2020 06:45:54 +0000 (UTC) (envelope-from ruslanngaripov@gmail.com) Received: by mail-lj1-x243.google.com with SMTP id k25so2016515ljg.9; Tue, 08 Sep 2020 23:45:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:date:message-id:in-reply-to:references:user-agent:subject :mime-version:content-transfer-encoding; bh=yT+w/3ZZGcOjsF3QuWDdE4NM0zPTpZtu4D9DXD3asew=; b=JUB9CNtqYmttRf//sIJ/yFa6jAesHWpyb2okjy6l9jmgCvi1K9KoQQbHwGFZA5bfay WgEYGbXcwiaazEj0x/v6TxoLCNY7HBZdh/hJ628KA6o+4C2dhaFzSb2PQYF36M/Qg07Q mOTJ0rQa0NqVOFVO1VOFIxd2pbQDnA+GoI+cwAzoHa7NbuIQDARXhGs1btTY+aD9LsXD v6ftZi4Fr91hGrxhzFb8KxyjWgdnqS+mDrB9FM6zaotsIsk9OerRS58ukdmxE1Ac+p4y Wr/X6h6MC9Wtttm8GTKrFmnr/x/C3yMhlx37AMVzvnYvhbiKzCBK7UIqsLiCYqQFqqYm xKHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:date:message-id:in-reply-to:references :user-agent:subject:mime-version:content-transfer-encoding; bh=yT+w/3ZZGcOjsF3QuWDdE4NM0zPTpZtu4D9DXD3asew=; b=KAZF3BQxHqTtE8EPMv2LborudHjVC50yz2hV20y6iVWX0AoFRD7njWzEoEYteqW/Oj /G7hcyqKuxRRB73K4zhw3TXxFi/uEcVuUeYd4jiqV+1hJG88q1Csg0wjrz/2l0mmwGgP 24aRKk4mb+M+fJV/ThAQ2hLPnoA9TiPR4QBjDpVXDmS5IHzsQ5jy0PaRuuc4bAqcveD9 9lJPFuEbNJdyYIjybMqC/QtLZm5cVyKcjqPCgQCUZfGcEjFRKgzfRI3/3XwYSghlXs2z fUiouRP6fTcgn+Kxm02Yiw+ydk/GVSQEL+DA5owAfTLOrbuGyx7yicFUTtYMEHVNWrOe SLhA== X-Gm-Message-State: AOAM5305CW4CLoDJnZ/3dRMB2i7X1+y4bOhz2lE0oUmadxt1+/+0Iz51 KX5WId2eQuyU3OTAqXRy4eKuKuOGMihsC3cw X-Google-Smtp-Source: ABdhPJymCyTwBhUoNO5lXFqZkdpYa5aObKDAoekeja8RfgGnDfOLsD6mYW5Q5CtgADXiXHY1648www== X-Received: by 2002:a05:651c:130b:: with SMTP id u11mr1022498lja.17.1599633951403; Tue, 08 Sep 2020 23:45:51 -0700 (PDT) Received: from [192.168.0.15] (ip-18-154.tagiltelecom.ru. [217.114.18.154]) by smtp.gmail.com with ESMTPSA id e17sm497166ljn.18.2020.09.08.23.45.50 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 08 Sep 2020 23:45:50 -0700 (PDT) From: Ruslan Garipov To: Glen Barber , , , Date: Wed, 09 Sep 2020 11:45:49 +0500 Message-ID: <174719d0148.27b9.e2363f32305322128423a5fd7014e4c4@gmail.com> In-Reply-To: <202008272119.07RLJGgb043888@repo.freebsd.org> References: <202008272119.07RLJGgb043888@repo.freebsd.org> User-Agent: AquaMail/1.26.0-1689 (build: 102600004) Subject: Re: svn commit: r364891 - in head: . release release/scripts MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="us-ascii" Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4BmXbQ6TNCz3YRV X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=JUB9CNtq; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of ruslanngaripov@gmail.com designates 2a00:1450:4864:20::243 as permitted sender) smtp.mailfrom=ruslanngaripov@gmail.com X-Spamd-Result: default: False [-3.41 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; MID_RHS_MATCH_FROM(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; MIME_GOOD(-0.10)[text/plain]; FREEMAIL_FROM(0.00)[gmail.com]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; RCVD_COUNT_THREE(0.00)[3]; NEURAL_HAM_MEDIUM(-0.97)[-0.968]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::243:from]; NEURAL_HAM_SHORT(-0.44)[-0.438]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[svn-src-all,svn-src-head]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 09 Sep 2020 06:45:56 -0000 On August 28, 2020 2:19:33 AM Glen Barber wrote: > Author: gjb > Date: Thu Aug 27 21:19:16 2020 > New Revision: 364891 > URL: https://svnweb.freebsd.org/changeset/base/364891 > > Log: > Merge the projects/release-git branch to head. > This allows building 13.x from Git instead of Subversion. I'm sorry for the late response (and for the bad first one I made on this commit recently via Gmail web client). My build machine is completely offline. I provide it with fresh snapshots of the source and ports tree manually -- via tarballs which I'm pulling on a FreeBSD machine having Internet connection. Therefore, neither "/scratch", nor the chrooted environment for me don't require Internet access (I fetch distfiles for offline usage too). Can we somehow remove that requirement for the devel/git port? For example, if one has set all three {SRC,PORTS,DOC}_UPDATE_SKIP variables, then release/release.sh doesn't require devel/git to exist on the host. I really don't need git on my build machine (and don't need it for building). Thanks. > > No MFC to stable branches is planned at this time. [1] > > Discussed with: git working group [1] > Sponsored by: Rubicon Communications, LLC (netgate.com) > > Added: > head/release/Makefile.inc1 > - copied unchanged from r364890, projects/release-git/release/Makefile.inc1 > Deleted: > head/release/scripts/relnotes-search.sh > Modified: > head/Makefile.inc1 > head/release/Makefile > head/release/Makefile.azure > head/release/Makefile.ec2 > head/release/Makefile.gce > head/release/Makefile.mirrors > head/release/Makefile.vagrant > head/release/release.conf.sample > head/release/release.sh > Directory Properties: > head/ (props changed) > head/cddl/ (props changed) > head/cddl/contrib/opensolaris/ (props changed) > head/contrib/bc/ (props changed) > head/contrib/byacc/ (props changed) > head/contrib/elftoolchain/ (props changed) > head/contrib/ipfilter/ (props changed) > head/contrib/llvm-project/ (props changed) > head/contrib/llvm-project/clang/ (props changed) > head/contrib/llvm-project/compiler-rt/ (props changed) > head/contrib/llvm-project/libcxx/ (props changed) > head/contrib/llvm-project/libunwind/ (props changed) > head/contrib/llvm-project/lld/ (props changed) > head/contrib/llvm-project/lldb/ (props changed) > head/contrib/llvm-project/llvm/ (props changed) > head/contrib/llvm-project/openmp/ (props changed) > head/contrib/lua/ (props changed) > head/contrib/mtree/ (props changed) > head/contrib/netbsd-tests/ (props changed) > head/contrib/openbsm/ (props changed) > head/contrib/sendmail/ (props changed) > head/contrib/sqlite3/ (props changed) > head/contrib/unbound/ (props changed) > head/crypto/openssh/ (props changed) > head/crypto/openssl/ (props changed) > head/sys/cddl/contrib/opensolaris/ (props changed) > head/sys/contrib/dev/acpica/ (props changed) > head/sys/contrib/ipfilter/ (props changed) > head/sys/gnu/dts/arm/ (props changed) > head/sys/gnu/dts/arm64/ (props changed) > head/sys/gnu/dts/include/ (props changed) > head/sys/gnu/dts/riscv/ (props changed) > > Modified: head/Makefile.inc1 > ============================================================================== > --- head/Makefile.inc1 Thu Aug 27 21:09:17 2020 (r364890) > +++ head/Makefile.inc1 Thu Aug 27 21:19:16 2020 (r364891) > @@ -510,6 +510,15 @@ VCS_REVISION= $$(echo r${_VCS_REVISION}) > .export VCS_REVISION > .endif > > +.if !defined(GIT_CMD) || empty(GIT_CMD) > +. for _P in /usr/bin /usr/local/bin > +. if exists(${_P}/git) > +GIT_CMD= ${_P}/git > +. endif > +. endfor > +.export GIT_CMD > +.endif > + > .if !defined(OSRELDATE) > .if exists(/usr/include/osreldate.h) > OSRELDATE!= awk '/^\#define[[:space:]]*__FreeBSD_version/ { print $$3 }' \ > > Modified: head/release/Makefile > ============================================================================== > --- head/release/Makefile Thu Aug 27 21:09:17 2020 (r364890) > +++ head/release/Makefile Thu Aug 27 21:19:16 2020 (r364891) > @@ -90,15 +90,6 @@ EXTRA_PACKAGES+= src.txz > .endif > .if !defined(NODOC) > EXTRA_PACKAGES+= reldoc > -. if !defined(SVN) || empty(SVN) > -. for S in svn svnlite > -. for D in /usr/local/bin /usr/bin > -. if(exists(${D}/${S})) > -SVN?= ${D}/${S} > -. endif > -. endfor > -. endfor > -. endif > .endif > > RELEASE_TARGETS= ftp > @@ -173,7 +164,6 @@ ports.txz: > reldoc: > cd ${DOCDIR}/en_US.ISO8859-1/htdocs/releases/${REVISION}R && \ > env MAN4DIR=${WORLDDIR}/share/man/man4 \ > - SVN=${SVN} \ > _BRANCH=${BRANCH} \ > ${MAKE} all install clean "FORMATS=html txt" \ > INSTALL_COMPRESSED='' URLS_ABSOLUTE=YES DOCDIR=${.OBJDIR}/rdoc \ > @@ -336,4 +326,5 @@ release-install: > cd ${DESTDIR} && sha512 ${OSRELEASE}* > ${DESTDIR}/CHECKSUM.SHA512 > cd ${DESTDIR} && sha256 ${OSRELEASE}* > ${DESTDIR}/CHECKSUM.SHA256 > > +.include "${.CURDIR}/Makefile.inc1" > .include "${.CURDIR}/Makefile.vm" > > Modified: head/release/Makefile.azure > ============================================================================== > --- head/release/Makefile.azure Thu Aug 27 21:09:17 2020 (r364890) > +++ head/release/Makefile.azure Thu Aug 27 21:19:16 2020 (r364891) > @@ -17,7 +17,7 @@ AZURE${VAR}!= grep -E ^AZURE${VAR} ${AZURE_UPLOAD_CONF > .endif > > .if ${BRANCH} == "STABLE" || ${BRANCH} == "CURRENT" || ${BRANCH} == > "PRERELEASE" > -SNAPSHOT_DATE!= date +-%Y-%m-%d > +SNAPSHOT_DATE!= date +-${BUILDDATE} > .endif > > AZURE_TARGET:= ${OSRELEASE}${SNAPSHOT_DATE}.vhd > > Modified: head/release/Makefile.ec2 > ============================================================================== > --- head/release/Makefile.ec2 Thu Aug 27 21:09:17 2020 (r364890) > +++ head/release/Makefile.ec2 Thu Aug 27 21:19:16 2020 (r364891) > @@ -5,32 +5,8 @@ > # Makefile for creating an EC2 AMI from a disk image. > # > > -# Figure out where SVN is > -.if !defined(SVN_CMD) || empty(SVN_CMD) > -. for _P in /usr/bin /usr/local/bin > -. for _S in svn svnlite > -. if exists(${_P}/${_S}) > -SVN_CMD= ${_P}/${_S} > -. endif > -. endfor > -. endfor > -.endif > -.if exists(${SRCTOP}/.svn) > -. if empty(EC2_SVNBRANCH) > - EC2_SVNBRANCH!= ${SVN_CMD} info --show-item relative-url ${WORLDDIR} > 2>/dev/null | sed -e 's/\^\///' > -. export EC2_SVNBRANCH > -. endif > -. if empty(EC2_SVNREV) > - EC2_SVNREV!= ${SVN_CMD} info --show-item last-changed-revision > ${WORLDDIR} 2>/dev/null || true > -. export EC2_SVNREV > -. endif > -.else > -EC2_SVNBRANCH= unknown > -EC2_SVNREV= unknown > -.endif > - > .if ${BRANCH} == "CURRENT" || ${BRANCH} == "STABLE" || ${BRANCH} == > "PRERELEASE" > -AMINAMESUFFIX!= date +-%Y-%m-%d > +AMINAMESUFFIX!= date +-${BUILDDATE} > .endif > .if defined(EC2PUBLIC) && !empty(EC2PUBLIC) > PUBLISH= --public > @@ -40,7 +16,7 @@ PUBLICSNAP= --publicsnap > .endif > .if defined(EC2SNSTOPIC) && !empty(EC2SNSTOPIC) > EC2SNSREL= ${REVISION}-${BRANCH} > -EC2SNSVERS= ${EC2_SVNBRANCH}@${EC2_SVNREV} > +EC2SNSVERS= ${GITBRANCH}@${GITREV} > .endif > .if ${TARGET_ARCH} != "amd64" > EC2ARCH= --${TARGET_ARCH:S/aarch64/arm64/} > @@ -89,7 +65,7 @@ ec2ami: cw-ec2 ${CW_EC2_PORTINSTALL} > ${EC2ARCH} --sriov --ena \ > ${.OBJDIR}/ec2.raw \ > "${TYPE} ${REVISION}-${BRANCH}-${TARGET}${AMINAMESUFFIX}" \ > - "${TYPE}/${TARGET} ${EC2_SVNBRANCH}@${EC2_SVNREV}" \ > + "${TYPE}/${TARGET} ${GITBRANCH}@${GITREV}" \ > ${AWSREGION} ${AWSBUCKET} ${AWSKEYFILE} \ > ${EC2SNSTOPIC} ${EC2SNSREL} ${EC2SNSVERS} > @touch ${.TARGET} > > Modified: head/release/Makefile.gce > ============================================================================== > --- head/release/Makefile.gce Thu Aug 27 21:09:17 2020 (r364890) > +++ head/release/Makefile.gce Thu Aug 27 21:19:16 2020 (r364891) > @@ -24,8 +24,7 @@ GCE_FAMILY= ${TYPE:tl}-${REVISION:S,.,-,} > .endif > > .if ${BRANCH} == "STABLE" || ${BRANCH} == "CURRENT" || ${BRANCH} == > "PRERELEASE" > -_SNAPSHOT_DATE!= date +%Y%m%d > -SNAPSHOT_DATE= -v${_SNAPSHOT_DATE} > +SNAPSHOT_DATE= -v${BUILDDATE} > GCE_FAMILY_SUFX= -snap > .endif > > > Copied: head/release/Makefile.inc1 (from r364890, > projects/release-git/release/Makefile.inc1) > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/release/Makefile.inc1 Thu Aug 27 21:19:16 2020 (r364891, copy of > r364890, projects/release-git/release/Makefile.inc1) > @@ -0,0 +1,31 @@ > +# > +# $FreeBSD$ > +# > + > +# Figure out where the git binary is. > +.for _P in /usr/bin /usr/local/bin > +. if !defined(GIT_CMD) || empty(GIT_CMD) > +. if exists(${_P}/git) > +GIT_CMD= ${_P}/git > +. endif > +. endif > +.endfor > +.if !defined(GIT_CMD) && empty(GIT_CMD) > +. error "Git binary not found. Set GIT_CMD appropriately." > +.endif > + > +# Set the git branch and hash to export where needed. > +.if !defined(GITBRANCH) || empty(GITBRANCH) > +GITBRANCH!= ${GIT_CMD} -C ${.CURDIR} rev-parse --abbrev-ref HEAD > 2>/dev/null | sed -e 's/\^\///' > +.export GITBRANCH > +.endif > +.if !defined(GITREV) || empty(GITREV) > +GITREV!= ${GIT_CMD} -C ${.CURDIR} rev-parse --verify --short HEAD > 2>/dev/null || true > +.export GITREV > +.endif > + > +# Set the build date, primarily for snapshot builds. > +.if !defined(BUILDDATE) || empty(BUILDDATE) > +BUILDDATE!= date +%Y%m%d > +.export BUILDDATE > +.endif > > Modified: head/release/Makefile.mirrors > ============================================================================== > --- head/release/Makefile.mirrors Thu Aug 27 21:09:17 2020 (r364890) > +++ head/release/Makefile.mirrors Thu Aug 27 21:19:16 2020 (r364891) > @@ -19,7 +19,6 @@ FTPDIR?= ${RELEASEDIR}/ftp-stage > .if exists(${RELEASEDIR}) > STAGE_TARGETS?= iso-images-stage > .endif > -SRCBRANCH!= ${SVN_CMD} info --show-item relative-url ${WORLDDIR} > > .if (defined(EMBEDDED_TARGET) && !empty(EMBEDDED_TARGET)) || > (defined(EMBEDDEDBUILD) && !empty(EMBEDDEDBUILD)) > . if ${TARGET:Marm*} != "" || ${EMBEDDED_TARGET:Marm*} != "" > @@ -31,26 +30,10 @@ EMBEDDED= 1 > .if ${BRANCH} == "STABLE" || ${BRANCH} == "CURRENT" || ${BRANCH} == > "PRERELEASE" || ${BRANCH:MALPHA*} != "" > SNAPSHOT= 1 > TLD?= ${FTPDIR}/snapshots > -. if !defined(SVNREVISION) || empty(SVNREVISION) > -. for _D in /usr/bin /usr/local/bin > -. for _S in svnversion svnliteversion > -. if exists(${_D}/${_S}) > -SVNVERSION?= ${_D}/${_S} > -. endif > -. endfor > -. endfor > -. if exists(${SVNVERSION}) && !empty(SVNVERSION) > -SVNREVISION!= ${SVNVERSION} ${WORLDDIR}/Makefile > -. endif > -. endif # !defined(SVNREVISION) > -. if !defined(BUILDDATE) || empty(BUILDDATE) > -. if exists(${.CURDIR}/${.OBJDIR}/dist/base/bin/sh) > -BUILDDATE!= cd ${.CURDIR} && date -j -f '%s' $$(stat -f "%c" > ${.OBJDIR}/dist/base/bin/sh) +%Y%m%d > -. else > +.if !defined(BUILDDATE) || empty(BUILDDATE) > BUILDDATE!= date +%Y%m%d > -. endif > -. endif > -_SNAP_SUFFIX:= ${BUILDDATE}-r${SVNREVISION} > +.endif > +_SNAP_SUFFIX:= ${BUILDDATE}-${GITREV} > .else > # release > SNAPSHOT= > @@ -187,8 +170,8 @@ iso-images-stage: > mkdir -p ${FTP_DIR} > cp -p ${RELEASEDIR}/ftp/*.txz ${RELEASEDIR}/ftp/MANIFEST ${FTP_DIR} > echo ${BUILDDATE} > ${FTP_DIR}/BUILDDATE > - echo ${SRCBRANCH} > ${FTP_DIR}/SRCBRANCH > - echo r${SVNREVISION} > ${FTP_DIR}/REVISION > + echo ${GITBRANCH} > ${FTP_DIR}/GITBRANCH > + echo ${GITREV} > ${FTP_DIR}/REVISION > cd ${TLD}/${TARGET} && \ > ln -s ${TARGET_ARCH}/${REVISION}-${BRANCH} \ > ${REVISION}-${BRANCH} > > Modified: head/release/Makefile.vagrant > ============================================================================== > --- head/release/Makefile.vagrant Thu Aug 27 21:09:17 2020 (r364890) > +++ head/release/Makefile.vagrant Thu Aug 27 21:19:16 2020 (r364891) > @@ -29,7 +29,7 @@ ATLAS${VAR}:= ${VAGRANT${VAR}} > .endif > > .if ${BRANCH} == "STABLE" || ${BRANCH} == "CURRENT" || ${BRANCH} == > "PRERELEASE" > -SNAPSHOT_DATE!= date +-%Y%m%d > +SNAPSHOT_DATE!= date +-${BUILDDATE} > .endif > > VAGRANT_VERSION!= date +%Y.%m.%d > > Modified: head/release/release.conf.sample > ============================================================================== > --- head/release/release.conf.sample Thu Aug 27 21:09:17 2020 (r364890) > +++ head/release/release.conf.sample Thu Aug 27 21:19:16 2020 (r364891) > @@ -12,23 +12,19 @@ > ## Set the directory within which the release will be built. > CHROOTDIR="/scratch" > > -## Set the svn host. > -SVNROOT="svn://svn.FreeBSD.org/" > +## Set the version control system host. > +GITROOT="https://cgit-beta.freebsd.org/" > +GITSRC="src.git" > +GITPORTS="ports.git" > +GITDOC="doc.git" > > ## Set the src/, ports/, and doc/ branches or tags. > -SRCBRANCH="base/head@rHEAD" > -DOCBRANCH="doc/head@rHEAD" > -PORTBRANCH="ports/head@rHEAD" > +SRCBRANCH="main" > +DOCBRANCH="main" > +PORTBRANCH="main" > > -## Run svn co --force for src checkout. > -#SRC_FORCE_CHECKOUT=yes > - > -## Sample configuration for using git instead of svn. > -#VCSCMD="/usr/local/bin/git clone --branch master" > -#SVNROOT="" > -#SRCBRANCH="https://github.com/freebsd/freebsd" > -#DOCBRANCH="https://github.com/freebsd/freebsd-doc" > -#PORTBRANCH="https://github.com/freebsd/freebsd-ports" > +## Sample configuration for using git from ports. > +#GITCMD="/usr/local/bin/git clone -q --branch main" > > ## Set to override the default target architecture. > #TARGET="amd64" > > Modified: head/release/release.sh > ============================================================================== > --- head/release/release.sh Thu Aug 27 21:09:17 2020 (r364890) > +++ head/release/release.sh Thu Aug 27 21:19:16 2020 (r364891) > @@ -1,6 +1,7 @@ > #!/bin/sh > #- > -# Copyright (c) 2013-2018 The FreeBSD Foundation > +# Copyright (c) 2020 Rubicon Communications, LLC (netgate.com) > +# Copyright (c) 2013-2019 The FreeBSD Foundation > # Copyright (c) 2013 Glen Barber > # Copyright (c) 2011 Nathan Whitehorn > # All rights reserved. > @@ -38,7 +39,7 @@ > > export PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin" > > -VERSION=2 > +VERSION=3 > > # Prototypes that can be redefined per-chroot or per-target. > load_chroot_env() { } > @@ -51,7 +52,7 @@ usage() { > } > > # env_setup(): Set up the default build environment variables, such as the > -# CHROOTDIR, VCSCMD, SVNROOT, etc. This is called before the release.conf > +# CHROOTDIR, VCSCMD, GITROOT, etc. This is called before the release.conf > # file is sourced, if '-c ' is specified. > env_setup() { > # The directory within which the release will be built. > @@ -60,27 +61,29 @@ env_setup() { > > # The default version control system command to obtain the sources. > for _dir in /usr/bin /usr/local/bin; do > - for _svn in svn svnlite; do > - [ -x "${_dir}/${_svn}" ] && VCSCMD="${_dir}/${_svn}" > - [ ! -z "${VCSCMD}" ] && break 2 > - done > + [ -x "${_dir}/git" ] && VCSCMD="/${_dir}/git" > + [ ! -z "${VCSCMD}" ] && break 2 > done > - VCSCMD="${VCSCMD} checkout" > > - # The default svn checkout server, and svn branches for src/, doc/, > + if [ -z "${VCSCMD}" ]; then > + echo "*** The devel/git port/package is required." > + exit 1 > + fi > + VCSCMD="/usr/local/bin/git clone -q" > + > + # The default git checkout server, and branches for src/, doc/, > # and ports/. > - SVNROOT="svn://svn.FreeBSD.org/" > - SRCBRANCH="base/head@rHEAD" > - DOCBRANCH="doc/head@rHEAD" > - PORTBRANCH="ports/head@rHEAD" > + GITROOT="https://cgit-beta.FreeBSD.org/" > + SRCBRANCH="main" > + DOCBRANCH="main" > + PORTBRANCH="main" > + GITSRC="src.git" > + GITPORTS="ports.git" > + GITDOC="doc.git" > > # Set for embedded device builds. > EMBEDDEDBUILD= > > - # Sometimes one needs to checkout src with --force svn option. > - # If custom kernel configs copied to src tree before checkout, e.g. > - SRC_FORCE_CHECKOUT= > - > # The default make.conf and src.conf to use. Set to /dev/null > # by default to avoid polluting the chroot(8) environment with > # non-default settings. > @@ -128,20 +131,11 @@ env_setup() { > # in env_setup() if '-c ' is specified. > env_check() { > chroot_build_release_cmd="chroot_build_release" > - # Fix for backwards-compatibility with release.conf that does not have > - # the trailing '/'. > - case ${SVNROOT} in > - *svn*) > - SVNROOT="${SVNROOT}/" > - ;; > - *) > - ;; > - esac > > - # Prefix the branches with the SVNROOT for the full checkout URL. > - SRCBRANCH="${SVNROOT}${SRCBRANCH}" > - DOCBRANCH="${SVNROOT}${DOCBRANCH}" > - PORTBRANCH="${SVNROOT}${PORTBRANCH}" > + # Prefix the branches with the GITROOT for the full checkout URL. > + SRC="${GITROOT}${GITSRC}" > + DOC="${GITROOT}${GITDOC}" > + PORT="${GITROOT}${GITPORTS}" > > if [ -n "${EMBEDDEDBUILD}" ]; then > WITH_DVD= > @@ -187,11 +181,6 @@ env_check() { > else > ARCH_FLAGS= > fi > - # Force src checkout if configured > - FORCE_SRC_KEY= > - if [ -n "${SRC_FORCE_CHECKOUT}" ]; then > - FORCE_SRC_KEY="--force" > - fi > > if [ -z "${CHROOTDIR}" ]; then > echo "Please set CHROOTDIR." > @@ -231,13 +220,13 @@ chroot_setup() { > mkdir -p ${CHROOTDIR}/usr > > if [ -z "${SRC_UPDATE_SKIP}" ]; then > - ${VCSCMD} ${FORCE_SRC_KEY} ${SRCBRANCH} ${CHROOTDIR}/usr/src > + ${VCSCMD} ${SRC} -b ${SRCBRANCH} ${CHROOTDIR}/usr/src > fi > if [ -z "${NODOC}" ] && [ -z "${DOC_UPDATE_SKIP}" ]; then > - ${VCSCMD} ${DOCBRANCH} ${CHROOTDIR}/usr/doc > + ${VCSCMD} ${DOC} -b ${DOCBRANCH} ${CHROOTDIR}/usr/doc > fi > if [ -z "${NOPORTS}" ] && [ -z "${PORTS_UPDATE_SKIP}" ]; then > - ${VCSCMD} ${PORTBRANCH} ${CHROOTDIR}/usr/ports > + ${VCSCMD} ${PORT} -b ${PORTBRANCH} ${CHROOTDIR}/usr/ports > fi > > if [ -z "${CHROOTBUILD_SKIP}" ]; then > @@ -274,6 +263,26 @@ extra_chroot_setup() { > cp ${SRC_CONF} ${CHROOTDIR}/${SRC_CONF} > fi > > + # Install git from ports or packages if the ports tree is > + # available and VCSCMD is unset. > + _gitcmd="$(which git)" > + if [ -d ${CHROOTDIR}/usr/ports -a -z "${_gitcmd}" ]; then > + # Trick the ports 'run-autotools-fixup' target to do the right > + # thing. > + _OSVERSION=$(chroot ${CHROOTDIR} /usr/bin/uname -U) > + REVISION=$(chroot ${CHROOTDIR} make -C /usr/src/release -V REVISION) > + BRANCH=$(chroot ${CHROOTDIR} make -C /usr/src/release -V BRANCH) > + UNAME_r=${REVISION}-${BRANCH} > + GITUNSETOPTS="CONTRIB CURL CVS GITWEB GUI HTMLDOCS" > + GITUNSETOPTS="${GITUNSETOPTS} ICONV NLS P4 PERL" > + GITUNSETOPTS="${GITUNSETOPTS} SEND_EMAIL SUBTREE SVN" > + GITUNSETOPTS="${GITUNSETOPTS} PCRE PCRE2" > + eval chroot ${CHROOTDIR} env OPTIONS_UNSET=\"${GITUNSETOPTS}\" \ > + make -C /usr/ports/devel/git FORCE_PKG_REGISTER=1 \ > + WRKDIRPREFIX=/tmp/ports \ > + DISTDIR=/tmp/distfiles \ > + install clean distclean > + fi > if [ -d ${CHROOTDIR}/usr/ports ]; then > # Trick the ports 'run-autotools-fixup' target to do the right > # thing. > _______________________________________________ > svn-src-head@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" From owner-svn-src-all@freebsd.org Wed Sep 9 07:58:03 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 51C8F3C8501; Wed, 9 Sep 2020 07:58:03 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BmZBg1m8Yz3crS; Wed, 9 Sep 2020 07:58:03 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 209281E2E1; Wed, 9 Sep 2020 07:58:03 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0897w3q3077431; Wed, 9 Sep 2020 07:58:03 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0897vxkx077410; Wed, 9 Sep 2020 07:57:59 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <202009090757.0897vxkx077410@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Wed, 9 Sep 2020 07:57:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r365495 - in vendor/nvi/dist: . catalog cl common docs ex files man vi X-SVN-Group: vendor X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: in vendor/nvi/dist: . catalog cl common docs ex files man vi X-SVN-Commit-Revision: 365495 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.33 Precedence: list List-Id: "SVN commit messages 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, 09 Sep 2020 07:58:03 -0000 Author: bapt Date: Wed Sep 9 07:57:59 2020 New Revision: 365495 URL: https://svnweb.freebsd.org/changeset/base/365495 Log: Import nvi 2.2.0 Added: vendor/nvi/dist/.gitignore vendor/nvi/dist/CMakeLists.txt (contents, props changed) vendor/nvi/dist/catalog/tr_TR.ISO8859-9.base vendor/nvi/dist/catalog/tr_TR.ISO8859-9.owner vendor/nvi/dist/catalog/tr_TR.UTF-8.base vendor/nvi/dist/catalog/tr_TR.UTF-8.owner vendor/nvi/dist/files/ vendor/nvi/dist/files/config.h.in (contents, props changed) vendor/nvi/dist/files/pathnames.h.in (contents, props changed) vendor/nvi/dist/files/recover.in (contents, props changed) vendor/nvi/dist/man/ vendor/nvi/dist/man/vi.1 (contents, props changed) Deleted: vendor/nvi/dist/cl/extern.h vendor/nvi/dist/common/extern.h vendor/nvi/dist/common/options_def.h vendor/nvi/dist/docs/ vendor/nvi/dist/ex/ex_def.h vendor/nvi/dist/ex/extern.h vendor/nvi/dist/ex/version.h vendor/nvi/dist/vi/extern.h Modified: vendor/nvi/dist/LICENSE vendor/nvi/dist/README vendor/nvi/dist/catalog/Makefile vendor/nvi/dist/catalog/README vendor/nvi/dist/catalog/dump.c vendor/nvi/dist/cl/README.signal vendor/nvi/dist/cl/cl.h vendor/nvi/dist/cl/cl_funcs.c vendor/nvi/dist/cl/cl_main.c vendor/nvi/dist/cl/cl_read.c vendor/nvi/dist/cl/cl_screen.c vendor/nvi/dist/cl/cl_term.c vendor/nvi/dist/common/args.h vendor/nvi/dist/common/common.h vendor/nvi/dist/common/conv.c vendor/nvi/dist/common/conv.h vendor/nvi/dist/common/cut.c vendor/nvi/dist/common/cut.h vendor/nvi/dist/common/delete.c vendor/nvi/dist/common/encoding.c vendor/nvi/dist/common/exf.c vendor/nvi/dist/common/exf.h vendor/nvi/dist/common/gs.h vendor/nvi/dist/common/key.c vendor/nvi/dist/common/key.h vendor/nvi/dist/common/line.c vendor/nvi/dist/common/log.c vendor/nvi/dist/common/log.h vendor/nvi/dist/common/main.c vendor/nvi/dist/common/mark.c vendor/nvi/dist/common/mark.h vendor/nvi/dist/common/mem.h vendor/nvi/dist/common/msg.c vendor/nvi/dist/common/msg.h vendor/nvi/dist/common/multibyte.h vendor/nvi/dist/common/options.c vendor/nvi/dist/common/options.h vendor/nvi/dist/common/options_f.c vendor/nvi/dist/common/put.c vendor/nvi/dist/common/recover.c vendor/nvi/dist/common/screen.c vendor/nvi/dist/common/screen.h vendor/nvi/dist/common/search.c vendor/nvi/dist/common/seq.c vendor/nvi/dist/common/seq.h vendor/nvi/dist/common/util.c vendor/nvi/dist/common/util.h vendor/nvi/dist/ex/ex.c vendor/nvi/dist/ex/ex.h vendor/nvi/dist/ex/ex_abbrev.c vendor/nvi/dist/ex/ex_append.c vendor/nvi/dist/ex/ex_args.c vendor/nvi/dist/ex/ex_argv.c vendor/nvi/dist/ex/ex_at.c vendor/nvi/dist/ex/ex_bang.c vendor/nvi/dist/ex/ex_cd.c vendor/nvi/dist/ex/ex_cmd.c vendor/nvi/dist/ex/ex_cscope.c vendor/nvi/dist/ex/ex_delete.c vendor/nvi/dist/ex/ex_display.c vendor/nvi/dist/ex/ex_edit.c vendor/nvi/dist/ex/ex_equal.c vendor/nvi/dist/ex/ex_file.c vendor/nvi/dist/ex/ex_filter.c vendor/nvi/dist/ex/ex_global.c vendor/nvi/dist/ex/ex_init.c vendor/nvi/dist/ex/ex_join.c vendor/nvi/dist/ex/ex_map.c vendor/nvi/dist/ex/ex_mark.c vendor/nvi/dist/ex/ex_mkexrc.c vendor/nvi/dist/ex/ex_move.c vendor/nvi/dist/ex/ex_open.c vendor/nvi/dist/ex/ex_preserve.c vendor/nvi/dist/ex/ex_print.c vendor/nvi/dist/ex/ex_put.c vendor/nvi/dist/ex/ex_quit.c vendor/nvi/dist/ex/ex_read.c vendor/nvi/dist/ex/ex_screen.c vendor/nvi/dist/ex/ex_script.c vendor/nvi/dist/ex/ex_set.c vendor/nvi/dist/ex/ex_shell.c vendor/nvi/dist/ex/ex_shift.c vendor/nvi/dist/ex/ex_source.c vendor/nvi/dist/ex/ex_stop.c vendor/nvi/dist/ex/ex_subst.c vendor/nvi/dist/ex/ex_tag.c vendor/nvi/dist/ex/ex_txt.c vendor/nvi/dist/ex/ex_undo.c vendor/nvi/dist/ex/ex_usage.c vendor/nvi/dist/ex/ex_util.c vendor/nvi/dist/ex/ex_version.c vendor/nvi/dist/ex/ex_visual.c vendor/nvi/dist/ex/ex_write.c vendor/nvi/dist/ex/ex_yank.c vendor/nvi/dist/ex/ex_z.c vendor/nvi/dist/ex/script.h vendor/nvi/dist/ex/tag.h vendor/nvi/dist/vi/getc.c vendor/nvi/dist/vi/v_at.c vendor/nvi/dist/vi/v_ch.c vendor/nvi/dist/vi/v_cmd.c vendor/nvi/dist/vi/v_delete.c vendor/nvi/dist/vi/v_ex.c vendor/nvi/dist/vi/v_increment.c vendor/nvi/dist/vi/v_init.c vendor/nvi/dist/vi/v_itxt.c vendor/nvi/dist/vi/v_left.c vendor/nvi/dist/vi/v_mark.c vendor/nvi/dist/vi/v_match.c vendor/nvi/dist/vi/v_paragraph.c vendor/nvi/dist/vi/v_put.c vendor/nvi/dist/vi/v_redraw.c vendor/nvi/dist/vi/v_replace.c vendor/nvi/dist/vi/v_right.c vendor/nvi/dist/vi/v_screen.c vendor/nvi/dist/vi/v_scroll.c vendor/nvi/dist/vi/v_search.c vendor/nvi/dist/vi/v_section.c vendor/nvi/dist/vi/v_sentence.c vendor/nvi/dist/vi/v_status.c vendor/nvi/dist/vi/v_txt.c vendor/nvi/dist/vi/v_ulcase.c vendor/nvi/dist/vi/v_undo.c vendor/nvi/dist/vi/v_util.c vendor/nvi/dist/vi/v_word.c vendor/nvi/dist/vi/v_xchar.c vendor/nvi/dist/vi/v_yank.c vendor/nvi/dist/vi/v_z.c vendor/nvi/dist/vi/v_zexit.c vendor/nvi/dist/vi/vi.c vendor/nvi/dist/vi/vi.h vendor/nvi/dist/vi/vs_line.c vendor/nvi/dist/vi/vs_msg.c vendor/nvi/dist/vi/vs_refresh.c vendor/nvi/dist/vi/vs_relative.c vendor/nvi/dist/vi/vs_smap.c vendor/nvi/dist/vi/vs_split.c Added: vendor/nvi/dist/.gitignore ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/nvi/dist/.gitignore Wed Sep 9 07:57:59 2020 (r365495) @@ -0,0 +1,9 @@ +*.swp +*~ +*.orig +*.core +extern.h +*_def.h +version.h +tags +build/ Added: vendor/nvi/dist/CMakeLists.txt ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/nvi/dist/CMakeLists.txt Wed Sep 9 07:57:59 2020 (r365495) @@ -0,0 +1,190 @@ +cmake_minimum_required(VERSION 3.9) + +get_property(is_multi_config GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) +if(is_multi_config) + set(CMAKE_CONFIGURATION_TYPES Debug Release CACHE STRING + "Semicolon separated list of supported configuration types") + mark_as_advanced(CMAKE_CONFIGURATION_TYPES) +elseif(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_C_FLAGS) + message(WARNING "No CMAKE_BUILD_TYPE is selected") +endif() + +project(nvi2 C) + +include(CheckIncludeFiles) +include(CheckFunctionExists) +include(CheckCSourceCompiles) + +mark_as_advanced(CMAKE_INSTALL_PREFIX) + +option(USE_WIDECHAR "Enable wide character support" ON) +option(USE_ICONV "Enable iconv support" ON) + +add_compile_options(-fcolor-diagnostics) +add_compile_options($<$:-Wall>) +add_compile_options($<$:-Wno-parentheses>) +add_compile_options($<$:-Wno-uninitialized>) +add_compile_options($<$:-Wmissing-prototypes>) +add_compile_options($<$:-Wsystem-headers>) +add_compile_options($<$:-Wuninitialized>) +add_compile_options($<$:-Wno-dangling-else>) +add_compile_options(-Wstack-protector -fstack-protector) +add_compile_options(-Wstrict-aliasing -fstrict-aliasing) + +include_directories(${CMAKE_CURRENT_BINARY_DIR}) + +set(MAIN_PROTOS + cl/extern.h common/extern.h ex/extern.h vi/extern.h + common/options_def.h ex/ex_def.h ex/version.h) + +set(CL_SRCS + cl/cl_funcs.c cl/cl_main.c cl/cl_read.c cl/cl_screen.c cl/cl_term.c) + +set(COMMON_SRCS + common/conv.c common/cut.c common/delete.c common/encoding.c common/exf.c + common/key.c common/line.c common/log.c common/main.c common/mark.c + common/msg.c common/options.c common/options_f.c common/put.c + common/recover.c common/screen.c common/search.c common/seq.c + common/util.c) + +set(EX_SRCS + ex/ex.c ex/ex_abbrev.c ex/ex_append.c ex/ex_args.c ex/ex_argv.c ex/ex_at.c + ex/ex_bang.c ex/ex_cd.c ex/ex_cmd.c ex/ex_cscope.c ex/ex_delete.c + ex/ex_display.c ex/ex_edit.c ex/ex_equal.c ex/ex_file.c ex/ex_filter.c + ex/ex_global.c ex/ex_init.c ex/ex_join.c ex/ex_map.c ex/ex_mark.c + ex/ex_mkexrc.c ex/ex_move.c ex/ex_open.c ex/ex_preserve.c ex/ex_print.c + ex/ex_put.c ex/ex_quit.c ex/ex_read.c ex/ex_screen.c ex/ex_script.c + ex/ex_set.c ex/ex_shell.c ex/ex_shift.c ex/ex_source.c ex/ex_stop.c + ex/ex_subst.c ex/ex_tag.c ex/ex_txt.c ex/ex_undo.c ex/ex_usage.c + ex/ex_util.c ex/ex_version.c ex/ex_visual.c ex/ex_write.c ex/ex_yank.c + ex/ex_z.c) + +set(VI_SRCS + vi/getc.c vi/v_at.c vi/v_ch.c vi/v_cmd.c vi/v_delete.c vi/v_ex.c + vi/v_increment.c vi/v_init.c vi/v_itxt.c vi/v_left.c vi/v_mark.c + vi/v_match.c vi/v_paragraph.c vi/v_put.c vi/v_redraw.c vi/v_replace.c + vi/v_right.c vi/v_screen.c vi/v_scroll.c vi/v_search.c vi/v_section.c + vi/v_sentence.c vi/v_status.c vi/v_txt.c vi/v_ulcase.c vi/v_undo.c + vi/v_util.c vi/v_word.c vi/v_xchar.c vi/v_yank.c vi/v_z.c vi/v_zexit.c + vi/vi.c vi/vs_line.c vi/vs_msg.c vi/vs_refresh.c vi/vs_relative.c + vi/vs_smap.c vi/vs_split.c) + +set(REGEX_SRCS + regex/regcomp.c regex/regerror.c regex/regexec.c regex/regfree.c) + +# commands to generate the public headers +set(extract_protos sed -n 's/^ \\* PUBLIC: \\\(.*\\\)/\\1/p') +set(extract_version sed -n + 's/^.*version \\\([^\)]*\)\\\).*/\#define VI_VERSION \\\"\\1\\\"/p') + +add_custom_command(OUTPUT cl/extern.h + COMMAND ${extract_protos} ${CL_SRCS} > cl/extern.h + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + DEPENDS ${CL_SRCS}) +add_custom_command(OUTPUT common/extern.h + COMMAND ${extract_protos} ${COMMON_SRCS} > common/extern.h + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + DEPENDS ${COMMON_SRCS}) +add_custom_command(OUTPUT ex/extern.h + COMMAND ${extract_protos} ${EX_SRCS} > ex/extern.h + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + DEPENDS ${EX_SRCS}) +add_custom_command(OUTPUT vi/extern.h + COMMAND ${extract_protos} ${VI_SRCS} > vi/extern.h + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + DEPENDS ${VI_SRCS}) +add_custom_command(OUTPUT common/options_def.h + COMMAND awk -f common/options.awk + common/options.c > common/options_def.h + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + DEPENDS common/options.c) +add_custom_command(OUTPUT ex/ex_def.h + COMMAND awk -f ex/ex.awk ex/ex_cmd.c > ex/ex_def.h + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + DEPENDS ex/ex_cmd.c) +add_custom_command(OUTPUT ex/version.h + COMMAND ${extract_version} README > ex/version.h + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + DEPENDS README) + +add_executable(nvi) +target_sources(nvi PRIVATE ${MAIN_PROTOS} ${CL_SRCS} ${COMMON_SRCS} + ${EX_SRCS} ${VI_SRCS}) +target_compile_definitions(nvi PRIVATE $<$:DEBUG> + $<$:COMLOG>) + +check_function_exists(openpty UTIL_IN_LIBC) +if(NOT UTIL_IN_LIBC) + find_library(UTIL_LIBRARY util) + target_link_libraries(nvi PRIVATE ${UTIL_LIBRARY}) +endif() + +check_function_exists(__b64_ntop RESOLV_IN_LIBC) +if(NOT RESOLV_IN_LIBC) + find_library(RESOLV_LIBRARY resolv) + target_link_libraries(nvi PRIVATE ${RESOLV_LIBRARY}) +endif() + +if(USE_WIDECHAR) + find_library(CURSES_LIBRARY NAMES ncursesw cursesw curses HINTS /usr/lib) + + # link to the wchar_t awared BSD libregex.a + add_library(regex STATIC) + target_sources(regex PRIVATE ${REGEX_SRCS}) + target_include_directories(regex PUBLIC regex) + target_compile_definitions(regex PUBLIC __REGEX_PRIVATE) + target_link_libraries(nvi PRIVATE regex) +else() + find_library(CURSES_LIBRARY NAMES ncurses curses HINTS /usr/lib) + target_compile_options(nvi PRIVATE -Wno-pointer-sign) +endif() + +target_link_libraries(nvi PRIVATE ${CURSES_LIBRARY}) + +if(USE_ICONV) + check_function_exists(__iconv ICONV_IN_LIBC) + if(NOT ICONV_IN_LIBC) + find_path(ICONV_INCLUDE_DIR iconv.h) + find_library(ICONV_LIBRARY iconv) + endif() + + # detect the prototype of iconv(3) + set(CMAKE_C_FLAGS_BACKUP "${CMAKE_C_FLAGS}") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror") + set(CMAKE_REQUIRED_INCLUDES "${ICONV_INCLUDE_DIR}") + set(CMAKE_REQUIRED_LIBRARIES "${ICONV_LIBRARY}") + check_c_source_compiles(" + #include + int main() { + iconv_t conv = 0; + char* in = 0; + size_t ilen = 0; + char* out = 0; + size_t olen = 0; + iconv(conv, &in, &ilen, &out, &olen); + return 0; + } + " ICONV_TRADITIONAL) + set(CMAKE_REQUIRED_INCLUDES) + set(CMAKE_REQUIRED_LIBRARIES) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS_BACKUP}") + + target_include_directories(nvi PRIVATE ${ICONV_INCLUDE_DIR}) + target_link_libraries(nvi PRIVATE ${ICONV_LIBRARY}) +endif() + +check_include_files(libutil.h HAVE_LIBUTIL_H) +check_include_files(ncurses.h HAVE_NCURSES_H) +check_include_files(term.h HAVE_TERM_H) + +configure_file(files/config.h.in config.h) + +set(vi_cv_path_preserve /var/tmp/vi.recover/) +if(APPLE) + set(vi_cv_path_msgcat /usr/local/share/vi/catalog/) +else() + set(vi_cv_path_msgcat /usr/share/vi/catalog/) +endif() + +configure_file(files/pathnames.h.in pathnames.h) +configure_file(files/recover.in recover @ONLY) Modified: vendor/nvi/dist/LICENSE ============================================================================== --- vendor/nvi/dist/LICENSE Wed Sep 9 02:45:47 2020 (r365494) +++ vendor/nvi/dist/LICENSE Wed Sep 9 07:57:59 2020 (r365495) @@ -1,7 +1,3 @@ -/*- - * $Id: LICENSE,v 8.18 2011/07/10 11:58:35 zy Exp $ - */ - The following are the copyrights and redistribution conditions that apply to this copy of the Vi software. Modified: vendor/nvi/dist/README ============================================================================== --- vendor/nvi/dist/README Wed Sep 9 02:45:47 2020 (r365494) +++ vendor/nvi/dist/README Wed Sep 9 07:57:59 2020 (r365495) @@ -1,6 +1,4 @@ -# $Id: README,v 9.2 2015/04/08 17:18:56 zy Exp $ - -This is version 2.1.3 (2015-04-08) of nex/nvi, a reimplementation of the ex/vi +This is version 2.2.0 (2020-08-01) of nex/nvi, a reimplementation of the ex/vi text editors originally distributed as part of the Fourth Berkeley Software Distribution (4BSD), by the University of California, Berkeley. @@ -8,12 +6,12 @@ The directory layout is as follows: LICENSE ....... Copyright, use and redistribution information. README ........ This file. - build ......... Build directory. catalog ....... Message catalogs; see catalog/README. cl ............ Vi interface to the curses(3) library. common ........ Code shared by ex and vi. - docs .......... Ex/vi documentation, both current and historic. ex ............ Ex source code. + files ......... Template files. + man ........... Ex/vi documentation. regex ......... Modified regex library with wide character support. vi ............ Vi source code. @@ -29,7 +27,7 @@ o Nvi was written by Keith Bostic, and the last versio The following acknowledgments were written by Keith Bostic: =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -o This software is several years old and is the product of many folks' work. +o This software is several years old and is the product of many folks' work. This software was originally derived from software contributed to the University of California, Berkeley by Steve Kirkendall, the Modified: vendor/nvi/dist/catalog/Makefile ============================================================================== --- vendor/nvi/dist/catalog/Makefile Wed Sep 9 02:45:47 2020 (r365494) +++ vendor/nvi/dist/catalog/Makefile Wed Sep 9 07:57:59 2020 (r365495) @@ -1,7 +1,5 @@ -# $Id: Makefile,v 9.0 2012/10/19 15:13:11 zy Exp $ - -CAT= dutch english french german polish ru_RU.KOI8-R spanish swedish \ - uk_UA.KOI8-U zh_CN.GB2312 +CAT= dutch english french german polish ru_RU.KOI8-R spanish \ + swedish tr_TR.ISO8859-9 tr_TR.UTF-8 uk_UA.KOI8-U zh_CN.GB2312 FILES= ../cl/*.c ../common/*.c ../ex/*.c ../vi/*.c all: dump ${CAT} @@ -33,7 +31,8 @@ ${CAT}: english.base CHK= dutch.check english.check french.check german.check \ polish.check ru_RU.KOI8-R.check spanish.check swedish.check \ - uk_UA.KOI8-U.check zh_CN.GB2312.check + tr_TR.ISO8859-9.check tr_TR.UTF-8.check uk_UA.KOI8-U.check \ + zh_CN.GB2312.check check: ${CHK} ${CHK}: ${CAT} @echo "... $@"; \ Modified: vendor/nvi/dist/catalog/README ============================================================================== --- vendor/nvi/dist/catalog/README Wed Sep 9 02:45:47 2020 (r365494) +++ vendor/nvi/dist/catalog/README Wed Sep 9 07:57:59 2020 (r365495) @@ -1,5 +1,3 @@ -# $Id: README,v 9.0 2012/10/19 17:06:15 zy Exp $ - Generally, all non-system error and informational messages in nvi are catalog messages, i.e. they can be tailored to a specific langauge. Command strings, usage strings, system errors and other 'known text' Modified: vendor/nvi/dist/catalog/dump.c ============================================================================== --- vendor/nvi/dist/catalog/dump.c Wed Sep 9 02:45:47 2020 (r365494) +++ vendor/nvi/dist/catalog/dump.c Wed Sep 9 07:57:59 2020 (r365495) @@ -27,10 +27,6 @@ * SUCH DAMAGE. */ -#ifndef lint -static char sccsid[] = "$Id: dump.c,v 8.2 2011/07/14 00:05:25 zy Exp $"; -#endif /* not lint */ - #include #include Added: vendor/nvi/dist/catalog/tr_TR.ISO8859-9.base ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/nvi/dist/catalog/tr_TR.ISO8859-9.base Wed Sep 9 07:57:59 2020 (r365495) @@ -0,0 +1,304 @@ +002 "Satýr uzunluðu taþýmý" +003 "%lu numaralý satýr silinemiyor" +004 "%lu numaralý satýra iliþtirilemiyor" +005 "%lu numaralý satýrda ekleme yapýlamýyor" +006 "%lu numaralý satýr kaydedilemiyor" +007 "Son satýr alýnamýyor" +008 "Hata: %lu numaralý satýr okunamýyor" +009 "Günlük dosyasý" +010 "Günlükleme gerçekleþtirilmiyor, geri alma olanaklý deðil" +011 "Geri alýnacak bir deðiþiklik yok" +012 "Günlükleme gerçekleþtirilmiyor, geri alma olanaklý deðil" +013 "Günlükleme gerçekleþtirilmiyor, ileri sarma olanaklý deðil" +014 "Yinelenecek bir deðiþiklik yok" +015 "%s/%d: Günlük kayýt hatasý" +016 "Vi'nin standart girdisi ve çýktýsý bir uçbirim olmalý" +017 "Ým %s: Ayarlanmamýþ" +018 "Ým %s: Satýr silinmiþ" +019 "Ým %s: Ýmleç konumu artýk yok" +020 "Hata: " +021 "yeni dosya +022 "adý deðiþti" +023 "deðiþtirildi" +024 "deðiþtirilmedi" +025 "KÝLÝDÝ AÇILDI" +026 "saltokunur" +027 "satýr %lu/%lu [%ld%%]" +028 "boþ dosya" +029 "%lu. satýr" +030 "%s dosyasý bir ileti kataloðu deðil" +031 "Öntanýmlý %s seçeneði ayarlanamadý" +032 "Kullaným: %s" +033 "set: %s seçeneði yok: 'set all' tüm seçenek deðerlerini verir" +034 "set: [no]%s seçeneði bir deðer almaz" +035 "set: %s seçeneði bir Boole deðeri deðil" +036 "set: %s seçeneði: %s" +037 "set: %s seçeneði: %s: Deðer taþýmý" +038 "set: %s seçeneði: %s izin verilmeyen bir sayý" +039 "set: %s seçeneði bir Boole deðeri deðil" +040 "Ekran sütun sayýsý çok küçük, þundan daha az: %d" +041 "Ekran sütun sayýsý çok büyük, þundan daha çok: %d" +042 "Ekran satýr sayýsý çok küçük, þundan daha az: %d" +043 "Ekran satýr sayýsý çok büyük, þundan daha çok: %d" +044 "Lisp seçeneði eklenmemiþ" +045 "Ýletiler kapatýlmamýþ: %s" +046 "Ýletiler açýlmamýþ: %s" +047 "%s seçeneði iki karakterli öbekler biçiminde olmalý" +053 "Baþlangýç arabelleði boþ" +054 "%s arabelleði boþ" +056 "Oturum baþarýsýz olursa deðiþiklikler kurtarýlamaz" +057 "Dosya, kurtarma için kopyalanýyor..." +058 "Koruma baþarýsýz oldu: %s" +059 "Oturum baþarýsýz olursa deðiþiklikler kurtarýlamaz" +060 "Dosya yedeklemesi baþarýsýz oldu: %s" +061 "Dosya, kurtarma için kopyalanýyor..." +062 "%u kullanýcýsý üzerine bilgi bulunamadý" +063 "Kurtarma dosyasý kilitlenemiyor" +065 "Kurtarma dosyasý" +066 "%s: Hatalý oluþturulmuþ kurtarma dosyasý" +067 "%s: Hatalý oluþturulmuþ kurtarma dosyasý" +068 "Kurtarýlacak %s adýnda sizce okunabilir bir dosya yok" +069 "Bu dosyanýn kurtarabileceðiniz eski sürümleri var" +070 "Kurtarabileceðiniz baþka dosyalar var" +071 "E-posta gönderilmedi: %s" +072 "Dosya boþ, aranacak bir þey yok" +073 "Dizgi bulunamadan dosyanýn sonuna eriþildi" +074 "Arama dizgisi yok" +075 "Dizgi bulunamadý" +076 "Dizgi bulunamadan dosyanýn baþýna eriþildi" +077 "Arama tamamlandý" +078 "Aranýyor..." +079 "Yazdýrýlamaz karakter bulunmadý" +080 "Bilinmeyen komut adý" +082 "%s: Komut ex kipinde kullanýlamaz" +083 "Sayým sýfýr olmayabilir" +084 "%s: Hatalý satýr belirtimi" +085 "Ýç sözdizim tablo hatasý (%s: %s)" +086 "Kullaným: %s" +087 "%s: Geçici arabellek salýverilmedi" +088 "Bayrak göreli konumu birinci satýrdan önceye" +089 "Bayrak göreli konumu dosya sonunu geçiyor" +090 "Erimli @, dosya/ekran deðiþtiðinde çalýþýr" +091 "Global/v komutu dosya/ekran deðiþtiðinde çalýþýr" +092 "Ex komutu baþarýsýz: Sýradaki komutlar çýkarýldý" +093 "Ex komutu baþarýsýz: Eþlemlenen düðmeler çýkarýldý" +094 "Ýkinci adres ilkinden daha küçük" +095 "Bir im adý saðlanmadý" +096 "\\ sonrasýnda / veya ? gelmiyor" +097 "Bir satýr numarasýna yapýlan baþvuru sayýsý sýfýrdan az" +098 "Bilinmeyen komut: %s" +099 "Adres deðeri taþýmý" +100 "Adres deðeri alttaþýmý" +101 "Ýzin verilmeyen adres birleþimi" +102 "Ýzin verilmeyen adres: Dosyada yalnýzca %lu satýr var" +103 "Ýzin verilmeyen adres: Dosya boþ" +104 "%s komutu bir 0 adresine izin vermiyor" +105 "Görüntülenecek kýsaltma yok" +106 "Kýsaltmalar bir \"sözcük\" karakteri ile bitmelidir" +107 "Kýsaltmalar sekme veya boþluk içeremez" +108 "Kýsaltmalar sonu dýþýnda sözcük/sözcük olmayan karakterleri karýþtýramaz" +109 "\"%s\" bir kýsaltma deðil" +110 "Vi komutu baþarýsýz: Eþlemlenen düðmeler çýkarýldý" +111 "Düzenlenecek baþka dosya yok" +112 "Öncesinde düzenlenecek baþka dosya yok" +113 "Öncesinde geri sarýlacak dosyalar yok" +114 "Görüntülenecek dosya yok" +115 "Öncesinde \"!\" ögesinin yerine geçecek bir komut yok" +116 "%% yerine geçecek bir dosya adý yok" +117 "# yerine geçecek bir dosya adý yok" +118 "Hata: execl: %s" +119 "Girdi/Çýktý hatasý: %s" +120 "Dosya son tam yazýmdan bu yana deðiþtirilmiþ; yazýn veya yok saymak için ! kullanýn" +121 "Ev dizini konumu bulunamýyor" +122 "Yeni þimdiki dizin: %s" +123 "Görüntülenecek kesilmiþ arabellek yok" +124 "%s komutu bir global veya v komutunun parçasý olarak kullanýlamaz" +128 "%s: kaynak alýnmýyor: Ýyesi siz veya kök deðil" +129 "%s: kaynak alýnmýyor: Ýyesi siz deðilsiniz" +130 "%s: kaynak alýnmýyor: Ýyesi dýþýnda baþka bir kullanýcý tarafýndan yazýlabilir" +131 "Uç uca eklenecek bir satýr yok" +132 "Girdi eþlem girdisi yok" +133 "Komut eþlem girdisi yok" +134 "%s yeniden eþlemlenemeyebilir" +135 "\"%s\" þu anda eþlemlenmemiþ" +136 "Ým adlarý tek bir karakter olmalýdýr" +137 "%s mevcut, yazýlmamýþ; yok saymak için ! kullanýn" +138 "Yeni exrc dosyasý: %s" +139 "Hedef satýrý taþýma erimi içinde" +140 "'open' komutu 'open' seçeneðinin ayarlý olmasýný gerektirir" +141 "'open' komutu henüz eklenmemiþ" +142 "Bu dosyanýn korunmasý olanaklý deðil" +143 "Dosya korundu" +144 "%s: Çok fazla dosya adýna geniþletilmiþ" +145 "Yalnýzca sýradan dosyalar ve adlandýrýlmýþ veri yollarý okunabilir" +146 "%s: Okuma kilidi kullanýlabilir deðildi" +147 "Okunuyor..." +148 "%s: %lu satýr, %lu karakter" +149 "Görüntülenecek arkaplan ekraný yok" +150 "'script' komutu yalnýzca vi kipinde kullanýlabilir" +151 "Çalýþtýrýlacak komut yok" +152 "'shiftwidth' seçeneði 0 olarak ayarlanmýþ" +153 "Sayým taþýmý" +154 "Sayým alttaþýmý" +155 "Düzenli ifade belirtilmiþ; r bayraðý anlamsýz" +156 "#, l ve p bayraklarý vi kipinde c bayraðý ile birlikte kullanýlamaz" +157 "Eþleþme bulunamadý" +158 "Önceden bir etiket girilmemiþ" +159 "Etiket yýðýnýnda %s sayýsýndan az girdi; :display t[ags] kullanýn" +160 "Etiket yýðýnýnda dönülecek bir %s dosyasý yok; :display t[ags] kullanýn" +161 "Sürdürmek için Enter'a basýn:" +162 "%s: Etiket bulunamadý" +163 "%s: %s içinde hasar görmüþ etiket" +164 "%s: Etiketin satýr numarasý dosya sonunu geçmiþ" +165 "Etiket yýðýný boþ" +166 "%s: Arama dizgisi bulunamadý" +167 "%d dosya daha düzenlenecek" +168 "%s arabelleði boþ" +169 "Deðiþikliði onayla? [n]" +170 "Yarýda kesildi" +171 "Öncesinde çalýþtýrýlacak arabellek yok" +172 "Öncesinde düzenli ifade yok" +173 "%s komutu bir dosyanýn halihazýrda okunmuþ olmasýný gerektirir" +174 "Kullaným: %s" +175 "'visual' komutu 'open' seçeneðinin ayarlanmýþ olmasýný gerektirir" +177 "Boþ dosya" +178 "Öncesinde F, f, T veya t aramasý yok" +179 "%s bulunamadý" +180 "Düzenlenecek dosya yok" +181 "Ýmleç bir sayýda deðil" +182 "Ortaya çýkan sayý çok büyük" +183 "Ortaya çýkan sayý çok küçük" +184 "Bu satýrda eþleþen karakter yok" +185 "Eþleþen karakter bulunamadý" +186 "Deðiþtirilecek karakter yok" +187 "Geçilecek baþka ekran yok" +188 "Arama dizgisinden, satýr ofsetinden ve/veya 'z' komutundan sonraki karakterler" +189 "Öncesinde arama dizgisi yok" +190 "Arama baþlanan konumda tamamlandý" +191 "Kýsaltma geniþleme sýnýrýný aþtý: Karakterler çýkarýldý" +192 "Ýzin verilmeyen karakter; giriþ için týrnak içine alýn" +193 "Halihazýrda eklemenin baþýnda" +194 "Silinecek baþka karakter yok" +195 "Hareket dosya sonunu geçti" +196 "Hareket satýr sonunu geçti" +197 "Ýmleç hareket ettirilmedi" +198 "Halihazýrda dosyanýn baþýnda" +199 "Hareket dosyanýn baþýný geçti" +200 "Halihazýrda ilk sütunda" +201 "Arabellekler komuttan önce belirtilmeli" +202 "Halihazýrda dosya sonunda" +203 "Halihazýrda satýr sonunda" +204 "%s bir vi komutu deðil" +205 "Kullaným: %s" +206 "Silinecek karakter yok" +207 "Q komutu ex uçbirim arabirimini gerektirir" +208 "Yinelenecek komut yok" +209 "Dosya boþ" +210 "%s bir hareket komutu olarak kullanýlamaz" +211 "Halihazýrda komut kipi içinde" +212 "Ýmleç bir sözcükte deðil" +214 "'windows' seçeneði deðeri çok büyük, en çok %u olabilir" +215 "Ýliþtir" +216 "Deðiþiklik yap" +217 "Komut" +218 "Ekle" +219 "Deðiþtir" +220 "Hareket ekran sonunu geçti" +221 "Hareket ekran baþýný geçti" +222 "Ekran bölünebilmesi için %d satýrdan daha geniþ olmalýdýr" +223 "Arkaplan ekraný yok" +224 "Arkaplanda %s dosyasýný düzenleyen bir ekran yok" +225 "Açýk olan tek ekranýnýzý arkaplana alamazsýnýz" +226 "Ekran yalnýzca %d satýra küçültülebilir" +227 "Ekran küçülemez" +228 "Ekran büyüyemez" +230 "Bu ekran askýya alýnamaz" +231 "Yarýda kesildi: Eþlemlenen düðmeler çýkarýldý" +232 "vi: Geçici arabellek salýverilmedi" +233 "Bu uçbirimde %s düðmesi yok" +234 "Yalnýzca bir arabellek belirtilebilir" +235 "Sayý þundan daha büyük: %lu" +236 "Yarýda kesildi" +237 "Geçici dosya oluþturulamýyor" +238 "Uyarý: %s sýradan bir dosya deðil" +239 "%s halihazýrda kilitlenmiþ, oturum saltokunur" +240 "%s: Kaldýr" +241 "%s: Kapat" +242 "%s: Kaldýr" +243 "%s: Kaldýr" +244 "Saltokunur dosya, yazýlmadý; yok saymak için ! kullanýn" +245 "Saltokunur dosya, yazýlmadý" +246 "%s mevcut, yazýlmadý; yok saymak için ! kullanýn" +247 "%s mevcut, yazýlmadý" +248 "Kýsmi dosya, yazýlmadý; yok saymak için ! kullanýn" +249 "Kýsmi dosya, yazýlmadý" +250 "%s: Dosya bu kopyadan daha önce deðiþtirilmiþ; yok saymak için ! kullanýn" +251 "%s: Dosya bu kopyadan daha önce deðiþtirilmiþ" +252 "%s: Yazým korumasý kullanýlabilir deðildi" +253 "Yazýlýyor..." +254 "%s: UYARI: DOSYA KIRPILMIÞ" +255 "Halihazýrda bu grubun ilk etiketinde" +256 "%s: Yeni dosya: %lu satýr, %lu karakter" +257 "%s: %lu satýr, %lu karakter" +258 "%s çok fazla dosya adýna geniþletilmiþ" +259 "%s: Sýradan bir dosya deðil" +260 "%s: Ýyesi siz deðilsiniz" +261 "%s: Ýyesi dýþýnda baþka bir kullanýcý tarafýndan da eriþilebilir" +262 "Dosya son tam yazýmdan bu yana deðiþtirilmiþ; yazýn veya yok saymak için ! kullanýn" +263 "Dosya son tam yazýmdan bu yana deðiþtirilmiþ; yazýn veya yok saymak için :edit! kullanýn" +264 "Dosya son tam yazýmdan bu yana deðiþtirilmiþ; yazýn veya yok saymak için ! kullanýn" +265 "Dosya geçici; çýkarsanýz deðiþiklikler atýlacaktýr" +266 "Dosya saltokunur, deðiþiklikler kendiliðinden yazýlmaz" +267 "Günlük yeniden baþlatýldý" +268 "Onayla? [ynq]" +269 "Sürdürmek için herhangi bir düðmeye basýn: " +270 "Sürdürmek için herhangi bir düðmeye basýn [ex komutu girmek için :]: " +271 "Sürdürmek için herhangi bir düðmeye basýn [çýkýþ için q]: " +272 "Bu biçim %s ex uçbirim arabirimini gerektirir" +273 "ex girdisi kipine giriliyor" +274 "Komut baþarýsýz, henüz bir dosya okunmadý." +275 " sürdür?" +276 "Beklenmedik karakter olayý" +277 "Beklenmedik dosya sonu olayý" +278 "Sorgu eþleþmesi bulunamadý" +279 "Beklenmedik yarýda kesme olayý" +281 "Beklenmedik yeniden boyama olayý" +282 "Halihazýrda bu grubun son etiketinde" +283 "%s komutu ex uçbirim arabirimini gerektirir" +284 "Bu biçim %s 'secure edit' seçeneði ayarlandýðýnda desteklenmez" +285 "Beklenmedik dizi olayý" +286 "Beklenmedik zaman aþýmý olayý" +288 "Bölünebilmesi için ekran %d sütundan daha geniþ olmalýdýr" +289 "Kabuk geniþletmeleri 'secure edit' seçeneði ayarlandýðýnda desteklenmez" +290 "%s komutu 'secure edit' seçeneði ayarlandýðýnda desteklenmez" +291 "set: %s seçeneði kapatýlamaz" +292 "Ekran çok küçük." +293 "eklendi" +294 "deðiþtirildi" +295 "silindi" +296 "uç uca eklendi" +297 "taþýndý" +298 "kaydýrýldý" +299 "kopyalandý" +300 "satýr" +301 "satýr" +303 "Dosya son yazýmdan bu yana deðiþtirilmiþ." +304 "Kabuk geniþletmesi baþarýsýz" +305 "Bir '%s' düzenleme seçeneði belirtilmedi" +307 "Çalýþtýrýlacak ex komutu yok" +308 "Bir komut çalýþtýrmak için , çýkmak için :q girin" +309 "Yardým için \"cscope help\" kullanýn" +310 "Çalýþan bir cscope baðlantýsý yok" +311 "%s: Bilinmeyen arama türü: Þunlardan bir tanesini kullanýn: %s" +312 "%d: Böyle bir cscope oturumu yok" +313 "set: %s seçeneði hiçbir zaman açýlamaz" +314 "set: %s seçeneði hiçbir zaman 0 olarak ayarlanamaz" +315 "%s: Ýliþtirildi: %lu satýr, %lu karakter" +316 "Beklenmedik yeniden boyutlandýrma olayý" +317 "Düzenlenecek %d dosya var" +319 "%d ekran arkaplana alýndý; onlarý listelemek için :display kullanýn" +320 "Bilinmeyen imleç konumu" +321 "Dosya kodlama dönüþtürmesi desteklenmiyor" +322 "Girdi kodlama dönüþtürmesi desteklenmiyor" +323 "Geçersiz girdi. Kýrpýldý." +324 "%d numaralý satýrda dönüþtürme hatasý" Added: vendor/nvi/dist/catalog/tr_TR.ISO8859-9.owner ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/nvi/dist/catalog/tr_TR.ISO8859-9.owner Wed Sep 9 07:57:59 2020 (r365495) @@ -0,0 +1 @@ +Emir SARI Added: vendor/nvi/dist/catalog/tr_TR.UTF-8.base ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/nvi/dist/catalog/tr_TR.UTF-8.base Wed Sep 9 07:57:59 2020 (r365495) @@ -0,0 +1,304 @@ +002 "Satır uzunluÄŸu taşımı" +003 "%lu numaralı satır silinemiyor" +004 "%lu numaralı satıra iliÅŸtirilemiyor" +005 "%lu numaralı satırda ekleme yapılamıyor" +006 "%lu numaralı satır kaydedilemiyor" +007 "Son satır alınamıyor" +008 "Hata: %lu numaralı satır okunamıyor" +009 "Günlük dosyası" +010 "Günlükleme gerçekleÅŸtirilmiyor, geri alma olanaklı deÄŸil" +011 "Geri alınacak bir deÄŸiÅŸiklik yok" +012 "Günlükleme gerçekleÅŸtirilmiyor, geri alma olanaklı deÄŸil" +013 "Günlükleme gerçekleÅŸtirilmiyor, ileri sarma olanaklı deÄŸil" +014 "Yinelenecek bir deÄŸiÅŸiklik yok" +015 "%s/%d: Günlük kayıt hatası" +016 "Vi'nin standart girdisi ve çıktısı bir uçbirim olmalı" +017 "Ä°m %s: Ayarlanmamış" +018 "Ä°m %s: Satır silinmiÅŸ" +019 "Ä°m %s: Ä°mleç konumu artık yok" +020 "Hata: " +021 "yeni dosya +022 "adı deÄŸiÅŸti" +023 "deÄŸiÅŸtirildi" +024 "deÄŸiÅŸtirilmedi" +025 "KÄ°LÄ°DÄ° AÇILDI" +026 "saltokunur" +027 "satır %lu/%lu [%ld%%]" +028 "boÅŸ dosya" +029 "%lu. satır" +030 "%s dosyası bir ileti kataloÄŸu deÄŸil" +031 "Öntanımlı %s seçeneÄŸi ayarlanamadı" +032 "Kullanım: %s" +033 "set: %s seçeneÄŸi yok: 'set all' tüm seçenek deÄŸerlerini verir" +034 "set: [no]%s seçeneÄŸi bir deÄŸer almaz" +035 "set: %s seçeneÄŸi bir Boole deÄŸeri deÄŸil" +036 "set: %s seçeneÄŸi: %s" +037 "set: %s seçeneÄŸi: %s: DeÄŸer taşımı" +038 "set: %s seçeneÄŸi: %s izin verilmeyen bir sayı" +039 "set: %s seçeneÄŸi bir Boole deÄŸeri deÄŸil" +040 "Ekran sütun sayısı çok küçük, ÅŸundan daha az: %d" +041 "Ekran sütun sayısı çok büyük, ÅŸundan daha çok: %d" +042 "Ekran satır sayısı çok küçük, ÅŸundan daha az: %d" +043 "Ekran satır sayısı çok büyük, ÅŸundan daha çok: %d" +044 "Lisp seçeneÄŸi eklenmemiÅŸ" +045 "Ä°letiler kapatılmamış: %s" +046 "Ä°letiler açılmamış: %s" +047 "%s seçeneÄŸi iki karakterli öbekler biçiminde olmalı" +053 "BaÅŸlangıç arabelleÄŸi boÅŸ" +054 "%s arabelleÄŸi boÅŸ" +056 "Oturum baÅŸarısız olursa deÄŸiÅŸiklikler kurtarılamaz" +057 "Dosya, kurtarma için kopyalanıyor..." +058 "Koruma baÅŸarısız oldu: %s" +059 "Oturum baÅŸarısız olursa deÄŸiÅŸiklikler kurtarılamaz" +060 "Dosya yedeklemesi baÅŸarısız oldu: %s" +061 "Dosya, kurtarma için kopyalanıyor..." +062 "%u kullanıcısı üzerine bilgi bulunamadı" +063 "Kurtarma dosyası kilitlenemiyor" +065 "Kurtarma dosyası" +066 "%s: Hatalı oluÅŸturulmuÅŸ kurtarma dosyası" +067 "%s: Hatalı oluÅŸturulmuÅŸ kurtarma dosyası" +068 "Kurtarılacak %s adında sizce okunabilir bir dosya yok" +069 "Bu dosyanın kurtarabileceÄŸiniz eski sürümleri var" +070 "KurtarabileceÄŸiniz baÅŸka dosyalar var" +071 "E-posta gönderilmedi: %s" +072 "Dosya boÅŸ, aranacak bir ÅŸey yok" +073 "Dizgi bulunamadan dosyanın sonuna eriÅŸildi" +074 "Arama dizgisi yok" +075 "Dizgi bulunamadı" +076 "Dizgi bulunamadan dosyanın başına eriÅŸildi" +077 "Arama tamamlandı" +078 "Aranıyor..." +079 "Yazdırılamaz karakter bulunmadı" +080 "Bilinmeyen komut adı" +082 "%s: Komut ex kipinde kullanılamaz" +083 "Sayım sıfır olmayabilir" +084 "%s: Hatalı satır belirtimi" +085 "İç sözdizim tablo hatası (%s: %s)" +086 "Kullanım: %s" +087 "%s: Geçici arabellek salıverilmedi" +088 "Bayrak göreli konumu birinci satırdan önceye" +089 "Bayrak göreli konumu dosya sonunu geçiyor" +090 "Erimli @, dosya/ekran deÄŸiÅŸtiÄŸinde çalışır" +091 "Global/v komutu dosya/ekran deÄŸiÅŸtiÄŸinde çalışır" +092 "Ex komutu baÅŸarısız: Sıradaki komutlar çıkarıldı" +093 "Ex komutu baÅŸarısız: EÅŸlemlenen düğmeler çıkarıldı" +094 "Ä°kinci adres ilkinden daha küçük" +095 "Bir im adı saÄŸlanmadı" +096 "\\ sonrasında / veya ? gelmiyor" +097 "Bir satır numarasına yapılan baÅŸvuru sayısı sıfırdan az" +098 "Bilinmeyen komut: %s" +099 "Adres deÄŸeri taşımı" +100 "Adres deÄŸeri alttaşımı" +101 "Ä°zin verilmeyen adres birleÅŸimi" +102 "Ä°zin verilmeyen adres: Dosyada yalnızca %lu satır var" +103 "Ä°zin verilmeyen adres: Dosya boÅŸ" +104 "%s komutu bir 0 adresine izin vermiyor" +105 "Görüntülenecek kısaltma yok" +106 "Kısaltmalar bir \"sözcük\" karakteri ile bitmelidir" +107 "Kısaltmalar sekme veya boÅŸluk içeremez" +108 "Kısaltmalar sonu dışında sözcük/sözcük olmayan karakterleri karıştıramaz" +109 "\"%s\" bir kısaltma deÄŸil" +110 "Vi komutu baÅŸarısız: EÅŸlemlenen düğmeler çıkarıldı" +111 "Düzenlenecek baÅŸka dosya yok" +112 "Öncesinde düzenlenecek baÅŸka dosya yok" +113 "Öncesinde geri sarılacak dosyalar yok" +114 "Görüntülenecek dosya yok" +115 "Öncesinde \"!\" ögesinin yerine geçecek bir komut yok" +116 "%% yerine geçecek bir dosya adı yok" +117 "# yerine geçecek bir dosya adı yok" +118 "Hata: execl: %s" +119 "Girdi/Çıktı hatası: %s" +120 "Dosya son tam yazımdan bu yana deÄŸiÅŸtirilmiÅŸ; yazın veya yok saymak için ! kullanın" +121 "Ev dizini konumu bulunamıyor" +122 "Yeni ÅŸimdiki dizin: %s" +123 "Görüntülenecek kesilmiÅŸ arabellek yok" +124 "%s komutu bir global veya v komutunun parçası olarak kullanılamaz" +128 "%s: kaynak alınmıyor: Ä°yesi siz veya kök deÄŸil" +129 "%s: kaynak alınmıyor: Ä°yesi siz deÄŸilsiniz" +130 "%s: kaynak alınmıyor: Ä°yesi dışında baÅŸka bir kullanıcı tarafından yazılabilir" +131 "Uç uca eklenecek bir satır yok" +132 "Girdi eÅŸlem girdisi yok" +133 "Komut eÅŸlem girdisi yok" +134 "%s yeniden eÅŸlemlenemeyebilir" +135 "\"%s\" ÅŸu anda eÅŸlemlenmemiÅŸ" +136 "Ä°m adları tek bir karakter olmalıdır" +137 "%s mevcut, yazılmamış; yok saymak için ! kullanın" +138 "Yeni exrc dosyası: %s" +139 "Hedef satırı taşıma erimi içinde" +140 "'open' komutu 'open' seçeneÄŸinin ayarlı olmasını gerektirir" +141 "'open' komutu henüz eklenmemiÅŸ" +142 "Bu dosyanın korunması olanaklı deÄŸil" +143 "Dosya korundu" +144 "%s: Çok fazla dosya adına geniÅŸletilmiÅŸ" +145 "Yalnızca sıradan dosyalar ve adlandırılmış veri yolları okunabilir" +146 "%s: Okuma kilidi kullanılabilir deÄŸildi" +147 "Okunuyor..." +148 "%s: %lu satır, %lu karakter" +149 "Görüntülenecek arkaplan ekranı yok" +150 "'script' komutu yalnızca vi kipinde kullanılabilir" +151 "Çalıştırılacak komut yok" +152 "'shiftwidth' seçeneÄŸi 0 olarak ayarlanmış" +153 "Sayım taşımı" +154 "Sayım alttaşımı" +155 "Düzenli ifade belirtilmiÅŸ; r bayrağı anlamsız" +156 "#, l ve p bayrakları vi kipinde c bayrağı ile birlikte kullanılamaz" +157 "EÅŸleÅŸme bulunamadı" +158 "Önceden bir etiket girilmemiÅŸ" +159 "Etiket yığınında %s sayısından az girdi; :display t[ags] kullanın" +160 "Etiket yığınında dönülecek bir %s dosyası yok; :display t[ags] kullanın" +161 "Sürdürmek için Enter'a basın:" +162 "%s: Etiket bulunamadı" +163 "%s: %s içinde hasar görmüş etiket" +164 "%s: Etiketin satır numarası dosya sonunu geçmiÅŸ" +165 "Etiket yığını boÅŸ" +166 "%s: Arama dizgisi bulunamadı" +167 "%d dosya daha düzenlenecek" +168 "%s arabelleÄŸi boÅŸ" +169 "DeÄŸiÅŸikliÄŸi onayla? [n]" +170 "Yarıda kesildi" +171 "Öncesinde çalıştırılacak arabellek yok" +172 "Öncesinde düzenli ifade yok" +173 "%s komutu bir dosyanın halihazırda okunmuÅŸ olmasını gerektirir" +174 "Kullanım: %s" +175 "'visual' komutu 'open' seçeneÄŸinin ayarlanmış olmasını gerektirir" +177 "BoÅŸ dosya" +178 "Öncesinde F, f, T veya t araması yok" +179 "%s bulunamadı" +180 "Düzenlenecek dosya yok" +181 "Ä°mleç bir sayıda deÄŸil" +182 "Ortaya çıkan sayı çok büyük" +183 "Ortaya çıkan sayı çok küçük" +184 "Bu satırda eÅŸleÅŸen karakter yok" +185 "EÅŸleÅŸen karakter bulunamadı" +186 "DeÄŸiÅŸtirilecek karakter yok" +187 "Geçilecek baÅŸka ekran yok" +188 "Arama dizgisinden, satır ofsetinden ve/veya 'z' komutundan sonraki karakterler" +189 "Öncesinde arama dizgisi yok" +190 "Arama baÅŸlanan konumda tamamlandı" +191 "Kısaltma geniÅŸleme sınırını aÅŸtı: Karakterler çıkarıldı" +192 "Ä°zin verilmeyen karakter; giriÅŸ için tırnak içine alın" +193 "Halihazırda eklemenin başında" +194 "Silinecek baÅŸka karakter yok" +195 "Hareket dosya sonunu geçti" +196 "Hareket satır sonunu geçti" +197 "Ä°mleç hareket ettirilmedi" +198 "Halihazırda dosyanın başında" +199 "Hareket dosyanın başını geçti" +200 "Halihazırda ilk sütunda" +201 "Arabellekler komuttan önce belirtilmeli" +202 "Halihazırda dosya sonunda" +203 "Halihazırda satır sonunda" +204 "%s bir vi komutu deÄŸil" +205 "Kullanım: %s" +206 "Silinecek karakter yok" +207 "Q komutu ex uçbirim arabirimini gerektirir" +208 "Yinelenecek komut yok" +209 "Dosya boÅŸ" +210 "%s bir hareket komutu olarak kullanılamaz" +211 "Halihazırda komut kipi içinde" +212 "Ä°mleç bir sözcükte deÄŸil" +214 "'windows' seçeneÄŸi deÄŸeri çok büyük, en çok %u olabilir" +215 "Ä°liÅŸtir" +216 "DeÄŸiÅŸiklik yap" +217 "Komut" +218 "Ekle" +219 "DeÄŸiÅŸtir" +220 "Hareket ekran sonunu geçti" +221 "Hareket ekran başını geçti" +222 "Ekran bölünebilmesi için %d satırdan daha geniÅŸ olmalıdır" +223 "Arkaplan ekranı yok" +224 "Arkaplanda %s dosyasını düzenleyen bir ekran yok" +225 "Açık olan tek ekranınızı arkaplana alamazsınız" +226 "Ekran yalnızca %d satıra küçültülebilir" +227 "Ekran küçülemez" +228 "Ekran büyüyemez" +230 "Bu ekran askıya alınamaz" +231 "Yarıda kesildi: EÅŸlemlenen düğmeler çıkarıldı" +232 "vi: Geçici arabellek salıverilmedi" +233 "Bu uçbirimde %s düğmesi yok" +234 "Yalnızca bir arabellek belirtilebilir" +235 "Sayı ÅŸundan daha büyük: %lu" +236 "Yarıda kesildi" +237 "Geçici dosya oluÅŸturulamıyor" +238 "Uyarı: %s sıradan bir dosya deÄŸil" +239 "%s halihazırda kilitlenmiÅŸ, oturum saltokunur" +240 "%s: Kaldır" +241 "%s: Kapat" +242 "%s: Kaldır" +243 "%s: Kaldır" +244 "Saltokunur dosya, yazılmadı; yok saymak için ! kullanın" +245 "Saltokunur dosya, yazılmadı" +246 "%s mevcut, yazılmadı; yok saymak için ! kullanın" +247 "%s mevcut, yazılmadı" +248 "Kısmi dosya, yazılmadı; yok saymak için ! kullanın" +249 "Kısmi dosya, yazılmadı" +250 "%s: Dosya bu kopyadan daha önce deÄŸiÅŸtirilmiÅŸ; yok saymak için ! kullanın" +251 "%s: Dosya bu kopyadan daha önce deÄŸiÅŸtirilmiÅŸ" +252 "%s: Yazım koruması kullanılabilir deÄŸildi" +253 "Yazılıyor..." +254 "%s: UYARI: DOSYA KIRPILMIÅž" +255 "Halihazırda bu grubun ilk etiketinde" +256 "%s: Yeni dosya: %lu satır, %lu karakter" +257 "%s: %lu satır, %lu karakter" +258 "%s çok fazla dosya adına geniÅŸletilmiÅŸ" +259 "%s: Sıradan bir dosya deÄŸil" +260 "%s: Ä°yesi siz deÄŸilsiniz" +261 "%s: Ä°yesi dışında baÅŸka bir kullanıcı tarafından da eriÅŸilebilir" +262 "Dosya son tam yazımdan bu yana deÄŸiÅŸtirilmiÅŸ; yazın veya yok saymak için ! kullanın" +263 "Dosya son tam yazımdan bu yana deÄŸiÅŸtirilmiÅŸ; yazın veya yok saymak için :edit! kullanın" +264 "Dosya son tam yazımdan bu yana deÄŸiÅŸtirilmiÅŸ; yazın veya yok saymak için ! kullanın" +265 "Dosya geçici; çıkarsanız deÄŸiÅŸiklikler atılacaktır" +266 "Dosya saltokunur, deÄŸiÅŸiklikler kendiliÄŸinden yazılmaz" +267 "Günlük yeniden baÅŸlatıldı" +268 "Onayla? [ynq]" +269 "Sürdürmek için herhangi bir düğmeye basın: " +270 "Sürdürmek için herhangi bir düğmeye basın [ex komutu girmek için :]: " +271 "Sürdürmek için herhangi bir düğmeye basın [çıkış için q]: " +272 "Bu biçim %s ex uçbirim arabirimini gerektirir" +273 "ex girdisi kipine giriliyor" +274 "Komut baÅŸarısız, henüz bir dosya okunmadı." +275 " sürdür?" +276 "Beklenmedik karakter olayı" +277 "Beklenmedik dosya sonu olayı" +278 "Sorgu eÅŸleÅŸmesi bulunamadı" +279 "Beklenmedik yarıda kesme olayı" +281 "Beklenmedik yeniden boyama olayı" +282 "Halihazırda bu grubun son etiketinde" +283 "%s komutu ex uçbirim arabirimini gerektirir" +284 "Bu biçim %s 'secure edit' seçeneÄŸi ayarlandığında desteklenmez" +285 "Beklenmedik dizi olayı" +286 "Beklenmedik zaman aşımı olayı" +288 "Bölünebilmesi için ekran %d sütundan daha geniÅŸ olmalıdır" +289 "Kabuk geniÅŸletmeleri 'secure edit' seçeneÄŸi ayarlandığında desteklenmez" +290 "%s komutu 'secure edit' seçeneÄŸi ayarlandığında desteklenmez" +291 "set: %s seçeneÄŸi kapatılamaz" +292 "Ekran çok küçük." +293 "eklendi" +294 "deÄŸiÅŸtirildi" +295 "silindi" +296 "uç uca eklendi" +297 "taşındı" +298 "kaydırıldı" +299 "kopyalandı" +300 "satır" +301 "satır" +303 "Dosya son yazımdan bu yana deÄŸiÅŸtirilmiÅŸ." +304 "Kabuk geniÅŸletmesi baÅŸarısız" +305 "Bir '%s' düzenleme seçeneÄŸi belirtilmedi" +307 "Çalıştırılacak ex komutu yok" +308 "Bir komut çalıştırmak için , çıkmak için :q girin" +309 "Yardım için \"cscope help\" kullanın" +310 "Çalışan bir cscope baÄŸlantısı yok" +311 "%s: Bilinmeyen arama türü: Åžunlardan bir tanesini kullanın: %s" +312 "%d: Böyle bir cscope oturumu yok" +313 "set: %s seçeneÄŸi hiçbir zaman açılamaz" +314 "set: %s seçeneÄŸi hiçbir zaman 0 olarak ayarlanamaz" +315 "%s: Ä°liÅŸtirildi: %lu satır, %lu karakter" +316 "Beklenmedik yeniden boyutlandırma olayı" +317 "Düzenlenecek %d dosya var" +319 "%d ekran arkaplana alındı; onları listelemek için :display kullanın" +320 "Bilinmeyen imleç konumu" +321 "Dosya kodlama dönüştürmesi desteklenmiyor" +322 "Girdi kodlama dönüştürmesi desteklenmiyor" +323 "Geçersiz girdi. Kırpıldı." +324 "%d numaralı satırda dönüştürme hatası" Added: vendor/nvi/dist/catalog/tr_TR.UTF-8.owner ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/nvi/dist/catalog/tr_TR.UTF-8.owner Wed Sep 9 07:57:59 2020 (r365495) @@ -0,0 +1 @@ +Emir SARI Modified: vendor/nvi/dist/cl/README.signal ============================================================================== --- vendor/nvi/dist/cl/README.signal Wed Sep 9 02:45:47 2020 (r365494) +++ vendor/nvi/dist/cl/README.signal Wed Sep 9 07:57:59 2020 (r365495) @@ -1,5 +1,3 @@ -# $Id: README.signal,v 10.1 1995/06/23 10:28:17 bostic Exp $ - There are six (normally) asynchronous actions about which vi cares: SIGHUP, SIGINT, SIGQUIT, SIGTERM, SIGTSTP and SIGWINCH. Modified: vendor/nvi/dist/cl/cl.h ============================================================================== --- vendor/nvi/dist/cl/cl.h Wed Sep 9 02:45:47 2020 (r365494) +++ vendor/nvi/dist/cl/cl.h Wed Sep 9 07:57:59 2020 (r365495) @@ -5,8 +5,6 @@ * Keith Bostic. All rights reserved. * * See the LICENSE file for redistribution information. - * - * $Id: cl.h,v 10.34 2011/08/15 20:07:32 zy Exp $ */ #ifdef USE_WIDECHAR Modified: vendor/nvi/dist/cl/cl_funcs.c ============================================================================== --- vendor/nvi/dist/cl/cl_funcs.c Wed Sep 9 02:45:47 2020 (r365494) +++ vendor/nvi/dist/cl/cl_funcs.c Wed Sep 9 07:57:59 2020 (r365495) @@ -9,10 +9,6 @@ #include "config.h" -#ifndef lint -static const char sccsid[] = "$Id: cl_funcs.c,v 10.74 2012/10/11 10:30:16 zy Exp $"; -#endif /* not lint */ - #include #include #include Modified: vendor/nvi/dist/cl/cl_main.c ============================================================================== --- vendor/nvi/dist/cl/cl_main.c Wed Sep 9 02:45:47 2020 (r365494) +++ vendor/nvi/dist/cl/cl_main.c Wed Sep 9 07:57:59 2020 (r365495) @@ -9,14 +9,11 @@ #include "config.h" -#ifndef lint -static const char sccsid[] = "$Id: cl_main.c,v 10.56 2015/04/05 06:20:53 zy Exp $"; -#endif /* not lint */ - #include #include #include +#include #include #include #include @@ -38,11 +35,10 @@ sigset_t __sigblockset; /* GLOBAL: Blocked signals. static void cl_func_std(GS *); static CL_PRIVATE *cl_init(GS *); -static GS *gs_init(char *); -static void perr(char *, char *); +static GS *gs_init(void); static int setsig(int, struct sigaction *, void (*)(int)); static void sig_end(GS *); -static void term_init(char *, char *); +static void term_init(char *); /* * main -- @@ -63,7 +59,7 @@ main(int argc, char *argv[]) abort(); /* Create and initialize the global structure. */ - __global_list = gp = gs_init(argv[0]); + __global_list = gp = gs_init(); /* * Strip out any arguments that vi isn't going to understand. There's @@ -93,12 +89,12 @@ main(int argc, char *argv[]) */ if ((ttype = getenv("TERM")) == NULL) ttype = "ansi"; - term_init(gp->progname, ttype); + term_init(ttype); /* Add the terminal type to the global structure. */ if ((OG_D_STR(gp, GO_TERM) = OG_STR(gp, GO_TERM) = strdup(ttype)) == NULL) - perr(gp->progname, NULL); + err(1, NULL); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Wed Sep 9 07:58:38 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3C0B83C823C; Wed, 9 Sep 2020 07:58:38 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BmZCL14pbz3dGf; Wed, 9 Sep 2020 07:58:38 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0807A1E5DC; Wed, 9 Sep 2020 07:58:38 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0897wbhP077511; Wed, 9 Sep 2020 07:58:37 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0897wZSR077500; Wed, 9 Sep 2020 07:58:35 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <202009090758.0897wZSR077500@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Wed, 9 Sep 2020 07:58:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r365496 - in vendor/nvi/2.2.0: . catalog cl common docs ex files man vi X-SVN-Group: vendor X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: in vendor/nvi/2.2.0: . catalog cl common docs ex files man vi X-SVN-Commit-Revision: 365496 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.33 Precedence: list List-Id: "SVN commit messages 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, 09 Sep 2020 07:58:38 -0000 Author: bapt Date: Wed Sep 9 07:58:35 2020 New Revision: 365496 URL: https://svnweb.freebsd.org/changeset/base/365496 Log: Tag import of nvi 2.2.0 Added: vendor/nvi/2.2.0/ - copied from r365494, vendor/nvi/dist/ vendor/nvi/2.2.0/.gitignore - copied unchanged from r365495, vendor/nvi/dist/.gitignore vendor/nvi/2.2.0/CMakeLists.txt - copied unchanged from r365495, vendor/nvi/dist/CMakeLists.txt vendor/nvi/2.2.0/catalog/tr_TR.ISO8859-9.base - copied unchanged from r365495, vendor/nvi/dist/catalog/tr_TR.ISO8859-9.base vendor/nvi/2.2.0/catalog/tr_TR.ISO8859-9.owner - copied unchanged from r365495, vendor/nvi/dist/catalog/tr_TR.ISO8859-9.owner vendor/nvi/2.2.0/catalog/tr_TR.UTF-8.base - copied unchanged from r365495, vendor/nvi/dist/catalog/tr_TR.UTF-8.base vendor/nvi/2.2.0/catalog/tr_TR.UTF-8.owner - copied unchanged from r365495, vendor/nvi/dist/catalog/tr_TR.UTF-8.owner vendor/nvi/2.2.0/files/ - copied from r365495, vendor/nvi/dist/files/ vendor/nvi/2.2.0/man/ - copied from r365495, vendor/nvi/dist/man/ Replaced: vendor/nvi/2.2.0/LICENSE - copied unchanged from r365495, vendor/nvi/dist/LICENSE vendor/nvi/2.2.0/README - copied unchanged from r365495, vendor/nvi/dist/README vendor/nvi/2.2.0/catalog/Makefile - copied unchanged from r365495, vendor/nvi/dist/catalog/Makefile vendor/nvi/2.2.0/catalog/README - copied unchanged from r365495, vendor/nvi/dist/catalog/README vendor/nvi/2.2.0/catalog/dump.c - copied unchanged from r365495, vendor/nvi/dist/catalog/dump.c vendor/nvi/2.2.0/cl/README.signal - copied unchanged from r365495, vendor/nvi/dist/cl/README.signal vendor/nvi/2.2.0/cl/cl.h - copied unchanged from r365495, vendor/nvi/dist/cl/cl.h vendor/nvi/2.2.0/cl/cl_funcs.c - copied unchanged from r365495, vendor/nvi/dist/cl/cl_funcs.c vendor/nvi/2.2.0/cl/cl_main.c - copied unchanged from r365495, vendor/nvi/dist/cl/cl_main.c vendor/nvi/2.2.0/cl/cl_read.c - copied unchanged from r365495, vendor/nvi/dist/cl/cl_read.c vendor/nvi/2.2.0/cl/cl_screen.c - copied unchanged from r365495, vendor/nvi/dist/cl/cl_screen.c vendor/nvi/2.2.0/cl/cl_term.c - copied unchanged from r365495, vendor/nvi/dist/cl/cl_term.c vendor/nvi/2.2.0/common/args.h - copied unchanged from r365495, vendor/nvi/dist/common/args.h vendor/nvi/2.2.0/common/common.h - copied unchanged from r365495, vendor/nvi/dist/common/common.h vendor/nvi/2.2.0/common/conv.c - copied unchanged from r365495, vendor/nvi/dist/common/conv.c vendor/nvi/2.2.0/common/conv.h - copied unchanged from r365495, vendor/nvi/dist/common/conv.h vendor/nvi/2.2.0/common/cut.c - copied unchanged from r365495, vendor/nvi/dist/common/cut.c vendor/nvi/2.2.0/common/cut.h - copied unchanged from r365495, vendor/nvi/dist/common/cut.h vendor/nvi/2.2.0/common/delete.c - copied unchanged from r365495, vendor/nvi/dist/common/delete.c vendor/nvi/2.2.0/common/encoding.c - copied unchanged from r365495, vendor/nvi/dist/common/encoding.c vendor/nvi/2.2.0/common/exf.c - copied unchanged from r365495, vendor/nvi/dist/common/exf.c vendor/nvi/2.2.0/common/exf.h - copied unchanged from r365495, vendor/nvi/dist/common/exf.h vendor/nvi/2.2.0/common/gs.h - copied unchanged from r365495, vendor/nvi/dist/common/gs.h vendor/nvi/2.2.0/common/key.c - copied unchanged from r365495, vendor/nvi/dist/common/key.c vendor/nvi/2.2.0/common/key.h - copied unchanged from r365495, vendor/nvi/dist/common/key.h vendor/nvi/2.2.0/common/line.c - copied unchanged from r365495, vendor/nvi/dist/common/line.c vendor/nvi/2.2.0/common/log.c - copied unchanged from r365495, vendor/nvi/dist/common/log.c vendor/nvi/2.2.0/common/log.h - copied unchanged from r365495, vendor/nvi/dist/common/log.h vendor/nvi/2.2.0/common/main.c - copied unchanged from r365495, vendor/nvi/dist/common/main.c vendor/nvi/2.2.0/common/mark.c - copied unchanged from r365495, vendor/nvi/dist/common/mark.c vendor/nvi/2.2.0/common/mark.h - copied unchanged from r365495, vendor/nvi/dist/common/mark.h vendor/nvi/2.2.0/common/mem.h - copied unchanged from r365495, vendor/nvi/dist/common/mem.h vendor/nvi/2.2.0/common/msg.c - copied unchanged from r365495, vendor/nvi/dist/common/msg.c vendor/nvi/2.2.0/common/msg.h - copied unchanged from r365495, vendor/nvi/dist/common/msg.h vendor/nvi/2.2.0/common/multibyte.h - copied unchanged from r365495, vendor/nvi/dist/common/multibyte.h vendor/nvi/2.2.0/common/options.c - copied unchanged from r365495, vendor/nvi/dist/common/options.c vendor/nvi/2.2.0/common/options.h - copied unchanged from r365495, vendor/nvi/dist/common/options.h vendor/nvi/2.2.0/common/options_f.c - copied unchanged from r365495, vendor/nvi/dist/common/options_f.c vendor/nvi/2.2.0/common/put.c - copied unchanged from r365495, vendor/nvi/dist/common/put.c vendor/nvi/2.2.0/common/recover.c - copied unchanged from r365495, vendor/nvi/dist/common/recover.c vendor/nvi/2.2.0/common/screen.c - copied unchanged from r365495, vendor/nvi/dist/common/screen.c vendor/nvi/2.2.0/common/screen.h - copied unchanged from r365495, vendor/nvi/dist/common/screen.h vendor/nvi/2.2.0/common/search.c - copied unchanged from r365495, vendor/nvi/dist/common/search.c vendor/nvi/2.2.0/common/seq.c - copied unchanged from r365495, vendor/nvi/dist/common/seq.c vendor/nvi/2.2.0/common/seq.h - copied unchanged from r365495, vendor/nvi/dist/common/seq.h vendor/nvi/2.2.0/common/util.c - copied unchanged from r365495, vendor/nvi/dist/common/util.c vendor/nvi/2.2.0/common/util.h - copied unchanged from r365495, vendor/nvi/dist/common/util.h vendor/nvi/2.2.0/ex/ex.c - copied unchanged from r365495, vendor/nvi/dist/ex/ex.c vendor/nvi/2.2.0/ex/ex.h - copied unchanged from r365495, vendor/nvi/dist/ex/ex.h vendor/nvi/2.2.0/ex/ex_abbrev.c - copied unchanged from r365495, vendor/nvi/dist/ex/ex_abbrev.c vendor/nvi/2.2.0/ex/ex_append.c - copied unchanged from r365495, vendor/nvi/dist/ex/ex_append.c vendor/nvi/2.2.0/ex/ex_args.c - copied unchanged from r365495, vendor/nvi/dist/ex/ex_args.c vendor/nvi/2.2.0/ex/ex_argv.c - copied unchanged from r365495, vendor/nvi/dist/ex/ex_argv.c vendor/nvi/2.2.0/ex/ex_at.c - copied unchanged from r365495, vendor/nvi/dist/ex/ex_at.c vendor/nvi/2.2.0/ex/ex_bang.c - copied unchanged from r365495, vendor/nvi/dist/ex/ex_bang.c vendor/nvi/2.2.0/ex/ex_cd.c - copied unchanged from r365495, vendor/nvi/dist/ex/ex_cd.c vendor/nvi/2.2.0/ex/ex_cmd.c - copied unchanged from r365495, vendor/nvi/dist/ex/ex_cmd.c vendor/nvi/2.2.0/ex/ex_cscope.c - copied unchanged from r365495, vendor/nvi/dist/ex/ex_cscope.c vendor/nvi/2.2.0/ex/ex_delete.c - copied unchanged from r365495, vendor/nvi/dist/ex/ex_delete.c vendor/nvi/2.2.0/ex/ex_display.c - copied unchanged from r365495, vendor/nvi/dist/ex/ex_display.c vendor/nvi/2.2.0/ex/ex_edit.c - copied unchanged from r365495, vendor/nvi/dist/ex/ex_edit.c vendor/nvi/2.2.0/ex/ex_equal.c - copied unchanged from r365495, vendor/nvi/dist/ex/ex_equal.c vendor/nvi/2.2.0/ex/ex_file.c - copied unchanged from r365495, vendor/nvi/dist/ex/ex_file.c vendor/nvi/2.2.0/ex/ex_filter.c - copied unchanged from r365495, vendor/nvi/dist/ex/ex_filter.c vendor/nvi/2.2.0/ex/ex_global.c - copied unchanged from r365495, vendor/nvi/dist/ex/ex_global.c vendor/nvi/2.2.0/ex/ex_init.c - copied unchanged from r365495, vendor/nvi/dist/ex/ex_init.c vendor/nvi/2.2.0/ex/ex_join.c - copied unchanged from r365495, vendor/nvi/dist/ex/ex_join.c vendor/nvi/2.2.0/ex/ex_map.c - copied unchanged from r365495, vendor/nvi/dist/ex/ex_map.c vendor/nvi/2.2.0/ex/ex_mark.c - copied unchanged from r365495, vendor/nvi/dist/ex/ex_mark.c vendor/nvi/2.2.0/ex/ex_mkexrc.c - copied unchanged from r365495, vendor/nvi/dist/ex/ex_mkexrc.c vendor/nvi/2.2.0/ex/ex_move.c - copied unchanged from r365495, vendor/nvi/dist/ex/ex_move.c vendor/nvi/2.2.0/ex/ex_open.c - copied unchanged from r365495, vendor/nvi/dist/ex/ex_open.c vendor/nvi/2.2.0/ex/ex_preserve.c - copied unchanged from r365495, vendor/nvi/dist/ex/ex_preserve.c vendor/nvi/2.2.0/ex/ex_print.c - copied unchanged from r365495, vendor/nvi/dist/ex/ex_print.c vendor/nvi/2.2.0/ex/ex_put.c - copied unchanged from r365495, vendor/nvi/dist/ex/ex_put.c vendor/nvi/2.2.0/ex/ex_quit.c - copied unchanged from r365495, vendor/nvi/dist/ex/ex_quit.c vendor/nvi/2.2.0/ex/ex_read.c - copied unchanged from r365495, vendor/nvi/dist/ex/ex_read.c vendor/nvi/2.2.0/ex/ex_screen.c - copied unchanged from r365495, vendor/nvi/dist/ex/ex_screen.c vendor/nvi/2.2.0/ex/ex_script.c - copied unchanged from r365495, vendor/nvi/dist/ex/ex_script.c vendor/nvi/2.2.0/ex/ex_set.c - copied unchanged from r365495, vendor/nvi/dist/ex/ex_set.c vendor/nvi/2.2.0/ex/ex_shell.c - copied unchanged from r365495, vendor/nvi/dist/ex/ex_shell.c vendor/nvi/2.2.0/ex/ex_shift.c - copied unchanged from r365495, vendor/nvi/dist/ex/ex_shift.c vendor/nvi/2.2.0/ex/ex_source.c - copied unchanged from r365495, vendor/nvi/dist/ex/ex_source.c vendor/nvi/2.2.0/ex/ex_stop.c - copied unchanged from r365495, vendor/nvi/dist/ex/ex_stop.c vendor/nvi/2.2.0/ex/ex_subst.c - copied unchanged from r365495, vendor/nvi/dist/ex/ex_subst.c vendor/nvi/2.2.0/ex/ex_tag.c - copied unchanged from r365495, vendor/nvi/dist/ex/ex_tag.c vendor/nvi/2.2.0/ex/ex_txt.c - copied unchanged from r365495, vendor/nvi/dist/ex/ex_txt.c vendor/nvi/2.2.0/ex/ex_undo.c - copied unchanged from r365495, vendor/nvi/dist/ex/ex_undo.c vendor/nvi/2.2.0/ex/ex_usage.c - copied unchanged from r365495, vendor/nvi/dist/ex/ex_usage.c vendor/nvi/2.2.0/ex/ex_util.c - copied unchanged from r365495, vendor/nvi/dist/ex/ex_util.c vendor/nvi/2.2.0/ex/ex_version.c - copied unchanged from r365495, vendor/nvi/dist/ex/ex_version.c vendor/nvi/2.2.0/ex/ex_visual.c - copied unchanged from r365495, vendor/nvi/dist/ex/ex_visual.c vendor/nvi/2.2.0/ex/ex_write.c - copied unchanged from r365495, vendor/nvi/dist/ex/ex_write.c vendor/nvi/2.2.0/ex/ex_yank.c - copied unchanged from r365495, vendor/nvi/dist/ex/ex_yank.c vendor/nvi/2.2.0/ex/ex_z.c - copied unchanged from r365495, vendor/nvi/dist/ex/ex_z.c vendor/nvi/2.2.0/ex/script.h - copied unchanged from r365495, vendor/nvi/dist/ex/script.h vendor/nvi/2.2.0/ex/tag.h - copied unchanged from r365495, vendor/nvi/dist/ex/tag.h vendor/nvi/2.2.0/vi/getc.c - copied unchanged from r365495, vendor/nvi/dist/vi/getc.c vendor/nvi/2.2.0/vi/v_at.c - copied unchanged from r365495, vendor/nvi/dist/vi/v_at.c vendor/nvi/2.2.0/vi/v_ch.c - copied unchanged from r365495, vendor/nvi/dist/vi/v_ch.c vendor/nvi/2.2.0/vi/v_cmd.c - copied unchanged from r365495, vendor/nvi/dist/vi/v_cmd.c vendor/nvi/2.2.0/vi/v_delete.c - copied unchanged from r365495, vendor/nvi/dist/vi/v_delete.c vendor/nvi/2.2.0/vi/v_ex.c - copied unchanged from r365495, vendor/nvi/dist/vi/v_ex.c vendor/nvi/2.2.0/vi/v_increment.c - copied unchanged from r365495, vendor/nvi/dist/vi/v_increment.c vendor/nvi/2.2.0/vi/v_init.c - copied unchanged from r365495, vendor/nvi/dist/vi/v_init.c vendor/nvi/2.2.0/vi/v_itxt.c - copied unchanged from r365495, vendor/nvi/dist/vi/v_itxt.c vendor/nvi/2.2.0/vi/v_left.c - copied unchanged from r365495, vendor/nvi/dist/vi/v_left.c vendor/nvi/2.2.0/vi/v_mark.c - copied unchanged from r365495, vendor/nvi/dist/vi/v_mark.c vendor/nvi/2.2.0/vi/v_match.c - copied unchanged from r365495, vendor/nvi/dist/vi/v_match.c vendor/nvi/2.2.0/vi/v_paragraph.c - copied unchanged from r365495, vendor/nvi/dist/vi/v_paragraph.c vendor/nvi/2.2.0/vi/v_put.c - copied unchanged from r365495, vendor/nvi/dist/vi/v_put.c vendor/nvi/2.2.0/vi/v_redraw.c - copied unchanged from r365495, vendor/nvi/dist/vi/v_redraw.c vendor/nvi/2.2.0/vi/v_replace.c - copied unchanged from r365495, vendor/nvi/dist/vi/v_replace.c vendor/nvi/2.2.0/vi/v_right.c - copied unchanged from r365495, vendor/nvi/dist/vi/v_right.c vendor/nvi/2.2.0/vi/v_screen.c - copied unchanged from r365495, vendor/nvi/dist/vi/v_screen.c vendor/nvi/2.2.0/vi/v_scroll.c - copied unchanged from r365495, vendor/nvi/dist/vi/v_scroll.c vendor/nvi/2.2.0/vi/v_search.c - copied unchanged from r365495, vendor/nvi/dist/vi/v_search.c vendor/nvi/2.2.0/vi/v_section.c - copied unchanged from r365495, vendor/nvi/dist/vi/v_section.c vendor/nvi/2.2.0/vi/v_sentence.c - copied unchanged from r365495, vendor/nvi/dist/vi/v_sentence.c vendor/nvi/2.2.0/vi/v_status.c - copied unchanged from r365495, vendor/nvi/dist/vi/v_status.c vendor/nvi/2.2.0/vi/v_txt.c - copied unchanged from r365495, vendor/nvi/dist/vi/v_txt.c vendor/nvi/2.2.0/vi/v_ulcase.c - copied unchanged from r365495, vendor/nvi/dist/vi/v_ulcase.c vendor/nvi/2.2.0/vi/v_undo.c - copied unchanged from r365495, vendor/nvi/dist/vi/v_undo.c vendor/nvi/2.2.0/vi/v_util.c - copied unchanged from r365495, vendor/nvi/dist/vi/v_util.c vendor/nvi/2.2.0/vi/v_word.c - copied unchanged from r365495, vendor/nvi/dist/vi/v_word.c vendor/nvi/2.2.0/vi/v_xchar.c - copied unchanged from r365495, vendor/nvi/dist/vi/v_xchar.c vendor/nvi/2.2.0/vi/v_yank.c - copied unchanged from r365495, vendor/nvi/dist/vi/v_yank.c vendor/nvi/2.2.0/vi/v_z.c - copied unchanged from r365495, vendor/nvi/dist/vi/v_z.c vendor/nvi/2.2.0/vi/v_zexit.c - copied unchanged from r365495, vendor/nvi/dist/vi/v_zexit.c vendor/nvi/2.2.0/vi/vi.c - copied unchanged from r365495, vendor/nvi/dist/vi/vi.c vendor/nvi/2.2.0/vi/vi.h - copied unchanged from r365495, vendor/nvi/dist/vi/vi.h vendor/nvi/2.2.0/vi/vs_line.c - copied unchanged from r365495, vendor/nvi/dist/vi/vs_line.c vendor/nvi/2.2.0/vi/vs_msg.c - copied unchanged from r365495, vendor/nvi/dist/vi/vs_msg.c vendor/nvi/2.2.0/vi/vs_refresh.c - copied unchanged from r365495, vendor/nvi/dist/vi/vs_refresh.c vendor/nvi/2.2.0/vi/vs_relative.c - copied unchanged from r365495, vendor/nvi/dist/vi/vs_relative.c vendor/nvi/2.2.0/vi/vs_smap.c - copied unchanged from r365495, vendor/nvi/dist/vi/vs_smap.c vendor/nvi/2.2.0/vi/vs_split.c - copied unchanged from r365495, vendor/nvi/dist/vi/vs_split.c Deleted: vendor/nvi/2.2.0/cl/extern.h vendor/nvi/2.2.0/common/extern.h vendor/nvi/2.2.0/common/options_def.h vendor/nvi/2.2.0/docs/ vendor/nvi/2.2.0/ex/ex_def.h vendor/nvi/2.2.0/ex/extern.h vendor/nvi/2.2.0/ex/version.h vendor/nvi/2.2.0/vi/extern.h Copied: vendor/nvi/2.2.0/.gitignore (from r365495, vendor/nvi/dist/.gitignore) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/nvi/2.2.0/.gitignore Wed Sep 9 07:58:35 2020 (r365496, copy of r365495, vendor/nvi/dist/.gitignore) @@ -0,0 +1,9 @@ +*.swp +*~ +*.orig +*.core +extern.h +*_def.h +version.h +tags +build/ Copied: vendor/nvi/2.2.0/CMakeLists.txt (from r365495, vendor/nvi/dist/CMakeLists.txt) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/nvi/2.2.0/CMakeLists.txt Wed Sep 9 07:58:35 2020 (r365496, copy of r365495, vendor/nvi/dist/CMakeLists.txt) @@ -0,0 +1,190 @@ +cmake_minimum_required(VERSION 3.9) + +get_property(is_multi_config GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) +if(is_multi_config) + set(CMAKE_CONFIGURATION_TYPES Debug Release CACHE STRING + "Semicolon separated list of supported configuration types") + mark_as_advanced(CMAKE_CONFIGURATION_TYPES) +elseif(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_C_FLAGS) + message(WARNING "No CMAKE_BUILD_TYPE is selected") +endif() + +project(nvi2 C) + +include(CheckIncludeFiles) +include(CheckFunctionExists) +include(CheckCSourceCompiles) + +mark_as_advanced(CMAKE_INSTALL_PREFIX) + +option(USE_WIDECHAR "Enable wide character support" ON) +option(USE_ICONV "Enable iconv support" ON) + +add_compile_options(-fcolor-diagnostics) +add_compile_options($<$:-Wall>) +add_compile_options($<$:-Wno-parentheses>) +add_compile_options($<$:-Wno-uninitialized>) +add_compile_options($<$:-Wmissing-prototypes>) +add_compile_options($<$:-Wsystem-headers>) +add_compile_options($<$:-Wuninitialized>) +add_compile_options($<$:-Wno-dangling-else>) +add_compile_options(-Wstack-protector -fstack-protector) +add_compile_options(-Wstrict-aliasing -fstrict-aliasing) + +include_directories(${CMAKE_CURRENT_BINARY_DIR}) + +set(MAIN_PROTOS + cl/extern.h common/extern.h ex/extern.h vi/extern.h + common/options_def.h ex/ex_def.h ex/version.h) + +set(CL_SRCS + cl/cl_funcs.c cl/cl_main.c cl/cl_read.c cl/cl_screen.c cl/cl_term.c) + +set(COMMON_SRCS + common/conv.c common/cut.c common/delete.c common/encoding.c common/exf.c + common/key.c common/line.c common/log.c common/main.c common/mark.c + common/msg.c common/options.c common/options_f.c common/put.c + common/recover.c common/screen.c common/search.c common/seq.c + common/util.c) + +set(EX_SRCS + ex/ex.c ex/ex_abbrev.c ex/ex_append.c ex/ex_args.c ex/ex_argv.c ex/ex_at.c + ex/ex_bang.c ex/ex_cd.c ex/ex_cmd.c ex/ex_cscope.c ex/ex_delete.c + ex/ex_display.c ex/ex_edit.c ex/ex_equal.c ex/ex_file.c ex/ex_filter.c + ex/ex_global.c ex/ex_init.c ex/ex_join.c ex/ex_map.c ex/ex_mark.c + ex/ex_mkexrc.c ex/ex_move.c ex/ex_open.c ex/ex_preserve.c ex/ex_print.c + ex/ex_put.c ex/ex_quit.c ex/ex_read.c ex/ex_screen.c ex/ex_script.c + ex/ex_set.c ex/ex_shell.c ex/ex_shift.c ex/ex_source.c ex/ex_stop.c + ex/ex_subst.c ex/ex_tag.c ex/ex_txt.c ex/ex_undo.c ex/ex_usage.c + ex/ex_util.c ex/ex_version.c ex/ex_visual.c ex/ex_write.c ex/ex_yank.c + ex/ex_z.c) + +set(VI_SRCS + vi/getc.c vi/v_at.c vi/v_ch.c vi/v_cmd.c vi/v_delete.c vi/v_ex.c + vi/v_increment.c vi/v_init.c vi/v_itxt.c vi/v_left.c vi/v_mark.c + vi/v_match.c vi/v_paragraph.c vi/v_put.c vi/v_redraw.c vi/v_replace.c + vi/v_right.c vi/v_screen.c vi/v_scroll.c vi/v_search.c vi/v_section.c + vi/v_sentence.c vi/v_status.c vi/v_txt.c vi/v_ulcase.c vi/v_undo.c + vi/v_util.c vi/v_word.c vi/v_xchar.c vi/v_yank.c vi/v_z.c vi/v_zexit.c + vi/vi.c vi/vs_line.c vi/vs_msg.c vi/vs_refresh.c vi/vs_relative.c + vi/vs_smap.c vi/vs_split.c) + +set(REGEX_SRCS + regex/regcomp.c regex/regerror.c regex/regexec.c regex/regfree.c) + +# commands to generate the public headers +set(extract_protos sed -n 's/^ \\* PUBLIC: \\\(.*\\\)/\\1/p') +set(extract_version sed -n + 's/^.*version \\\([^\)]*\)\\\).*/\#define VI_VERSION \\\"\\1\\\"/p') + +add_custom_command(OUTPUT cl/extern.h + COMMAND ${extract_protos} ${CL_SRCS} > cl/extern.h + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + DEPENDS ${CL_SRCS}) +add_custom_command(OUTPUT common/extern.h + COMMAND ${extract_protos} ${COMMON_SRCS} > common/extern.h + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + DEPENDS ${COMMON_SRCS}) +add_custom_command(OUTPUT ex/extern.h + COMMAND ${extract_protos} ${EX_SRCS} > ex/extern.h + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + DEPENDS ${EX_SRCS}) +add_custom_command(OUTPUT vi/extern.h + COMMAND ${extract_protos} ${VI_SRCS} > vi/extern.h + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + DEPENDS ${VI_SRCS}) +add_custom_command(OUTPUT common/options_def.h + COMMAND awk -f common/options.awk + common/options.c > common/options_def.h + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + DEPENDS common/options.c) +add_custom_command(OUTPUT ex/ex_def.h + COMMAND awk -f ex/ex.awk ex/ex_cmd.c > ex/ex_def.h + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + DEPENDS ex/ex_cmd.c) +add_custom_command(OUTPUT ex/version.h + COMMAND ${extract_version} README > ex/version.h + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + DEPENDS README) + +add_executable(nvi) +target_sources(nvi PRIVATE ${MAIN_PROTOS} ${CL_SRCS} ${COMMON_SRCS} + ${EX_SRCS} ${VI_SRCS}) +target_compile_definitions(nvi PRIVATE $<$:DEBUG> + $<$:COMLOG>) + +check_function_exists(openpty UTIL_IN_LIBC) +if(NOT UTIL_IN_LIBC) + find_library(UTIL_LIBRARY util) + target_link_libraries(nvi PRIVATE ${UTIL_LIBRARY}) +endif() + +check_function_exists(__b64_ntop RESOLV_IN_LIBC) +if(NOT RESOLV_IN_LIBC) + find_library(RESOLV_LIBRARY resolv) + target_link_libraries(nvi PRIVATE ${RESOLV_LIBRARY}) +endif() + +if(USE_WIDECHAR) + find_library(CURSES_LIBRARY NAMES ncursesw cursesw curses HINTS /usr/lib) + + # link to the wchar_t awared BSD libregex.a + add_library(regex STATIC) + target_sources(regex PRIVATE ${REGEX_SRCS}) + target_include_directories(regex PUBLIC regex) + target_compile_definitions(regex PUBLIC __REGEX_PRIVATE) + target_link_libraries(nvi PRIVATE regex) +else() + find_library(CURSES_LIBRARY NAMES ncurses curses HINTS /usr/lib) + target_compile_options(nvi PRIVATE -Wno-pointer-sign) +endif() + +target_link_libraries(nvi PRIVATE ${CURSES_LIBRARY}) + +if(USE_ICONV) + check_function_exists(__iconv ICONV_IN_LIBC) + if(NOT ICONV_IN_LIBC) + find_path(ICONV_INCLUDE_DIR iconv.h) + find_library(ICONV_LIBRARY iconv) + endif() + + # detect the prototype of iconv(3) + set(CMAKE_C_FLAGS_BACKUP "${CMAKE_C_FLAGS}") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror") + set(CMAKE_REQUIRED_INCLUDES "${ICONV_INCLUDE_DIR}") + set(CMAKE_REQUIRED_LIBRARIES "${ICONV_LIBRARY}") + check_c_source_compiles(" + #include + int main() { + iconv_t conv = 0; + char* in = 0; + size_t ilen = 0; + char* out = 0; + size_t olen = 0; + iconv(conv, &in, &ilen, &out, &olen); + return 0; + } + " ICONV_TRADITIONAL) + set(CMAKE_REQUIRED_INCLUDES) + set(CMAKE_REQUIRED_LIBRARIES) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS_BACKUP}") + + target_include_directories(nvi PRIVATE ${ICONV_INCLUDE_DIR}) + target_link_libraries(nvi PRIVATE ${ICONV_LIBRARY}) +endif() + +check_include_files(libutil.h HAVE_LIBUTIL_H) +check_include_files(ncurses.h HAVE_NCURSES_H) +check_include_files(term.h HAVE_TERM_H) + +configure_file(files/config.h.in config.h) + +set(vi_cv_path_preserve /var/tmp/vi.recover/) +if(APPLE) + set(vi_cv_path_msgcat /usr/local/share/vi/catalog/) +else() + set(vi_cv_path_msgcat /usr/share/vi/catalog/) +endif() + +configure_file(files/pathnames.h.in pathnames.h) +configure_file(files/recover.in recover @ONLY) Copied: vendor/nvi/2.2.0/LICENSE (from r365495, vendor/nvi/dist/LICENSE) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/nvi/2.2.0/LICENSE Wed Sep 9 07:58:35 2020 (r365496, copy of r365495, vendor/nvi/dist/LICENSE) @@ -0,0 +1,37 @@ +The following are the copyrights and redistribution conditions that apply +to this copy of the Vi software. + +/* + * Copyright (c) 1991, 1992, 1993, 1994 + * The Regents of the University of California. All rights reserved. + * Copyright (c) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000 + * Keith Bostic. All rights reserved. + * Copyright (c) 1999, 2000 + * Sven Verdoolaege. All rights reserved. + * Copyright (c) 2011 + * Zhihao Yuan. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ Copied: vendor/nvi/2.2.0/README (from r365495, vendor/nvi/dist/README) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/nvi/2.2.0/README Wed Sep 9 07:58:35 2020 (r365496, copy of r365495, vendor/nvi/dist/README) @@ -0,0 +1,64 @@ +This is version 2.2.0 (2020-08-01) of nex/nvi, a reimplementation of the ex/vi +text editors originally distributed as part of the Fourth Berkeley +Software Distribution (4BSD), by the University of California, Berkeley. + +The directory layout is as follows: + + LICENSE ....... Copyright, use and redistribution information. + README ........ This file. + catalog ....... Message catalogs; see catalog/README. + cl ............ Vi interface to the curses(3) library. + common ........ Code shared by ex and vi. + ex ............ Ex source code. + files ......... Template files. + man ........... Ex/vi documentation. + regex ......... Modified regex library with wide character support. + vi ............ Vi source code. + +=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +o Nvi was written by Keith Bostic, and the last version is 1.79. After that, + + Sven Verdoolaege added the iconv support and the DB3 locking. + + Jun-ichiro itojun Hagino developed the file encoding detection + techniques in his nvi-m17n. + +The following acknowledgments were written by Keith Bostic: + +=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +o This software is several years old and is the product of many folks' work. + + This software was originally derived from software contributed to + the University of California, Berkeley by Steve Kirkendall, the + author of the vi clone elvis. Without his work, this work would + have been far more difficult. + + IEEE POSIX 1003.2 style regular expression support is courtesy of + Henry Spencer, for which I am *very* grateful. + + Elan Amir did the original 4BSD curses work that made it possible + to support a full-screen editor using curses. + + George Neville-Neil added the Tcl interpreter, and the initial + interpreter design was his. + + Sven Verdoolaege added the Perl interpreter. + + Rob Mayoff provided the original Cscope support. + +o Many, many people suggested enhancements, and provided bug reports and + testing, far too many to individually thank. + +o From the original vi acknowledgements, by William Joy and Mark Horton: + + Bruce Englar encouraged the early development of this display + editor. Peter Kessler helped bring sanity to version 2's + command layout. Bill Joy wrote versions 1 and 2.0 through 2.7, + and created the framework that users see in the present editor. + Mark Horton added macros and other features and made the editor + work on a large number of terminals and Unix systems. + +o And... + The financial support of UUNET Communications Services is gratefully + acknowledged. Copied: vendor/nvi/2.2.0/catalog/Makefile (from r365495, vendor/nvi/dist/catalog/Makefile) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/nvi/2.2.0/catalog/Makefile Wed Sep 9 07:58:35 2020 (r365496, copy of r365495, vendor/nvi/dist/catalog/Makefile) @@ -0,0 +1,77 @@ +CAT= dutch english french german polish ru_RU.KOI8-R spanish \ + swedish tr_TR.ISO8859-9 tr_TR.UTF-8 uk_UA.KOI8-U zh_CN.GB2312 +FILES= ../cl/*.c ../common/*.c ../ex/*.c ../vi/*.c + +all: dump ${CAT} + +${CAT}: english.base + @echo "... $@"; \ + rm -f $@; \ + sort -u $@.base | \ + awk '{ \ + if ($$1 == 1) { \ + print "\nMESSAGE NUMBER 1 IS NOT LEGAL"; \ + exit 1; \ + } \ + if (++nline > $$1) { \ + print "DUPLICATE MESSAGE NUMBER " $$1; \ + exit 1; \ + } \ + print $0; \ + }' | \ + sed -e '1s/^/$$set 1~$$quote "~/; 1y/~/\n/' | \ + gencat $@ /dev/stdin; \ + chmod 444 $@; \ + if grep DUPLICATE $@ > /dev/null; then \ + grep DUPLICATE $@; \ + fi; \ + if grep 'NOT LEGAL' $@ > /dev/null; then \ + grep 'NOT LEGAL' $@; \ + fi + +CHK= dutch.check english.check french.check german.check \ + polish.check ru_RU.KOI8-R.check spanish.check swedish.check \ + tr_TR.ISO8859-9.check tr_TR.UTF-8.check uk_UA.KOI8-U.check \ + zh_CN.GB2312.check +check: ${CHK} +${CHK}: ${CAT} + @echo "... $@"; \ + f=`basename $@ .check`; \ + (echo "Unused message id's (this is okay):"; \ + awk '{ \ + while (++nline < $$1) \ + printf "%03d\n", nline; \ + }' < $$f.base; \ + echo =========================; \ + echo "MISSING ERROR MESSAGES (Please add!):"; \ + awk '{print $$1}' < $$f.base | sort -u > __ck1; \ + awk '{print $$1}' < english.base | sort -u > __ck2; \ + comm -13 __ck1 __ck2; \ + echo =========================; \ + echo "Extra error messages (just delete them):"; \ + comm -23 __ck1 __ck2; \ + echo =========================; \ + echo "MESSAGES WITH THE SAME MESSAGE ID's (FIX!):"; \ + for j in \ + `sed '/^$$/d' < $$f.base | sort -u | \ + awk '{print $$1}' | uniq -d`; do \ + egrep $$j $$f.base; \ + done; \ + echo =========================; \ + echo "Duplicate messages, both id and message (this is okay):"; \ + sed '/^$$/d' < $$f.base | sort | uniq -c | \ + awk '$$1 != 1 { print $$0 }' | sort -n; \ + echo =========================) > $@ + +english.base: dump ${FILES} #Makefile + ./dump ${FILES} |\ + sed -e '/|/!d' \ + -e 's/|/ "/' \ + -e 's/^"//' |\ + sort -nu > $@ + +dump: dump.c + ${CC} -O -o dump dump.c + +clean: + rm -f dump dump.o ${CAT} english.base *.check __ck1 __ck2 Copied: vendor/nvi/2.2.0/catalog/README (from r365495, vendor/nvi/dist/catalog/README) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/nvi/2.2.0/catalog/README Wed Sep 9 07:58:35 2020 (r365496, copy of r365495, vendor/nvi/dist/catalog/README) @@ -0,0 +1,125 @@ +Generally, all non-system error and informational messages in nvi are +catalog messages, i.e. they can be tailored to a specific langauge. +Command strings, usage strings, system errors and other 'known text' +are not. + +Message catalogs in nvi are fairly simple. Every catalog message +consists of two parts -- an initial number followed by a pipe (`|') +character, followed by the English text for the message. For example: + + msgq(sp, M_ERR, "001|This is an error message"); + +would be a typical message. + +When the msgq() routine is called, if the user has specified a message +catalog and the format string (the third argument) has a leading number, +then it is converted to a record number, and that record is retrieved +from the message catalog and used as a replacement format string. If +the record can't be retrieved for any reason, the English text is displayed +instead. + +Each message format string MUST map into the English format string, i.e. +it can't display more or different arguments than the English one. + +For example: + + msgq(sp, M_ERR, "002|Error: %d %x", arg1, arg2); + +is a format string that displays two arguments. + +Arguments to the msgq function are required to contain ONLY printable +characters. No further translation is done by the msgq routine before +displaying the message on the screen. For example, in the msgq call: + + msgq(sp, M_ERR, "003|File: %s", file_name); + +"file_name" must contain only printable characters. The routine +msg_print() returns a printable version of a string; the third argument +indicates whether the string needs to be freed. For example: + + char *p; + int nf; + + p = msg_print(sp, file_name, &nf); + msgq(sp, M_ERR, "003|File: %s", p); + if (nf) + FREE_SPACE(sp, p, 0); + +makes sure that "file_name" is printable before calling the msgq +routine. + +=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +The message catalogs themselves are maintained in two files. The first +is the "base file" which contains two fields, a record number and the +message itself. All base files are named using the convention +".base", e.g. the English one is "english.base". For +example: + + 002 "Line length overflow" + 003 "unable to delete line %lu" + 004 "unable to append to line %lu" + 005 "unable to insert at line %lu" + 006 "unable to store line %lu" + 007 "unable to get last line" + +are the first few lines of the current english.base file. + +Before this file being converted to the second file, the POSIX formatted +message catalog file, by gencat(1), two lines: + + $set 1 + $quote " + +will be inserted before the base text to setup the set_id and the quote +character. So the double-quote needs to be escaped by a backslash to be +included in a message; same as the backslash itself. + +These files are named for their language, e.g. "english". However, a +locale(1) name is also recommended. + +To create a new catalog for nvi: + +Copy the file english.base to a file that you can modify , e.g. "cp +english.base german.base". For each of the messages in the file, +replace the message with the string that you want to use. If you have +doubts about the meaning of a message, just email me. + +A latest english.base can be created from source by running the command +"make english" in the catalog/ directory. + +Once you've translated all of the strings, then add your catalog to the +"CAT=" line of the Makefile, and run the command "make catalog". This +will create the second (and corresponding) file for each file named +.base. + +Don't worry about missing line numbers, i.e. base files that look like: + + 005 Message number 5. + 007 Message number 7. + +This simply means that a message was deleted during the course of nvi's +development. It will be taken care of automatically when you create +the second form of the file. + +=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +If you add new messages to the nvi sources, you can check your work by +doing "make english; make check". The "make check" target lists unused +message numbers, duplicate message numbers, and duplicate messages. +Unused message numbers are only useful if you are condensing messages. +Duplicate message numbers are a serious problem and have to be fixed. +Duplicate messages are only interesting if a message appears often enough +that it's worth creating a routine so that the string is only need in +a single place. + +=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +To select a catalog when running nvi, set the "msgcat" option. If the +value of this option ends with a '/', it is treated as the name of a +directory that contains a message catalog "$LC_MESSAGES", which is set +through the LC_MESSAGES environment variable but returned by setlocale(3). +Check the output of locale(1) to validate such a value. If the option +doesn't end in a '/', the option is treated as the full path name of the +message catalog to use. + +If any messages are missing from the catalog, the backup text (English) +is used instead. Copied: vendor/nvi/2.2.0/catalog/dump.c (from r365495, vendor/nvi/dist/catalog/dump.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/nvi/2.2.0/catalog/dump.c Wed Sep 9 07:58:35 2020 (r365496, copy of r365495, vendor/nvi/dist/catalog/dump.c) @@ -0,0 +1,97 @@ +/*- + * Copyright (c) 1992, 1993, 1994 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +#include + +static void +parse(FILE *fp) +{ + int ch, s1, s2, s3; + +#define TESTD(s) { \ + if ((s = getc(fp)) == EOF) \ + return; \ + if (!isdigit(s)) \ + continue; \ +} +#define TESTP { \ + if ((ch = getc(fp)) == EOF) \ + return; \ + if (ch != '|') \ + continue; \ +} +#define MOVEC(t) { \ + do { \ + if ((ch = getc(fp)) == EOF) \ + return; \ + } while (ch != (t)); \ +} + for (;;) { + MOVEC('"'); + TESTD(s1); + TESTD(s2); + TESTD(s3); + TESTP; + putchar('"'); + putchar(s1); + putchar(s2); + putchar(s3); + putchar('|'); + for (;;) { /* dump to end quote. */ + if ((ch = getc(fp)) == EOF) + return; + putchar(ch); + if (ch == '"') + break; + if (ch == '\\') { + if ((ch = getc(fp)) == EOF) + return; + putchar(ch); + } + } + putchar('\n'); + } +} + +int +main(int argc, char *argv[]) +{ + FILE *fp; + + for (; *argv != NULL; ++argv) { + if ((fp = fopen(*argv, "r")) == NULL) { + perror(*argv); + return (1); + } + parse(fp); + (void)fclose(fp); + } + return (0); +} Copied: vendor/nvi/2.2.0/catalog/tr_TR.ISO8859-9.base (from r365495, vendor/nvi/dist/catalog/tr_TR.ISO8859-9.base) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/nvi/2.2.0/catalog/tr_TR.ISO8859-9.base Wed Sep 9 07:58:35 2020 (r365496, copy of r365495, vendor/nvi/dist/catalog/tr_TR.ISO8859-9.base) @@ -0,0 +1,304 @@ +002 "Satýr uzunluðu taþýmý" +003 "%lu numaralý satýr silinemiyor" +004 "%lu numaralý satýra iliþtirilemiyor" +005 "%lu numaralý satýrda ekleme yapýlamýyor" +006 "%lu numaralý satýr kaydedilemiyor" +007 "Son satýr alýnamýyor" +008 "Hata: %lu numaralý satýr okunamýyor" +009 "Günlük dosyasý" +010 "Günlükleme gerçekleþtirilmiyor, geri alma olanaklý deðil" +011 "Geri alýnacak bir deðiþiklik yok" +012 "Günlükleme gerçekleþtirilmiyor, geri alma olanaklý deðil" +013 "Günlükleme gerçekleþtirilmiyor, ileri sarma olanaklý deðil" +014 "Yinelenecek bir deðiþiklik yok" +015 "%s/%d: Günlük kayýt hatasý" +016 "Vi'nin standart girdisi ve çýktýsý bir uçbirim olmalý" +017 "Ým %s: Ayarlanmamýþ" +018 "Ým %s: Satýr silinmiþ" +019 "Ým %s: Ýmleç konumu artýk yok" +020 "Hata: " +021 "yeni dosya +022 "adý deðiþti" +023 "deðiþtirildi" +024 "deðiþtirilmedi" +025 "KÝLÝDÝ AÇILDI" +026 "saltokunur" +027 "satýr %lu/%lu [%ld%%]" +028 "boþ dosya" +029 "%lu. satýr" +030 "%s dosyasý bir ileti kataloðu deðil" +031 "Öntanýmlý %s seçeneði ayarlanamadý" +032 "Kullaným: %s" +033 "set: %s seçeneði yok: 'set all' tüm seçenek deðerlerini verir" +034 "set: [no]%s seçeneði bir deðer almaz" +035 "set: %s seçeneði bir Boole deðeri deðil" +036 "set: %s seçeneði: %s" +037 "set: %s seçeneði: %s: Deðer taþýmý" +038 "set: %s seçeneði: %s izin verilmeyen bir sayý" +039 "set: %s seçeneði bir Boole deðeri deðil" +040 "Ekran sütun sayýsý çok küçük, þundan daha az: %d" +041 "Ekran sütun sayýsý çok büyük, þundan daha çok: %d" +042 "Ekran satýr sayýsý çok küçük, þundan daha az: %d" +043 "Ekran satýr sayýsý çok büyük, þundan daha çok: %d" +044 "Lisp seçeneði eklenmemiþ" +045 "Ýletiler kapatýlmamýþ: %s" +046 "Ýletiler açýlmamýþ: %s" +047 "%s seçeneði iki karakterli öbekler biçiminde olmalý" +053 "Baþlangýç arabelleði boþ" +054 "%s arabelleði boþ" +056 "Oturum baþarýsýz olursa deðiþiklikler kurtarýlamaz" +057 "Dosya, kurtarma için kopyalanýyor..." +058 "Koruma baþarýsýz oldu: %s" +059 "Oturum baþarýsýz olursa deðiþiklikler kurtarýlamaz" +060 "Dosya yedeklemesi baþarýsýz oldu: %s" +061 "Dosya, kurtarma için kopyalanýyor..." +062 "%u kullanýcýsý üzerine bilgi bulunamadý" +063 "Kurtarma dosyasý kilitlenemiyor" +065 "Kurtarma dosyasý" +066 "%s: Hatalý oluþturulmuþ kurtarma dosyasý" +067 "%s: Hatalý oluþturulmuþ kurtarma dosyasý" +068 "Kurtarýlacak %s adýnda sizce okunabilir bir dosya yok" +069 "Bu dosyanýn kurtarabileceðiniz eski sürümleri var" +070 "Kurtarabileceðiniz baþka dosyalar var" +071 "E-posta gönderilmedi: %s" +072 "Dosya boþ, aranacak bir þey yok" +073 "Dizgi bulunamadan dosyanýn sonuna eriþildi" +074 "Arama dizgisi yok" +075 "Dizgi bulunamadý" +076 "Dizgi bulunamadan dosyanýn baþýna eriþildi" +077 "Arama tamamlandý" +078 "Aranýyor..." +079 "Yazdýrýlamaz karakter bulunmadý" +080 "Bilinmeyen komut adý" +082 "%s: Komut ex kipinde kullanýlamaz" +083 "Sayým sýfýr olmayabilir" +084 "%s: Hatalý satýr belirtimi" +085 "Ýç sözdizim tablo hatasý (%s: %s)" +086 "Kullaným: %s" +087 "%s: Geçici arabellek salýverilmedi" +088 "Bayrak göreli konumu birinci satýrdan önceye" +089 "Bayrak göreli konumu dosya sonunu geçiyor" +090 "Erimli @, dosya/ekran deðiþtiðinde çalýþýr" +091 "Global/v komutu dosya/ekran deðiþtiðinde çalýþýr" +092 "Ex komutu baþarýsýz: Sýradaki komutlar çýkarýldý" +093 "Ex komutu baþarýsýz: Eþlemlenen düðmeler çýkarýldý" +094 "Ýkinci adres ilkinden daha küçük" +095 "Bir im adý saðlanmadý" +096 "\\ sonrasýnda / veya ? gelmiyor" +097 "Bir satýr numarasýna yapýlan baþvuru sayýsý sýfýrdan az" +098 "Bilinmeyen komut: %s" +099 "Adres deðeri taþýmý" +100 "Adres deðeri alttaþýmý" +101 "Ýzin verilmeyen adres birleþimi" +102 "Ýzin verilmeyen adres: Dosyada yalnýzca %lu satýr var" +103 "Ýzin verilmeyen adres: Dosya boþ" +104 "%s komutu bir 0 adresine izin vermiyor" +105 "Görüntülenecek kýsaltma yok" +106 "Kýsaltmalar bir \"sözcük\" karakteri ile bitmelidir" +107 "Kýsaltmalar sekme veya boþluk içeremez" +108 "Kýsaltmalar sonu dýþýnda sözcük/sözcük olmayan karakterleri karýþtýramaz" +109 "\"%s\" bir kýsaltma deðil" +110 "Vi komutu baþarýsýz: Eþlemlenen düðmeler çýkarýldý" +111 "Düzenlenecek baþka dosya yok" +112 "Öncesinde düzenlenecek baþka dosya yok" +113 "Öncesinde geri sarýlacak dosyalar yok" +114 "Görüntülenecek dosya yok" +115 "Öncesinde \"!\" ögesinin yerine geçecek bir komut yok" +116 "%% yerine geçecek bir dosya adý yok" +117 "# yerine geçecek bir dosya adý yok" +118 "Hata: execl: %s" +119 "Girdi/Çýktý hatasý: %s" +120 "Dosya son tam yazýmdan bu yana deðiþtirilmiþ; yazýn veya yok saymak için ! kullanýn" +121 "Ev dizini konumu bulunamýyor" +122 "Yeni þimdiki dizin: %s" +123 "Görüntülenecek kesilmiþ arabellek yok" +124 "%s komutu bir global veya v komutunun parçasý olarak kullanýlamaz" +128 "%s: kaynak alýnmýyor: Ýyesi siz veya kök deðil" +129 "%s: kaynak alýnmýyor: Ýyesi siz deðilsiniz" +130 "%s: kaynak alýnmýyor: Ýyesi dýþýnda baþka bir kullanýcý tarafýndan yazýlabilir" +131 "Uç uca eklenecek bir satýr yok" +132 "Girdi eþlem girdisi yok" +133 "Komut eþlem girdisi yok" +134 "%s yeniden eþlemlenemeyebilir" +135 "\"%s\" þu anda eþlemlenmemiþ" +136 "Ým adlarý tek bir karakter olmalýdýr" +137 "%s mevcut, yazýlmamýþ; yok saymak için ! kullanýn" +138 "Yeni exrc dosyasý: %s" +139 "Hedef satýrý taþýma erimi içinde" +140 "'open' komutu 'open' seçeneðinin ayarlý olmasýný gerektirir" +141 "'open' komutu henüz eklenmemiþ" +142 "Bu dosyanýn korunmasý olanaklý deðil" +143 "Dosya korundu" +144 "%s: Çok fazla dosya adýna geniþletilmiþ" +145 "Yalnýzca sýradan dosyalar ve adlandýrýlmýþ veri yollarý okunabilir" +146 "%s: Okuma kilidi kullanýlabilir deðildi" +147 "Okunuyor..." +148 "%s: %lu satýr, %lu karakter" +149 "Görüntülenecek arkaplan ekraný yok" +150 "'script' komutu yalnýzca vi kipinde kullanýlabilir" +151 "Çalýþtýrýlacak komut yok" +152 "'shiftwidth' seçeneði 0 olarak ayarlanmýþ" +153 "Sayým taþýmý" +154 "Sayým alttaþýmý" +155 "Düzenli ifade belirtilmiþ; r bayraðý anlamsýz" +156 "#, l ve p bayraklarý vi kipinde c bayraðý ile birlikte kullanýlamaz" +157 "Eþleþme bulunamadý" +158 "Önceden bir etiket girilmemiþ" +159 "Etiket yýðýnýnda %s sayýsýndan az girdi; :display t[ags] kullanýn" +160 "Etiket yýðýnýnda dönülecek bir %s dosyasý yok; :display t[ags] kullanýn" +161 "Sürdürmek için Enter'a basýn:" +162 "%s: Etiket bulunamadý" +163 "%s: %s içinde hasar görmüþ etiket" +164 "%s: Etiketin satýr numarasý dosya sonunu geçmiþ" +165 "Etiket yýðýný boþ" +166 "%s: Arama dizgisi bulunamadý" +167 "%d dosya daha düzenlenecek" +168 "%s arabelleði boþ" +169 "Deðiþikliði onayla? [n]" +170 "Yarýda kesildi" +171 "Öncesinde çalýþtýrýlacak arabellek yok" +172 "Öncesinde düzenli ifade yok" +173 "%s komutu bir dosyanýn halihazýrda okunmuþ olmasýný gerektirir" +174 "Kullaným: %s" +175 "'visual' komutu 'open' seçeneðinin ayarlanmýþ olmasýný gerektirir" +177 "Boþ dosya" +178 "Öncesinde F, f, T veya t aramasý yok" +179 "%s bulunamadý" +180 "Düzenlenecek dosya yok" +181 "Ýmleç bir sayýda deðil" +182 "Ortaya çýkan sayý çok büyük" +183 "Ortaya çýkan sayý çok küçük" +184 "Bu satýrda eþleþen karakter yok" +185 "Eþleþen karakter bulunamadý" +186 "Deðiþtirilecek karakter yok" +187 "Geçilecek baþka ekran yok" +188 "Arama dizgisinden, satýr ofsetinden ve/veya 'z' komutundan sonraki karakterler" +189 "Öncesinde arama dizgisi yok" +190 "Arama baþlanan konumda tamamlandý" +191 "Kýsaltma geniþleme sýnýrýný aþtý: Karakterler çýkarýldý" +192 "Ýzin verilmeyen karakter; giriþ için týrnak içine alýn" +193 "Halihazýrda eklemenin baþýnda" +194 "Silinecek baþka karakter yok" +195 "Hareket dosya sonunu geçti" +196 "Hareket satýr sonunu geçti" +197 "Ýmleç hareket ettirilmedi" +198 "Halihazýrda dosyanýn baþýnda" +199 "Hareket dosyanýn baþýný geçti" +200 "Halihazýrda ilk sütunda" +201 "Arabellekler komuttan önce belirtilmeli" +202 "Halihazýrda dosya sonunda" +203 "Halihazýrda satýr sonunda" +204 "%s bir vi komutu deðil" +205 "Kullaným: %s" +206 "Silinecek karakter yok" +207 "Q komutu ex uçbirim arabirimini gerektirir" +208 "Yinelenecek komut yok" +209 "Dosya boþ" +210 "%s bir hareket komutu olarak kullanýlamaz" +211 "Halihazýrda komut kipi içinde" +212 "Ýmleç bir sözcükte deðil" +214 "'windows' seçeneði deðeri çok büyük, en çok %u olabilir" +215 "Ýliþtir" +216 "Deðiþiklik yap" +217 "Komut" +218 "Ekle" +219 "Deðiþtir" +220 "Hareket ekran sonunu geçti" +221 "Hareket ekran baþýný geçti" +222 "Ekran bölünebilmesi için %d satýrdan daha geniþ olmalýdýr" +223 "Arkaplan ekraný yok" +224 "Arkaplanda %s dosyasýný düzenleyen bir ekran yok" +225 "Açýk olan tek ekranýnýzý arkaplana alamazsýnýz" +226 "Ekran yalnýzca %d satýra küçültülebilir" +227 "Ekran küçülemez" +228 "Ekran büyüyemez" +230 "Bu ekran askýya alýnamaz" +231 "Yarýda kesildi: Eþlemlenen düðmeler çýkarýldý" +232 "vi: Geçici arabellek salýverilmedi" +233 "Bu uçbirimde %s düðmesi yok" +234 "Yalnýzca bir arabellek belirtilebilir" +235 "Sayý þundan daha büyük: %lu" +236 "Yarýda kesildi" +237 "Geçici dosya oluþturulamýyor" +238 "Uyarý: %s sýradan bir dosya deðil" +239 "%s halihazýrda kilitlenmiþ, oturum saltokunur" +240 "%s: Kaldýr" +241 "%s: Kapat" +242 "%s: Kaldýr" +243 "%s: Kaldýr" +244 "Saltokunur dosya, yazýlmadý; yok saymak için ! kullanýn" +245 "Saltokunur dosya, yazýlmadý" +246 "%s mevcut, yazýlmadý; yok saymak için ! kullanýn" +247 "%s mevcut, yazýlmadý" +248 "Kýsmi dosya, yazýlmadý; yok saymak için ! kullanýn" +249 "Kýsmi dosya, yazýlmadý" +250 "%s: Dosya bu kopyadan daha önce deðiþtirilmiþ; yok saymak için ! kullanýn" +251 "%s: Dosya bu kopyadan daha önce deðiþtirilmiþ" +252 "%s: Yazým korumasý kullanýlabilir deðildi" +253 "Yazýlýyor..." +254 "%s: UYARI: DOSYA KIRPILMIÞ" +255 "Halihazýrda bu grubun ilk etiketinde" +256 "%s: Yeni dosya: %lu satýr, %lu karakter" +257 "%s: %lu satýr, %lu karakter" +258 "%s çok fazla dosya adýna geniþletilmiþ" +259 "%s: Sýradan bir dosya deðil" +260 "%s: Ýyesi siz deðilsiniz" +261 "%s: Ýyesi dýþýnda baþka bir kullanýcý tarafýndan da eriþilebilir" +262 "Dosya son tam yazýmdan bu yana deðiþtirilmiþ; yazýn veya yok saymak için ! kullanýn" +263 "Dosya son tam yazýmdan bu yana deðiþtirilmiþ; yazýn veya yok saymak için :edit! kullanýn" +264 "Dosya son tam yazýmdan bu yana deðiþtirilmiþ; yazýn veya yok saymak için ! kullanýn" +265 "Dosya geçici; çýkarsanýz deðiþiklikler atýlacaktýr" +266 "Dosya saltokunur, deðiþiklikler kendiliðinden yazýlmaz" +267 "Günlük yeniden baþlatýldý" +268 "Onayla? [ynq]" +269 "Sürdürmek için herhangi bir düðmeye basýn: " +270 "Sürdürmek için herhangi bir düðmeye basýn [ex komutu girmek için :]: " +271 "Sürdürmek için herhangi bir düðmeye basýn [çýkýþ için q]: " +272 "Bu biçim %s ex uçbirim arabirimini gerektirir" +273 "ex girdisi kipine giriliyor" +274 "Komut baþarýsýz, henüz bir dosya okunmadý." +275 " sürdür?" +276 "Beklenmedik karakter olayý" +277 "Beklenmedik dosya sonu olayý" +278 "Sorgu eþleþmesi bulunamadý" +279 "Beklenmedik yarýda kesme olayý" +281 "Beklenmedik yeniden boyama olayý" +282 "Halihazýrda bu grubun son etiketinde" +283 "%s komutu ex uçbirim arabirimini gerektirir" +284 "Bu biçim %s 'secure edit' seçeneði ayarlandýðýnda desteklenmez" +285 "Beklenmedik dizi olayý" +286 "Beklenmedik zaman aþýmý olayý" +288 "Bölünebilmesi için ekran %d sütundan daha geniþ olmalýdýr" +289 "Kabuk geniþletmeleri 'secure edit' seçeneði ayarlandýðýnda desteklenmez" +290 "%s komutu 'secure edit' seçeneði ayarlandýðýnda desteklenmez" +291 "set: %s seçeneði kapatýlamaz" +292 "Ekran çok küçük." +293 "eklendi" +294 "deðiþtirildi" +295 "silindi" +296 "uç uca eklendi" +297 "taþýndý" +298 "kaydýrýldý" +299 "kopyalandý" +300 "satýr" +301 "satýr" +303 "Dosya son yazýmdan bu yana deðiþtirilmiþ." +304 "Kabuk geniþletmesi baþarýsýz" +305 "Bir '%s' düzenleme seçeneði belirtilmedi" +307 "Çalýþtýrýlacak ex komutu yok" +308 "Bir komut çalýþtýrmak için , çýkmak için :q girin" +309 "Yardým için \"cscope help\" kullanýn" +310 "Çalýþan bir cscope baðlantýsý yok" +311 "%s: Bilinmeyen arama türü: Þunlardan bir tanesini kullanýn: %s" +312 "%d: Böyle bir cscope oturumu yok" +313 "set: %s seçeneði hiçbir zaman açýlamaz" +314 "set: %s seçeneði hiçbir zaman 0 olarak ayarlanamaz" +315 "%s: Ýliþtirildi: %lu satýr, %lu karakter" +316 "Beklenmedik yeniden boyutlandýrma olayý" +317 "Düzenlenecek %d dosya var" +319 "%d ekran arkaplana alýndý; onlarý listelemek için :display kullanýn" +320 "Bilinmeyen imleç konumu" +321 "Dosya kodlama dönüþtürmesi desteklenmiyor" +322 "Girdi kodlama dönüþtürmesi desteklenmiyor" +323 "Geçersiz girdi. Kýrpýldý." +324 "%d numaralý satýrda dönüþtürme hatasý" Copied: vendor/nvi/2.2.0/catalog/tr_TR.ISO8859-9.owner (from r365495, vendor/nvi/dist/catalog/tr_TR.ISO8859-9.owner) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/nvi/2.2.0/catalog/tr_TR.ISO8859-9.owner Wed Sep 9 07:58:35 2020 (r365496, copy of r365495, vendor/nvi/dist/catalog/tr_TR.ISO8859-9.owner) @@ -0,0 +1 @@ +Emir SARI Copied: vendor/nvi/2.2.0/catalog/tr_TR.UTF-8.base (from r365495, vendor/nvi/dist/catalog/tr_TR.UTF-8.base) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/nvi/2.2.0/catalog/tr_TR.UTF-8.base Wed Sep 9 07:58:35 2020 (r365496, copy of r365495, vendor/nvi/dist/catalog/tr_TR.UTF-8.base) @@ -0,0 +1,304 @@ +002 "Satır uzunluÄŸu taşımı" +003 "%lu numaralı satır silinemiyor" +004 "%lu numaralı satıra iliÅŸtirilemiyor" +005 "%lu numaralı satırda ekleme yapılamıyor" +006 "%lu numaralı satır kaydedilemiyor" +007 "Son satır alınamıyor" +008 "Hata: %lu numaralı satır okunamıyor" +009 "Günlük dosyası" +010 "Günlükleme gerçekleÅŸtirilmiyor, geri alma olanaklı deÄŸil" +011 "Geri alınacak bir deÄŸiÅŸiklik yok" +012 "Günlükleme gerçekleÅŸtirilmiyor, geri alma olanaklı deÄŸil" +013 "Günlükleme gerçekleÅŸtirilmiyor, ileri sarma olanaklı deÄŸil" +014 "Yinelenecek bir deÄŸiÅŸiklik yok" +015 "%s/%d: Günlük kayıt hatası" +016 "Vi'nin standart girdisi ve çıktısı bir uçbirim olmalı" +017 "Ä°m %s: Ayarlanmamış" +018 "Ä°m %s: Satır silinmiÅŸ" +019 "Ä°m %s: Ä°mleç konumu artık yok" +020 "Hata: " +021 "yeni dosya +022 "adı deÄŸiÅŸti" +023 "deÄŸiÅŸtirildi" +024 "deÄŸiÅŸtirilmedi" +025 "KÄ°LÄ°DÄ° AÇILDI" +026 "saltokunur" +027 "satır %lu/%lu [%ld%%]" +028 "boÅŸ dosya" +029 "%lu. satır" +030 "%s dosyası bir ileti kataloÄŸu deÄŸil" +031 "Öntanımlı %s seçeneÄŸi ayarlanamadı" +032 "Kullanım: %s" +033 "set: %s seçeneÄŸi yok: 'set all' tüm seçenek deÄŸerlerini verir" +034 "set: [no]%s seçeneÄŸi bir deÄŸer almaz" +035 "set: %s seçeneÄŸi bir Boole deÄŸeri deÄŸil" +036 "set: %s seçeneÄŸi: %s" +037 "set: %s seçeneÄŸi: %s: DeÄŸer taşımı" +038 "set: %s seçeneÄŸi: %s izin verilmeyen bir sayı" +039 "set: %s seçeneÄŸi bir Boole deÄŸeri deÄŸil" +040 "Ekran sütun sayısı çok küçük, ÅŸundan daha az: %d" +041 "Ekran sütun sayısı çok büyük, ÅŸundan daha çok: %d" +042 "Ekran satır sayısı çok küçük, ÅŸundan daha az: %d" +043 "Ekran satır sayısı çok büyük, ÅŸundan daha çok: %d" +044 "Lisp seçeneÄŸi eklenmemiÅŸ" +045 "Ä°letiler kapatılmamış: %s" +046 "Ä°letiler açılmamış: %s" +047 "%s seçeneÄŸi iki karakterli öbekler biçiminde olmalı" +053 "BaÅŸlangıç arabelleÄŸi boÅŸ" +054 "%s arabelleÄŸi boÅŸ" +056 "Oturum baÅŸarısız olursa deÄŸiÅŸiklikler kurtarılamaz" +057 "Dosya, kurtarma için kopyalanıyor..." +058 "Koruma baÅŸarısız oldu: %s" +059 "Oturum baÅŸarısız olursa deÄŸiÅŸiklikler kurtarılamaz" +060 "Dosya yedeklemesi baÅŸarısız oldu: %s" +061 "Dosya, kurtarma için kopyalanıyor..." +062 "%u kullanıcısı üzerine bilgi bulunamadı" +063 "Kurtarma dosyası kilitlenemiyor" +065 "Kurtarma dosyası" +066 "%s: Hatalı oluÅŸturulmuÅŸ kurtarma dosyası" +067 "%s: Hatalı oluÅŸturulmuÅŸ kurtarma dosyası" +068 "Kurtarılacak %s adında sizce okunabilir bir dosya yok" +069 "Bu dosyanın kurtarabileceÄŸiniz eski sürümleri var" +070 "KurtarabileceÄŸiniz baÅŸka dosyalar var" +071 "E-posta gönderilmedi: %s" +072 "Dosya boÅŸ, aranacak bir ÅŸey yok" +073 "Dizgi bulunamadan dosyanın sonuna eriÅŸildi" +074 "Arama dizgisi yok" *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Wed Sep 9 08:18:06 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 609FB3C8B2E; Wed, 9 Sep 2020 08:18:06 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BmZdp2H0bz3fJr; Wed, 9 Sep 2020 08:18:06 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 313B61EB08; Wed, 9 Sep 2020 08:18:06 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0898I6IQ090298; Wed, 9 Sep 2020 08:18:06 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0898I5iL090292; Wed, 9 Sep 2020 08:18:05 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <202009090818.0898I5iL090292@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Wed, 9 Sep 2020 08:18:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r365497 - in vendor/nvi/dist: cl common ex vi X-SVN-Group: vendor X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: in vendor/nvi/dist: cl common ex vi X-SVN-Commit-Revision: 365497 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.33 Precedence: list List-Id: "SVN commit messages 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, 09 Sep 2020 08:18:06 -0000 Author: bapt Date: Wed Sep 9 08:18:04 2020 New Revision: 365497 URL: https://svnweb.freebsd.org/changeset/base/365497 Log: Import missing files from the nvi 2.2.0 previous half done import Added: vendor/nvi/dist/cl/extern.h (contents, props changed) vendor/nvi/dist/common/extern.h (contents, props changed) vendor/nvi/dist/common/options_def.h (contents, props changed) vendor/nvi/dist/ex/ex_def.h (contents, props changed) vendor/nvi/dist/ex/extern.h (contents, props changed) vendor/nvi/dist/ex/version.h (contents, props changed) vendor/nvi/dist/vi/extern.h (contents, props changed) Added: vendor/nvi/dist/cl/extern.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/nvi/dist/cl/extern.h Wed Sep 9 08:18:04 2020 (r365497) @@ -0,0 +1,31 @@ +int cl_waddstr(SCR *, const CHAR_T *, size_t); +int cl_addstr(SCR *, const char *, size_t); +int cl_attr(SCR *, scr_attr_t, int); +int cl_baud(SCR *, u_long *); +int cl_bell(SCR *); +int cl_clrtoeol(SCR *); +int cl_cursor(SCR *, size_t *, size_t *); +int cl_deleteln(SCR *); +int cl_discard(SCR *, SCR **); +int cl_ex_adjust(SCR *, exadj_t); +int cl_insertln(SCR *); +int cl_keyval(SCR *, scr_keyval_t, CHAR_T *, int *); +int cl_move(SCR *, size_t, size_t); +int cl_refresh(SCR *, int); +int cl_rename(SCR *, char *, int); +void cl_setname(GS *, char *); +int cl_split(SCR *, SCR *); +int cl_suspend(SCR *, int *); +void cl_usage(void); +int sig_init(GS *, SCR *); +int cl_event(SCR *, EVENT *, u_int32_t, int); +int cl_screen(SCR *, u_int32_t); +int cl_quit(GS *); +int cl_getcap(SCR *, char *, char **); +int cl_term_init(SCR *); +int cl_term_end(GS *); +int cl_fmap(SCR *, seq_t, CHAR_T *, size_t, CHAR_T *, size_t); +int cl_optchange(SCR *, int, char *, u_long *); +int cl_omesg(SCR *, CL_PRIVATE *, int); +int cl_ssize(SCR *, int, size_t *, size_t *, int *); +int cl_putchar(int); Added: vendor/nvi/dist/common/extern.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/nvi/dist/common/extern.h Wed Sep 9 08:18:04 2020 (r365497) @@ -0,0 +1,131 @@ +char * codeset(void); +void conv_init(SCR *, SCR *); +int conv_enc(SCR *, int, char *); +void conv_end(SCR *); +int cut(SCR *, CHAR_T *, MARK *, MARK *, int); +int cut_line(SCR *, recno_t, size_t, size_t, CB *); +void cut_close(GS *); +TEXT *text_init(SCR *, const CHAR_T *, size_t, size_t); +void text_lfree(TEXTH *); +void text_free(TEXT *); +int del(SCR *, MARK *, MARK *, int); +int looks_utf8(const char *, size_t); +int looks_utf16(const char *, size_t); +int decode_utf8(const char *); +int decode_utf16(const char *, int); +FREF *file_add(SCR *, char *); +int file_init(SCR *, FREF *, char *, int); +int file_end(SCR *, EXF *, int); +int file_write(SCR *, MARK *, MARK *, char *, int); +int file_m1(SCR *, int, int); +int file_m2(SCR *, int); +int file_m3(SCR *, int); +int file_aw(SCR *, int); +void set_alt_name(SCR *, char *); +lockr_t file_lock(SCR *, char *, int, int); +int v_key_init(SCR *); +void v_key_ilookup(SCR *); +size_t v_key_len(SCR *, ARG_CHAR_T); +char *v_key_name(SCR *, ARG_CHAR_T); +e_key_t v_key_val(SCR *, ARG_CHAR_T); +int v_event_push(SCR *, EVENT *, CHAR_T *, size_t, u_int); +int v_event_get(SCR *, EVENT *, int, u_int32_t); +void v_event_err(SCR *, EVENT *); +int v_event_flush(SCR *, u_int); +int db_eget(SCR *, recno_t, CHAR_T **, size_t *, int *); +int db_get(SCR *, recno_t, u_int32_t, CHAR_T **, size_t *); +int db_delete(SCR *, recno_t); +int db_append(SCR *, int, recno_t, CHAR_T *, size_t); +int db_insert(SCR *, recno_t, CHAR_T *, size_t); +int db_set(SCR *, recno_t, CHAR_T *, size_t); +int db_exist(SCR *, recno_t); +int db_last(SCR *, recno_t *); +int db_rget(SCR *, recno_t, char **, size_t *); +int db_rset(SCR *, recno_t, char *, size_t); +void db_err(SCR *, recno_t); +int log_init(SCR *, EXF *); +int log_end(SCR *, EXF *); +int log_cursor(SCR *); +int log_line(SCR *, recno_t, u_int); +int log_mark(SCR *, LMARK *); +int log_backward(SCR *, MARK *); +int log_setline(SCR *); +int log_forward(SCR *, MARK *); +int editor(GS *, int, char *[]); +void v_end(GS *); +int mark_init(SCR *, EXF *); +int mark_end(SCR *, EXF *); +int mark_get(SCR *, ARG_CHAR_T, MARK *, mtype_t); +int mark_set(SCR *, ARG_CHAR_T, MARK *, int); +int mark_insdel(SCR *, lnop_t, recno_t); +void msgq(SCR *, mtype_t, const char *, ...); +void msgq_wstr(SCR *, mtype_t, const CHAR_T *, const char *); +void msgq_str(SCR *, mtype_t, const char *, const char *); +void mod_rpt(SCR *); +void msgq_status(SCR *, recno_t, u_int); +int msg_open(SCR *, char *); +void msg_close(GS *); +const char *msg_cmsg(SCR *, cmsg_t, size_t *); +const char *msg_cat(SCR *, const char *, size_t *); +char *msg_print(SCR *, const char *, int *); +int opts_init(SCR *, int *); +int opts_set(SCR *, ARGS *[], char *); +int o_set(SCR *, int, u_int, char *, u_long); +int opts_empty(SCR *, int, int); +void opts_dump(SCR *, enum optdisp); +int opts_save(SCR *, FILE *); +OPTLIST const *opts_search(CHAR_T *); +void opts_nomatch(SCR *, CHAR_T *); +int opts_copy(SCR *, SCR *); +void opts_free(SCR *); +int f_altwerase(SCR *, OPTION *, char *, u_long *); +int f_columns(SCR *, OPTION *, char *, u_long *); +int f_lines(SCR *, OPTION *, char *, u_long *); +int f_lisp(SCR *, OPTION *, char *, u_long *); +int f_msgcat(SCR *, OPTION *, char *, u_long *); +int f_print(SCR *, OPTION *, char *, u_long *); +int f_readonly(SCR *, OPTION *, char *, u_long *); +int f_recompile(SCR *, OPTION *, char *, u_long *); +int f_reformat(SCR *, OPTION *, char *, u_long *); +int f_ttywerase(SCR *, OPTION *, char *, u_long *); +int f_w300(SCR *, OPTION *, char *, u_long *); +int f_w1200(SCR *, OPTION *, char *, u_long *); +int f_w9600(SCR *, OPTION *, char *, u_long *); +int f_window(SCR *, OPTION *, char *, u_long *); +int f_encoding(SCR *, OPTION *, char *, u_long *); +int put(SCR *, CB *, CHAR_T *, MARK *, MARK *, int); +int rcv_tmp(SCR *, EXF *, char *); +int rcv_init(SCR *); +int rcv_sync(SCR *, u_int); +int rcv_list(SCR *); +int rcv_read(SCR *, FREF *); +int screen_init(GS *, SCR *, SCR **); +int screen_end(SCR *); +SCR *screen_next(SCR *); +int f_search(SCR *, + MARK *, MARK *, CHAR_T *, size_t, CHAR_T **, u_int); +int b_search(SCR *, + MARK *, MARK *, CHAR_T *, size_t, CHAR_T **, u_int); +void search_busy(SCR *, busy_t); +int seq_set(SCR *, CHAR_T *, + size_t, CHAR_T *, size_t, CHAR_T *, size_t, seq_t, int); +int seq_delete(SCR *, CHAR_T *, size_t, seq_t); +int seq_free(SEQ *); +SEQ *seq_find + (SCR *, SEQ **, EVENT *, CHAR_T *, size_t, seq_t, int *); +void seq_close(GS *); +int seq_dump(SCR *, seq_t, int); +int seq_save(SCR *, FILE *, char *, seq_t); +int e_memcmp(CHAR_T *, EVENT *, size_t); +void *binc(SCR *, void *, size_t *, size_t); +int nonblank(SCR *, recno_t, size_t *); +char *join(char *, char *); +char *expanduser(char *); +char *quote(char *); +char *v_strdup(SCR *, const char *, size_t); +CHAR_T *v_wstrdup(SCR *, const CHAR_T *, size_t); +enum nresult nget_uslong(u_long *, const CHAR_T *, CHAR_T **, int); +enum nresult nget_slong(long *, const CHAR_T *, CHAR_T **, int); +void timepoint_steady(struct timespec *); +void timepoint_system(struct timespec *); +void TRACE(SCR *, const char *, ...); Added: vendor/nvi/dist/common/options_def.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/nvi/dist/common/options_def.h Wed Sep 9 08:18:04 2020 (r365497) @@ -0,0 +1,84 @@ +#define O_ALTWERASE 0 +#define O_AUTOINDENT 1 +#define O_AUTOPRINT 2 +#define O_AUTOWRITE 3 +#define O_BACKUP 4 +#define O_BEAUTIFY 5 +#define O_CDPATH 6 +#define O_CEDIT 7 +#define O_COLUMNS 8 +#define O_COMBINED 9 +#define O_COMMENT 10 +#define O_TMPDIR 11 +#define O_EDCOMPATIBLE 12 +#define O_ERRORBELLS 13 +#define O_ESCAPETIME 14 +#define O_EXPANDTAB 15 +#define O_EXRC 16 +#define O_EXTENDED 17 +#define O_FILEC 18 +#define O_FILEENCODING 19 +#define O_FLASH 20 +#define O_HARDTABS 21 +#define O_ICLOWER 22 +#define O_IGNORECASE 23 +#define O_INPUTENCODING 24 +#define O_KEYTIME 25 +#define O_LEFTRIGHT 26 +#define O_LINES 27 +#define O_LISP 28 +#define O_LIST 29 +#define O_LOCKFILES 30 +#define O_MAGIC 31 +#define O_MATCHCHARS 32 +#define O_MATCHTIME 33 +#define O_MESG 34 +#define O_MODELINE 35 +#define O_MSGCAT 36 +#define O_NOPRINT 37 +#define O_NUMBER 38 +#define O_OCTAL 39 +#define O_OPEN 40 +#define O_OPTIMIZE 41 +#define O_PARAGRAPHS 42 +#define O_PATH 43 +#define O_PRINT 44 +#define O_PROMPT 45 +#define O_READONLY 46 +#define O_RECDIR 47 +#define O_REDRAW 48 +#define O_REMAP 49 +#define O_REPORT 50 +#define O_RULER 51 +#define O_SCROLL 52 +#define O_SEARCHINCR 53 +#define O_SECTIONS 54 +#define O_SECURE 55 +#define O_SHELL 56 +#define O_SHELLMETA 57 +#define O_SHIFTWIDTH 58 +#define O_SHOWMATCH 59 +#define O_SHOWMODE 60 +#define O_SIDESCROLL 61 +#define O_SLOWOPEN 62 +#define O_SOURCEANY 63 +#define O_TABSTOP 64 +#define O_TAGLENGTH 65 +#define O_TAGS 66 +#define O_TERM 67 +#define O_TERSE 68 +#define O_TILDEOP 69 +#define O_TIMEOUT 70 +#define O_TTYWERASE 71 +#define O_VERBOSE 72 +#define O_W1200 73 +#define O_W300 74 +#define O_W9600 75 +#define O_WARN 76 +#define O_WINDOW 77 +#define O_WINDOWNAME 78 +#define O_WRAPLEN 79 +#define O_WRAPMARGIN 80 +#define O_WRAPSCAN 81 +#define O_WRITEANY 82 +#define O_OPTIONCOUNT 83 Added: vendor/nvi/dist/ex/ex_def.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/nvi/dist/ex/ex_def.h Wed Sep 9 08:18:04 2020 (r365497) @@ -0,0 +1,76 @@ +#define C_SCROLL 0 +#define C_BANG 1 +#define C_HASH 2 +#define C_SUBAGAIN 3 +#define C_STAR 4 +#define C_SHIFTL 5 +#define C_EQUAL 6 +#define C_SHIFTR 7 +#define C_AT 8 +#define C_APPEND 9 +#define C_ABBR 10 +#define C_ARGS 11 +#define C_BG 12 +#define C_CHANGE 13 +#define C_CD 14 +#define C_CHDIR 15 +#define C_COPY 16 +#define C_CSCOPE 17 +#define C_DELETE 18 +#define C_DISPLAY 19 +#define C_EDIT 20 +#define C_EX 21 +#define C_EXUSAGE 22 +#define C_FILE 23 +#define C_FG 24 +#define C_GLOBAL 25 +#define C_HELP 26 +#define C_INSERT 27 +#define C_JOIN 28 +#define C_K 29 +#define C_LIST 30 +#define C_MOVE 31 +#define C_MARK 32 +#define C_MAP 33 +#define C_MKEXRC 34 +#define C_NEXT 35 +#define C_NUMBER 36 +#define C_OPEN 37 +#define C_PRINT 38 +#define C_PRESERVE 39 +#define C_PREVIOUS 40 +#define C_PUT 41 +#define C_QUIT 42 +#define C_READ 43 +#define C_RECOVER 44 +#define C_RESIZE 45 +#define C_REWIND 46 +#define C_SUBSTITUTE 47 +#define C_SCRIPT 48 +#define C_SET 49 +#define C_SHELL 50 +#define C_SOURCE 51 +#define C_STOP 52 +#define C_SUSPEND 53 +#define C_T 54 +#define C_TAG 55 +#define C_TAGNEXT 56 +#define C_TAGPOP 57 +#define C_TAGPREV 58 +#define C_TAGTOP 59 +#define C_UNDO 60 +#define C_UNABBREVIATE 61 +#define C_UNMAP 62 +#define C_V 63 +#define C_VERSION 64 +#define C_VISUAL_EX 65 +#define C_VISUAL_VI 66 +#define C_VIUSAGE 67 +#define C_VSPLIT 68 +#define C_WRITE 69 +#define C_WN 70 +#define C_WQ 71 +#define C_XIT 72 +#define C_YANK 73 +#define C_Z 74 +#define C_SUBTILDE 75 Added: vendor/nvi/dist/ex/extern.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/nvi/dist/ex/extern.h Wed Sep 9 08:18:04 2020 (r365497) @@ -0,0 +1,131 @@ +int ex(SCR **); +int ex_cmd(SCR *); +int ex_range(SCR *, EXCMD *, int *); +int ex_is_abbrev(CHAR_T *, size_t); +int ex_is_unmap(CHAR_T *, size_t); +void ex_badaddr + (SCR *, EXCMDLIST const *, enum badaddr, enum nresult); +int ex_abbr(SCR *, EXCMD *); +int ex_unabbr(SCR *, EXCMD *); +int ex_append(SCR *, EXCMD *); +int ex_change(SCR *, EXCMD *); +int ex_insert(SCR *, EXCMD *); +int ex_next(SCR *, EXCMD *); +int ex_prev(SCR *, EXCMD *); +int ex_rew(SCR *, EXCMD *); +int ex_args(SCR *, EXCMD *); +char **ex_buildargv(SCR *, EXCMD *, char *); +int argv_init(SCR *, EXCMD *); +int argv_exp0(SCR *, EXCMD *, CHAR_T *, size_t); +int argv_exp1(SCR *, EXCMD *, CHAR_T *, size_t, int); +int argv_exp2(SCR *, EXCMD *, CHAR_T *, size_t); +int argv_exp3(SCR *, EXCMD *, CHAR_T *, size_t); +int argv_flt_ex(SCR *, EXCMD *, CHAR_T *, size_t); +int argv_free(SCR *); +int argv_flt_path(SCR *, EXCMD *, CHAR_T *, size_t); +CHAR_T *argv_esc(SCR *, EXCMD *, CHAR_T *, size_t); +CHAR_T *argv_uesc(SCR *, EXCMD *, CHAR_T *, size_t); +int ex_at(SCR *, EXCMD *); +int ex_bang(SCR *, EXCMD *); +int ex_cd(SCR *, EXCMD *); +int ex_cscope(SCR *, EXCMD *); +int cscope_end(SCR *); +int cscope_display(SCR *); +int cscope_search(SCR *, TAGQ *, TAG *); +int ex_delete(SCR *, EXCMD *); +int ex_display(SCR *, EXCMD *); +int ex_edit(SCR *, EXCMD *); +int ex_equal(SCR *, EXCMD *); +int ex_file(SCR *, EXCMD *); +int ex_filter(SCR *, + EXCMD *, MARK *, MARK *, MARK *, CHAR_T *, enum filtertype); +int ex_global(SCR *, EXCMD *); +int ex_v(SCR *, EXCMD *); +int ex_g_insdel(SCR *, lnop_t, recno_t); +int ex_screen_copy(SCR *, SCR *); +int ex_screen_end(SCR *); +int ex_optchange(SCR *, int, char *, u_long *); +int ex_exrc(SCR *); +int ex_run_str(SCR *, char *, CHAR_T *, size_t, int, int); +int ex_join(SCR *, EXCMD *); +int ex_map(SCR *, EXCMD *); +int ex_unmap(SCR *, EXCMD *); +int ex_mark(SCR *, EXCMD *); +int ex_mkexrc(SCR *, EXCMD *); +int ex_copy(SCR *, EXCMD *); +int ex_move(SCR *, EXCMD *); +int ex_open(SCR *, EXCMD *); +int ex_preserve(SCR *, EXCMD *); +int ex_recover(SCR *, EXCMD *); +int ex_list(SCR *, EXCMD *); +int ex_number(SCR *, EXCMD *); +int ex_pr(SCR *, EXCMD *); +int ex_print(SCR *, EXCMD *, MARK *, MARK *, u_int32_t); +int ex_ldisplay(SCR *, const CHAR_T *, size_t, size_t, u_int); +int ex_scprint(SCR *, MARK *, MARK *); +int ex_printf(SCR *, const char *, ...); +int ex_puts(SCR *, const char *); +int ex_fflush(SCR *sp); +int ex_put(SCR *, EXCMD *); +int ex_quit(SCR *, EXCMD *); +int ex_read(SCR *, EXCMD *); +int ex_readfp(SCR *, char *, FILE *, MARK *, recno_t *, int); +int ex_bg(SCR *, EXCMD *); +int ex_fg(SCR *, EXCMD *); +int ex_resize(SCR *, EXCMD *); +int ex_sdisplay(SCR *); +int ex_script(SCR *, EXCMD *); +int sscr_exec(SCR *, recno_t); +int sscr_input(SCR *); +int sscr_end(SCR *); +int ex_set(SCR *, EXCMD *); +int ex_shell(SCR *, EXCMD *); +int ex_exec_proc(SCR *, EXCMD *, char *, const char *, int); +int proc_wait(SCR *, long, const char *, int, int); +int ex_shiftl(SCR *, EXCMD *); +int ex_shiftr(SCR *, EXCMD *); +int ex_retab(SCR *, EXCMD *); +int ex_source(SCR *, EXCMD *); +int ex_stop(SCR *, EXCMD *); +int ex_s(SCR *, EXCMD *); +int ex_subagain(SCR *, EXCMD *); +int ex_subtilde(SCR *, EXCMD *); +int re_compile(SCR *, + CHAR_T *, size_t, CHAR_T **, size_t *, regex_t *, u_int); +void re_error(SCR *, int, regex_t *); +int ex_tag_first(SCR *, CHAR_T *); +int ex_tag_push(SCR *, EXCMD *); +int ex_tag_next(SCR *, EXCMD *); +int ex_tag_prev(SCR *, EXCMD *); +int ex_tag_nswitch(SCR *, TAG *, int); +int ex_tag_Nswitch(SCR *, TAG *, int); +int ex_tag_pop(SCR *, EXCMD *); +int ex_tag_top(SCR *, EXCMD *); +int ex_tag_display(SCR *); +int ex_tag_copy(SCR *, SCR *); +int tagq_free(SCR *, TAGQ *); +int tagq_push(SCR*, TAGQ*, int, int ); +void tag_msg(SCR *, tagmsg_t, char *); +int ex_tagf_alloc(SCR *, char *); +int ex_tag_free(SCR *); +int ex_txt(SCR *, TEXTH *, ARG_CHAR_T, u_int32_t); +int ex_undo(SCR *, EXCMD *); +int ex_help(SCR *, EXCMD *); +int ex_usage(SCR *, EXCMD *); +int ex_viusage(SCR *, EXCMD *); +void ex_cinit(SCR *, EXCMD *, int, int, recno_t, recno_t, int); +int ex_getline(SCR *, FILE *, size_t *); +int ex_ncheck(SCR *, int); +int ex_init(SCR *); +void ex_wemsg(SCR *, CHAR_T *, exm_t); +void ex_emsg(SCR *, char *, exm_t); +int ex_version(SCR *, EXCMD *); +int ex_visual(SCR *, EXCMD *); +int ex_wn(SCR *, EXCMD *); +int ex_wq(SCR *, EXCMD *); +int ex_write(SCR *, EXCMD *); +int ex_xit(SCR *, EXCMD *); +int ex_writefp(SCR *, + char *, FILE *, MARK *, MARK *, u_long *, u_long *, int); +int ex_yank(SCR *, EXCMD *); +int ex_z(SCR *, EXCMD *); Added: vendor/nvi/dist/ex/version.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/nvi/dist/ex/version.h Wed Sep 9 08:18:04 2020 (r365497) @@ -0,0 +1 @@ +#define VI_VERSION "2.2.0 (2020-08-01)" Added: vendor/nvi/dist/vi/extern.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/nvi/dist/vi/extern.h Wed Sep 9 08:18:04 2020 (r365497) @@ -0,0 +1,145 @@ +int cs_init(SCR *, VCS *); +int cs_next(SCR *, VCS *); +int cs_fspace(SCR *, VCS *); +int cs_fblank(SCR *, VCS *); +int cs_prev(SCR *, VCS *); +int cs_bblank(SCR *, VCS *); +int v_at(SCR *, VICMD *); +int v_chrepeat(SCR *, VICMD *); +int v_chrrepeat(SCR *, VICMD *); +int v_cht(SCR *, VICMD *); +int v_chf(SCR *, VICMD *); +int v_chT(SCR *, VICMD *); +int v_chF(SCR *, VICMD *); +int v_delete(SCR *, VICMD *); +int v_again(SCR *, VICMD *); +int v_exmode(SCR *, VICMD *); +int v_join(SCR *, VICMD *); +int v_shiftl(SCR *, VICMD *); +int v_shiftr(SCR *, VICMD *); +int v_suspend(SCR *, VICMD *); +int v_switch(SCR *, VICMD *); +int v_tagpush(SCR *, VICMD *); +int v_tagpop(SCR *, VICMD *); +int v_filter(SCR *, VICMD *); +int v_ex(SCR *, VICMD *); +int v_ecl_exec(SCR *); +int v_increment(SCR *, VICMD *); +int v_screen_copy(SCR *, SCR *); +int v_screen_end(SCR *); +int v_optchange(SCR *, int, char *, u_long *); +int v_iA(SCR *, VICMD *); +int v_ia(SCR *, VICMD *); +int v_iI(SCR *, VICMD *); +int v_ii(SCR *, VICMD *); +int v_iO(SCR *, VICMD *); +int v_io(SCR *, VICMD *); +int v_change(SCR *, VICMD *); +int v_Replace(SCR *, VICMD *); +int v_subst(SCR *, VICMD *); +int v_left(SCR *, VICMD *); +int v_cfirst(SCR *, VICMD *); +int v_first(SCR *, VICMD *); +int v_ncol(SCR *, VICMD *); +int v_zero(SCR *, VICMD *); +int v_mark(SCR *, VICMD *); +int v_bmark(SCR *, VICMD *); +int v_fmark(SCR *, VICMD *); +int v_emark(SCR *, VICMD *); +int v_match(SCR *, VICMD *); +int v_buildmcs(SCR *, char *); +int v_paragraphf(SCR *, VICMD *); +int v_paragraphb(SCR *, VICMD *); +int v_buildps(SCR *, char *, char *); +int v_Put(SCR *, VICMD *); +int v_put(SCR *, VICMD *); +int v_redraw(SCR *, VICMD *); +int v_replace(SCR *, VICMD *); +int v_right(SCR *, VICMD *); +int v_dollar(SCR *, VICMD *); +int v_screen(SCR *, VICMD *); +int v_lgoto(SCR *, VICMD *); +int v_home(SCR *, VICMD *); +int v_middle(SCR *, VICMD *); +int v_bottom(SCR *, VICMD *); +int v_up(SCR *, VICMD *); +int v_cr(SCR *, VICMD *); +int v_down(SCR *, VICMD *); +int v_hpageup(SCR *, VICMD *); +int v_hpagedown(SCR *, VICMD *); +int v_pagedown(SCR *, VICMD *); +int v_pageup(SCR *, VICMD *); +int v_lineup(SCR *, VICMD *); +int v_linedown(SCR *, VICMD *); +int v_searchb(SCR *, VICMD *); +int v_searchf(SCR *, VICMD *); +int v_searchN(SCR *, VICMD *); +int v_searchn(SCR *, VICMD *); +int v_searchw(SCR *, VICMD *); +int v_correct(SCR *, VICMD *, int); +int v_sectionf(SCR *, VICMD *); +int v_sectionb(SCR *, VICMD *); +int v_sentencef(SCR *, VICMD *); +int v_sentenceb(SCR *, VICMD *); +int v_status(SCR *, VICMD *); +int v_tcmd(SCR *, VICMD *, ARG_CHAR_T, u_int); +int v_txt(SCR *, VICMD *, MARK *, + const CHAR_T *, size_t, ARG_CHAR_T, recno_t, u_long, u_int32_t); +int v_txt_auto(SCR *, recno_t, TEXT *, size_t, TEXT *); +int v_ulcase(SCR *, VICMD *); +int v_mulcase(SCR *, VICMD *); +int v_Undo(SCR *, VICMD *); +int v_undo(SCR *, VICMD *); +void v_eof(SCR *, MARK *); +void v_eol(SCR *, MARK *); +void v_nomove(SCR *); +void v_sof(SCR *, MARK *); +void v_sol(SCR *); +int v_isempty(CHAR_T *, size_t); +void v_emsg(SCR *, char *, vim_t); +int v_wordW(SCR *, VICMD *); +int v_wordw(SCR *, VICMD *); +int v_wordE(SCR *, VICMD *); +int v_worde(SCR *, VICMD *); +int v_wordB(SCR *, VICMD *); +int v_wordb(SCR *, VICMD *); +int v_xchar(SCR *, VICMD *); +int v_Xchar(SCR *, VICMD *); +int v_yank(SCR *, VICMD *); +int v_z(SCR *, VICMD *); +int vs_crel(SCR *, long); +int v_zexit(SCR *, VICMD *); +int vi(SCR **); +int v_curword(SCR *); +int vs_line(SCR *, SMAP *, size_t *, size_t *); +int vs_number(SCR *); +void vs_busy(SCR *, const char *, busy_t); +void vs_home(SCR *); +void vs_update(SCR *, const char *, const CHAR_T *); +void vs_msg(SCR *, mtype_t, char *, size_t); +int vs_ex_resolve(SCR *, int *); +int vs_resolve(SCR *, SCR *, int); +int vs_repaint(SCR *, EVENT *); +int vs_refresh(SCR *, int); +int vs_column(SCR *, size_t *); +size_t vs_screens(SCR *, recno_t, size_t *); +size_t vs_columns(SCR *, CHAR_T *, recno_t, size_t *, size_t *); +size_t vs_rcm(SCR *, recno_t, int); +size_t vs_colpos(SCR *, recno_t, size_t); +int vs_change(SCR *, recno_t, lnop_t); +int vs_sm_fill(SCR *, recno_t, pos_t); +int vs_sm_scroll(SCR *, MARK *, recno_t, scroll_t); +int vs_sm_1up(SCR *); +int vs_sm_1down(SCR *); +int vs_sm_next(SCR *, SMAP *, SMAP *); +int vs_sm_prev(SCR *, SMAP *, SMAP *); +int vs_sm_cursor(SCR *, SMAP **); +int vs_sm_position(SCR *, MARK *, u_long, pos_t); +recno_t vs_sm_nlines(SCR *, SMAP *, recno_t, size_t); +int vs_split(SCR *, SCR *, int); +int vs_vsplit(SCR *, SCR *); +int vs_discard(SCR *, SCR **); +int vs_fg(SCR *, SCR **, CHAR_T *, int); +int vs_bg(SCR *); +int vs_swap(SCR *, SCR **, char *); +int vs_resize(SCR *, long, adj_t); From owner-svn-src-all@freebsd.org Wed Sep 9 08:19:24 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 75E223C8F3F; Wed, 9 Sep 2020 08:19:24 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BmZgJ2qlVz3fSg; Wed, 9 Sep 2020 08:19:24 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 226C01E949; Wed, 9 Sep 2020 08:19:24 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0898JOec090418; Wed, 9 Sep 2020 08:19:24 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0898JM99090408; Wed, 9 Sep 2020 08:19:22 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <202009090819.0898JM99090408@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Wed, 9 Sep 2020 08:19:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r365498 - in vendor/nvi/2.2.0: . catalog cl common docs ex files man vi X-SVN-Group: vendor X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: in vendor/nvi/2.2.0: . catalog cl common docs ex files man vi X-SVN-Commit-Revision: 365498 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.33 Precedence: list List-Id: "SVN commit messages 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, 09 Sep 2020 08:19:24 -0000 Author: bapt Date: Wed Sep 9 08:19:22 2020 New Revision: 365498 URL: https://svnweb.freebsd.org/changeset/base/365498 Log: Retag the import of nvi 2.2.0 previous import was half done Added: vendor/nvi/2.2.0/.gitignore - copied unchanged from r365495, vendor/nvi/dist/.gitignore vendor/nvi/2.2.0/CMakeLists.txt - copied unchanged from r365495, vendor/nvi/dist/CMakeLists.txt vendor/nvi/2.2.0/catalog/tr_TR.ISO8859-9.base - copied unchanged from r365495, vendor/nvi/dist/catalog/tr_TR.ISO8859-9.base vendor/nvi/2.2.0/catalog/tr_TR.ISO8859-9.owner - copied unchanged from r365495, vendor/nvi/dist/catalog/tr_TR.ISO8859-9.owner vendor/nvi/2.2.0/catalog/tr_TR.UTF-8.base - copied unchanged from r365495, vendor/nvi/dist/catalog/tr_TR.UTF-8.base vendor/nvi/2.2.0/catalog/tr_TR.UTF-8.owner - copied unchanged from r365495, vendor/nvi/dist/catalog/tr_TR.UTF-8.owner vendor/nvi/2.2.0/files/ - copied from r365495, vendor/nvi/dist/files/ vendor/nvi/2.2.0/man/ - copied from r365495, vendor/nvi/dist/man/ Replaced: vendor/nvi/2.2.0/ - copied from r365494, vendor/nvi/dist/ vendor/nvi/2.2.0/LICENSE - copied unchanged from r365495, vendor/nvi/dist/LICENSE vendor/nvi/2.2.0/README - copied unchanged from r365495, vendor/nvi/dist/README vendor/nvi/2.2.0/catalog/Makefile - copied unchanged from r365495, vendor/nvi/dist/catalog/Makefile vendor/nvi/2.2.0/catalog/README - copied unchanged from r365495, vendor/nvi/dist/catalog/README vendor/nvi/2.2.0/catalog/dump.c - copied unchanged from r365495, vendor/nvi/dist/catalog/dump.c vendor/nvi/2.2.0/cl/README.signal - copied unchanged from r365495, vendor/nvi/dist/cl/README.signal vendor/nvi/2.2.0/cl/cl.h - copied unchanged from r365495, vendor/nvi/dist/cl/cl.h vendor/nvi/2.2.0/cl/cl_funcs.c - copied unchanged from r365495, vendor/nvi/dist/cl/cl_funcs.c vendor/nvi/2.2.0/cl/cl_main.c - copied unchanged from r365495, vendor/nvi/dist/cl/cl_main.c vendor/nvi/2.2.0/cl/cl_read.c - copied unchanged from r365495, vendor/nvi/dist/cl/cl_read.c vendor/nvi/2.2.0/cl/cl_screen.c - copied unchanged from r365495, vendor/nvi/dist/cl/cl_screen.c vendor/nvi/2.2.0/cl/cl_term.c - copied unchanged from r365495, vendor/nvi/dist/cl/cl_term.c vendor/nvi/2.2.0/cl/extern.h - copied unchanged from r365497, vendor/nvi/dist/cl/extern.h vendor/nvi/2.2.0/common/args.h - copied unchanged from r365495, vendor/nvi/dist/common/args.h vendor/nvi/2.2.0/common/common.h - copied unchanged from r365495, vendor/nvi/dist/common/common.h vendor/nvi/2.2.0/common/conv.c - copied unchanged from r365495, vendor/nvi/dist/common/conv.c vendor/nvi/2.2.0/common/conv.h - copied unchanged from r365495, vendor/nvi/dist/common/conv.h vendor/nvi/2.2.0/common/cut.c - copied unchanged from r365495, vendor/nvi/dist/common/cut.c vendor/nvi/2.2.0/common/cut.h - copied unchanged from r365495, vendor/nvi/dist/common/cut.h vendor/nvi/2.2.0/common/delete.c - copied unchanged from r365495, vendor/nvi/dist/common/delete.c vendor/nvi/2.2.0/common/encoding.c - copied unchanged from r365495, vendor/nvi/dist/common/encoding.c vendor/nvi/2.2.0/common/exf.c - copied unchanged from r365495, vendor/nvi/dist/common/exf.c vendor/nvi/2.2.0/common/exf.h - copied unchanged from r365495, vendor/nvi/dist/common/exf.h vendor/nvi/2.2.0/common/extern.h - copied unchanged from r365497, vendor/nvi/dist/common/extern.h vendor/nvi/2.2.0/common/gs.h - copied unchanged from r365495, vendor/nvi/dist/common/gs.h vendor/nvi/2.2.0/common/key.c - copied unchanged from r365495, vendor/nvi/dist/common/key.c vendor/nvi/2.2.0/common/key.h - copied unchanged from r365495, vendor/nvi/dist/common/key.h vendor/nvi/2.2.0/common/line.c - copied unchanged from r365495, vendor/nvi/dist/common/line.c vendor/nvi/2.2.0/common/log.c - copied unchanged from r365495, vendor/nvi/dist/common/log.c vendor/nvi/2.2.0/common/log.h - copied unchanged from r365495, vendor/nvi/dist/common/log.h vendor/nvi/2.2.0/common/main.c - copied unchanged from r365495, vendor/nvi/dist/common/main.c vendor/nvi/2.2.0/common/mark.c - copied unchanged from r365495, vendor/nvi/dist/common/mark.c vendor/nvi/2.2.0/common/mark.h - copied unchanged from r365495, vendor/nvi/dist/common/mark.h vendor/nvi/2.2.0/common/mem.h - copied unchanged from r365495, vendor/nvi/dist/common/mem.h vendor/nvi/2.2.0/common/msg.c - copied unchanged from r365495, vendor/nvi/dist/common/msg.c vendor/nvi/2.2.0/common/msg.h - copied unchanged from r365495, vendor/nvi/dist/common/msg.h vendor/nvi/2.2.0/common/multibyte.h - copied unchanged from r365495, vendor/nvi/dist/common/multibyte.h vendor/nvi/2.2.0/common/options.c - copied unchanged from r365495, vendor/nvi/dist/common/options.c vendor/nvi/2.2.0/common/options.h - copied unchanged from r365495, vendor/nvi/dist/common/options.h vendor/nvi/2.2.0/common/options_def.h - copied unchanged from r365497, vendor/nvi/dist/common/options_def.h vendor/nvi/2.2.0/common/options_f.c - copied unchanged from r365495, vendor/nvi/dist/common/options_f.c vendor/nvi/2.2.0/common/put.c - copied unchanged from r365495, vendor/nvi/dist/common/put.c vendor/nvi/2.2.0/common/recover.c - copied unchanged from r365495, vendor/nvi/dist/common/recover.c vendor/nvi/2.2.0/common/screen.c - copied unchanged from r365495, vendor/nvi/dist/common/screen.c vendor/nvi/2.2.0/common/screen.h - copied unchanged from r365495, vendor/nvi/dist/common/screen.h vendor/nvi/2.2.0/common/search.c - copied unchanged from r365495, vendor/nvi/dist/common/search.c vendor/nvi/2.2.0/common/seq.c - copied unchanged from r365495, vendor/nvi/dist/common/seq.c vendor/nvi/2.2.0/common/seq.h - copied unchanged from r365495, vendor/nvi/dist/common/seq.h vendor/nvi/2.2.0/common/util.c - copied unchanged from r365495, vendor/nvi/dist/common/util.c vendor/nvi/2.2.0/common/util.h - copied unchanged from r365495, vendor/nvi/dist/common/util.h vendor/nvi/2.2.0/ex/ex.c - copied unchanged from r365495, vendor/nvi/dist/ex/ex.c vendor/nvi/2.2.0/ex/ex.h - copied unchanged from r365495, vendor/nvi/dist/ex/ex.h vendor/nvi/2.2.0/ex/ex_abbrev.c - copied unchanged from r365495, vendor/nvi/dist/ex/ex_abbrev.c vendor/nvi/2.2.0/ex/ex_append.c - copied unchanged from r365495, vendor/nvi/dist/ex/ex_append.c vendor/nvi/2.2.0/ex/ex_args.c - copied unchanged from r365495, vendor/nvi/dist/ex/ex_args.c vendor/nvi/2.2.0/ex/ex_argv.c - copied unchanged from r365495, vendor/nvi/dist/ex/ex_argv.c vendor/nvi/2.2.0/ex/ex_at.c - copied unchanged from r365495, vendor/nvi/dist/ex/ex_at.c vendor/nvi/2.2.0/ex/ex_bang.c - copied unchanged from r365495, vendor/nvi/dist/ex/ex_bang.c vendor/nvi/2.2.0/ex/ex_cd.c - copied unchanged from r365495, vendor/nvi/dist/ex/ex_cd.c vendor/nvi/2.2.0/ex/ex_cmd.c - copied unchanged from r365495, vendor/nvi/dist/ex/ex_cmd.c vendor/nvi/2.2.0/ex/ex_cscope.c - copied unchanged from r365495, vendor/nvi/dist/ex/ex_cscope.c vendor/nvi/2.2.0/ex/ex_def.h - copied unchanged from r365497, vendor/nvi/dist/ex/ex_def.h vendor/nvi/2.2.0/ex/ex_delete.c - copied unchanged from r365495, vendor/nvi/dist/ex/ex_delete.c vendor/nvi/2.2.0/ex/ex_display.c - copied unchanged from r365495, vendor/nvi/dist/ex/ex_display.c vendor/nvi/2.2.0/ex/ex_edit.c - copied unchanged from r365495, vendor/nvi/dist/ex/ex_edit.c vendor/nvi/2.2.0/ex/ex_equal.c - copied unchanged from r365495, vendor/nvi/dist/ex/ex_equal.c vendor/nvi/2.2.0/ex/ex_file.c - copied unchanged from r365495, vendor/nvi/dist/ex/ex_file.c vendor/nvi/2.2.0/ex/ex_filter.c - copied unchanged from r365495, vendor/nvi/dist/ex/ex_filter.c vendor/nvi/2.2.0/ex/ex_global.c - copied unchanged from r365495, vendor/nvi/dist/ex/ex_global.c vendor/nvi/2.2.0/ex/ex_init.c - copied unchanged from r365495, vendor/nvi/dist/ex/ex_init.c vendor/nvi/2.2.0/ex/ex_join.c - copied unchanged from r365495, vendor/nvi/dist/ex/ex_join.c vendor/nvi/2.2.0/ex/ex_map.c - copied unchanged from r365495, vendor/nvi/dist/ex/ex_map.c vendor/nvi/2.2.0/ex/ex_mark.c - copied unchanged from r365495, vendor/nvi/dist/ex/ex_mark.c vendor/nvi/2.2.0/ex/ex_mkexrc.c - copied unchanged from r365495, vendor/nvi/dist/ex/ex_mkexrc.c vendor/nvi/2.2.0/ex/ex_move.c - copied unchanged from r365495, vendor/nvi/dist/ex/ex_move.c vendor/nvi/2.2.0/ex/ex_open.c - copied unchanged from r365495, vendor/nvi/dist/ex/ex_open.c vendor/nvi/2.2.0/ex/ex_preserve.c - copied unchanged from r365495, vendor/nvi/dist/ex/ex_preserve.c vendor/nvi/2.2.0/ex/ex_print.c - copied unchanged from r365495, vendor/nvi/dist/ex/ex_print.c vendor/nvi/2.2.0/ex/ex_put.c - copied unchanged from r365495, vendor/nvi/dist/ex/ex_put.c vendor/nvi/2.2.0/ex/ex_quit.c - copied unchanged from r365495, vendor/nvi/dist/ex/ex_quit.c vendor/nvi/2.2.0/ex/ex_read.c - copied unchanged from r365495, vendor/nvi/dist/ex/ex_read.c vendor/nvi/2.2.0/ex/ex_screen.c - copied unchanged from r365495, vendor/nvi/dist/ex/ex_screen.c vendor/nvi/2.2.0/ex/ex_script.c - copied unchanged from r365495, vendor/nvi/dist/ex/ex_script.c vendor/nvi/2.2.0/ex/ex_set.c - copied unchanged from r365495, vendor/nvi/dist/ex/ex_set.c vendor/nvi/2.2.0/ex/ex_shell.c - copied unchanged from r365495, vendor/nvi/dist/ex/ex_shell.c vendor/nvi/2.2.0/ex/ex_shift.c - copied unchanged from r365495, vendor/nvi/dist/ex/ex_shift.c vendor/nvi/2.2.0/ex/ex_source.c - copied unchanged from r365495, vendor/nvi/dist/ex/ex_source.c vendor/nvi/2.2.0/ex/ex_stop.c - copied unchanged from r365495, vendor/nvi/dist/ex/ex_stop.c vendor/nvi/2.2.0/ex/ex_subst.c - copied unchanged from r365495, vendor/nvi/dist/ex/ex_subst.c vendor/nvi/2.2.0/ex/ex_tag.c - copied unchanged from r365495, vendor/nvi/dist/ex/ex_tag.c vendor/nvi/2.2.0/ex/ex_txt.c - copied unchanged from r365495, vendor/nvi/dist/ex/ex_txt.c vendor/nvi/2.2.0/ex/ex_undo.c - copied unchanged from r365495, vendor/nvi/dist/ex/ex_undo.c vendor/nvi/2.2.0/ex/ex_usage.c - copied unchanged from r365495, vendor/nvi/dist/ex/ex_usage.c vendor/nvi/2.2.0/ex/ex_util.c - copied unchanged from r365495, vendor/nvi/dist/ex/ex_util.c vendor/nvi/2.2.0/ex/ex_version.c - copied unchanged from r365495, vendor/nvi/dist/ex/ex_version.c vendor/nvi/2.2.0/ex/ex_visual.c - copied unchanged from r365495, vendor/nvi/dist/ex/ex_visual.c vendor/nvi/2.2.0/ex/ex_write.c - copied unchanged from r365495, vendor/nvi/dist/ex/ex_write.c vendor/nvi/2.2.0/ex/ex_yank.c - copied unchanged from r365495, vendor/nvi/dist/ex/ex_yank.c vendor/nvi/2.2.0/ex/ex_z.c - copied unchanged from r365495, vendor/nvi/dist/ex/ex_z.c vendor/nvi/2.2.0/ex/extern.h - copied unchanged from r365497, vendor/nvi/dist/ex/extern.h vendor/nvi/2.2.0/ex/script.h - copied unchanged from r365495, vendor/nvi/dist/ex/script.h vendor/nvi/2.2.0/ex/tag.h - copied unchanged from r365495, vendor/nvi/dist/ex/tag.h vendor/nvi/2.2.0/ex/version.h - copied unchanged from r365497, vendor/nvi/dist/ex/version.h vendor/nvi/2.2.0/vi/extern.h - copied unchanged from r365497, vendor/nvi/dist/vi/extern.h vendor/nvi/2.2.0/vi/getc.c - copied unchanged from r365495, vendor/nvi/dist/vi/getc.c vendor/nvi/2.2.0/vi/v_at.c - copied unchanged from r365495, vendor/nvi/dist/vi/v_at.c vendor/nvi/2.2.0/vi/v_ch.c - copied unchanged from r365495, vendor/nvi/dist/vi/v_ch.c vendor/nvi/2.2.0/vi/v_cmd.c - copied unchanged from r365495, vendor/nvi/dist/vi/v_cmd.c vendor/nvi/2.2.0/vi/v_delete.c - copied unchanged from r365495, vendor/nvi/dist/vi/v_delete.c vendor/nvi/2.2.0/vi/v_ex.c - copied unchanged from r365495, vendor/nvi/dist/vi/v_ex.c vendor/nvi/2.2.0/vi/v_increment.c - copied unchanged from r365495, vendor/nvi/dist/vi/v_increment.c vendor/nvi/2.2.0/vi/v_init.c - copied unchanged from r365495, vendor/nvi/dist/vi/v_init.c vendor/nvi/2.2.0/vi/v_itxt.c - copied unchanged from r365495, vendor/nvi/dist/vi/v_itxt.c vendor/nvi/2.2.0/vi/v_left.c - copied unchanged from r365495, vendor/nvi/dist/vi/v_left.c vendor/nvi/2.2.0/vi/v_mark.c - copied unchanged from r365495, vendor/nvi/dist/vi/v_mark.c vendor/nvi/2.2.0/vi/v_match.c - copied unchanged from r365495, vendor/nvi/dist/vi/v_match.c vendor/nvi/2.2.0/vi/v_paragraph.c - copied unchanged from r365495, vendor/nvi/dist/vi/v_paragraph.c vendor/nvi/2.2.0/vi/v_put.c - copied unchanged from r365495, vendor/nvi/dist/vi/v_put.c vendor/nvi/2.2.0/vi/v_redraw.c - copied unchanged from r365495, vendor/nvi/dist/vi/v_redraw.c vendor/nvi/2.2.0/vi/v_replace.c - copied unchanged from r365495, vendor/nvi/dist/vi/v_replace.c vendor/nvi/2.2.0/vi/v_right.c - copied unchanged from r365495, vendor/nvi/dist/vi/v_right.c vendor/nvi/2.2.0/vi/v_screen.c - copied unchanged from r365495, vendor/nvi/dist/vi/v_screen.c vendor/nvi/2.2.0/vi/v_scroll.c - copied unchanged from r365495, vendor/nvi/dist/vi/v_scroll.c vendor/nvi/2.2.0/vi/v_search.c - copied unchanged from r365495, vendor/nvi/dist/vi/v_search.c vendor/nvi/2.2.0/vi/v_section.c - copied unchanged from r365495, vendor/nvi/dist/vi/v_section.c vendor/nvi/2.2.0/vi/v_sentence.c - copied unchanged from r365495, vendor/nvi/dist/vi/v_sentence.c vendor/nvi/2.2.0/vi/v_status.c - copied unchanged from r365495, vendor/nvi/dist/vi/v_status.c vendor/nvi/2.2.0/vi/v_txt.c - copied unchanged from r365495, vendor/nvi/dist/vi/v_txt.c vendor/nvi/2.2.0/vi/v_ulcase.c - copied unchanged from r365495, vendor/nvi/dist/vi/v_ulcase.c vendor/nvi/2.2.0/vi/v_undo.c - copied unchanged from r365495, vendor/nvi/dist/vi/v_undo.c vendor/nvi/2.2.0/vi/v_util.c - copied unchanged from r365495, vendor/nvi/dist/vi/v_util.c vendor/nvi/2.2.0/vi/v_word.c - copied unchanged from r365495, vendor/nvi/dist/vi/v_word.c vendor/nvi/2.2.0/vi/v_xchar.c - copied unchanged from r365495, vendor/nvi/dist/vi/v_xchar.c vendor/nvi/2.2.0/vi/v_yank.c - copied unchanged from r365495, vendor/nvi/dist/vi/v_yank.c vendor/nvi/2.2.0/vi/v_z.c - copied unchanged from r365495, vendor/nvi/dist/vi/v_z.c vendor/nvi/2.2.0/vi/v_zexit.c - copied unchanged from r365495, vendor/nvi/dist/vi/v_zexit.c vendor/nvi/2.2.0/vi/vi.c - copied unchanged from r365495, vendor/nvi/dist/vi/vi.c vendor/nvi/2.2.0/vi/vi.h - copied unchanged from r365495, vendor/nvi/dist/vi/vi.h vendor/nvi/2.2.0/vi/vs_line.c - copied unchanged from r365495, vendor/nvi/dist/vi/vs_line.c vendor/nvi/2.2.0/vi/vs_msg.c - copied unchanged from r365495, vendor/nvi/dist/vi/vs_msg.c vendor/nvi/2.2.0/vi/vs_refresh.c - copied unchanged from r365495, vendor/nvi/dist/vi/vs_refresh.c vendor/nvi/2.2.0/vi/vs_relative.c - copied unchanged from r365495, vendor/nvi/dist/vi/vs_relative.c vendor/nvi/2.2.0/vi/vs_smap.c - copied unchanged from r365495, vendor/nvi/dist/vi/vs_smap.c vendor/nvi/2.2.0/vi/vs_split.c - copied unchanged from r365495, vendor/nvi/dist/vi/vs_split.c Deleted: vendor/nvi/2.2.0/docs/ Copied: vendor/nvi/2.2.0/.gitignore (from r365495, vendor/nvi/dist/.gitignore) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/nvi/2.2.0/.gitignore Wed Sep 9 08:19:22 2020 (r365498, copy of r365495, vendor/nvi/dist/.gitignore) @@ -0,0 +1,9 @@ +*.swp +*~ +*.orig +*.core +extern.h +*_def.h +version.h +tags +build/ Copied: vendor/nvi/2.2.0/CMakeLists.txt (from r365495, vendor/nvi/dist/CMakeLists.txt) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/nvi/2.2.0/CMakeLists.txt Wed Sep 9 08:19:22 2020 (r365498, copy of r365495, vendor/nvi/dist/CMakeLists.txt) @@ -0,0 +1,190 @@ +cmake_minimum_required(VERSION 3.9) + +get_property(is_multi_config GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) +if(is_multi_config) + set(CMAKE_CONFIGURATION_TYPES Debug Release CACHE STRING + "Semicolon separated list of supported configuration types") + mark_as_advanced(CMAKE_CONFIGURATION_TYPES) +elseif(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_C_FLAGS) + message(WARNING "No CMAKE_BUILD_TYPE is selected") +endif() + +project(nvi2 C) + +include(CheckIncludeFiles) +include(CheckFunctionExists) +include(CheckCSourceCompiles) + +mark_as_advanced(CMAKE_INSTALL_PREFIX) + +option(USE_WIDECHAR "Enable wide character support" ON) +option(USE_ICONV "Enable iconv support" ON) + +add_compile_options(-fcolor-diagnostics) +add_compile_options($<$:-Wall>) +add_compile_options($<$:-Wno-parentheses>) +add_compile_options($<$:-Wno-uninitialized>) +add_compile_options($<$:-Wmissing-prototypes>) +add_compile_options($<$:-Wsystem-headers>) +add_compile_options($<$:-Wuninitialized>) +add_compile_options($<$:-Wno-dangling-else>) +add_compile_options(-Wstack-protector -fstack-protector) +add_compile_options(-Wstrict-aliasing -fstrict-aliasing) + +include_directories(${CMAKE_CURRENT_BINARY_DIR}) + +set(MAIN_PROTOS + cl/extern.h common/extern.h ex/extern.h vi/extern.h + common/options_def.h ex/ex_def.h ex/version.h) + +set(CL_SRCS + cl/cl_funcs.c cl/cl_main.c cl/cl_read.c cl/cl_screen.c cl/cl_term.c) + +set(COMMON_SRCS + common/conv.c common/cut.c common/delete.c common/encoding.c common/exf.c + common/key.c common/line.c common/log.c common/main.c common/mark.c + common/msg.c common/options.c common/options_f.c common/put.c + common/recover.c common/screen.c common/search.c common/seq.c + common/util.c) + +set(EX_SRCS + ex/ex.c ex/ex_abbrev.c ex/ex_append.c ex/ex_args.c ex/ex_argv.c ex/ex_at.c + ex/ex_bang.c ex/ex_cd.c ex/ex_cmd.c ex/ex_cscope.c ex/ex_delete.c + ex/ex_display.c ex/ex_edit.c ex/ex_equal.c ex/ex_file.c ex/ex_filter.c + ex/ex_global.c ex/ex_init.c ex/ex_join.c ex/ex_map.c ex/ex_mark.c + ex/ex_mkexrc.c ex/ex_move.c ex/ex_open.c ex/ex_preserve.c ex/ex_print.c + ex/ex_put.c ex/ex_quit.c ex/ex_read.c ex/ex_screen.c ex/ex_script.c + ex/ex_set.c ex/ex_shell.c ex/ex_shift.c ex/ex_source.c ex/ex_stop.c + ex/ex_subst.c ex/ex_tag.c ex/ex_txt.c ex/ex_undo.c ex/ex_usage.c + ex/ex_util.c ex/ex_version.c ex/ex_visual.c ex/ex_write.c ex/ex_yank.c + ex/ex_z.c) + +set(VI_SRCS + vi/getc.c vi/v_at.c vi/v_ch.c vi/v_cmd.c vi/v_delete.c vi/v_ex.c + vi/v_increment.c vi/v_init.c vi/v_itxt.c vi/v_left.c vi/v_mark.c + vi/v_match.c vi/v_paragraph.c vi/v_put.c vi/v_redraw.c vi/v_replace.c + vi/v_right.c vi/v_screen.c vi/v_scroll.c vi/v_search.c vi/v_section.c + vi/v_sentence.c vi/v_status.c vi/v_txt.c vi/v_ulcase.c vi/v_undo.c + vi/v_util.c vi/v_word.c vi/v_xchar.c vi/v_yank.c vi/v_z.c vi/v_zexit.c + vi/vi.c vi/vs_line.c vi/vs_msg.c vi/vs_refresh.c vi/vs_relative.c + vi/vs_smap.c vi/vs_split.c) + +set(REGEX_SRCS + regex/regcomp.c regex/regerror.c regex/regexec.c regex/regfree.c) + +# commands to generate the public headers +set(extract_protos sed -n 's/^ \\* PUBLIC: \\\(.*\\\)/\\1/p') +set(extract_version sed -n + 's/^.*version \\\([^\)]*\)\\\).*/\#define VI_VERSION \\\"\\1\\\"/p') + +add_custom_command(OUTPUT cl/extern.h + COMMAND ${extract_protos} ${CL_SRCS} > cl/extern.h + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + DEPENDS ${CL_SRCS}) +add_custom_command(OUTPUT common/extern.h + COMMAND ${extract_protos} ${COMMON_SRCS} > common/extern.h + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + DEPENDS ${COMMON_SRCS}) +add_custom_command(OUTPUT ex/extern.h + COMMAND ${extract_protos} ${EX_SRCS} > ex/extern.h + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + DEPENDS ${EX_SRCS}) +add_custom_command(OUTPUT vi/extern.h + COMMAND ${extract_protos} ${VI_SRCS} > vi/extern.h + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + DEPENDS ${VI_SRCS}) +add_custom_command(OUTPUT common/options_def.h + COMMAND awk -f common/options.awk + common/options.c > common/options_def.h + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + DEPENDS common/options.c) +add_custom_command(OUTPUT ex/ex_def.h + COMMAND awk -f ex/ex.awk ex/ex_cmd.c > ex/ex_def.h + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + DEPENDS ex/ex_cmd.c) +add_custom_command(OUTPUT ex/version.h + COMMAND ${extract_version} README > ex/version.h + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + DEPENDS README) + +add_executable(nvi) +target_sources(nvi PRIVATE ${MAIN_PROTOS} ${CL_SRCS} ${COMMON_SRCS} + ${EX_SRCS} ${VI_SRCS}) +target_compile_definitions(nvi PRIVATE $<$:DEBUG> + $<$:COMLOG>) + +check_function_exists(openpty UTIL_IN_LIBC) +if(NOT UTIL_IN_LIBC) + find_library(UTIL_LIBRARY util) + target_link_libraries(nvi PRIVATE ${UTIL_LIBRARY}) +endif() + +check_function_exists(__b64_ntop RESOLV_IN_LIBC) +if(NOT RESOLV_IN_LIBC) + find_library(RESOLV_LIBRARY resolv) + target_link_libraries(nvi PRIVATE ${RESOLV_LIBRARY}) +endif() + +if(USE_WIDECHAR) + find_library(CURSES_LIBRARY NAMES ncursesw cursesw curses HINTS /usr/lib) + + # link to the wchar_t awared BSD libregex.a + add_library(regex STATIC) + target_sources(regex PRIVATE ${REGEX_SRCS}) + target_include_directories(regex PUBLIC regex) + target_compile_definitions(regex PUBLIC __REGEX_PRIVATE) + target_link_libraries(nvi PRIVATE regex) +else() + find_library(CURSES_LIBRARY NAMES ncurses curses HINTS /usr/lib) + target_compile_options(nvi PRIVATE -Wno-pointer-sign) +endif() + +target_link_libraries(nvi PRIVATE ${CURSES_LIBRARY}) + +if(USE_ICONV) + check_function_exists(__iconv ICONV_IN_LIBC) + if(NOT ICONV_IN_LIBC) + find_path(ICONV_INCLUDE_DIR iconv.h) + find_library(ICONV_LIBRARY iconv) + endif() + + # detect the prototype of iconv(3) + set(CMAKE_C_FLAGS_BACKUP "${CMAKE_C_FLAGS}") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror") + set(CMAKE_REQUIRED_INCLUDES "${ICONV_INCLUDE_DIR}") + set(CMAKE_REQUIRED_LIBRARIES "${ICONV_LIBRARY}") + check_c_source_compiles(" + #include + int main() { + iconv_t conv = 0; + char* in = 0; + size_t ilen = 0; + char* out = 0; + size_t olen = 0; + iconv(conv, &in, &ilen, &out, &olen); + return 0; + } + " ICONV_TRADITIONAL) + set(CMAKE_REQUIRED_INCLUDES) + set(CMAKE_REQUIRED_LIBRARIES) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS_BACKUP}") + + target_include_directories(nvi PRIVATE ${ICONV_INCLUDE_DIR}) + target_link_libraries(nvi PRIVATE ${ICONV_LIBRARY}) +endif() + +check_include_files(libutil.h HAVE_LIBUTIL_H) +check_include_files(ncurses.h HAVE_NCURSES_H) +check_include_files(term.h HAVE_TERM_H) + +configure_file(files/config.h.in config.h) + +set(vi_cv_path_preserve /var/tmp/vi.recover/) +if(APPLE) + set(vi_cv_path_msgcat /usr/local/share/vi/catalog/) +else() + set(vi_cv_path_msgcat /usr/share/vi/catalog/) +endif() + +configure_file(files/pathnames.h.in pathnames.h) +configure_file(files/recover.in recover @ONLY) Copied: vendor/nvi/2.2.0/LICENSE (from r365495, vendor/nvi/dist/LICENSE) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/nvi/2.2.0/LICENSE Wed Sep 9 08:19:22 2020 (r365498, copy of r365495, vendor/nvi/dist/LICENSE) @@ -0,0 +1,37 @@ +The following are the copyrights and redistribution conditions that apply +to this copy of the Vi software. + +/* + * Copyright (c) 1991, 1992, 1993, 1994 + * The Regents of the University of California. All rights reserved. + * Copyright (c) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000 + * Keith Bostic. All rights reserved. + * Copyright (c) 1999, 2000 + * Sven Verdoolaege. All rights reserved. + * Copyright (c) 2011 + * Zhihao Yuan. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ Copied: vendor/nvi/2.2.0/README (from r365495, vendor/nvi/dist/README) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/nvi/2.2.0/README Wed Sep 9 08:19:22 2020 (r365498, copy of r365495, vendor/nvi/dist/README) @@ -0,0 +1,64 @@ +This is version 2.2.0 (2020-08-01) of nex/nvi, a reimplementation of the ex/vi +text editors originally distributed as part of the Fourth Berkeley +Software Distribution (4BSD), by the University of California, Berkeley. + +The directory layout is as follows: + + LICENSE ....... Copyright, use and redistribution information. + README ........ This file. + catalog ....... Message catalogs; see catalog/README. + cl ............ Vi interface to the curses(3) library. + common ........ Code shared by ex and vi. + ex ............ Ex source code. + files ......... Template files. + man ........... Ex/vi documentation. + regex ......... Modified regex library with wide character support. + vi ............ Vi source code. + +=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +o Nvi was written by Keith Bostic, and the last version is 1.79. After that, + + Sven Verdoolaege added the iconv support and the DB3 locking. + + Jun-ichiro itojun Hagino developed the file encoding detection + techniques in his nvi-m17n. + +The following acknowledgments were written by Keith Bostic: + +=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +o This software is several years old and is the product of many folks' work. + + This software was originally derived from software contributed to + the University of California, Berkeley by Steve Kirkendall, the + author of the vi clone elvis. Without his work, this work would + have been far more difficult. + + IEEE POSIX 1003.2 style regular expression support is courtesy of + Henry Spencer, for which I am *very* grateful. + + Elan Amir did the original 4BSD curses work that made it possible + to support a full-screen editor using curses. + + George Neville-Neil added the Tcl interpreter, and the initial + interpreter design was his. + + Sven Verdoolaege added the Perl interpreter. + + Rob Mayoff provided the original Cscope support. + +o Many, many people suggested enhancements, and provided bug reports and + testing, far too many to individually thank. + +o From the original vi acknowledgements, by William Joy and Mark Horton: + + Bruce Englar encouraged the early development of this display + editor. Peter Kessler helped bring sanity to version 2's + command layout. Bill Joy wrote versions 1 and 2.0 through 2.7, + and created the framework that users see in the present editor. + Mark Horton added macros and other features and made the editor + work on a large number of terminals and Unix systems. + +o And... + The financial support of UUNET Communications Services is gratefully + acknowledged. Copied: vendor/nvi/2.2.0/catalog/Makefile (from r365495, vendor/nvi/dist/catalog/Makefile) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/nvi/2.2.0/catalog/Makefile Wed Sep 9 08:19:22 2020 (r365498, copy of r365495, vendor/nvi/dist/catalog/Makefile) @@ -0,0 +1,77 @@ +CAT= dutch english french german polish ru_RU.KOI8-R spanish \ + swedish tr_TR.ISO8859-9 tr_TR.UTF-8 uk_UA.KOI8-U zh_CN.GB2312 +FILES= ../cl/*.c ../common/*.c ../ex/*.c ../vi/*.c + +all: dump ${CAT} + +${CAT}: english.base + @echo "... $@"; \ + rm -f $@; \ + sort -u $@.base | \ + awk '{ \ + if ($$1 == 1) { \ + print "\nMESSAGE NUMBER 1 IS NOT LEGAL"; \ + exit 1; \ + } \ + if (++nline > $$1) { \ + print "DUPLICATE MESSAGE NUMBER " $$1; \ + exit 1; \ + } \ + print $0; \ + }' | \ + sed -e '1s/^/$$set 1~$$quote "~/; 1y/~/\n/' | \ + gencat $@ /dev/stdin; \ + chmod 444 $@; \ + if grep DUPLICATE $@ > /dev/null; then \ + grep DUPLICATE $@; \ + fi; \ + if grep 'NOT LEGAL' $@ > /dev/null; then \ + grep 'NOT LEGAL' $@; \ + fi + +CHK= dutch.check english.check french.check german.check \ + polish.check ru_RU.KOI8-R.check spanish.check swedish.check \ + tr_TR.ISO8859-9.check tr_TR.UTF-8.check uk_UA.KOI8-U.check \ + zh_CN.GB2312.check +check: ${CHK} +${CHK}: ${CAT} + @echo "... $@"; \ + f=`basename $@ .check`; \ + (echo "Unused message id's (this is okay):"; \ + awk '{ \ + while (++nline < $$1) \ + printf "%03d\n", nline; \ + }' < $$f.base; \ + echo =========================; \ + echo "MISSING ERROR MESSAGES (Please add!):"; \ + awk '{print $$1}' < $$f.base | sort -u > __ck1; \ + awk '{print $$1}' < english.base | sort -u > __ck2; \ + comm -13 __ck1 __ck2; \ + echo =========================; \ + echo "Extra error messages (just delete them):"; \ + comm -23 __ck1 __ck2; \ + echo =========================; \ + echo "MESSAGES WITH THE SAME MESSAGE ID's (FIX!):"; \ + for j in \ + `sed '/^$$/d' < $$f.base | sort -u | \ + awk '{print $$1}' | uniq -d`; do \ + egrep $$j $$f.base; \ + done; \ + echo =========================; \ + echo "Duplicate messages, both id and message (this is okay):"; \ + sed '/^$$/d' < $$f.base | sort | uniq -c | \ + awk '$$1 != 1 { print $$0 }' | sort -n; \ + echo =========================) > $@ + +english.base: dump ${FILES} #Makefile + ./dump ${FILES} |\ + sed -e '/|/!d' \ + -e 's/|/ "/' \ + -e 's/^"//' |\ + sort -nu > $@ + +dump: dump.c + ${CC} -O -o dump dump.c + +clean: + rm -f dump dump.o ${CAT} english.base *.check __ck1 __ck2 Copied: vendor/nvi/2.2.0/catalog/README (from r365495, vendor/nvi/dist/catalog/README) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/nvi/2.2.0/catalog/README Wed Sep 9 08:19:22 2020 (r365498, copy of r365495, vendor/nvi/dist/catalog/README) @@ -0,0 +1,125 @@ +Generally, all non-system error and informational messages in nvi are +catalog messages, i.e. they can be tailored to a specific langauge. +Command strings, usage strings, system errors and other 'known text' +are not. + +Message catalogs in nvi are fairly simple. Every catalog message +consists of two parts -- an initial number followed by a pipe (`|') +character, followed by the English text for the message. For example: + + msgq(sp, M_ERR, "001|This is an error message"); + +would be a typical message. + +When the msgq() routine is called, if the user has specified a message +catalog and the format string (the third argument) has a leading number, +then it is converted to a record number, and that record is retrieved +from the message catalog and used as a replacement format string. If +the record can't be retrieved for any reason, the English text is displayed +instead. + +Each message format string MUST map into the English format string, i.e. +it can't display more or different arguments than the English one. + +For example: + + msgq(sp, M_ERR, "002|Error: %d %x", arg1, arg2); + +is a format string that displays two arguments. + +Arguments to the msgq function are required to contain ONLY printable +characters. No further translation is done by the msgq routine before +displaying the message on the screen. For example, in the msgq call: + + msgq(sp, M_ERR, "003|File: %s", file_name); + +"file_name" must contain only printable characters. The routine +msg_print() returns a printable version of a string; the third argument +indicates whether the string needs to be freed. For example: + + char *p; + int nf; + + p = msg_print(sp, file_name, &nf); + msgq(sp, M_ERR, "003|File: %s", p); + if (nf) + FREE_SPACE(sp, p, 0); + +makes sure that "file_name" is printable before calling the msgq +routine. + +=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= + +The message catalogs themselves are maintained in two files. The first +is the "base file" which contains two fields, a record number and the +message itself. All base files are named using the convention +".base", e.g. the English one is "english.base". For +example: + + 002 "Line length overflow" + 003 "unable to delete line %lu" + 004 "unable to append to line %lu" + 005 "unable to insert at line %lu" + 006 "unable to store line %lu" + 007 "unable to get last line" + +are the first few lines of the current english.base file. + +Before this file being converted to the second file, the POSIX formatted +message catalog file, by gencat(1), two lines: + + $set 1 + $quote " + +will be inserted before the base text to setup the set_id and the quote +character. So the double-quote needs to be escaped by a backslash to be +included in a message; same as the backslash itself. + +These files are named for their language, e.g. "english". However, a +locale(1) name is also recommended. + +To create a new catalog for nvi: + +Copy the file english.base to a file that you can modify , e.g. "cp +english.base german.base". For each of the messages in the file, +replace the message with the string that you want to use. If you have +doubts about the meaning of a message, just email me. + +A latest english.base can be created from source by running the command +"make english" in the catalog/ directory. + +Once you've translated all of the strings, then add your catalog to the +"CAT=" line of the Makefile, and run the command "make catalog". This +will create the second (and corresponding) file for each file named +.base. + +Don't worry about missing line numbers, i.e. base files that look like: + + 005 Message number 5. + 007 Message number 7. + +This simply means that a message was deleted during the course of nvi's +development. It will be taken care of automatically when you create +the second form of the file. + +=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +If you add new messages to the nvi sources, you can check your work by +doing "make english; make check". The "make check" target lists unused +message numbers, duplicate message numbers, and duplicate messages. +Unused message numbers are only useful if you are condensing messages. +Duplicate message numbers are a serious problem and have to be fixed. +Duplicate messages are only interesting if a message appears often enough +that it's worth creating a routine so that the string is only need in +a single place. + +=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= +To select a catalog when running nvi, set the "msgcat" option. If the +value of this option ends with a '/', it is treated as the name of a +directory that contains a message catalog "$LC_MESSAGES", which is set +through the LC_MESSAGES environment variable but returned by setlocale(3). +Check the output of locale(1) to validate such a value. If the option +doesn't end in a '/', the option is treated as the full path name of the +message catalog to use. + +If any messages are missing from the catalog, the backup text (English) +is used instead. Copied: vendor/nvi/2.2.0/catalog/dump.c (from r365495, vendor/nvi/dist/catalog/dump.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/nvi/2.2.0/catalog/dump.c Wed Sep 9 08:19:22 2020 (r365498, copy of r365495, vendor/nvi/dist/catalog/dump.c) @@ -0,0 +1,97 @@ +/*- + * Copyright (c) 1992, 1993, 1994 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +#include + +static void +parse(FILE *fp) +{ + int ch, s1, s2, s3; + +#define TESTD(s) { \ + if ((s = getc(fp)) == EOF) \ + return; \ + if (!isdigit(s)) \ + continue; \ +} +#define TESTP { \ + if ((ch = getc(fp)) == EOF) \ + return; \ + if (ch != '|') \ + continue; \ +} +#define MOVEC(t) { \ + do { \ + if ((ch = getc(fp)) == EOF) \ + return; \ + } while (ch != (t)); \ +} + for (;;) { + MOVEC('"'); + TESTD(s1); + TESTD(s2); + TESTD(s3); + TESTP; + putchar('"'); + putchar(s1); + putchar(s2); + putchar(s3); + putchar('|'); + for (;;) { /* dump to end quote. */ + if ((ch = getc(fp)) == EOF) + return; + putchar(ch); + if (ch == '"') + break; + if (ch == '\\') { + if ((ch = getc(fp)) == EOF) + return; + putchar(ch); + } + } + putchar('\n'); + } +} + +int +main(int argc, char *argv[]) +{ + FILE *fp; + + for (; *argv != NULL; ++argv) { + if ((fp = fopen(*argv, "r")) == NULL) { + perror(*argv); + return (1); + } + parse(fp); + (void)fclose(fp); + } + return (0); +} Copied: vendor/nvi/2.2.0/catalog/tr_TR.ISO8859-9.base (from r365495, vendor/nvi/dist/catalog/tr_TR.ISO8859-9.base) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/nvi/2.2.0/catalog/tr_TR.ISO8859-9.base Wed Sep 9 08:19:22 2020 (r365498, copy of r365495, vendor/nvi/dist/catalog/tr_TR.ISO8859-9.base) @@ -0,0 +1,304 @@ +002 "Satýr uzunluðu taþýmý" +003 "%lu numaralý satýr silinemiyor" +004 "%lu numaralý satýra iliþtirilemiyor" +005 "%lu numaralý satýrda ekleme yapýlamýyor" +006 "%lu numaralý satýr kaydedilemiyor" +007 "Son satýr alýnamýyor" +008 "Hata: %lu numaralý satýr okunamýyor" +009 "Günlük dosyasý" +010 "Günlükleme gerçekleþtirilmiyor, geri alma olanaklý deðil" +011 "Geri alýnacak bir deðiþiklik yok" +012 "Günlükleme gerçekleþtirilmiyor, geri alma olanaklý deðil" +013 "Günlükleme gerçekleþtirilmiyor, ileri sarma olanaklý deðil" +014 "Yinelenecek bir deðiþiklik yok" +015 "%s/%d: Günlük kayýt hatasý" +016 "Vi'nin standart girdisi ve çýktýsý bir uçbirim olmalý" +017 "Ým %s: Ayarlanmamýþ" +018 "Ým %s: Satýr silinmiþ" +019 "Ým %s: Ýmleç konumu artýk yok" +020 "Hata: " +021 "yeni dosya +022 "adý deðiþti" +023 "deðiþtirildi" +024 "deðiþtirilmedi" +025 "KÝLÝDÝ AÇILDI" +026 "saltokunur" +027 "satýr %lu/%lu [%ld%%]" +028 "boþ dosya" +029 "%lu. satýr" +030 "%s dosyasý bir ileti kataloðu deðil" +031 "Öntanýmlý %s seçeneði ayarlanamadý" +032 "Kullaným: %s" +033 "set: %s seçeneði yok: 'set all' tüm seçenek deðerlerini verir" +034 "set: [no]%s seçeneði bir deðer almaz" +035 "set: %s seçeneði bir Boole deðeri deðil" +036 "set: %s seçeneði: %s" +037 "set: %s seçeneði: %s: Deðer taþýmý" +038 "set: %s seçeneði: %s izin verilmeyen bir sayý" +039 "set: %s seçeneði bir Boole deðeri deðil" +040 "Ekran sütun sayýsý çok küçük, þundan daha az: %d" +041 "Ekran sütun sayýsý çok büyük, þundan daha çok: %d" +042 "Ekran satýr sayýsý çok küçük, þundan daha az: %d" +043 "Ekran satýr sayýsý çok büyük, þundan daha çok: %d" +044 "Lisp seçeneði eklenmemiþ" +045 "Ýletiler kapatýlmamýþ: %s" +046 "Ýletiler açýlmamýþ: %s" +047 "%s seçeneði iki karakterli öbekler biçiminde olmalý" +053 "Baþlangýç arabelleði boþ" +054 "%s arabelleði boþ" +056 "Oturum baþarýsýz olursa deðiþiklikler kurtarýlamaz" +057 "Dosya, kurtarma için kopyalanýyor..." +058 "Koruma baþarýsýz oldu: %s" +059 "Oturum baþarýsýz olursa deðiþiklikler kurtarýlamaz" +060 "Dosya yedeklemesi baþarýsýz oldu: %s" +061 "Dosya, kurtarma için kopyalanýyor..." +062 "%u kullanýcýsý üzerine bilgi bulunamadý" +063 "Kurtarma dosyasý kilitlenemiyor" +065 "Kurtarma dosyasý" +066 "%s: Hatalý oluþturulmuþ kurtarma dosyasý" +067 "%s: Hatalý oluþturulmuþ kurtarma dosyasý" +068 "Kurtarýlacak %s adýnda sizce okunabilir bir dosya yok" +069 "Bu dosyanýn kurtarabileceðiniz eski sürümleri var" +070 "Kurtarabileceðiniz baþka dosyalar var" +071 "E-posta gönderilmedi: %s" +072 "Dosya boþ, aranacak bir þey yok" +073 "Dizgi bulunamadan dosyanýn sonuna eriþildi" +074 "Arama dizgisi yok" +075 "Dizgi bulunamadý" +076 "Dizgi bulunamadan dosyanýn baþýna eriþildi" +077 "Arama tamamlandý" +078 "Aranýyor..." +079 "Yazdýrýlamaz karakter bulunmadý" +080 "Bilinmeyen komut adý" +082 "%s: Komut ex kipinde kullanýlamaz" +083 "Sayým sýfýr olmayabilir" +084 "%s: Hatalý satýr belirtimi" +085 "Ýç sözdizim tablo hatasý (%s: %s)" +086 "Kullaným: %s" +087 "%s: Geçici arabellek salýverilmedi" +088 "Bayrak göreli konumu birinci satýrdan önceye" +089 "Bayrak göreli konumu dosya sonunu geçiyor" +090 "Erimli @, dosya/ekran deðiþtiðinde çalýþýr" +091 "Global/v komutu dosya/ekran deðiþtiðinde çalýþýr" +092 "Ex komutu baþarýsýz: Sýradaki komutlar çýkarýldý" +093 "Ex komutu baþarýsýz: Eþlemlenen düðmeler çýkarýldý" +094 "Ýkinci adres ilkinden daha küçük" +095 "Bir im adý saðlanmadý" +096 "\\ sonrasýnda / veya ? gelmiyor" +097 "Bir satýr numarasýna yapýlan baþvuru sayýsý sýfýrdan az" +098 "Bilinmeyen komut: %s" +099 "Adres deðeri taþýmý" +100 "Adres deðeri alttaþýmý" +101 "Ýzin verilmeyen adres birleþimi" +102 "Ýzin verilmeyen adres: Dosyada yalnýzca %lu satýr var" +103 "Ýzin verilmeyen adres: Dosya boþ" +104 "%s komutu bir 0 adresine izin vermiyor" +105 "Görüntülenecek kýsaltma yok" +106 "Kýsaltmalar bir \"sözcük\" karakteri ile bitmelidir" +107 "Kýsaltmalar sekme veya boþluk içeremez" +108 "Kýsaltmalar sonu dýþýnda sözcük/sözcük olmayan karakterleri karýþtýramaz" +109 "\"%s\" bir kýsaltma deðil" +110 "Vi komutu baþarýsýz: Eþlemlenen düðmeler çýkarýldý" +111 "Düzenlenecek baþka dosya yok" +112 "Öncesinde düzenlenecek baþka dosya yok" +113 "Öncesinde geri sarýlacak dosyalar yok" +114 "Görüntülenecek dosya yok" +115 "Öncesinde \"!\" ögesinin yerine geçecek bir komut yok" +116 "%% yerine geçecek bir dosya adý yok" +117 "# yerine geçecek bir dosya adý yok" +118 "Hata: execl: %s" +119 "Girdi/Çýktý hatasý: %s" +120 "Dosya son tam yazýmdan bu yana deðiþtirilmiþ; yazýn veya yok saymak için ! kullanýn" +121 "Ev dizini konumu bulunamýyor" +122 "Yeni þimdiki dizin: %s" +123 "Görüntülenecek kesilmiþ arabellek yok" +124 "%s komutu bir global veya v komutunun parçasý olarak kullanýlamaz" +128 "%s: kaynak alýnmýyor: Ýyesi siz veya kök deðil" +129 "%s: kaynak alýnmýyor: Ýyesi siz deðilsiniz" +130 "%s: kaynak alýnmýyor: Ýyesi dýþýnda baþka bir kullanýcý tarafýndan yazýlabilir" +131 "Uç uca eklenecek bir satýr yok" +132 "Girdi eþlem girdisi yok" +133 "Komut eþlem girdisi yok" +134 "%s yeniden eþlemlenemeyebilir" +135 "\"%s\" þu anda eþlemlenmemiþ" +136 "Ým adlarý tek bir karakter olmalýdýr" +137 "%s mevcut, yazýlmamýþ; yok saymak için ! kullanýn" +138 "Yeni exrc dosyasý: %s" +139 "Hedef satýrý taþýma erimi içinde" +140 "'open' komutu 'open' seçeneðinin ayarlý olmasýný gerektirir" +141 "'open' komutu henüz eklenmemiþ" +142 "Bu dosyanýn korunmasý olanaklý deðil" +143 "Dosya korundu" +144 "%s: Çok fazla dosya adýna geniþletilmiþ" +145 "Yalnýzca sýradan dosyalar ve adlandýrýlmýþ veri yollarý okunabilir" +146 "%s: Okuma kilidi kullanýlabilir deðildi" +147 "Okunuyor..." +148 "%s: %lu satýr, %lu karakter" +149 "Görüntülenecek arkaplan ekraný yok" +150 "'script' komutu yalnýzca vi kipinde kullanýlabilir" +151 "Çalýþtýrýlacak komut yok" +152 "'shiftwidth' seçeneði 0 olarak ayarlanmýþ" +153 "Sayým taþýmý" +154 "Sayým alttaþýmý" +155 "Düzenli ifade belirtilmiþ; r bayraðý anlamsýz" +156 "#, l ve p bayraklarý vi kipinde c bayraðý ile birlikte kullanýlamaz" +157 "Eþleþme bulunamadý" +158 "Önceden bir etiket girilmemiþ" +159 "Etiket yýðýnýnda %s sayýsýndan az girdi; :display t[ags] kullanýn" +160 "Etiket yýðýnýnda dönülecek bir %s dosyasý yok; :display t[ags] kullanýn" +161 "Sürdürmek için Enter'a basýn:" +162 "%s: Etiket bulunamadý" +163 "%s: %s içinde hasar görmüþ etiket" +164 "%s: Etiketin satýr numarasý dosya sonunu geçmiþ" +165 "Etiket yýðýný boþ" +166 "%s: Arama dizgisi bulunamadý" +167 "%d dosya daha düzenlenecek" +168 "%s arabelleði boþ" +169 "Deðiþikliði onayla? [n]" +170 "Yarýda kesildi" +171 "Öncesinde çalýþtýrýlacak arabellek yok" +172 "Öncesinde düzenli ifade yok" +173 "%s komutu bir dosyanýn halihazýrda okunmuþ olmasýný gerektirir" +174 "Kullaným: %s" +175 "'visual' komutu 'open' seçeneðinin ayarlanmýþ olmasýný gerektirir" +177 "Boþ dosya" +178 "Öncesinde F, f, T veya t aramasý yok" +179 "%s bulunamadý" +180 "Düzenlenecek dosya yok" +181 "Ýmleç bir sayýda deðil" +182 "Ortaya çýkan sayý çok büyük" +183 "Ortaya çýkan sayý çok küçük" +184 "Bu satýrda eþleþen karakter yok" +185 "Eþleþen karakter bulunamadý" +186 "Deðiþtirilecek karakter yok" +187 "Geçilecek baþka ekran yok" +188 "Arama dizgisinden, satýr ofsetinden ve/veya 'z' komutundan sonraki karakterler" +189 "Öncesinde arama dizgisi yok" +190 "Arama baþlanan konumda tamamlandý" +191 "Kýsaltma geniþleme sýnýrýný aþtý: Karakterler çýkarýldý" +192 "Ýzin verilmeyen karakter; giriþ için týrnak içine alýn" +193 "Halihazýrda eklemenin baþýnda" +194 "Silinecek baþka karakter yok" +195 "Hareket dosya sonunu geçti" +196 "Hareket satýr sonunu geçti" +197 "Ýmleç hareket ettirilmedi" +198 "Halihazýrda dosyanýn baþýnda" +199 "Hareket dosyanýn baþýný geçti" +200 "Halihazýrda ilk sütunda" +201 "Arabellekler komuttan önce belirtilmeli" +202 "Halihazýrda dosya sonunda" +203 "Halihazýrda satýr sonunda" +204 "%s bir vi komutu deðil" +205 "Kullaným: %s" +206 "Silinecek karakter yok" +207 "Q komutu ex uçbirim arabirimini gerektirir" +208 "Yinelenecek komut yok" +209 "Dosya boþ" +210 "%s bir hareket komutu olarak kullanýlamaz" +211 "Halihazýrda komut kipi içinde" +212 "Ýmleç bir sözcükte deðil" +214 "'windows' seçeneði deðeri çok büyük, en çok %u olabilir" +215 "Ýliþtir" +216 "Deðiþiklik yap" +217 "Komut" +218 "Ekle" +219 "Deðiþtir" +220 "Hareket ekran sonunu geçti" +221 "Hareket ekran baþýný geçti" +222 "Ekran bölünebilmesi için %d satýrdan daha geniþ olmalýdýr" +223 "Arkaplan ekraný yok" +224 "Arkaplanda %s dosyasýný düzenleyen bir ekran yok" +225 "Açýk olan tek ekranýnýzý arkaplana alamazsýnýz" +226 "Ekran yalnýzca %d satýra küçültülebilir" +227 "Ekran küçülemez" +228 "Ekran büyüyemez" +230 "Bu ekran askýya alýnamaz" +231 "Yarýda kesildi: Eþlemlenen düðmeler çýkarýldý" +232 "vi: Geçici arabellek salýverilmedi" +233 "Bu uçbirimde %s düðmesi yok" +234 "Yalnýzca bir arabellek belirtilebilir" +235 "Sayý þundan daha büyük: %lu" +236 "Yarýda kesildi" +237 "Geçici dosya oluþturulamýyor" +238 "Uyarý: %s sýradan bir dosya deðil" +239 "%s halihazýrda kilitlenmiþ, oturum saltokunur" +240 "%s: Kaldýr" +241 "%s: Kapat" +242 "%s: Kaldýr" +243 "%s: Kaldýr" +244 "Saltokunur dosya, yazýlmadý; yok saymak için ! kullanýn" +245 "Saltokunur dosya, yazýlmadý" +246 "%s mevcut, yazýlmadý; yok saymak için ! kullanýn" +247 "%s mevcut, yazýlmadý" +248 "Kýsmi dosya, yazýlmadý; yok saymak için ! kullanýn" +249 "Kýsmi dosya, yazýlmadý" +250 "%s: Dosya bu kopyadan daha önce deðiþtirilmiþ; yok saymak için ! kullanýn" +251 "%s: Dosya bu kopyadan daha önce deðiþtirilmiþ" +252 "%s: Yazým korumasý kullanýlabilir deðildi" +253 "Yazýlýyor..." +254 "%s: UYARI: DOSYA KIRPILMIÞ" +255 "Halihazýrda bu grubun ilk etiketinde" +256 "%s: Yeni dosya: %lu satýr, %lu karakter" +257 "%s: %lu satýr, %lu karakter" +258 "%s çok fazla dosya adýna geniþletilmiþ" +259 "%s: Sýradan bir dosya deðil" +260 "%s: Ýyesi siz deðilsiniz" +261 "%s: Ýyesi dýþýnda baþka bir kullanýcý tarafýndan da eriþilebilir" +262 "Dosya son tam yazýmdan bu yana deðiþtirilmiþ; yazýn veya yok saymak için ! kullanýn" +263 "Dosya son tam yazýmdan bu yana deðiþtirilmiþ; yazýn veya yok saymak için :edit! kullanýn" +264 "Dosya son tam yazýmdan bu yana deðiþtirilmiþ; yazýn veya yok saymak için ! kullanýn" +265 "Dosya geçici; çýkarsanýz deðiþiklikler atýlacaktýr" +266 "Dosya saltokunur, deðiþiklikler kendiliðinden yazýlmaz" +267 "Günlük yeniden baþlatýldý" +268 "Onayla? [ynq]" +269 "Sürdürmek için herhangi bir düðmeye basýn: " +270 "Sürdürmek için herhangi bir düðmeye basýn [ex komutu girmek için :]: " +271 "Sürdürmek için herhangi bir düðmeye basýn [çýkýþ için q]: " +272 "Bu biçim %s ex uçbirim arabirimini gerektirir" +273 "ex girdisi kipine giriliyor" +274 "Komut baþarýsýz, henüz bir dosya okunmadý." +275 " sürdür?" +276 "Beklenmedik karakter olayý" +277 "Beklenmedik dosya sonu olayý" +278 "Sorgu eþleþmesi bulunamadý" +279 "Beklenmedik yarýda kesme olayý" +281 "Beklenmedik yeniden boyama olayý" +282 "Halihazýrda bu grubun son etiketinde" +283 "%s komutu ex uçbirim arabirimini gerektirir" +284 "Bu biçim %s 'secure edit' seçeneði ayarlandýðýnda desteklenmez" +285 "Beklenmedik dizi olayý" +286 "Beklenmedik zaman aþýmý olayý" +288 "Bölünebilmesi için ekran %d sütundan daha geniþ olmalýdýr" +289 "Kabuk geniþletmeleri 'secure edit' seçeneði ayarlandýðýnda desteklenmez" +290 "%s komutu 'secure edit' seçeneði ayarlandýðýnda desteklenmez" +291 "set: %s seçeneði kapatýlamaz" +292 "Ekran çok küçük." +293 "eklendi" +294 "deðiþtirildi" +295 "silindi" +296 "uç uca eklendi" +297 "taþýndý" +298 "kaydýrýldý" +299 "kopyalandý" +300 "satýr" +301 "satýr" +303 "Dosya son yazýmdan bu yana deðiþtirilmiþ." +304 "Kabuk geniþletmesi baþarýsýz" +305 "Bir '%s' düzenleme seçeneði belirtilmedi" +307 "Çalýþtýrýlacak ex komutu yok" +308 "Bir komut çalýþtýrmak için , çýkmak için :q girin" +309 "Yardým için \"cscope help\" kullanýn" +310 "Çalýþan bir cscope baðlantýsý yok" +311 "%s: Bilinmeyen arama türü: Þunlardan bir tanesini kullanýn: %s" +312 "%d: Böyle bir cscope oturumu yok" +313 "set: %s seçeneði hiçbir zaman açýlamaz" +314 "set: %s seçeneði hiçbir zaman 0 olarak ayarlanamaz" +315 "%s: Ýliþtirildi: %lu satýr, %lu karakter" +316 "Beklenmedik yeniden boyutlandýrma olayý" +317 "Düzenlenecek %d dosya var" +319 "%d ekran arkaplana alýndý; onlarý listelemek için :display kullanýn" +320 "Bilinmeyen imleç konumu" +321 "Dosya kodlama dönüþtürmesi desteklenmiyor" +322 "Girdi kodlama dönüþtürmesi desteklenmiyor" +323 "Geçersiz girdi. Kýrpýldý." +324 "%d numaralý satýrda dönüþtürme hatasý" Copied: vendor/nvi/2.2.0/catalog/tr_TR.ISO8859-9.owner (from r365495, vendor/nvi/dist/catalog/tr_TR.ISO8859-9.owner) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/nvi/2.2.0/catalog/tr_TR.ISO8859-9.owner Wed Sep 9 08:19:22 2020 (r365498, copy of r365495, vendor/nvi/dist/catalog/tr_TR.ISO8859-9.owner) @@ -0,0 +1 @@ +Emir SARI Copied: vendor/nvi/2.2.0/catalog/tr_TR.UTF-8.base (from r365495, vendor/nvi/dist/catalog/tr_TR.UTF-8.base) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/nvi/2.2.0/catalog/tr_TR.UTF-8.base Wed Sep 9 08:19:22 2020 (r365498, copy of r365495, vendor/nvi/dist/catalog/tr_TR.UTF-8.base) @@ -0,0 +1,304 @@ +002 "Satır uzunluÄŸu taşımı" +003 "%lu numaralı satır silinemiyor" +004 "%lu numaralı satıra iliÅŸtirilemiyor" +005 "%lu numaralı satırda ekleme yapılamıyor" +006 "%lu numaralı satır kaydedilemiyor" +007 "Son satır alınamıyor" +008 "Hata: %lu numaralı satır okunamıyor" +009 "Günlük dosyası" +010 "Günlükleme gerçekleÅŸtirilmiyor, geri alma olanaklı deÄŸil" +011 "Geri alınacak bir deÄŸiÅŸiklik yok" +012 "Günlükleme gerçekleÅŸtirilmiyor, geri alma olanaklı deÄŸil" +013 "Günlükleme gerçekleÅŸtirilmiyor, ileri sarma olanaklı deÄŸil" +014 "Yinelenecek bir deÄŸiÅŸiklik yok" +015 "%s/%d: Günlük kayıt hatası" +016 "Vi'nin standart girdisi ve çıktısı bir uçbirim olmalı" +017 "Ä°m %s: Ayarlanmamış" +018 "Ä°m %s: Satır silinmiÅŸ" +019 "Ä°m %s: Ä°mleç konumu artık yok" +020 "Hata: " +021 "yeni dosya +022 "adı deÄŸiÅŸti" +023 "deÄŸiÅŸtirildi" +024 "deÄŸiÅŸtirilmedi" +025 "KÄ°LÄ°DÄ° AÇILDI" +026 "saltokunur" +027 "satır %lu/%lu [%ld%%]" +028 "boÅŸ dosya" +029 "%lu. satır" +030 "%s dosyası bir ileti kataloÄŸu deÄŸil" +031 "Öntanımlı %s seçeneÄŸi ayarlanamadı" +032 "Kullanım: %s" +033 "set: %s seçeneÄŸi yok: 'set all' tüm seçenek deÄŸerlerini verir" +034 "set: [no]%s seçeneÄŸi bir deÄŸer almaz" +035 "set: %s seçeneÄŸi bir Boole deÄŸeri deÄŸil" +036 "set: %s seçeneÄŸi: %s" +037 "set: %s seçeneÄŸi: %s: DeÄŸer taşımı" +038 "set: %s seçeneÄŸi: %s izin verilmeyen bir sayı" +039 "set: %s seçeneÄŸi bir Boole deÄŸeri deÄŸil" +040 "Ekran sütun sayısı çok küçük, ÅŸundan daha az: %d" +041 "Ekran sütun sayısı çok büyük, ÅŸundan daha çok: %d" +042 "Ekran satır sayısı çok küçük, ÅŸundan daha az: %d" +043 "Ekran satır sayısı çok büyük, ÅŸundan daha çok: %d" +044 "Lisp seçeneÄŸi eklenmemiÅŸ" +045 "Ä°letiler kapatılmamış: %s" +046 "Ä°letiler açılmamış: %s" +047 "%s seçeneÄŸi iki karakterli öbekler biçiminde olmalı" +053 "BaÅŸlangıç arabelleÄŸi boÅŸ" +054 "%s arabelleÄŸi boÅŸ" +056 "Oturum baÅŸarısız olursa deÄŸiÅŸiklikler kurtarılamaz" +057 "Dosya, kurtarma için kopyalanıyor..." +058 "Koruma baÅŸarısız oldu: %s" +059 "Oturum baÅŸarısız olursa deÄŸiÅŸiklikler kurtarılamaz" +060 "Dosya yedeklemesi baÅŸarısız oldu: %s" +061 "Dosya, kurtarma için kopyalanıyor..." +062 "%u kullanıcısı üzerine bilgi bulunamadı" +063 "Kurtarma dosyası kilitlenemiyor" +065 "Kurtarma dosyası" +066 "%s: Hatalı oluÅŸturulmuÅŸ kurtarma dosyası" +067 "%s: Hatalı oluÅŸturulmuÅŸ kurtarma dosyası" +068 "Kurtarılacak %s adında sizce okunabilir bir dosya yok" +069 "Bu dosyanın kurtarabileceÄŸiniz eski sürümleri var" +070 "KurtarabileceÄŸiniz baÅŸka dosyalar var" +071 "E-posta gönderilmedi: %s" +072 "Dosya boÅŸ, aranacak bir ÅŸey yok" +073 "Dizgi bulunamadan dosyanın sonuna eriÅŸildi" +074 "Arama dizgisi yok" *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Wed Sep 9 08:38:50 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BD1DC3C991B; Wed, 9 Sep 2020 08:38:50 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bmb5k4k1jz3gZw; Wed, 9 Sep 2020 08:38:50 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 680B41EB37; Wed, 9 Sep 2020 08:38:50 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0898couU002493; Wed, 9 Sep 2020 08:38:50 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0898cluA002476; Wed, 9 Sep 2020 08:38:47 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <202009090838.0898cluA002476@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Wed, 9 Sep 2020 08:38:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365499 - in head: contrib/nvi contrib/nvi/catalog contrib/nvi/cl contrib/nvi/common contrib/nvi/docs contrib/nvi/ex contrib/nvi/files contrib/nvi/man contrib/nvi/vi usr.bin/vi usr.bin/... X-SVN-Group: head X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: in head: contrib/nvi contrib/nvi/catalog contrib/nvi/cl contrib/nvi/common contrib/nvi/docs contrib/nvi/ex contrib/nvi/files contrib/nvi/man contrib/nvi/vi usr.bin/vi usr.bin/vi/catalog X-SVN-Commit-Revision: 365499 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.33 Precedence: list List-Id: "SVN commit messages 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, 09 Sep 2020 08:38:50 -0000 Author: bapt Date: Wed Sep 9 08:38:47 2020 New Revision: 365499 URL: https://svnweb.freebsd.org/changeset/base/365499 Log: Update nvi to 2.2.0 Main changes: * Vim-style expandtab option * Provides Turkish translation * Backspace now deletes \ rather than being escaped * T during motion commands is now VI-compatible * Encoding related fixes, such as UTF-8 detection * Fixed a number of memory management issues MFC after: 3 weeks Added: head/contrib/nvi/.gitignore - copied unchanged from r365495, vendor/nvi/dist/.gitignore head/contrib/nvi/CMakeLists.txt - copied unchanged from r365495, vendor/nvi/dist/CMakeLists.txt head/contrib/nvi/catalog/tr_TR.ISO8859-9.base - copied unchanged from r365495, vendor/nvi/dist/catalog/tr_TR.ISO8859-9.base head/contrib/nvi/catalog/tr_TR.ISO8859-9.owner - copied unchanged from r365495, vendor/nvi/dist/catalog/tr_TR.ISO8859-9.owner head/contrib/nvi/catalog/tr_TR.UTF-8.base - copied unchanged from r365495, vendor/nvi/dist/catalog/tr_TR.UTF-8.base head/contrib/nvi/catalog/tr_TR.UTF-8.owner - copied unchanged from r365495, vendor/nvi/dist/catalog/tr_TR.UTF-8.owner head/contrib/nvi/files/ - copied from r365495, vendor/nvi/dist/files/ head/contrib/nvi/man/ - copied from r365495, vendor/nvi/dist/man/ Replaced: head/contrib/nvi/cl/extern.h - copied unchanged from r365497, vendor/nvi/dist/cl/extern.h head/contrib/nvi/common/extern.h - copied unchanged from r365497, vendor/nvi/dist/common/extern.h head/contrib/nvi/common/options_def.h - copied unchanged from r365497, vendor/nvi/dist/common/options_def.h head/contrib/nvi/ex/ex_def.h - copied unchanged from r365497, vendor/nvi/dist/ex/ex_def.h head/contrib/nvi/ex/extern.h - copied unchanged from r365497, vendor/nvi/dist/ex/extern.h head/contrib/nvi/ex/version.h - copied unchanged from r365497, vendor/nvi/dist/ex/version.h head/contrib/nvi/vi/extern.h - copied unchanged from r365497, vendor/nvi/dist/vi/extern.h Deleted: head/contrib/nvi/docs/ Modified: head/contrib/nvi/LICENSE head/contrib/nvi/README head/contrib/nvi/catalog/Makefile head/contrib/nvi/catalog/README head/contrib/nvi/catalog/dump.c head/contrib/nvi/cl/README.signal head/contrib/nvi/cl/cl.h head/contrib/nvi/cl/cl_funcs.c head/contrib/nvi/cl/cl_main.c head/contrib/nvi/cl/cl_read.c head/contrib/nvi/cl/cl_screen.c head/contrib/nvi/cl/cl_term.c head/contrib/nvi/common/args.h head/contrib/nvi/common/common.h head/contrib/nvi/common/conv.c head/contrib/nvi/common/conv.h head/contrib/nvi/common/cut.c head/contrib/nvi/common/cut.h head/contrib/nvi/common/delete.c head/contrib/nvi/common/encoding.c head/contrib/nvi/common/exf.c head/contrib/nvi/common/exf.h head/contrib/nvi/common/gs.h head/contrib/nvi/common/key.c head/contrib/nvi/common/key.h head/contrib/nvi/common/line.c head/contrib/nvi/common/log.c head/contrib/nvi/common/log.h head/contrib/nvi/common/main.c head/contrib/nvi/common/mark.c head/contrib/nvi/common/mark.h head/contrib/nvi/common/mem.h head/contrib/nvi/common/msg.c head/contrib/nvi/common/msg.h head/contrib/nvi/common/multibyte.h head/contrib/nvi/common/options.c head/contrib/nvi/common/options.h head/contrib/nvi/common/options_f.c head/contrib/nvi/common/put.c head/contrib/nvi/common/recover.c head/contrib/nvi/common/screen.c head/contrib/nvi/common/screen.h head/contrib/nvi/common/search.c head/contrib/nvi/common/seq.c head/contrib/nvi/common/seq.h head/contrib/nvi/common/util.c head/contrib/nvi/common/util.h head/contrib/nvi/ex/ex.c head/contrib/nvi/ex/ex.h head/contrib/nvi/ex/ex_abbrev.c head/contrib/nvi/ex/ex_append.c head/contrib/nvi/ex/ex_args.c head/contrib/nvi/ex/ex_argv.c head/contrib/nvi/ex/ex_at.c head/contrib/nvi/ex/ex_bang.c head/contrib/nvi/ex/ex_cd.c head/contrib/nvi/ex/ex_cmd.c head/contrib/nvi/ex/ex_cscope.c head/contrib/nvi/ex/ex_delete.c head/contrib/nvi/ex/ex_display.c head/contrib/nvi/ex/ex_edit.c head/contrib/nvi/ex/ex_equal.c head/contrib/nvi/ex/ex_file.c head/contrib/nvi/ex/ex_filter.c head/contrib/nvi/ex/ex_global.c head/contrib/nvi/ex/ex_init.c head/contrib/nvi/ex/ex_join.c head/contrib/nvi/ex/ex_map.c head/contrib/nvi/ex/ex_mark.c head/contrib/nvi/ex/ex_mkexrc.c head/contrib/nvi/ex/ex_move.c head/contrib/nvi/ex/ex_open.c head/contrib/nvi/ex/ex_preserve.c head/contrib/nvi/ex/ex_print.c head/contrib/nvi/ex/ex_put.c head/contrib/nvi/ex/ex_quit.c head/contrib/nvi/ex/ex_read.c head/contrib/nvi/ex/ex_screen.c head/contrib/nvi/ex/ex_script.c head/contrib/nvi/ex/ex_set.c head/contrib/nvi/ex/ex_shell.c head/contrib/nvi/ex/ex_shift.c head/contrib/nvi/ex/ex_source.c head/contrib/nvi/ex/ex_stop.c head/contrib/nvi/ex/ex_subst.c head/contrib/nvi/ex/ex_tag.c head/contrib/nvi/ex/ex_txt.c head/contrib/nvi/ex/ex_undo.c head/contrib/nvi/ex/ex_usage.c head/contrib/nvi/ex/ex_util.c head/contrib/nvi/ex/ex_version.c head/contrib/nvi/ex/ex_visual.c head/contrib/nvi/ex/ex_write.c head/contrib/nvi/ex/ex_yank.c head/contrib/nvi/ex/ex_z.c head/contrib/nvi/ex/script.h head/contrib/nvi/ex/tag.h head/contrib/nvi/vi/getc.c head/contrib/nvi/vi/v_at.c head/contrib/nvi/vi/v_ch.c head/contrib/nvi/vi/v_cmd.c head/contrib/nvi/vi/v_delete.c head/contrib/nvi/vi/v_ex.c head/contrib/nvi/vi/v_increment.c head/contrib/nvi/vi/v_init.c head/contrib/nvi/vi/v_itxt.c head/contrib/nvi/vi/v_left.c head/contrib/nvi/vi/v_mark.c head/contrib/nvi/vi/v_match.c head/contrib/nvi/vi/v_paragraph.c head/contrib/nvi/vi/v_put.c head/contrib/nvi/vi/v_redraw.c head/contrib/nvi/vi/v_replace.c head/contrib/nvi/vi/v_right.c head/contrib/nvi/vi/v_screen.c head/contrib/nvi/vi/v_scroll.c head/contrib/nvi/vi/v_search.c head/contrib/nvi/vi/v_section.c head/contrib/nvi/vi/v_sentence.c head/contrib/nvi/vi/v_status.c head/contrib/nvi/vi/v_txt.c head/contrib/nvi/vi/v_ulcase.c head/contrib/nvi/vi/v_undo.c head/contrib/nvi/vi/v_util.c head/contrib/nvi/vi/v_word.c head/contrib/nvi/vi/v_xchar.c head/contrib/nvi/vi/v_yank.c head/contrib/nvi/vi/v_z.c head/contrib/nvi/vi/v_zexit.c head/contrib/nvi/vi/vi.c head/contrib/nvi/vi/vi.h head/contrib/nvi/vi/vs_line.c head/contrib/nvi/vi/vs_msg.c head/contrib/nvi/vi/vs_refresh.c head/contrib/nvi/vi/vs_relative.c head/contrib/nvi/vi/vs_smap.c head/contrib/nvi/vi/vs_split.c head/usr.bin/vi/Makefile head/usr.bin/vi/catalog/Makefile head/usr.bin/vi/config.h head/usr.bin/vi/pathnames.h Directory Properties: head/contrib/nvi/ (props changed) Copied: head/contrib/nvi/.gitignore (from r365495, vendor/nvi/dist/.gitignore) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/nvi/.gitignore Wed Sep 9 08:38:47 2020 (r365499, copy of r365495, vendor/nvi/dist/.gitignore) @@ -0,0 +1,9 @@ +*.swp +*~ +*.orig +*.core +extern.h +*_def.h +version.h +tags +build/ Copied: head/contrib/nvi/CMakeLists.txt (from r365495, vendor/nvi/dist/CMakeLists.txt) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/nvi/CMakeLists.txt Wed Sep 9 08:38:47 2020 (r365499, copy of r365495, vendor/nvi/dist/CMakeLists.txt) @@ -0,0 +1,190 @@ +cmake_minimum_required(VERSION 3.9) + +get_property(is_multi_config GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) +if(is_multi_config) + set(CMAKE_CONFIGURATION_TYPES Debug Release CACHE STRING + "Semicolon separated list of supported configuration types") + mark_as_advanced(CMAKE_CONFIGURATION_TYPES) +elseif(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_C_FLAGS) + message(WARNING "No CMAKE_BUILD_TYPE is selected") +endif() + +project(nvi2 C) + +include(CheckIncludeFiles) +include(CheckFunctionExists) +include(CheckCSourceCompiles) + +mark_as_advanced(CMAKE_INSTALL_PREFIX) + +option(USE_WIDECHAR "Enable wide character support" ON) +option(USE_ICONV "Enable iconv support" ON) + +add_compile_options(-fcolor-diagnostics) +add_compile_options($<$:-Wall>) +add_compile_options($<$:-Wno-parentheses>) +add_compile_options($<$:-Wno-uninitialized>) +add_compile_options($<$:-Wmissing-prototypes>) +add_compile_options($<$:-Wsystem-headers>) +add_compile_options($<$:-Wuninitialized>) +add_compile_options($<$:-Wno-dangling-else>) +add_compile_options(-Wstack-protector -fstack-protector) +add_compile_options(-Wstrict-aliasing -fstrict-aliasing) + +include_directories(${CMAKE_CURRENT_BINARY_DIR}) + +set(MAIN_PROTOS + cl/extern.h common/extern.h ex/extern.h vi/extern.h + common/options_def.h ex/ex_def.h ex/version.h) + +set(CL_SRCS + cl/cl_funcs.c cl/cl_main.c cl/cl_read.c cl/cl_screen.c cl/cl_term.c) + +set(COMMON_SRCS + common/conv.c common/cut.c common/delete.c common/encoding.c common/exf.c + common/key.c common/line.c common/log.c common/main.c common/mark.c + common/msg.c common/options.c common/options_f.c common/put.c + common/recover.c common/screen.c common/search.c common/seq.c + common/util.c) + +set(EX_SRCS + ex/ex.c ex/ex_abbrev.c ex/ex_append.c ex/ex_args.c ex/ex_argv.c ex/ex_at.c + ex/ex_bang.c ex/ex_cd.c ex/ex_cmd.c ex/ex_cscope.c ex/ex_delete.c + ex/ex_display.c ex/ex_edit.c ex/ex_equal.c ex/ex_file.c ex/ex_filter.c + ex/ex_global.c ex/ex_init.c ex/ex_join.c ex/ex_map.c ex/ex_mark.c + ex/ex_mkexrc.c ex/ex_move.c ex/ex_open.c ex/ex_preserve.c ex/ex_print.c + ex/ex_put.c ex/ex_quit.c ex/ex_read.c ex/ex_screen.c ex/ex_script.c + ex/ex_set.c ex/ex_shell.c ex/ex_shift.c ex/ex_source.c ex/ex_stop.c + ex/ex_subst.c ex/ex_tag.c ex/ex_txt.c ex/ex_undo.c ex/ex_usage.c + ex/ex_util.c ex/ex_version.c ex/ex_visual.c ex/ex_write.c ex/ex_yank.c + ex/ex_z.c) + +set(VI_SRCS + vi/getc.c vi/v_at.c vi/v_ch.c vi/v_cmd.c vi/v_delete.c vi/v_ex.c + vi/v_increment.c vi/v_init.c vi/v_itxt.c vi/v_left.c vi/v_mark.c + vi/v_match.c vi/v_paragraph.c vi/v_put.c vi/v_redraw.c vi/v_replace.c + vi/v_right.c vi/v_screen.c vi/v_scroll.c vi/v_search.c vi/v_section.c + vi/v_sentence.c vi/v_status.c vi/v_txt.c vi/v_ulcase.c vi/v_undo.c + vi/v_util.c vi/v_word.c vi/v_xchar.c vi/v_yank.c vi/v_z.c vi/v_zexit.c + vi/vi.c vi/vs_line.c vi/vs_msg.c vi/vs_refresh.c vi/vs_relative.c + vi/vs_smap.c vi/vs_split.c) + +set(REGEX_SRCS + regex/regcomp.c regex/regerror.c regex/regexec.c regex/regfree.c) + +# commands to generate the public headers +set(extract_protos sed -n 's/^ \\* PUBLIC: \\\(.*\\\)/\\1/p') +set(extract_version sed -n + 's/^.*version \\\([^\)]*\)\\\).*/\#define VI_VERSION \\\"\\1\\\"/p') + +add_custom_command(OUTPUT cl/extern.h + COMMAND ${extract_protos} ${CL_SRCS} > cl/extern.h + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + DEPENDS ${CL_SRCS}) +add_custom_command(OUTPUT common/extern.h + COMMAND ${extract_protos} ${COMMON_SRCS} > common/extern.h + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + DEPENDS ${COMMON_SRCS}) +add_custom_command(OUTPUT ex/extern.h + COMMAND ${extract_protos} ${EX_SRCS} > ex/extern.h + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + DEPENDS ${EX_SRCS}) +add_custom_command(OUTPUT vi/extern.h + COMMAND ${extract_protos} ${VI_SRCS} > vi/extern.h + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + DEPENDS ${VI_SRCS}) +add_custom_command(OUTPUT common/options_def.h + COMMAND awk -f common/options.awk + common/options.c > common/options_def.h + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + DEPENDS common/options.c) +add_custom_command(OUTPUT ex/ex_def.h + COMMAND awk -f ex/ex.awk ex/ex_cmd.c > ex/ex_def.h + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + DEPENDS ex/ex_cmd.c) +add_custom_command(OUTPUT ex/version.h + COMMAND ${extract_version} README > ex/version.h + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + DEPENDS README) + +add_executable(nvi) +target_sources(nvi PRIVATE ${MAIN_PROTOS} ${CL_SRCS} ${COMMON_SRCS} + ${EX_SRCS} ${VI_SRCS}) +target_compile_definitions(nvi PRIVATE $<$:DEBUG> + $<$:COMLOG>) + +check_function_exists(openpty UTIL_IN_LIBC) +if(NOT UTIL_IN_LIBC) + find_library(UTIL_LIBRARY util) + target_link_libraries(nvi PRIVATE ${UTIL_LIBRARY}) +endif() + +check_function_exists(__b64_ntop RESOLV_IN_LIBC) +if(NOT RESOLV_IN_LIBC) + find_library(RESOLV_LIBRARY resolv) + target_link_libraries(nvi PRIVATE ${RESOLV_LIBRARY}) +endif() + +if(USE_WIDECHAR) + find_library(CURSES_LIBRARY NAMES ncursesw cursesw curses HINTS /usr/lib) + + # link to the wchar_t awared BSD libregex.a + add_library(regex STATIC) + target_sources(regex PRIVATE ${REGEX_SRCS}) + target_include_directories(regex PUBLIC regex) + target_compile_definitions(regex PUBLIC __REGEX_PRIVATE) + target_link_libraries(nvi PRIVATE regex) +else() + find_library(CURSES_LIBRARY NAMES ncurses curses HINTS /usr/lib) + target_compile_options(nvi PRIVATE -Wno-pointer-sign) +endif() + +target_link_libraries(nvi PRIVATE ${CURSES_LIBRARY}) + +if(USE_ICONV) + check_function_exists(__iconv ICONV_IN_LIBC) + if(NOT ICONV_IN_LIBC) + find_path(ICONV_INCLUDE_DIR iconv.h) + find_library(ICONV_LIBRARY iconv) + endif() + + # detect the prototype of iconv(3) + set(CMAKE_C_FLAGS_BACKUP "${CMAKE_C_FLAGS}") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror") + set(CMAKE_REQUIRED_INCLUDES "${ICONV_INCLUDE_DIR}") + set(CMAKE_REQUIRED_LIBRARIES "${ICONV_LIBRARY}") + check_c_source_compiles(" + #include + int main() { + iconv_t conv = 0; + char* in = 0; + size_t ilen = 0; + char* out = 0; + size_t olen = 0; + iconv(conv, &in, &ilen, &out, &olen); + return 0; + } + " ICONV_TRADITIONAL) + set(CMAKE_REQUIRED_INCLUDES) + set(CMAKE_REQUIRED_LIBRARIES) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS_BACKUP}") + + target_include_directories(nvi PRIVATE ${ICONV_INCLUDE_DIR}) + target_link_libraries(nvi PRIVATE ${ICONV_LIBRARY}) +endif() + +check_include_files(libutil.h HAVE_LIBUTIL_H) +check_include_files(ncurses.h HAVE_NCURSES_H) +check_include_files(term.h HAVE_TERM_H) + +configure_file(files/config.h.in config.h) + +set(vi_cv_path_preserve /var/tmp/vi.recover/) +if(APPLE) + set(vi_cv_path_msgcat /usr/local/share/vi/catalog/) +else() + set(vi_cv_path_msgcat /usr/share/vi/catalog/) +endif() + +configure_file(files/pathnames.h.in pathnames.h) +configure_file(files/recover.in recover @ONLY) Modified: head/contrib/nvi/LICENSE ============================================================================== --- head/contrib/nvi/LICENSE Wed Sep 9 08:19:22 2020 (r365498) +++ head/contrib/nvi/LICENSE Wed Sep 9 08:38:47 2020 (r365499) @@ -1,7 +1,3 @@ -/*- - * $Id: LICENSE,v 8.18 2011/07/10 11:58:35 zy Exp $ - */ - The following are the copyrights and redistribution conditions that apply to this copy of the Vi software. Modified: head/contrib/nvi/README ============================================================================== --- head/contrib/nvi/README Wed Sep 9 08:19:22 2020 (r365498) +++ head/contrib/nvi/README Wed Sep 9 08:38:47 2020 (r365499) @@ -1,6 +1,4 @@ -# $Id: README,v 9.2 2015/04/08 17:18:56 zy Exp $ - -This is version 2.1.3 (2015-04-08) of nex/nvi, a reimplementation of the ex/vi +This is version 2.2.0 (2020-08-01) of nex/nvi, a reimplementation of the ex/vi text editors originally distributed as part of the Fourth Berkeley Software Distribution (4BSD), by the University of California, Berkeley. @@ -8,12 +6,12 @@ The directory layout is as follows: LICENSE ....... Copyright, use and redistribution information. README ........ This file. - build ......... Build directory. catalog ....... Message catalogs; see catalog/README. cl ............ Vi interface to the curses(3) library. common ........ Code shared by ex and vi. - docs .......... Ex/vi documentation, both current and historic. ex ............ Ex source code. + files ......... Template files. + man ........... Ex/vi documentation. regex ......... Modified regex library with wide character support. vi ............ Vi source code. @@ -29,7 +27,7 @@ o Nvi was written by Keith Bostic, and the last versio The following acknowledgments were written by Keith Bostic: =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -o This software is several years old and is the product of many folks' work. +o This software is several years old and is the product of many folks' work. This software was originally derived from software contributed to the University of California, Berkeley by Steve Kirkendall, the Modified: head/contrib/nvi/catalog/Makefile ============================================================================== --- head/contrib/nvi/catalog/Makefile Wed Sep 9 08:19:22 2020 (r365498) +++ head/contrib/nvi/catalog/Makefile Wed Sep 9 08:38:47 2020 (r365499) @@ -1,7 +1,5 @@ -# $Id: Makefile,v 9.0 2012/10/19 15:13:11 zy Exp $ - -CAT= dutch english french german polish ru_RU.KOI8-R spanish swedish \ - uk_UA.KOI8-U zh_CN.GB2312 +CAT= dutch english french german polish ru_RU.KOI8-R spanish \ + swedish tr_TR.ISO8859-9 tr_TR.UTF-8 uk_UA.KOI8-U zh_CN.GB2312 FILES= ../cl/*.c ../common/*.c ../ex/*.c ../vi/*.c all: dump ${CAT} @@ -33,7 +31,8 @@ ${CAT}: english.base CHK= dutch.check english.check french.check german.check \ polish.check ru_RU.KOI8-R.check spanish.check swedish.check \ - uk_UA.KOI8-U.check zh_CN.GB2312.check + tr_TR.ISO8859-9.check tr_TR.UTF-8.check uk_UA.KOI8-U.check \ + zh_CN.GB2312.check check: ${CHK} ${CHK}: ${CAT} @echo "... $@"; \ Modified: head/contrib/nvi/catalog/README ============================================================================== --- head/contrib/nvi/catalog/README Wed Sep 9 08:19:22 2020 (r365498) +++ head/contrib/nvi/catalog/README Wed Sep 9 08:38:47 2020 (r365499) @@ -1,5 +1,3 @@ -# $Id: README,v 9.0 2012/10/19 17:06:15 zy Exp $ - Generally, all non-system error and informational messages in nvi are catalog messages, i.e. they can be tailored to a specific langauge. Command strings, usage strings, system errors and other 'known text' Modified: head/contrib/nvi/catalog/dump.c ============================================================================== --- head/contrib/nvi/catalog/dump.c Wed Sep 9 08:19:22 2020 (r365498) +++ head/contrib/nvi/catalog/dump.c Wed Sep 9 08:38:47 2020 (r365499) @@ -27,10 +27,7 @@ * SUCH DAMAGE. */ -#ifndef lint -static char sccsid[] = "@(#)dump.c 8.1 (Berkeley) 8/31/94"; -#endif /* not lint */ - +#include #include #include Copied: head/contrib/nvi/catalog/tr_TR.ISO8859-9.base (from r365495, vendor/nvi/dist/catalog/tr_TR.ISO8859-9.base) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/nvi/catalog/tr_TR.ISO8859-9.base Wed Sep 9 08:38:47 2020 (r365499, copy of r365495, vendor/nvi/dist/catalog/tr_TR.ISO8859-9.base) @@ -0,0 +1,304 @@ +002 "Satýr uzunluðu taþýmý" +003 "%lu numaralý satýr silinemiyor" +004 "%lu numaralý satýra iliþtirilemiyor" +005 "%lu numaralý satýrda ekleme yapýlamýyor" +006 "%lu numaralý satýr kaydedilemiyor" +007 "Son satýr alýnamýyor" +008 "Hata: %lu numaralý satýr okunamýyor" +009 "Günlük dosyasý" +010 "Günlükleme gerçekleþtirilmiyor, geri alma olanaklý deðil" +011 "Geri alýnacak bir deðiþiklik yok" +012 "Günlükleme gerçekleþtirilmiyor, geri alma olanaklý deðil" +013 "Günlükleme gerçekleþtirilmiyor, ileri sarma olanaklý deðil" +014 "Yinelenecek bir deðiþiklik yok" +015 "%s/%d: Günlük kayýt hatasý" +016 "Vi'nin standart girdisi ve çýktýsý bir uçbirim olmalý" +017 "Ým %s: Ayarlanmamýþ" +018 "Ým %s: Satýr silinmiþ" +019 "Ým %s: Ýmleç konumu artýk yok" +020 "Hata: " +021 "yeni dosya +022 "adý deðiþti" +023 "deðiþtirildi" +024 "deðiþtirilmedi" +025 "KÝLÝDÝ AÇILDI" +026 "saltokunur" +027 "satýr %lu/%lu [%ld%%]" +028 "boþ dosya" +029 "%lu. satýr" +030 "%s dosyasý bir ileti kataloðu deðil" +031 "Öntanýmlý %s seçeneði ayarlanamadý" +032 "Kullaným: %s" +033 "set: %s seçeneði yok: 'set all' tüm seçenek deðerlerini verir" +034 "set: [no]%s seçeneði bir deðer almaz" +035 "set: %s seçeneði bir Boole deðeri deðil" +036 "set: %s seçeneði: %s" +037 "set: %s seçeneði: %s: Deðer taþýmý" +038 "set: %s seçeneði: %s izin verilmeyen bir sayý" +039 "set: %s seçeneði bir Boole deðeri deðil" +040 "Ekran sütun sayýsý çok küçük, þundan daha az: %d" +041 "Ekran sütun sayýsý çok büyük, þundan daha çok: %d" +042 "Ekran satýr sayýsý çok küçük, þundan daha az: %d" +043 "Ekran satýr sayýsý çok büyük, þundan daha çok: %d" +044 "Lisp seçeneði eklenmemiþ" +045 "Ýletiler kapatýlmamýþ: %s" +046 "Ýletiler açýlmamýþ: %s" +047 "%s seçeneði iki karakterli öbekler biçiminde olmalý" +053 "Baþlangýç arabelleði boþ" +054 "%s arabelleði boþ" +056 "Oturum baþarýsýz olursa deðiþiklikler kurtarýlamaz" +057 "Dosya, kurtarma için kopyalanýyor..." +058 "Koruma baþarýsýz oldu: %s" +059 "Oturum baþarýsýz olursa deðiþiklikler kurtarýlamaz" +060 "Dosya yedeklemesi baþarýsýz oldu: %s" +061 "Dosya, kurtarma için kopyalanýyor..." +062 "%u kullanýcýsý üzerine bilgi bulunamadý" +063 "Kurtarma dosyasý kilitlenemiyor" +065 "Kurtarma dosyasý" +066 "%s: Hatalý oluþturulmuþ kurtarma dosyasý" +067 "%s: Hatalý oluþturulmuþ kurtarma dosyasý" +068 "Kurtarýlacak %s adýnda sizce okunabilir bir dosya yok" +069 "Bu dosyanýn kurtarabileceðiniz eski sürümleri var" +070 "Kurtarabileceðiniz baþka dosyalar var" +071 "E-posta gönderilmedi: %s" +072 "Dosya boþ, aranacak bir þey yok" +073 "Dizgi bulunamadan dosyanýn sonuna eriþildi" +074 "Arama dizgisi yok" +075 "Dizgi bulunamadý" +076 "Dizgi bulunamadan dosyanýn baþýna eriþildi" +077 "Arama tamamlandý" +078 "Aranýyor..." +079 "Yazdýrýlamaz karakter bulunmadý" +080 "Bilinmeyen komut adý" +082 "%s: Komut ex kipinde kullanýlamaz" +083 "Sayým sýfýr olmayabilir" +084 "%s: Hatalý satýr belirtimi" +085 "Ýç sözdizim tablo hatasý (%s: %s)" +086 "Kullaným: %s" +087 "%s: Geçici arabellek salýverilmedi" +088 "Bayrak göreli konumu birinci satýrdan önceye" +089 "Bayrak göreli konumu dosya sonunu geçiyor" +090 "Erimli @, dosya/ekran deðiþtiðinde çalýþýr" +091 "Global/v komutu dosya/ekran deðiþtiðinde çalýþýr" +092 "Ex komutu baþarýsýz: Sýradaki komutlar çýkarýldý" +093 "Ex komutu baþarýsýz: Eþlemlenen düðmeler çýkarýldý" +094 "Ýkinci adres ilkinden daha küçük" +095 "Bir im adý saðlanmadý" +096 "\\ sonrasýnda / veya ? gelmiyor" +097 "Bir satýr numarasýna yapýlan baþvuru sayýsý sýfýrdan az" +098 "Bilinmeyen komut: %s" +099 "Adres deðeri taþýmý" +100 "Adres deðeri alttaþýmý" +101 "Ýzin verilmeyen adres birleþimi" +102 "Ýzin verilmeyen adres: Dosyada yalnýzca %lu satýr var" +103 "Ýzin verilmeyen adres: Dosya boþ" +104 "%s komutu bir 0 adresine izin vermiyor" +105 "Görüntülenecek kýsaltma yok" +106 "Kýsaltmalar bir \"sözcük\" karakteri ile bitmelidir" +107 "Kýsaltmalar sekme veya boþluk içeremez" +108 "Kýsaltmalar sonu dýþýnda sözcük/sözcük olmayan karakterleri karýþtýramaz" +109 "\"%s\" bir kýsaltma deðil" +110 "Vi komutu baþarýsýz: Eþlemlenen düðmeler çýkarýldý" +111 "Düzenlenecek baþka dosya yok" +112 "Öncesinde düzenlenecek baþka dosya yok" +113 "Öncesinde geri sarýlacak dosyalar yok" +114 "Görüntülenecek dosya yok" +115 "Öncesinde \"!\" ögesinin yerine geçecek bir komut yok" +116 "%% yerine geçecek bir dosya adý yok" +117 "# yerine geçecek bir dosya adý yok" +118 "Hata: execl: %s" +119 "Girdi/Çýktý hatasý: %s" +120 "Dosya son tam yazýmdan bu yana deðiþtirilmiþ; yazýn veya yok saymak için ! kullanýn" +121 "Ev dizini konumu bulunamýyor" +122 "Yeni þimdiki dizin: %s" +123 "Görüntülenecek kesilmiþ arabellek yok" +124 "%s komutu bir global veya v komutunun parçasý olarak kullanýlamaz" +128 "%s: kaynak alýnmýyor: Ýyesi siz veya kök deðil" +129 "%s: kaynak alýnmýyor: Ýyesi siz deðilsiniz" +130 "%s: kaynak alýnmýyor: Ýyesi dýþýnda baþka bir kullanýcý tarafýndan yazýlabilir" +131 "Uç uca eklenecek bir satýr yok" +132 "Girdi eþlem girdisi yok" +133 "Komut eþlem girdisi yok" +134 "%s yeniden eþlemlenemeyebilir" +135 "\"%s\" þu anda eþlemlenmemiþ" +136 "Ým adlarý tek bir karakter olmalýdýr" +137 "%s mevcut, yazýlmamýþ; yok saymak için ! kullanýn" +138 "Yeni exrc dosyasý: %s" +139 "Hedef satýrý taþýma erimi içinde" +140 "'open' komutu 'open' seçeneðinin ayarlý olmasýný gerektirir" +141 "'open' komutu henüz eklenmemiþ" +142 "Bu dosyanýn korunmasý olanaklý deðil" +143 "Dosya korundu" +144 "%s: Çok fazla dosya adýna geniþletilmiþ" +145 "Yalnýzca sýradan dosyalar ve adlandýrýlmýþ veri yollarý okunabilir" +146 "%s: Okuma kilidi kullanýlabilir deðildi" +147 "Okunuyor..." +148 "%s: %lu satýr, %lu karakter" +149 "Görüntülenecek arkaplan ekraný yok" +150 "'script' komutu yalnýzca vi kipinde kullanýlabilir" +151 "Çalýþtýrýlacak komut yok" +152 "'shiftwidth' seçeneði 0 olarak ayarlanmýþ" +153 "Sayým taþýmý" +154 "Sayým alttaþýmý" +155 "Düzenli ifade belirtilmiþ; r bayraðý anlamsýz" +156 "#, l ve p bayraklarý vi kipinde c bayraðý ile birlikte kullanýlamaz" +157 "Eþleþme bulunamadý" +158 "Önceden bir etiket girilmemiþ" +159 "Etiket yýðýnýnda %s sayýsýndan az girdi; :display t[ags] kullanýn" +160 "Etiket yýðýnýnda dönülecek bir %s dosyasý yok; :display t[ags] kullanýn" +161 "Sürdürmek için Enter'a basýn:" +162 "%s: Etiket bulunamadý" +163 "%s: %s içinde hasar görmüþ etiket" +164 "%s: Etiketin satýr numarasý dosya sonunu geçmiþ" +165 "Etiket yýðýný boþ" +166 "%s: Arama dizgisi bulunamadý" +167 "%d dosya daha düzenlenecek" +168 "%s arabelleði boþ" +169 "Deðiþikliði onayla? [n]" +170 "Yarýda kesildi" +171 "Öncesinde çalýþtýrýlacak arabellek yok" +172 "Öncesinde düzenli ifade yok" +173 "%s komutu bir dosyanýn halihazýrda okunmuþ olmasýný gerektirir" +174 "Kullaným: %s" +175 "'visual' komutu 'open' seçeneðinin ayarlanmýþ olmasýný gerektirir" +177 "Boþ dosya" +178 "Öncesinde F, f, T veya t aramasý yok" +179 "%s bulunamadý" +180 "Düzenlenecek dosya yok" +181 "Ýmleç bir sayýda deðil" +182 "Ortaya çýkan sayý çok büyük" +183 "Ortaya çýkan sayý çok küçük" +184 "Bu satýrda eþleþen karakter yok" +185 "Eþleþen karakter bulunamadý" +186 "Deðiþtirilecek karakter yok" +187 "Geçilecek baþka ekran yok" +188 "Arama dizgisinden, satýr ofsetinden ve/veya 'z' komutundan sonraki karakterler" +189 "Öncesinde arama dizgisi yok" +190 "Arama baþlanan konumda tamamlandý" +191 "Kýsaltma geniþleme sýnýrýný aþtý: Karakterler çýkarýldý" +192 "Ýzin verilmeyen karakter; giriþ için týrnak içine alýn" +193 "Halihazýrda eklemenin baþýnda" +194 "Silinecek baþka karakter yok" +195 "Hareket dosya sonunu geçti" +196 "Hareket satýr sonunu geçti" +197 "Ýmleç hareket ettirilmedi" +198 "Halihazýrda dosyanýn baþýnda" +199 "Hareket dosyanýn baþýný geçti" +200 "Halihazýrda ilk sütunda" +201 "Arabellekler komuttan önce belirtilmeli" +202 "Halihazýrda dosya sonunda" +203 "Halihazýrda satýr sonunda" +204 "%s bir vi komutu deðil" +205 "Kullaným: %s" +206 "Silinecek karakter yok" +207 "Q komutu ex uçbirim arabirimini gerektirir" +208 "Yinelenecek komut yok" +209 "Dosya boþ" +210 "%s bir hareket komutu olarak kullanýlamaz" +211 "Halihazýrda komut kipi içinde" +212 "Ýmleç bir sözcükte deðil" +214 "'windows' seçeneði deðeri çok büyük, en çok %u olabilir" +215 "Ýliþtir" +216 "Deðiþiklik yap" +217 "Komut" +218 "Ekle" +219 "Deðiþtir" +220 "Hareket ekran sonunu geçti" +221 "Hareket ekran baþýný geçti" +222 "Ekran bölünebilmesi için %d satýrdan daha geniþ olmalýdýr" +223 "Arkaplan ekraný yok" +224 "Arkaplanda %s dosyasýný düzenleyen bir ekran yok" +225 "Açýk olan tek ekranýnýzý arkaplana alamazsýnýz" +226 "Ekran yalnýzca %d satýra küçültülebilir" +227 "Ekran küçülemez" +228 "Ekran büyüyemez" +230 "Bu ekran askýya alýnamaz" +231 "Yarýda kesildi: Eþlemlenen düðmeler çýkarýldý" +232 "vi: Geçici arabellek salýverilmedi" +233 "Bu uçbirimde %s düðmesi yok" +234 "Yalnýzca bir arabellek belirtilebilir" +235 "Sayý þundan daha büyük: %lu" +236 "Yarýda kesildi" +237 "Geçici dosya oluþturulamýyor" +238 "Uyarý: %s sýradan bir dosya deðil" +239 "%s halihazýrda kilitlenmiþ, oturum saltokunur" +240 "%s: Kaldýr" +241 "%s: Kapat" +242 "%s: Kaldýr" +243 "%s: Kaldýr" +244 "Saltokunur dosya, yazýlmadý; yok saymak için ! kullanýn" +245 "Saltokunur dosya, yazýlmadý" +246 "%s mevcut, yazýlmadý; yok saymak için ! kullanýn" +247 "%s mevcut, yazýlmadý" +248 "Kýsmi dosya, yazýlmadý; yok saymak için ! kullanýn" +249 "Kýsmi dosya, yazýlmadý" +250 "%s: Dosya bu kopyadan daha önce deðiþtirilmiþ; yok saymak için ! kullanýn" +251 "%s: Dosya bu kopyadan daha önce deðiþtirilmiþ" +252 "%s: Yazým korumasý kullanýlabilir deðildi" +253 "Yazýlýyor..." +254 "%s: UYARI: DOSYA KIRPILMIÞ" +255 "Halihazýrda bu grubun ilk etiketinde" +256 "%s: Yeni dosya: %lu satýr, %lu karakter" +257 "%s: %lu satýr, %lu karakter" +258 "%s çok fazla dosya adýna geniþletilmiþ" +259 "%s: Sýradan bir dosya deðil" +260 "%s: Ýyesi siz deðilsiniz" +261 "%s: Ýyesi dýþýnda baþka bir kullanýcý tarafýndan da eriþilebilir" +262 "Dosya son tam yazýmdan bu yana deðiþtirilmiþ; yazýn veya yok saymak için ! kullanýn" +263 "Dosya son tam yazýmdan bu yana deðiþtirilmiþ; yazýn veya yok saymak için :edit! kullanýn" +264 "Dosya son tam yazýmdan bu yana deðiþtirilmiþ; yazýn veya yok saymak için ! kullanýn" +265 "Dosya geçici; çýkarsanýz deðiþiklikler atýlacaktýr" +266 "Dosya saltokunur, deðiþiklikler kendiliðinden yazýlmaz" +267 "Günlük yeniden baþlatýldý" +268 "Onayla? [ynq]" +269 "Sürdürmek için herhangi bir düðmeye basýn: " +270 "Sürdürmek için herhangi bir düðmeye basýn [ex komutu girmek için :]: " +271 "Sürdürmek için herhangi bir düðmeye basýn [çýkýþ için q]: " +272 "Bu biçim %s ex uçbirim arabirimini gerektirir" +273 "ex girdisi kipine giriliyor" +274 "Komut baþarýsýz, henüz bir dosya okunmadý." +275 " sürdür?" +276 "Beklenmedik karakter olayý" +277 "Beklenmedik dosya sonu olayý" +278 "Sorgu eþleþmesi bulunamadý" +279 "Beklenmedik yarýda kesme olayý" +281 "Beklenmedik yeniden boyama olayý" +282 "Halihazýrda bu grubun son etiketinde" +283 "%s komutu ex uçbirim arabirimini gerektirir" +284 "Bu biçim %s 'secure edit' seçeneði ayarlandýðýnda desteklenmez" +285 "Beklenmedik dizi olayý" +286 "Beklenmedik zaman aþýmý olayý" +288 "Bölünebilmesi için ekran %d sütundan daha geniþ olmalýdýr" +289 "Kabuk geniþletmeleri 'secure edit' seçeneði ayarlandýðýnda desteklenmez" +290 "%s komutu 'secure edit' seçeneði ayarlandýðýnda desteklenmez" +291 "set: %s seçeneði kapatýlamaz" +292 "Ekran çok küçük." +293 "eklendi" +294 "deðiþtirildi" +295 "silindi" +296 "uç uca eklendi" +297 "taþýndý" +298 "kaydýrýldý" +299 "kopyalandý" +300 "satýr" +301 "satýr" +303 "Dosya son yazýmdan bu yana deðiþtirilmiþ." +304 "Kabuk geniþletmesi baþarýsýz" +305 "Bir '%s' düzenleme seçeneði belirtilmedi" +307 "Çalýþtýrýlacak ex komutu yok" +308 "Bir komut çalýþtýrmak için , çýkmak için :q girin" +309 "Yardým için \"cscope help\" kullanýn" +310 "Çalýþan bir cscope baðlantýsý yok" +311 "%s: Bilinmeyen arama türü: Þunlardan bir tanesini kullanýn: %s" +312 "%d: Böyle bir cscope oturumu yok" +313 "set: %s seçeneði hiçbir zaman açýlamaz" +314 "set: %s seçeneði hiçbir zaman 0 olarak ayarlanamaz" +315 "%s: Ýliþtirildi: %lu satýr, %lu karakter" +316 "Beklenmedik yeniden boyutlandýrma olayý" +317 "Düzenlenecek %d dosya var" +319 "%d ekran arkaplana alýndý; onlarý listelemek için :display kullanýn" +320 "Bilinmeyen imleç konumu" +321 "Dosya kodlama dönüþtürmesi desteklenmiyor" +322 "Girdi kodlama dönüþtürmesi desteklenmiyor" +323 "Geçersiz girdi. Kýrpýldý." +324 "%d numaralý satýrda dönüþtürme hatasý" Copied: head/contrib/nvi/catalog/tr_TR.ISO8859-9.owner (from r365495, vendor/nvi/dist/catalog/tr_TR.ISO8859-9.owner) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/nvi/catalog/tr_TR.ISO8859-9.owner Wed Sep 9 08:38:47 2020 (r365499, copy of r365495, vendor/nvi/dist/catalog/tr_TR.ISO8859-9.owner) @@ -0,0 +1 @@ +Emir SARI Copied: head/contrib/nvi/catalog/tr_TR.UTF-8.base (from r365495, vendor/nvi/dist/catalog/tr_TR.UTF-8.base) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/nvi/catalog/tr_TR.UTF-8.base Wed Sep 9 08:38:47 2020 (r365499, copy of r365495, vendor/nvi/dist/catalog/tr_TR.UTF-8.base) @@ -0,0 +1,304 @@ +002 "Satır uzunluÄŸu taşımı" +003 "%lu numaralı satır silinemiyor" +004 "%lu numaralı satıra iliÅŸtirilemiyor" +005 "%lu numaralı satırda ekleme yapılamıyor" +006 "%lu numaralı satır kaydedilemiyor" +007 "Son satır alınamıyor" +008 "Hata: %lu numaralı satır okunamıyor" +009 "Günlük dosyası" +010 "Günlükleme gerçekleÅŸtirilmiyor, geri alma olanaklı deÄŸil" +011 "Geri alınacak bir deÄŸiÅŸiklik yok" +012 "Günlükleme gerçekleÅŸtirilmiyor, geri alma olanaklı deÄŸil" +013 "Günlükleme gerçekleÅŸtirilmiyor, ileri sarma olanaklı deÄŸil" +014 "Yinelenecek bir deÄŸiÅŸiklik yok" +015 "%s/%d: Günlük kayıt hatası" +016 "Vi'nin standart girdisi ve çıktısı bir uçbirim olmalı" +017 "Ä°m %s: Ayarlanmamış" +018 "Ä°m %s: Satır silinmiÅŸ" +019 "Ä°m %s: Ä°mleç konumu artık yok" +020 "Hata: " +021 "yeni dosya +022 "adı deÄŸiÅŸti" +023 "deÄŸiÅŸtirildi" +024 "deÄŸiÅŸtirilmedi" +025 "KÄ°LÄ°DÄ° AÇILDI" +026 "saltokunur" +027 "satır %lu/%lu [%ld%%]" +028 "boÅŸ dosya" +029 "%lu. satır" +030 "%s dosyası bir ileti kataloÄŸu deÄŸil" +031 "Öntanımlı %s seçeneÄŸi ayarlanamadı" +032 "Kullanım: %s" +033 "set: %s seçeneÄŸi yok: 'set all' tüm seçenek deÄŸerlerini verir" +034 "set: [no]%s seçeneÄŸi bir deÄŸer almaz" +035 "set: %s seçeneÄŸi bir Boole deÄŸeri deÄŸil" +036 "set: %s seçeneÄŸi: %s" +037 "set: %s seçeneÄŸi: %s: DeÄŸer taşımı" +038 "set: %s seçeneÄŸi: %s izin verilmeyen bir sayı" +039 "set: %s seçeneÄŸi bir Boole deÄŸeri deÄŸil" +040 "Ekran sütun sayısı çok küçük, ÅŸundan daha az: %d" +041 "Ekran sütun sayısı çok büyük, ÅŸundan daha çok: %d" +042 "Ekran satır sayısı çok küçük, ÅŸundan daha az: %d" +043 "Ekran satır sayısı çok büyük, ÅŸundan daha çok: %d" +044 "Lisp seçeneÄŸi eklenmemiÅŸ" +045 "Ä°letiler kapatılmamış: %s" +046 "Ä°letiler açılmamış: %s" +047 "%s seçeneÄŸi iki karakterli öbekler biçiminde olmalı" +053 "BaÅŸlangıç arabelleÄŸi boÅŸ" +054 "%s arabelleÄŸi boÅŸ" +056 "Oturum baÅŸarısız olursa deÄŸiÅŸiklikler kurtarılamaz" +057 "Dosya, kurtarma için kopyalanıyor..." +058 "Koruma baÅŸarısız oldu: %s" +059 "Oturum baÅŸarısız olursa deÄŸiÅŸiklikler kurtarılamaz" +060 "Dosya yedeklemesi baÅŸarısız oldu: %s" +061 "Dosya, kurtarma için kopyalanıyor..." +062 "%u kullanıcısı üzerine bilgi bulunamadı" +063 "Kurtarma dosyası kilitlenemiyor" +065 "Kurtarma dosyası" +066 "%s: Hatalı oluÅŸturulmuÅŸ kurtarma dosyası" +067 "%s: Hatalı oluÅŸturulmuÅŸ kurtarma dosyası" +068 "Kurtarılacak %s adında sizce okunabilir bir dosya yok" +069 "Bu dosyanın kurtarabileceÄŸiniz eski sürümleri var" +070 "KurtarabileceÄŸiniz baÅŸka dosyalar var" +071 "E-posta gönderilmedi: %s" +072 "Dosya boÅŸ, aranacak bir ÅŸey yok" +073 "Dizgi bulunamadan dosyanın sonuna eriÅŸildi" +074 "Arama dizgisi yok" +075 "Dizgi bulunamadı" +076 "Dizgi bulunamadan dosyanın başına eriÅŸildi" +077 "Arama tamamlandı" +078 "Aranıyor..." +079 "Yazdırılamaz karakter bulunmadı" +080 "Bilinmeyen komut adı" +082 "%s: Komut ex kipinde kullanılamaz" +083 "Sayım sıfır olmayabilir" +084 "%s: Hatalı satır belirtimi" +085 "İç sözdizim tablo hatası (%s: %s)" +086 "Kullanım: %s" +087 "%s: Geçici arabellek salıverilmedi" +088 "Bayrak göreli konumu birinci satırdan önceye" +089 "Bayrak göreli konumu dosya sonunu geçiyor" +090 "Erimli @, dosya/ekran deÄŸiÅŸtiÄŸinde çalışır" +091 "Global/v komutu dosya/ekran deÄŸiÅŸtiÄŸinde çalışır" +092 "Ex komutu baÅŸarısız: Sıradaki komutlar çıkarıldı" +093 "Ex komutu baÅŸarısız: EÅŸlemlenen düğmeler çıkarıldı" +094 "Ä°kinci adres ilkinden daha küçük" +095 "Bir im adı saÄŸlanmadı" +096 "\\ sonrasında / veya ? gelmiyor" +097 "Bir satır numarasına yapılan baÅŸvuru sayısı sıfırdan az" +098 "Bilinmeyen komut: %s" +099 "Adres deÄŸeri taşımı" +100 "Adres deÄŸeri alttaşımı" +101 "Ä°zin verilmeyen adres birleÅŸimi" +102 "Ä°zin verilmeyen adres: Dosyada yalnızca %lu satır var" +103 "Ä°zin verilmeyen adres: Dosya boÅŸ" +104 "%s komutu bir 0 adresine izin vermiyor" +105 "Görüntülenecek kısaltma yok" +106 "Kısaltmalar bir \"sözcük\" karakteri ile bitmelidir" +107 "Kısaltmalar sekme veya boÅŸluk içeremez" +108 "Kısaltmalar sonu dışında sözcük/sözcük olmayan karakterleri karıştıramaz" +109 "\"%s\" bir kısaltma deÄŸil" +110 "Vi komutu baÅŸarısız: EÅŸlemlenen düğmeler çıkarıldı" +111 "Düzenlenecek baÅŸka dosya yok" +112 "Öncesinde düzenlenecek baÅŸka dosya yok" +113 "Öncesinde geri sarılacak dosyalar yok" +114 "Görüntülenecek dosya yok" +115 "Öncesinde \"!\" ögesinin yerine geçecek bir komut yok" +116 "%% yerine geçecek bir dosya adı yok" +117 "# yerine geçecek bir dosya adı yok" +118 "Hata: execl: %s" +119 "Girdi/Çıktı hatası: %s" +120 "Dosya son tam yazımdan bu yana deÄŸiÅŸtirilmiÅŸ; yazın veya yok saymak için ! kullanın" +121 "Ev dizini konumu bulunamıyor" +122 "Yeni ÅŸimdiki dizin: %s" +123 "Görüntülenecek kesilmiÅŸ arabellek yok" +124 "%s komutu bir global veya v komutunun parçası olarak kullanılamaz" +128 "%s: kaynak alınmıyor: Ä°yesi siz veya kök deÄŸil" +129 "%s: kaynak alınmıyor: Ä°yesi siz deÄŸilsiniz" +130 "%s: kaynak alınmıyor: Ä°yesi dışında baÅŸka bir kullanıcı tarafından yazılabilir" +131 "Uç uca eklenecek bir satır yok" +132 "Girdi eÅŸlem girdisi yok" +133 "Komut eÅŸlem girdisi yok" +134 "%s yeniden eÅŸlemlenemeyebilir" +135 "\"%s\" ÅŸu anda eÅŸlemlenmemiÅŸ" +136 "Ä°m adları tek bir karakter olmalıdır" +137 "%s mevcut, yazılmamış; yok saymak için ! kullanın" +138 "Yeni exrc dosyası: %s" +139 "Hedef satırı taşıma erimi içinde" +140 "'open' komutu 'open' seçeneÄŸinin ayarlı olmasını gerektirir" +141 "'open' komutu henüz eklenmemiÅŸ" +142 "Bu dosyanın korunması olanaklı deÄŸil" +143 "Dosya korundu" +144 "%s: Çok fazla dosya adına geniÅŸletilmiÅŸ" +145 "Yalnızca sıradan dosyalar ve adlandırılmış veri yolları okunabilir" +146 "%s: Okuma kilidi kullanılabilir deÄŸildi" +147 "Okunuyor..." +148 "%s: %lu satır, %lu karakter" +149 "Görüntülenecek arkaplan ekranı yok" +150 "'script' komutu yalnızca vi kipinde kullanılabilir" +151 "Çalıştırılacak komut yok" +152 "'shiftwidth' seçeneÄŸi 0 olarak ayarlanmış" +153 "Sayım taşımı" +154 "Sayım alttaşımı" +155 "Düzenli ifade belirtilmiÅŸ; r bayrağı anlamsız" +156 "#, l ve p bayrakları vi kipinde c bayrağı ile birlikte kullanılamaz" +157 "EÅŸleÅŸme bulunamadı" +158 "Önceden bir etiket girilmemiÅŸ" +159 "Etiket yığınında %s sayısından az girdi; :display t[ags] kullanın" +160 "Etiket yığınında dönülecek bir %s dosyası yok; :display t[ags] kullanın" +161 "Sürdürmek için Enter'a basın:" +162 "%s: Etiket bulunamadı" +163 "%s: %s içinde hasar görmüş etiket" +164 "%s: Etiketin satır numarası dosya sonunu geçmiÅŸ" +165 "Etiket yığını boÅŸ" +166 "%s: Arama dizgisi bulunamadı" +167 "%d dosya daha düzenlenecek" +168 "%s arabelleÄŸi boÅŸ" +169 "DeÄŸiÅŸikliÄŸi onayla? [n]" +170 "Yarıda kesildi" +171 "Öncesinde çalıştırılacak arabellek yok" +172 "Öncesinde düzenli ifade yok" +173 "%s komutu bir dosyanın halihazırda okunmuÅŸ olmasını gerektirir" +174 "Kullanım: %s" +175 "'visual' komutu 'open' seçeneÄŸinin ayarlanmış olmasını gerektirir" +177 "BoÅŸ dosya" +178 "Öncesinde F, f, T veya t araması yok" +179 "%s bulunamadı" +180 "Düzenlenecek dosya yok" +181 "Ä°mleç bir sayıda deÄŸil" +182 "Ortaya çıkan sayı çok büyük" +183 "Ortaya çıkan sayı çok küçük" +184 "Bu satırda eÅŸleÅŸen karakter yok" +185 "EÅŸleÅŸen karakter bulunamadı" +186 "DeÄŸiÅŸtirilecek karakter yok" +187 "Geçilecek baÅŸka ekran yok" +188 "Arama dizgisinden, satır ofsetinden ve/veya 'z' komutundan sonraki karakterler" +189 "Öncesinde arama dizgisi yok" +190 "Arama baÅŸlanan konumda tamamlandı" +191 "Kısaltma geniÅŸleme sınırını aÅŸtı: Karakterler çıkarıldı" +192 "Ä°zin verilmeyen karakter; giriÅŸ için tırnak içine alın" +193 "Halihazırda eklemenin başında" +194 "Silinecek baÅŸka karakter yok" +195 "Hareket dosya sonunu geçti" +196 "Hareket satır sonunu geçti" +197 "Ä°mleç hareket ettirilmedi" +198 "Halihazırda dosyanın başında" +199 "Hareket dosyanın başını geçti" +200 "Halihazırda ilk sütunda" +201 "Arabellekler komuttan önce belirtilmeli" +202 "Halihazırda dosya sonunda" +203 "Halihazırda satır sonunda" +204 "%s bir vi komutu deÄŸil" +205 "Kullanım: %s" +206 "Silinecek karakter yok" +207 "Q komutu ex uçbirim arabirimini gerektirir" +208 "Yinelenecek komut yok" +209 "Dosya boÅŸ" +210 "%s bir hareket komutu olarak kullanılamaz" +211 "Halihazırda komut kipi içinde" +212 "Ä°mleç bir sözcükte deÄŸil" +214 "'windows' seçeneÄŸi deÄŸeri çok büyük, en çok %u olabilir" +215 "Ä°liÅŸtir" +216 "DeÄŸiÅŸiklik yap" +217 "Komut" +218 "Ekle" +219 "DeÄŸiÅŸtir" +220 "Hareket ekran sonunu geçti" +221 "Hareket ekran başını geçti" +222 "Ekran bölünebilmesi için %d satırdan daha geniÅŸ olmalıdır" +223 "Arkaplan ekranı yok" +224 "Arkaplanda %s dosyasını düzenleyen bir ekran yok" +225 "Açık olan tek ekranınızı arkaplana alamazsınız" +226 "Ekran yalnızca %d satıra küçültülebilir" +227 "Ekran küçülemez" +228 "Ekran büyüyemez" +230 "Bu ekran askıya alınamaz" +231 "Yarıda kesildi: EÅŸlemlenen düğmeler çıkarıldı" +232 "vi: Geçici arabellek salıverilmedi" +233 "Bu uçbirimde %s düğmesi yok" +234 "Yalnızca bir arabellek belirtilebilir" +235 "Sayı ÅŸundan daha büyük: %lu" +236 "Yarıda kesildi" +237 "Geçici dosya oluÅŸturulamıyor" +238 "Uyarı: %s sıradan bir dosya deÄŸil" +239 "%s halihazırda kilitlenmiÅŸ, oturum saltokunur" +240 "%s: Kaldır" +241 "%s: Kapat" +242 "%s: Kaldır" +243 "%s: Kaldır" +244 "Saltokunur dosya, yazılmadı; yok saymak için ! kullanın" +245 "Saltokunur dosya, yazılmadı" +246 "%s mevcut, yazılmadı; yok saymak için ! kullanın" +247 "%s mevcut, yazılmadı" +248 "Kısmi dosya, yazılmadı; yok saymak için ! kullanın" +249 "Kısmi dosya, yazılmadı" +250 "%s: Dosya bu kopyadan daha önce deÄŸiÅŸtirilmiÅŸ; yok saymak için ! kullanın" +251 "%s: Dosya bu kopyadan daha önce deÄŸiÅŸtirilmiÅŸ" +252 "%s: Yazım koruması kullanılabilir deÄŸildi" +253 "Yazılıyor..." +254 "%s: UYARI: DOSYA KIRPILMIÅž" +255 "Halihazırda bu grubun ilk etiketinde" +256 "%s: Yeni dosya: %lu satır, %lu karakter" +257 "%s: %lu satır, %lu karakter" +258 "%s çok fazla dosya adına geniÅŸletilmiÅŸ" +259 "%s: Sıradan bir dosya deÄŸil" +260 "%s: Ä°yesi siz deÄŸilsiniz" +261 "%s: Ä°yesi dışında baÅŸka bir kullanıcı tarafından da eriÅŸilebilir" +262 "Dosya son tam yazımdan bu yana deÄŸiÅŸtirilmiÅŸ; yazın veya yok saymak için ! kullanın" +263 "Dosya son tam yazımdan bu yana deÄŸiÅŸtirilmiÅŸ; yazın veya yok saymak için :edit! kullanın" +264 "Dosya son tam yazımdan bu yana deÄŸiÅŸtirilmiÅŸ; yazın veya yok saymak için ! kullanın" +265 "Dosya geçici; çıkarsanız deÄŸiÅŸiklikler atılacaktır" +266 "Dosya saltokunur, deÄŸiÅŸiklikler kendiliÄŸinden yazılmaz" +267 "Günlük yeniden baÅŸlatıldı" +268 "Onayla? [ynq]" +269 "Sürdürmek için herhangi bir düğmeye basın: " +270 "Sürdürmek için herhangi bir düğmeye basın [ex komutu girmek için :]: " +271 "Sürdürmek için herhangi bir düğmeye basın [çıkış için q]: " +272 "Bu biçim %s ex uçbirim arabirimini gerektirir" +273 "ex girdisi kipine giriliyor" +274 "Komut baÅŸarısız, henüz bir dosya okunmadı." +275 " sürdür?" +276 "Beklenmedik karakter olayı" +277 "Beklenmedik dosya sonu olayı" +278 "Sorgu eÅŸleÅŸmesi bulunamadı" +279 "Beklenmedik yarıda kesme olayı" +281 "Beklenmedik yeniden boyama olayı" +282 "Halihazırda bu grubun son etiketinde" +283 "%s komutu ex uçbirim arabirimini gerektirir" +284 "Bu biçim %s 'secure edit' seçeneÄŸi ayarlandığında desteklenmez" +285 "Beklenmedik dizi olayı" +286 "Beklenmedik zaman aşımı olayı" +288 "Bölünebilmesi için ekran %d sütundan daha geniÅŸ olmalıdır" +289 "Kabuk geniÅŸletmeleri 'secure edit' seçeneÄŸi ayarlandığında desteklenmez" +290 "%s komutu 'secure edit' seçeneÄŸi ayarlandığında desteklenmez" +291 "set: %s seçeneÄŸi kapatılamaz" +292 "Ekran çok küçük." +293 "eklendi" +294 "deÄŸiÅŸtirildi" +295 "silindi" +296 "uç uca eklendi" +297 "taşındı" +298 "kaydırıldı" +299 "kopyalandı" +300 "satır" +301 "satır" +303 "Dosya son yazımdan bu yana deÄŸiÅŸtirilmiÅŸ." +304 "Kabuk geniÅŸletmesi baÅŸarısız" +305 "Bir '%s' düzenleme seçeneÄŸi belirtilmedi" +307 "Çalıştırılacak ex komutu yok" +308 "Bir komut çalıştırmak için , çıkmak için :q girin" +309 "Yardım için \"cscope help\" kullanın" +310 "Çalışan bir cscope baÄŸlantısı yok" +311 "%s: Bilinmeyen arama türü: Åžunlardan bir tanesini kullanın: %s" +312 "%d: Böyle bir cscope oturumu yok" +313 "set: %s seçeneÄŸi hiçbir zaman açılamaz" +314 "set: %s seçeneÄŸi hiçbir zaman 0 olarak ayarlanamaz" +315 "%s: Ä°liÅŸtirildi: %lu satır, %lu karakter" +316 "Beklenmedik yeniden boyutlandırma olayı" +317 "Düzenlenecek %d dosya var" +319 "%d ekran arkaplana alındı; onları listelemek için :display kullanın" +320 "Bilinmeyen imleç konumu" +321 "Dosya kodlama dönüştürmesi desteklenmiyor" +322 "Girdi kodlama dönüştürmesi desteklenmiyor" +323 "Geçersiz girdi. Kırpıldı." +324 "%d numaralı satırda dönüştürme hatası" Copied: head/contrib/nvi/catalog/tr_TR.UTF-8.owner (from r365495, vendor/nvi/dist/catalog/tr_TR.UTF-8.owner) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/nvi/catalog/tr_TR.UTF-8.owner Wed Sep 9 08:38:47 2020 (r365499, copy of r365495, vendor/nvi/dist/catalog/tr_TR.UTF-8.owner) @@ -0,0 +1 @@ +Emir SARI Modified: head/contrib/nvi/cl/README.signal ============================================================================== --- head/contrib/nvi/cl/README.signal Wed Sep 9 08:19:22 2020 (r365498) +++ head/contrib/nvi/cl/README.signal Wed Sep 9 08:38:47 2020 (r365499) @@ -1,5 +1,3 @@ -# $Id: README.signal,v 10.1 1995/06/23 10:28:17 bostic Exp $ - There are six (normally) asynchronous actions about which vi cares: SIGHUP, SIGINT, SIGQUIT, SIGTERM, SIGTSTP and SIGWINCH. Modified: head/contrib/nvi/cl/cl.h ============================================================================== --- head/contrib/nvi/cl/cl.h Wed Sep 9 08:19:22 2020 (r365498) +++ head/contrib/nvi/cl/cl.h Wed Sep 9 08:38:47 2020 (r365499) @@ -5,8 +5,6 @@ * Keith Bostic. All rights reserved. * * See the LICENSE file for redistribution information. - * - * $Id: cl.h,v 10.34 2011/08/15 20:07:32 zy Exp $ */ #ifdef USE_WIDECHAR Modified: head/contrib/nvi/cl/cl_funcs.c ============================================================================== --- head/contrib/nvi/cl/cl_funcs.c Wed Sep 9 08:19:22 2020 (r365498) +++ head/contrib/nvi/cl/cl_funcs.c Wed Sep 9 08:38:47 2020 (r365499) @@ -9,10 +9,6 @@ #include "config.h" -#ifndef lint -static const char sccsid[] = "$Id: cl_funcs.c,v 10.74 2012/10/11 10:30:16 zy Exp $"; -#endif /* not lint */ - #include #include #include Modified: head/contrib/nvi/cl/cl_main.c ============================================================================== --- head/contrib/nvi/cl/cl_main.c Wed Sep 9 08:19:22 2020 (r365498) +++ head/contrib/nvi/cl/cl_main.c Wed Sep 9 08:38:47 2020 (r365499) @@ -9,14 +9,11 @@ #include "config.h" -#ifndef lint -static const char sccsid[] = "$Id: cl_main.c,v 10.56 2015/04/05 06:20:53 zy Exp $"; -#endif /* not lint */ - #include #include #include +#include #include #include #include @@ -38,11 +35,10 @@ sigset_t __sigblockset; /* GLOBAL: Blocked signals. static void cl_func_std(GS *); static CL_PRIVATE *cl_init(GS *); -static GS *gs_init(char *); -static void perr(char *, char *); +static GS *gs_init(void); static int setsig(int, struct sigaction *, void (*)(int)); static void sig_end(GS *); -static void term_init(char *, char *); +static void term_init(char *); /* * main -- @@ -63,7 +59,7 @@ main(int argc, char *argv[]) abort(); /* Create and initialize the global structure. */ - __global_list = gp = gs_init(argv[0]); + __global_list = gp = gs_init(); /* * Strip out any arguments that vi isn't going to understand. There's @@ -93,12 +89,12 @@ main(int argc, char *argv[]) */ if ((ttype = getenv("TERM")) == NULL) ttype = "ansi"; - term_init(gp->progname, ttype); + term_init(ttype); /* Add the terminal type to the global structure. */ if ((OG_D_STR(gp, GO_TERM) = OG_STR(gp, GO_TERM) = strdup(ttype)) == NULL) - perr(gp->progname, NULL); + err(1, NULL); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Wed Sep 9 09:08:10 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 36E043CA12F; Wed, 9 Sep 2020 09:08: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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BmblZ0d5tz400B; Wed, 9 Sep 2020 09:08: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 E9CA01F32F; Wed, 9 Sep 2020 09:08:09 +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 089989G2020992; Wed, 9 Sep 2020 09:08:09 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 089989gM020991; Wed, 9 Sep 2020 09:08:09 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202009090908.089989gM020991@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 9 Sep 2020 09:08:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365500 - head/usr.sbin/certctl X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/usr.sbin/certctl X-SVN-Commit-Revision: 365500 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.33 Precedence: list List-Id: "SVN commit messages 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, 09 Sep 2020 09:08:10 -0000 Author: kevans Date: Wed Sep 9 09:08:09 2020 New Revision: 365500 URL: https://svnweb.freebsd.org/changeset/base/365500 Log: certctl: fix hashed link generation with duplicate subjects Currently, certctl rehash will just keep clobbering .0 rather than incrementing the suffix upon encountering a duplicate. Do this, and do it for blacklisted certs as well. This also improves the situation with the blacklist to be a little less flakey, comparing cert fingerprints for all certs with a matching subject hash in the blacklist to determine if the cert we're looking at can be installed. Future work needs to completely revamp the blacklist to align more with how it's described in PR 246614. In particular, /etc/ssl/blacklisted should go away to avoid potential confusion -- OpenSSL will not read it, it's basically certctl internal. PR: 246614 Reviewed by: Michael Osipov Tested by: Michael Osipov With suggestions from: Michael Osipov MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D26167 Modified: head/usr.sbin/certctl/certctl.sh Modified: head/usr.sbin/certctl/certctl.sh ============================================================================== --- head/usr.sbin/certctl/certctl.sh Wed Sep 9 08:38:47 2020 (r365499) +++ head/usr.sbin/certctl/certctl.sh Wed Sep 9 09:08:09 2020 (r365500) @@ -30,7 +30,7 @@ ############################################################ CONFIGURATION : ${DESTDIR:=} -: ${FILEPAT:="\.pem$|\.crt$|\.cer$|\.crl$|\.0$"} +: ${FILEPAT:="\.pem$|\.crt$|\.cer$|\.crl$"} : ${VERBOSE:=0} ############################################################ GLOBALS @@ -56,31 +56,58 @@ do_hash() fi } +get_decimal() +{ + local checkdir hash decimal + + checkdir=$1 + hash=$2 + decimal=0 + + while [ -e "$checkdir/$hash.$decimal" ]; do + decimal=$((decimal + 1)) + done + + echo ${decimal} + return 0 +} + create_trusted_link() { - local hash + local blisthash certhash hash + local suffix hash=$( do_hash "$1" ) || return - if [ -e "$BLACKLISTDESTDIR/$hash.0" ]; then - echo "Skipping blacklisted certificate $1 ($BLACKLISTDESTDIR/$hash.0)" - return 1 - fi - [ $VERBOSE -gt 0 ] && echo "Adding $hash.0 to trust store" - [ $NOOP -eq 0 ] && install ${INSTALLFLAGS} -lrs $(realpath "$1") "$CERTDESTDIR/$hash.0" + certhash=$( openssl x509 -sha1 -in "$1" -noout -fingerprint ) + for blistfile in $(find $BLACKLISTDESTDIR -name "$hash.*"); do + blisthash=$( openssl x509 -sha1 -in "$blistfile" -noout -fingerprint ) + if [ "$certhash" = "$blisthash" ]; then + echo "Skipping blacklisted certificate $1 ($blistfile)" + return 1 + fi + done + suffix=$(get_decimal "$CERTDESTDIR" "$hash") + [ $VERBOSE -gt 0 ] && echo "Adding $hash.$suffix to trust store" + [ $NOOP -eq 0 ] && \ + install ${INSTALLFLAGS} -lrs $(realpath "$1") "$CERTDESTDIR/$hash.$suffix" } create_blacklisted() { local hash srcfile filename + local suffix # If it exists as a file, we'll try that; otherwise, we'll scan if [ -e "$1" ]; then hash=$( do_hash "$1" ) || return srcfile=$(realpath "$1") - filename="$hash.0" + suffix=$(get_decimal "$BLACKLISTDESTDIR" "$hash") + filename="$hash.$suffix" elif [ -e "${CERTDESTDIR}/$1" ]; then srcfile=$(realpath "${CERTDESTDIR}/$1") - filename="$1" + hash=$(echo "$1" | sed -Ee 's/\.([0-9])+$//') + suffix=$(get_decimal "$BLACKLISTDESTDIR" "$hash") + filename="$hash.$suffix" else return fi @@ -115,7 +142,7 @@ do_list() if [ -e "$1" ]; then cd "$1" - for CFILE in *.0; do + for CFILE in *.[0-9]; do if [ ! -s "$CFILE" ]; then echo "Unable to read $CFILE" >&2 ERRORS=$(( $ERRORS + 1 )) @@ -174,14 +201,20 @@ cmd_blacklist() cmd_unblacklist() { - local BFILE hash + local BFILE blisthash certhash hash shift # verb for BFILE in "$@"; do if [ -s "$BFILE" ]; then hash=$( do_hash "$BFILE" ) - echo "Removing $hash.0 from blacklist" - [ $NOOP -eq 0 ] && rm -f "$BLACKLISTDESTDIR/$hash.0" + certhash=$( openssl x509 -sha1 -in "$BFILE" -noout -fingerprint ) + for BLISTEDFILE in $(find $BLACKLISTDESTDIR -name "$hash.*"); do + blisthash=$( openssl x509 -sha1 -in "$BLISTEDFILE" -noout -fingerprint ) + if [ "$certhash" = "$blisthash" ]; then + echo "Removing $(basename "$BLISTEDFILE") from blacklist" + [ $NOOP -eq 0 ] && rm -f $BLISTEDFILE + fi + done elif [ -e "$BLACKLISTDESTDIR/$BFILE" ]; then echo "Removing $BFILE from blacklist" [ $NOOP -eq 0 ] && rm -f "$BLACKLISTDESTDIR/$BFILE" From owner-svn-src-all@freebsd.org Wed Sep 9 11:11:51 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 891E83CCAD9; Wed, 9 Sep 2020 11:11:51 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BmfVH387Jz45GD; Wed, 9 Sep 2020 11:11:51 +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 379BC20A6E; Wed, 9 Sep 2020 11:11:51 +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 089BBpAr001210; Wed, 9 Sep 2020 11:11:51 GMT (envelope-from rrs@FreeBSD.org) Received: (from rrs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 089BBor0001208; Wed, 9 Sep 2020 11:11:50 GMT (envelope-from rrs@FreeBSD.org) Message-Id: <202009091111.089BBor0001208@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rrs set sender to rrs@FreeBSD.org using -f From: Randall Stewart Date: Wed, 9 Sep 2020 11:11:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365501 - 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: 365501 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.33 Precedence: list List-Id: "SVN commit messages 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, 09 Sep 2020 11:11:51 -0000 Author: rrs Date: Wed Sep 9 11:11:50 2020 New Revision: 365501 URL: https://svnweb.freebsd.org/changeset/base/365501 Log: So it turns out that syzkaller hit another crash. It has to do with switching stacks with a SENT_FIN outstanding. Both rack and bbr will only send a FIN if all data is ack'd so this must be enforced. Also if the previous stack sent the FIN we need to make sure in rack that when we manufacture the "unknown" sends that we include the proper HAS_FIN bits. Note for BBR we take a simpler approach and just refuse to switch. Sponsored by: Netflix Inc. Differential Revision: https://reviews.freebsd.org/D26269 Modified: head/sys/netinet/tcp_stacks/bbr.c head/sys/netinet/tcp_stacks/rack.c Modified: head/sys/netinet/tcp_stacks/bbr.c ============================================================================== --- head/sys/netinet/tcp_stacks/bbr.c Wed Sep 9 09:08:09 2020 (r365500) +++ head/sys/netinet/tcp_stacks/bbr.c Wed Sep 9 11:11:50 2020 (r365501) @@ -10281,6 +10281,8 @@ bbr_handoff_ok(struct tcpcb *tp) */ return (EAGAIN); } + if (tp->t_flags & TF_SENTFIN) + return (EINVAL); if ((tp->t_flags & TF_SACK_PERMIT) || bbr_sack_not_required) { return (0); } Modified: head/sys/netinet/tcp_stacks/rack.c ============================================================================== --- head/sys/netinet/tcp_stacks/rack.c Wed Sep 9 09:08:09 2020 (r365500) +++ head/sys/netinet/tcp_stacks/rack.c Wed Sep 9 11:11:50 2020 (r365501) @@ -10451,7 +10451,12 @@ rack_init(struct tcpcb *tp) rsm->r_rtr_cnt = 1; rsm->r_rtr_bytes = 0; rsm->r_start = tp->snd_una; - rsm->r_end = tp->snd_max; + if (tp->t_flags & TF_SENTFIN) { + rsm->r_end = tp->snd_max - 1; + rsm->r_flags |= RACK_HAS_FIN; + } else { + rsm->r_end = tp->snd_max; + } rsm->usec_orig_send = us_cts; rsm->r_dupack = 0; insret = RB_INSERT(rack_rb_tree_head, &rack->r_ctl.rc_mtree, rsm); @@ -10518,8 +10523,21 @@ rack_handoff_ok(struct tcpcb *tp) if ((tp->t_state == TCPS_SYN_SENT) || (tp->t_state == TCPS_SYN_RECEIVED)) { /* - * We really don't know you have to get to ESTAB or beyond - * to tell. + * We really don't know if you support sack, + * you have to get to ESTAB or beyond to tell. + */ + return (EAGAIN); + } + if ((tp->t_flags & TF_SENTFIN) && ((tp->snd_max - tp->snd_una) > 1)) { + /* + * Rack will only send a FIN after all data is acknowledged. + * So in this case we have more data outstanding. We can't + * switch stacks until either all data and only the FIN + * is left (in which case rack_init() now knows how + * to deal with that) all is acknowledged and we + * are only left with incoming data, though why you + * would want to switch to rack after all data is acknowledged + * I have no idea (rrs)! */ return (EAGAIN); } From owner-svn-src-all@freebsd.org Wed Sep 9 12:58:20 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 840873D0031; Wed, 9 Sep 2020 12:58:20 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bmhs82vhsz4DX3; Wed, 9 Sep 2020 12:58: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 439E921F64; Wed, 9 Sep 2020 12:58: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 089CwKj2063073; Wed, 9 Sep 2020 12:58:20 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 089CwJmZ063071; Wed, 9 Sep 2020 12:58:19 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202009091258.089CwJmZ063071@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 9 Sep 2020 12:58:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365502 - in head/sbin/ggate: ggatec ggated X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/sbin/ggate: ggatec ggated X-SVN-Commit-Revision: 365502 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.33 Precedence: list List-Id: "SVN commit messages 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, 09 Sep 2020 12:58:20 -0000 Author: markj Date: Wed Sep 9 12:58:19 2020 New Revision: 365502 URL: https://svnweb.freebsd.org/changeset/base/365502 Log: ggate: Fix ggated/ggatec debug print of offsets. The request offset and length are always unsigned, so print them as such. Submitted by: Yoshihiro Ota MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D21388 Modified: head/sbin/ggate/ggatec/ggatec.c head/sbin/ggate/ggated/ggated.c Modified: head/sbin/ggate/ggatec/ggatec.c ============================================================================== --- head/sbin/ggate/ggatec/ggatec.c Wed Sep 9 11:11:50 2020 (r365501) +++ head/sbin/ggate/ggatec/ggatec.c Wed Sep 9 12:58:19 2020 (r365502) @@ -35,6 +35,7 @@ #include #include #include +#include #include #include #include @@ -174,8 +175,9 @@ send_thread(void *arg __unused) pthread_kill(recvtd, SIGUSR1); break; } - g_gate_log(LOG_DEBUG, "Sent %zd bytes (offset=%llu, " - "size=%u).", data, hdr.gh_offset, hdr.gh_length); + g_gate_log(LOG_DEBUG, "Sent %zd bytes (offset=%" + PRIu64 ", length=%" PRIu32 ").", data, + hdr.gh_offset, hdr.gh_length); } } g_gate_log(LOG_DEBUG, "%s: Died.", __func__); @@ -229,9 +231,9 @@ recv_thread(void *arg __unused) pthread_kill(sendtd, SIGUSR1); break; } - g_gate_log(LOG_DEBUG, "Received %d bytes (offset=%ju, " - "size=%zu).", data, (uintmax_t)hdr.gh_offset, - (size_t)hdr.gh_length); + g_gate_log(LOG_DEBUG, "Received %d bytes (offset=%" + PRIu64 ", length=%" PRIu32 ").", data, + hdr.gh_offset, hdr.gh_length); } g_gate_ioctl(G_GATE_CMD_DONE, &ggio); Modified: head/sbin/ggate/ggated/ggated.c ============================================================================== --- head/sbin/ggate/ggated/ggated.c Wed Sep 9 11:11:50 2020 (r365501) +++ head/sbin/ggate/ggated/ggated.c Wed Sep 9 12:58:19 2020 (r365502) @@ -43,6 +43,7 @@ #include #include #include +#include #include #include #include @@ -662,8 +663,8 @@ recv_thread(void *arg) g_gate_log(LOG_DEBUG, "Received hdr packet."); g_gate_swap2h_hdr(&req->r_hdr); - g_gate_log(LOG_DEBUG, "%s: offset=%jd length=%u", __func__, - (intmax_t)req->r_offset, (unsigned)req->r_length); + g_gate_log(LOG_DEBUG, "%s: offset=%" PRIu64 " length=%" PRIu32, + __func__, req->r_offset, req->r_length); /* * Allocate memory for data. @@ -730,8 +731,8 @@ disk_thread(void *arg) assert((req->r_offset % conn->c_sectorsize) == 0); assert((req->r_length % conn->c_sectorsize) == 0); - g_gate_log(LOG_DEBUG, "%s: offset=%jd length=%u", __func__, - (intmax_t)req->r_offset, (unsigned)req->r_length); + g_gate_log(LOG_DEBUG, "%s: offset=%" PRIu64 " length=%" PRIu32, + __func__, req->r_offset, req->r_length); /* * Do the request. @@ -804,8 +805,8 @@ send_thread(void *arg) error = pthread_mutex_unlock(&outqueue_mtx); assert(error == 0); - g_gate_log(LOG_DEBUG, "%s: offset=%jd length=%u", __func__, - (intmax_t)req->r_offset, (unsigned)req->r_length); + g_gate_log(LOG_DEBUG, "%s: offset=%" PRIu64 " length=%" PRIu32, + __func__, req->r_offset, req->r_length); /* * Send the request. @@ -824,8 +825,8 @@ send_thread(void *arg) strerror(errno)); } g_gate_log(LOG_DEBUG, - "Sent %zd bytes (offset=%ju, size=%zu).", data, - (uintmax_t)req->r_offset, (size_t)req->r_length); + "Sent %zd bytes (offset=%" PRIu64 ", size=%" PRIu32 + ").", data, req->r_offset, req->r_length); free(req->r_data); } free(req); From owner-svn-src-all@freebsd.org Wed Sep 9 13:16:20 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C5D5F3D0D15; Wed, 9 Sep 2020 13:16:20 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BmjFw4s93z4G0t; Wed, 9 Sep 2020 13:16:20 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8B1012238B; Wed, 9 Sep 2020 13:16:20 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 089DGKZm075369; Wed, 9 Sep 2020 13:16:20 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 089DGKGZ075368; Wed, 9 Sep 2020 13:16:20 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <202009091316.089DGKGZ075368@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Wed, 9 Sep 2020 13:16:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365503 - stable/12/usr.bin/nfsstat X-SVN-Group: stable-12 X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: stable/12/usr.bin/nfsstat X-SVN-Commit-Revision: 365503 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.33 Precedence: list List-Id: "SVN commit messages 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, 09 Sep 2020 13:16:20 -0000 Author: asomers Date: Wed Sep 9 13:16:20 2020 New Revision: 365503 URL: https://svnweb.freebsd.org/changeset/base/365503 Log: MFC r365262: Fix output of nfsstat -cE in json or xml mode Due to a copy/paste error, the "getacl" field was duplicated, but only in XML or JSON mode, not in txt mode. Discussed with: rmacklem Sponsored by: Axcient Modified: stable/12/usr.bin/nfsstat/nfsstat.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.bin/nfsstat/nfsstat.c ============================================================================== --- stable/12/usr.bin/nfsstat/nfsstat.c Wed Sep 9 12:58:19 2020 (r365502) +++ stable/12/usr.bin/nfsstat/nfsstat.c Wed Sep 9 13:16:20 2020 (r365503) @@ -731,7 +731,7 @@ exp_intpr(int clientOnly, int serverOnly, int nfs41) "{T:PutRootFH/%13.13s}{T:DelegRet/%13.13s}" "{T:GetAcl/%13.13s}{T:SetAcl/%13.13s}\n"); xo_emit("{:rellckown/%13ju}{:freestateid/%13ju}" - "{:getacl/%13ju}{:delegret/%13ju}" + "{:putrootfh/%13ju}{:delegret/%13ju}" "{:getacl/%13ju}{:setacl/%13ju}\n", (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_RELEASELCKOWN], (uintmax_t)ext_nfsstats.rpccnt[NFSPROC_FREESTATEID], From owner-svn-src-all@freebsd.org Wed Sep 9 13:44:36 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id ABCEE3D169E; Wed, 9 Sep 2020 13:44:36 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qk1-x731.google.com (mail-qk1-x731.google.com [IPv6:2607:f8b0:4864:20::731]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BmjtX2YkFz4HCc; Wed, 9 Sep 2020 13:44:36 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-qk1-x731.google.com with SMTP id v123so2403836qkd.9; Wed, 09 Sep 2020 06:44:36 -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; bh=Dht25Xtp1iDJgPNGGurDvsEf0YFXQZXrk7srbpy7m9M=; b=uU8KA1TfeKl0WpX6o+NYz232Ru+dMAaLe7eC93YzbqwCway1uL2HiicLzLttmd5k5o l4GnqBo7MZ3ZLD5JxevNve0C74P7OMKhk2VYeYC5t5W1fjg5Psp2lCo4uPKuIahYBEc0 BoJzFI4frfHJl4MttqHQj/+IGITDVRVtMcW/gRLSa8vWMFhM62YLSQvSET8Re3mFmpjR DZgXoRJbSq0tPHWHWVS7t6UC8LlRNdNIFj6sTshmWIm+XYsrpGPirp161xb6dMXJYSS9 9Zi2rfYc6wYQSiChDTv1SOwW8/8dc5zfJYu01oQ15vNz980+7mo+H1On0cCGug2+03Em k7UA== 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; bh=Dht25Xtp1iDJgPNGGurDvsEf0YFXQZXrk7srbpy7m9M=; b=Kz8yysa2YA8tRLvbWhCkxMf84dZ7QsrSQGxl1R2lBwl6kjsTJDhy+npuKHXACbo7jL AJtCkQpC9kosqV528qds7DDFTEpcSzuzPUnKiETCBkNaLaiCUwetiyoWPbtiZ3hAO3vO 5/kvapMoeGwzjsyNS9Zn6QKD7xld/wNgdxTBUsRSjtZAHELh6cCGh25xQO4pBhifsn7R 2Pl+LoQ3CJDLwaRXD4lHz/dmkKh9E6TKR1qi2YQ/sPaJxUTTmNaDVCxAqkQjntAplN7D 9RYGJ2hVga2KyYMbizxO2sDtUEp7Eo2CQ5UKjUVDapyIxN5V+5Edot63ls2g+bX8pMBs sxpw== X-Gm-Message-State: AOAM530aaqGZULyoYwfQ5+t5R2zO3W2KVrypgppHvZOiXDsZzaOjzpBp lUfng87zZOwXAUON1D+zyTo/lW6PSqSTBw== X-Google-Smtp-Source: ABdhPJzktjG6TzJYXjDE+L4i2djk4xH3CGaEycG55lD23w310zQiUWJdRg4rDBdWpsPSFbKvGg19vg== X-Received: by 2002:a37:a07:: with SMTP id 7mr3239736qkk.271.1599659075183; Wed, 09 Sep 2020 06:44:35 -0700 (PDT) Received: from raichu (toroon0560w-lp130-08-67-71-176-35.dsl.bell.ca. [67.71.176.35]) by smtp.gmail.com with ESMTPSA id r42sm3101200qtk.29.2020.09.09.06.44.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Sep 2020 06:44:34 -0700 (PDT) Sender: Mark Johnston Date: Wed, 9 Sep 2020 09:44:29 -0400 From: Mark Johnston To: Andriy Gapon Cc: Michal Meloun , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: uninitialized variables [Was: svn commit: r365445 - head/sys/cam/mmc] Message-ID: <20200909134429.GA65588@raichu> References: <202009080546.0885kAgk006783@repo.freebsd.org> <34826ee7-12a9-d309-1fee-cd2e95744603@FreeBSD.org> <67be7fa5-30dd-b7ee-1076-9c29195d83d3@gmail.com> <20200908124848.GB66031@raichu> <6b18b5ef-a743-3d5e-8dd2-24640614ec88@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6b18b5ef-a743-3d5e-8dd2-24640614ec88@FreeBSD.org> X-Rspamd-Queue-Id: 4BmjtX2YkFz4HCc X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; TAGGED_RCPT(0.00)[]; REPLY(-4.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 09 Sep 2020 13:44:36 -0000 On Wed, Sep 09, 2020 at 08:49:01AM +0300, Andriy Gapon wrote: > On 08/09/2020 15:48, Mark Johnston wrote: > > I observed the same thing recently as well: the compiler catches > > uninitialized variables only in simple cases. In my case, any uses of > > goto within the function seemed to silence the warning, even if they > > appeared after the uninitialized reference. > > I am running a kernel build now with this addition (for clang): > CWARNEXTRA+= -Wconditional-uninitialized -Wno-error-conditional-uninitialized > > It produces a ton of warnings. > Some of them are probably false positives, but some look quite reasonable. It has a lot of trouble with code patterns of the form: for (i = 0; i < 100; i++) { val = foo(); } if (val != 0) /* may be uninitialized!!1 */ bar(); or if (foo == bar) val = baz(); if (foo == bar && val == 3) The second example makes some sense to me since it's hard to prove that foo == bar will not change between the first and second evaluations. > E.g.: > sys/cam/cam_periph.c:314:19: warning: variable 'p_drv' may be uninitialized when > used here [-Wconditional-uninitialized] > TAILQ_REMOVE(&(*p_drv)->units, periph, unit_links); > > Indeed, there is a conditional 'goto failure' before a first assignment to p_drv > and the line is after the label. So, maybe the situation is impossible, but it > is reasonable to warn about it. > > But the number of false positives (and "possible but impossible" situations) is > too overwhelming. Yeah. I looked at maybe 30 warnings (out of hundreds) this morning and they were all false positives. KMSAN will provide a new tool for finding such bugs, but they will only be detected at runtime. From owner-svn-src-all@freebsd.org Wed Sep 9 13:51:17 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 519893D17A8; Wed, 9 Sep 2020 13:51:17 +0000 (UTC) (envelope-from gjb@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bmk2F1H5Fz4HdW; Wed, 9 Sep 2020 13:51:17 +0000 (UTC) (envelope-from gjb@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1599659477; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=lOldk8dGgxLKXv75nQgpE9pT4eUSTWd9HT9MBqiABwE=; b=pFRSAF2/yUyWvbEvGJDqxvPun/b5JJHE1kX+f31gwxE1XndTzSZjfMrR0XvPVtc7g4osXf aEVyLsqOLuO5xvhklufOZeHQ2F2Gi0bc8KgO9zrXJdGB3X+9tiKkoAPvKdSl8/XMCJtWHr Fc8/bthsGrxC6FrAqRGS89nkZ1MyD8NaoogYVasmeoctzrQOe5E1iWb4zVjVlQmD+PQtGz fj1ZevCTW75avbpdK42eGY+JEK+JEolHdqkGEsekBVYqf0Okh//MvekWnwEtDQ7QzsIgjM ZIWLu+zojRGIM+Z6uRgkNUq+W/IXjtcc8vW4V7wJQ/qKY6i/EfERKxhlunkXjA== Received: from FreeBSD.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by freefall.freebsd.org (Postfix) with ESMTPS id AD9DD14C71; Wed, 9 Sep 2020 13:51:16 +0000 (UTC) (envelope-from gjb@freebsd.org) Date: Wed, 9 Sep 2020 13:51:14 +0000 From: Glen Barber To: Ruslan Garipov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r364891 - in head: . release release/scripts Message-ID: <20200909135114.GC61041@FreeBSD.org> References: <202008272119.07RLJGgb043888@repo.freebsd.org> <174719d0148.27b9.e2363f32305322128423a5fd7014e4c4@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="JYM0PCMtI8imgUPy" Content-Disposition: inline In-Reply-To: <174719d0148.27b9.e2363f32305322128423a5fd7014e4c4@gmail.com> ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1599659477; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=lOldk8dGgxLKXv75nQgpE9pT4eUSTWd9HT9MBqiABwE=; b=DBc5beFKIkRzrLf/CSr6BIWXjXN3PmJDpLZmmpzyRYGJ0KrLDe0UIRopFDk9KgkihQaPi8 G2mLplYL8Gso95C00i32WwEMwrTFwZiiL9cbUuNHAk7SVNApJTAlTFif4IpejF28t3x32s CmR+tZutbFVxBstoQFwlbW59qufULs6nzh96+9BDPwKnxevDrHrZJIe+r8eO47EEgbrdjo 0LmhlmoJNdIB4QgNYfPtBRwpWZybQ6twrojQmXZeodOiXfTT1xV2emUUVidpB5NzZEIg+C cPMeP4CpzZLP++C/qSsQvDk2T0FwOsRFi6iMeGlzw4lDNc9px7Ld85nWwYF4qA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1599659477; a=rsa-sha256; cv=none; b=cx4AM6PVunk78cN6Ub257qKJqfO6e7U4iyKSfxLazsJ1FodhefzmZ/khC573yUUWyMz351 6pFla96CRIhbfnhaNyrVZANXvJT8oXJnvWmms8fP7cDSZQu6qVLk2FMZntbM6ESGzrWJBG R7EdK6wQWoBFdhAKkDYOba/DAvIrtbzXdzZcOTWn3zndiRe0VKPp73XGq/Xs72UN5D9lat Y8vfA1R3Upbwx6YnJxDt7LwiI5TxebhhrKqyPrU/b8ySYgkQnDhmub8ESfySEelsJonneK 4CiBVa6Rn0yrRNRC66y3OaebLLXNwydT1s8cH+5ZWsDLKhuwtCzos3+G3ij0Ew== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 09 Sep 2020 13:51:17 -0000 --JYM0PCMtI8imgUPy Content-Type: multipart/mixed; boundary="Vqhh7KwsSol0ht3S" Content-Disposition: inline --Vqhh7KwsSol0ht3S Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Sep 09, 2020 at 11:45:49AM +0500, Ruslan Garipov wrote: > On August 28, 2020 2:19:33 AM Glen Barber wrote: >=20 > > Author: gjb > > Date: Thu Aug 27 21:19:16 2020 > > New Revision: 364891 > > URL: https://svnweb.freebsd.org/changeset/base/364891 > >=20 > > Log: > > Merge the projects/release-git branch to head. > > This allows building 13.x from Git instead of Subversion. > I'm sorry for the late response (and for the bad first one I made on this > commit recently via Gmail web client). >=20 > My build machine is completely offline. I provide it with fresh snapshots > of the source and ports tree manually -- via tarballs which I'm pulling on > a FreeBSD machine having Internet connection. Therefore, neither > "/scratch", nor the chrooted environment for me don't require Internet > access (I fetch distfiles for offline usage too). >=20 > Can we somehow remove that requirement for the devel/git port? For > example, if one has set all three {SRC,PORTS,DOC}_UPDATE_SKIP variables, > then release/release.sh doesn't require devel/git to exist on the host. >=20 > I really don't need git on my build machine (and don't need it for > building). >=20 Can you verify if the attached patch works for your use case? You will need to set NOGIT=3D1 in your release.conf. Glen --Vqhh7KwsSol0ht3S Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="release_sh.txt" Content-Transfer-Encoding: quoted-printable Index: release/release.conf.sample =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- release/release.conf.sample (revision 365503) +++ release/release.conf.sample (working copy) @@ -12,6 +12,8 @@ ## Set the directory within which the release will be built. CHROOTDIR=3D"/scratch" =20 +## Do not explicitly require the devel/git port to be installed. +#NOGIT=3D1 ## Set the version control system host. GITROOT=3D"https://cgit-beta.freebsd.org/" GITSRC=3D"src.git" Index: release/release.sh =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- release/release.sh (revision 365503) +++ release/release.sh (working copy) @@ -65,7 +65,7 @@ env_setup() { [ ! -z "${VCSCMD}" ] && break 2 done =20 - if [ -z "${VCSCMD}" ]; then + if [ -z "${VCSCMD}" -a ! -z "${NOGIT}" ]; then echo "*** The devel/git port/package is required." exit 1 fi @@ -275,30 +275,32 @@ extra_chroot_setup() { cp ${SRC_CONF} ${CHROOTDIR}/${SRC_CONF} fi =20 - # Install git from ports or packages if the ports tree is - # available and VCSCMD is unset. - _gitcmd=3D"$(which git)" - if [ -d ${CHROOTDIR}/usr/ports -a -z "${_gitcmd}" ]; then - # Trick the ports 'run-autotools-fixup' target to do the right - # thing. - _OSVERSION=3D$(chroot ${CHROOTDIR} /usr/bin/uname -U) - REVISION=3D$(chroot ${CHROOTDIR} make -C /usr/src/release -V REVISION) - BRANCH=3D$(chroot ${CHROOTDIR} make -C /usr/src/release -V BRANCH) - UNAME_r=3D${REVISION}-${BRANCH} - GITUNSETOPTS=3D"CONTRIB CURL CVS GITWEB GUI HTMLDOCS" - GITUNSETOPTS=3D"${GITUNSETOPTS} ICONV NLS P4 PERL" - GITUNSETOPTS=3D"${GITUNSETOPTS} SEND_EMAIL SUBTREE SVN" - GITUNSETOPTS=3D"${GITUNSETOPTS} PCRE PCRE2" - eval chroot ${CHROOTDIR} env OPTIONS_UNSET=3D\"${GITUNSETOPTS}\" \ - make -C /usr/ports/devel/git FORCE_PKG_REGISTER=3D1 \ - WRKDIRPREFIX=3D/tmp/ports \ - DISTDIR=3D/tmp/distfiles \ - install clean distclean - else - eval chroot ${CHROOTDIR} env ASSUME_ALWAYS_YES=3Dyes \ - pkg install -y devel/git - eval chroot ${CHROOTDIR} env ASSUME_ALWAYS_YES=3Dyes \ - pkg clean -y + if [ ! -z "${NOGIT}" ]; then + # Install git from ports or packages if the ports tree is + # available and VCSCMD is unset. + _gitcmd=3D"$(which git)" + if [ -d ${CHROOTDIR}/usr/ports -a -z "${_gitcmd}" ]; then + # Trick the ports 'run-autotools-fixup' target to do the right + # thing. + _OSVERSION=3D$(chroot ${CHROOTDIR} /usr/bin/uname -U) + REVISION=3D$(chroot ${CHROOTDIR} make -C /usr/src/release -V REVISION) + BRANCH=3D$(chroot ${CHROOTDIR} make -C /usr/src/release -V BRANCH) + UNAME_r=3D${REVISION}-${BRANCH} + GITUNSETOPTS=3D"CONTRIB CURL CVS GITWEB GUI HTMLDOCS" + GITUNSETOPTS=3D"${GITUNSETOPTS} ICONV NLS P4 PERL" + GITUNSETOPTS=3D"${GITUNSETOPTS} SEND_EMAIL SUBTREE SVN" + GITUNSETOPTS=3D"${GITUNSETOPTS} PCRE PCRE2" + eval chroot ${CHROOTDIR} env OPTIONS_UNSET=3D\"${GITUNSETOPTS}\" \ + make -C /usr/ports/devel/git FORCE_PKG_REGISTER=3D1 \ + WRKDIRPREFIX=3D/tmp/ports \ + DISTDIR=3D/tmp/distfiles \ + install clean distclean + else + eval chroot ${CHROOTDIR} env ASSUME_ALWAYS_YES=3Dyes \ + pkg install -y devel/git + eval chroot ${CHROOTDIR} env ASSUME_ALWAYS_YES=3Dyes \ + pkg clean -y + fi fi if [ -d ${CHROOTDIR}/usr/ports ]; then # Trick the ports 'run-autotools-fixup' target to do the right --Vqhh7KwsSol0ht3S-- --JYM0PCMtI8imgUPy Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEjRJAPC5sqwhs9k2jAxRYpUeP4pMFAl9Y3cwACgkQAxRYpUeP 4pMTYA//eHzYD5qVXrj7UQnmqEp90GzpZ2K5tu8K4EtcbbxjjnziKBCf4QxghQsW m3H6OZ8EyAOKGauuSWM03VRGByhog4JqC/3hYfl1ZByyyPv+940sshif02tvlml2 HyUolDTl201gpmLZs4xdio9z72LfXpvyApg7IaorDJEw1PmB5FGgR8xZaRhiff7R PVVjhoREwrdtlQH8wkp1vCamiIreEMUtZ2WjvuyNo8xLoHU1puMMFn3HpLWH+UBr 8aanU2XgapRQ7b87eIELPVQTqOs363gO8yhPmFlaQ9+qIyAV4xKZxXUyG9zyukSn sCmT+nM4IIyyzqMHJi8Pmno3aF4sGgIaBEx3UY5dI27M+Uy/wPtsrawjDrEczLDo 4GMQBy36kySmXWrkwePP1i0B5O18/sDkR6J8XtC8O6bOMKh4xeoZIWANal3kbeZn uoS2wT3eJIXMJuCVxCBhneJ/Vm2Cudq4l8kjCqUi/YiNHXhlKOzRRi3teu3uczPT SpNlYct73B8QgpQLQgyIkMI1iYZgA1R2zRbgMKLMu/aulMSQ7wOX51NFSeBx8KGY tLDV8yLBF9uwu6rRHlTvXMsTZGLPQg2tbQhvis9uND48TtmXQNnCaT+mOfo+qx/g gLE0fR5CSRVk2tj3qqBLcxxpTDXHaV/UPxOlzukjR/qbCZHGIeA= =SjN8 -----END PGP SIGNATURE----- --JYM0PCMtI8imgUPy-- From owner-svn-src-all@freebsd.org Wed Sep 9 16:13:34 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9C9EF3D52A5; Wed, 9 Sep 2020 16:13:34 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BmnBQ3cSWz4RfP; Wed, 9 Sep 2020 16:13:34 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5F7D22424C; Wed, 9 Sep 2020 16:13:34 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 089GDYuX086939; Wed, 9 Sep 2020 16:13:34 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 089GDYkk086937; Wed, 9 Sep 2020 16:13:34 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <202009091613.089GDYkk086937@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Wed, 9 Sep 2020 16:13:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365504 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 365504 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.33 Precedence: list List-Id: "SVN commit messages 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, 09 Sep 2020 16:13:34 -0000 Author: glebius Date: Wed Sep 9 16:13:33 2020 New Revision: 365504 URL: https://svnweb.freebsd.org/changeset/base/365504 Log: In r354148 the goal was to check THREAD_CAN_SLEEP() only once for the purpose of epoch_trace() and for calling subsequent panic, but to keep code fully under INVARIANTS, so don't use bare function call to panic(). However, at the last stage of review a true value slipped in, while always false was assumed. I checked that in email archive with kib@. Noticed by: trasz Modified: head/sys/kern/subr_sleepqueue.c head/sys/kern/subr_trap.c Modified: head/sys/kern/subr_sleepqueue.c ============================================================================== --- head/sys/kern/subr_sleepqueue.c Wed Sep 9 13:16:20 2020 (r365503) +++ head/sys/kern/subr_sleepqueue.c Wed Sep 9 16:13:33 2020 (r365504) @@ -325,7 +325,7 @@ sleepq_add(const void *wchan, struct lock_object *lock #ifdef EPOCH_TRACE epoch_trace_list(curthread); #endif - KASSERT(1, + KASSERT(0, ("%s: td %p to sleep on wchan %p with sleeping prohibited", __func__, td, wchan)); } Modified: head/sys/kern/subr_trap.c ============================================================================== --- head/sys/kern/subr_trap.c Wed Sep 9 13:16:20 2020 (r365503) +++ head/sys/kern/subr_trap.c Wed Sep 9 16:13:33 2020 (r365504) @@ -187,7 +187,7 @@ userret(struct thread *td, struct trapframe *frame) #ifdef EPOCH_TRACE epoch_trace_list(curthread); #endif - KASSERT(1, ("userret: Returning with sleep disabled")); + KASSERT(0, ("userret: Returning with sleep disabled")); } KASSERT(td->td_pinned == 0 || (td->td_pflags & TDP_CALLCHAIN) != 0, ("userret: Returning with with pinned thread")); From owner-svn-src-all@freebsd.org Wed Sep 9 16:35:52 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1BE113D55FF; Wed, 9 Sep 2020 16:35:52 +0000 (UTC) (envelope-from scottph@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bmnh775K3z4SQS; Wed, 9 Sep 2020 16:35:51 +0000 (UTC) (envelope-from scottph@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 D69FE247C2; Wed, 9 Sep 2020 16:35:51 +0000 (UTC) (envelope-from scottph@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 089GZp5V099310; Wed, 9 Sep 2020 16:35:51 GMT (envelope-from scottph@FreeBSD.org) Received: (from scottph@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 089GZp5C099309; Wed, 9 Sep 2020 16:35:51 GMT (envelope-from scottph@FreeBSD.org) Message-Id: <202009091635.089GZp5C099309@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: scottph set sender to scottph@FreeBSD.org using -f From: D Scott Phillips Date: Wed, 9 Sep 2020 16:35:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365505 - head/stand/efi/libefi X-SVN-Group: head X-SVN-Commit-Author: scottph X-SVN-Commit-Paths: head/stand/efi/libefi X-SVN-Commit-Revision: 365505 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.33 Precedence: list List-Id: "SVN commit messages 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, 09 Sep 2020 16:35:52 -0000 Author: scottph Date: Wed Sep 9 16:35:51 2020 New Revision: 365505 URL: https://svnweb.freebsd.org/changeset/base/365505 Log: stand/efihttp: Work around a bug in edk2 http instance reconfiguration A bug in the EFI HTTP driver of TianoCore EDK2 causes memory corruption when an http instance that uses tls is reconfigured, leading to a crash. Work around this by forcing a new http instance for each request instead of reconfiguring the existing one. The upstream bug report is https://bugzilla.tianocore.org/show_bug.cgi?id=1917 Submitted by: bcran Reviewed By: imp, kevans, tsoome MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D21281 Modified: head/stand/efi/libefi/efihttp.c Modified: head/stand/efi/libefi/efihttp.c ============================================================================== --- head/stand/efi/libefi/efihttp.c Wed Sep 9 16:13:33 2020 (r365504) +++ head/stand/efi/libefi/efihttp.c Wed Sep 9 16:35:51 2020 (r365505) @@ -576,6 +576,14 @@ efihttp_fs_open(const char *path, struct open_file *f) */ err = _efihttp_fs_open(path, f); if (err != 0) { + /* + * Work around a bug in the EFI HTTP implementation which + * causes a crash if the http instance isn't torn down + * between requests. + * See https://bugzilla.tianocore.org/show_bug.cgi?id=1917 + */ + efihttp_dev_close(f); + efihttp_dev_open(f); path_slash = malloc(strlen(path) + 2); if (path_slash == NULL) return (ENOMEM); @@ -719,6 +727,14 @@ efihttp_fs_seek(struct open_file *f, off_t offset, int path = fh->path; fh->path = NULL; efihttp_fs_close(f); + /* + * Work around a bug in the EFI HTTP implementation which + * causes a crash if the http instance isn't torn down + * between requests. + * See https://bugzilla.tianocore.org/show_bug.cgi?id=1917 + */ + efihttp_dev_close(f); + efihttp_dev_open(f); err = efihttp_fs_open(path, f); free(path); if (err != 0) From owner-svn-src-all@freebsd.org Wed Sep 9 18:07:15 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 452E33D785C; Wed, 9 Sep 2020 18:07:15 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BmqjZ52Qpz4Yxm; Wed, 9 Sep 2020 18:07: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 90BF225A4C; Wed, 9 Sep 2020 18:07: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 089I7Ejb055432; Wed, 9 Sep 2020 18:07:14 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 089I7DIv055428; Wed, 9 Sep 2020 18:07:13 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202009091807.089I7DIv055428@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 9 Sep 2020 18:07:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365506 - in head: include lib/libc/gen lib/libc/sys X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head: include lib/libc/gen lib/libc/sys X-SVN-Commit-Revision: 365506 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.33 Precedence: list List-Id: "SVN commit messages 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, 09 Sep 2020 18:07:15 -0000 Author: kevans Date: Wed Sep 9 18:07:13 2020 New Revision: 365506 URL: https://svnweb.freebsd.org/changeset/base/365506 Log: getlogin_r: fix the type of len getlogin_r is specified by POSIX to to take a size_t len, not int. Fix our version to do the same, bump the symbol version due to ABI change and provide compat. This was reported to break compilation of Ruby 2.8. Some discussion about the necessity of the ABI compat did take place in the review. While many 64-bit platforms would likely be passing it in a 64-bit register and zero-extended and thus, not notice ABI breakage, some do sign-extend (e.g. mips). PR: 247102 Submitted by: Bertram Scharpf (original) Submitted by: cem (ABI compat) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D26335 Modified: head/include/unistd.h head/lib/libc/gen/Symbol.map head/lib/libc/gen/getlogin.c head/lib/libc/sys/getlogin.2 Modified: head/include/unistd.h ============================================================================== --- head/include/unistd.h Wed Sep 9 16:35:51 2020 (r365505) +++ head/include/unistd.h Wed Sep 9 18:07:13 2020 (r365506) @@ -399,7 +399,7 @@ int ftruncate(int, off_t); #endif #if __POSIX_VISIBLE >= 199506 -int getlogin_r(char *, int); +int getlogin_r(char *, size_t); #endif /* 1003.1-2001 */ Modified: head/lib/libc/gen/Symbol.map ============================================================================== --- head/lib/libc/gen/Symbol.map Wed Sep 9 16:35:51 2020 (r365505) +++ head/lib/libc/gen/Symbol.map Wed Sep 9 18:07:13 2020 (r365506) @@ -156,7 +156,6 @@ FBSD_1.0 { gethostname; getloadavg; getlogin; - getlogin_r; setnetgrent; getnetgrent; endnetgrent; @@ -422,6 +421,7 @@ FBSD_1.5 { }; FBSD_1.6 { + getlogin_r; memalign; scandir_b; sigandset; Modified: head/lib/libc/gen/getlogin.c ============================================================================== --- head/lib/libc/gen/getlogin.c Wed Sep 9 16:35:51 2020 (r365505) +++ head/lib/libc/gen/getlogin.c Wed Sep 9 18:07:13 2020 (r365506) @@ -58,7 +58,7 @@ getlogin(void) } int -getlogin_r(char *logname, int namelen) +getlogin_r(char *logname, size_t namelen) { char tmpname[MAXLOGNAME]; int len; @@ -75,3 +75,13 @@ getlogin_r(char *logname, int namelen) strlcpy(logname, tmpname, len); return (0); } + +/* FreeBSD 12 and earlier compat. */ +int +__getlogin_r_fbsd12(char *logname, int namelen) +{ + if (namelen < 1) + return (ERANGE); + return (getlogin_r(logname, namelen)); +} +__sym_compat(getlogin_r, __getlogin_r_fbsd12, FBSD_1.0); Modified: head/lib/libc/sys/getlogin.2 ============================================================================== --- head/lib/libc/sys/getlogin.2 Wed Sep 9 16:35:51 2020 (r365505) +++ head/lib/libc/sys/getlogin.2 Wed Sep 9 18:07:13 2020 (r365506) @@ -28,7 +28,7 @@ .\" @(#)getlogin.2 8.1 (Berkeley) 6/9/93 .\" $FreeBSD$ .\" -.Dd June 9, 1993 +.Dd September 9, 2020 .Dt GETLOGIN 2 .Os .Sh NAME @@ -44,7 +44,7 @@ .Fn getlogin void .In sys/param.h .Ft int -.Fn getlogin_r "char *name" "int len" +.Fn getlogin_r "char *name" "size_t len" .Ft int .Fn setlogin "const char *name" .Sh DESCRIPTION From owner-svn-src-all@freebsd.org Wed Sep 9 18:08:36 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 993F93D7A60 for ; Wed, 9 Sep 2020 18:08:36 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bmql83Xgqz4Yw9 for ; Wed, 9 Sep 2020 18:08:36 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-qt1-f171.google.com (mail-qt1-f171.google.com [209.85.160.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 5781B11508 for ; Wed, 9 Sep 2020 18:08:36 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qt1-f171.google.com with SMTP id n18so2718911qtw.0 for ; Wed, 09 Sep 2020 11:08:36 -0700 (PDT) X-Gm-Message-State: AOAM530WkJ6msqrbBIIzGTREeam8xwk/HHfEugOrDJoVp1CngQCW8gIl 3RM7aY2Q+LPZj/+wp29RZU4rpw1z9HHyXP4ZsjM= X-Received: by 2002:ac8:72d6:: with SMTP id o22mt4521147qtp.53.1599674915847; Wed, 09 Sep 2020 11:08:35 -0700 (PDT) MIME-Version: 1.0 References: <202009091807.089I7DIv055428@repo.freebsd.org> In-Reply-To: <202009091807.089I7DIv055428@repo.freebsd.org> From: Kyle Evans Date: Wed, 9 Sep 2020 13:08:23 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r365506 - in head: include lib/libc/gen lib/libc/sys Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 09 Sep 2020 18:08:36 -0000 On Wed, Sep 9, 2020 at 1:07 PM Kyle Evans wrote: > > Author: kevans > Date: Wed Sep 9 18:07:13 2020 > New Revision: 365506 > URL: https://svnweb.freebsd.org/changeset/base/365506 > > Log: > getlogin_r: fix the type of len > > getlogin_r is specified by POSIX to to take a size_t len, not int. Fix our > version to do the same, bump the symbol version due to ABI change and > provide compat. > > This was reported to break compilation of Ruby 2.8. > > Some discussion about the necessity of the ABI compat did take place in the > review. While many 64-bit platforms would likely be passing it in a 64-bit > register and zero-extended and thus, not notice ABI breakage, some do > sign-extend (e.g. mips). > > PR: 247102 > Submitted by: Bertram Scharpf (original) > Submitted by: cem (ABI compat) > MFC after: 1 week > Differential Revision: https://reviews.freebsd.org/D26335 > Argh, I dropped this =(: Reviewed by: emaste, jhb, kib From owner-svn-src-all@freebsd.org Wed Sep 9 18:11:04 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C90C33D7B41; Wed, 9 Sep 2020 18:11:04 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bmqp050DTz4ZJR; Wed, 9 Sep 2020 18:11:04 +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 8E9662592E; Wed, 9 Sep 2020 18:11:04 +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 089IB4Yb056682; Wed, 9 Sep 2020 18:11:04 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 089IB4N4056681; Wed, 9 Sep 2020 18:11:04 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202009091811.089IB4N4056681@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 9 Sep 2020 18:11:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365507 - head/contrib/llvm-project/llvm/lib/Support X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: head/contrib/llvm-project/llvm/lib/Support X-SVN-Commit-Revision: 365507 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.33 Precedence: list List-Id: "SVN commit messages 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, 09 Sep 2020 18:11:04 -0000 Author: dim Date: Wed Sep 9 18:11:04 2020 New Revision: 365507 URL: https://svnweb.freebsd.org/changeset/base/365507 Log: Merge commit e6bb4c8e7 from llvm git (by Craig Topper): [X86] SSE4_A should only imply SSE3 not SSSE3 in the frontend. SSE4_1 and SSE4_2 due imply SSSE3. So I guess I got confused when switching the code to being table based in D83273. Fixes PR47464 This should fix builds with -march=amdfam10 emitting SSSE3 instructions such as pshufb, which lead to programs crashing with SIGILL on such processors. Reported by: avg MFC after: 6 weeks X-MFC-With: r364284 Modified: head/contrib/llvm-project/llvm/lib/Support/X86TargetParser.cpp Modified: head/contrib/llvm-project/llvm/lib/Support/X86TargetParser.cpp ============================================================================== --- head/contrib/llvm-project/llvm/lib/Support/X86TargetParser.cpp Wed Sep 9 18:07:13 2020 (r365506) +++ head/contrib/llvm-project/llvm/lib/Support/X86TargetParser.cpp Wed Sep 9 18:11:04 2020 (r365507) @@ -522,7 +522,7 @@ static constexpr FeatureBitset ImpliedFeaturesAVX5124F static constexpr FeatureBitset ImpliedFeaturesAVX5124VNNIW = {}; // SSE4_A->FMA4->XOP chain. -static constexpr FeatureBitset ImpliedFeaturesSSE4_A = FeatureSSSE3; +static constexpr FeatureBitset ImpliedFeaturesSSE4_A = FeatureSSE3; static constexpr FeatureBitset ImpliedFeaturesFMA4 = FeatureAVX | FeatureSSE4_A; static constexpr FeatureBitset ImpliedFeaturesXOP = FeatureFMA4; From owner-svn-src-all@freebsd.org Wed Sep 9 19:07:35 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6FAD23D94F8; Wed, 9 Sep 2020 19:07:35 +0000 (UTC) (envelope-from rew@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bms3C2NrGz4fPT; Wed, 9 Sep 2020 19:07:35 +0000 (UTC) (envelope-from rew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 3192C2625A; Wed, 9 Sep 2020 19:07:35 +0000 (UTC) (envelope-from rew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 089J7ZXP093146; Wed, 9 Sep 2020 19:07:35 GMT (envelope-from rew@FreeBSD.org) Received: (from rew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 089J7Y4K093144; Wed, 9 Sep 2020 19:07:34 GMT (envelope-from rew@FreeBSD.org) Message-Id: <202009091907.089J7Y4K093144@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rew set sender to rew@FreeBSD.org using -f From: Robert Wing Date: Wed, 9 Sep 2020 19:07:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365508 - in head: share/man/man5 usr.sbin/periodic X-SVN-Group: head X-SVN-Commit-Author: rew X-SVN-Commit-Paths: in head: share/man/man5 usr.sbin/periodic X-SVN-Commit-Revision: 365508 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.33 Precedence: list List-Id: "SVN commit messages 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, 09 Sep 2020 19:07:35 -0000 Author: rew Date: Wed Sep 9 19:07:34 2020 New Revision: 365508 URL: https://svnweb.freebsd.org/changeset/base/365508 Log: periodic.conf(5): don't truncate interface names reported by 420.status-network. The daily periodic script, 420.status-network uses netstat(1) to report interface status. By default, netstat(1) truncates interface names. Add the '-W' flag (avoid truncating interface names) as the default for 'daily_status_network_netstat_flags' in periodic.conf(5). The default 420.status-network command is now 'netstat -i -d -W -n'. PR: 163572 Reported by: kes-kes@yandex.ru Reviewed by: allanjude (mentor) bcr (manpages) Approved by: allanjude (mentor) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D26023 Modified: head/share/man/man5/periodic.conf.5 head/usr.sbin/periodic/periodic.conf Modified: head/share/man/man5/periodic.conf.5 ============================================================================== --- head/share/man/man5/periodic.conf.5 Wed Sep 9 18:11:04 2020 (r365507) +++ head/share/man/man5/periodic.conf.5 Wed Sep 9 19:07:34 2020 (r365508) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 16, 2020 +.Dd September 9, 2020 .Dt PERIODIC.CONF 5 .Os .Sh NAME @@ -439,7 +439,7 @@ utility when is set to .Dq Li YES . The default is -.Fl d . +.Fl d W . .It Va daily_status_network_usedns .Pq Vt bool Set to Modified: head/usr.sbin/periodic/periodic.conf ============================================================================== --- head/usr.sbin/periodic/periodic.conf Wed Sep 9 18:11:04 2020 (r365507) +++ head/usr.sbin/periodic/periodic.conf Wed Sep 9 19:07:34 2020 (r365508) @@ -123,7 +123,7 @@ daily_status_mfi_enable="NO" # Check mfiutil(8) # 420.status-network daily_status_network_enable="YES" # Check network status daily_status_network_usedns="YES" # DNS lookups are ok -daily_status_network_netstat_flags="-d" # netstat(1) flags +daily_status_network_netstat_flags="-d -W" # netstat(1) flags # 430.status-uptime daily_status_uptime_enable="YES" # Check system uptime From owner-svn-src-all@freebsd.org Wed Sep 9 19:55:18 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 443A33DA8EE; Wed, 9 Sep 2020 19:55:18 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bmt6G0zh2z3TZB; Wed, 9 Sep 2020 19:55:18 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-274.local (unknown [IPv6:2601:648:8681:1cb0:1577:6de4:8b12:1f92]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 78D9F1214E; Wed, 9 Sep 2020 19:55:17 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r365281 - in stable: 11/sys/conf 11/sys/modules 11/sys/modules/tcp 12/sys/conf 12/sys/modules 12/sys/modules/tcp From: John Baldwin To: Eugene Grosbein , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org References: <202009022136.082LatjO029946@repo.freebsd.org> <7795ab88-6220-150b-38e9-0ffae40a6093@grosbein.net> Autocrypt: addr=jhb@FreeBSD.org; keydata= mQGiBETQ+XcRBADMFybiq69u+fJRy/0wzqTNS8jFfWaBTs5/OfcV7wWezVmf9sgwn8TW0Dk0 c9MBl0pz+H01dA2ZSGZ5fXlmFIsee1WEzqeJzpiwd/pejPgSzXB9ijbLHZ2/E0jhGBcVy5Yo /Tw5+U/+laeYKu2xb0XPvM0zMNls1ah5OnP9a6Ql6wCgupaoMySb7DXm2LHD1Z9jTsHcAQMD /1jzh2BoHriy/Q2s4KzzjVp/mQO5DSm2z14BvbQRcXU48oAosHA1u3Wrov6LfPY+0U1tG47X 1BGfnQH+rNAaH0livoSBQ0IPI/8WfIW7ub4qV6HYwWKVqkDkqwcpmGNDbz3gfaDht6nsie5Z pcuCcul4M9CW7Md6zzyvktjnbz61BADGDCopfZC4of0Z3Ka0u8Wik6UJOuqShBt1WcFS8ya1 oB4rc4tXfSHyMF63aPUBMxHR5DXeH+EO2edoSwViDMqWk1jTnYza51rbGY+pebLQOVOxAY7k do5Ordl3wklBPMVEPWoZ61SdbcjhHVwaC5zfiskcxj5wwXd2E9qYlBqRg7QeSm9obiBCYWxk d2luIDxqaGJARnJlZUJTRC5vcmc+iGAEExECACAFAkTQ+awCGwMGCwkIBwMCBBUCCAMEFgID AQIeAQIXgAAKCRBy3lIGd+N/BI6RAJ9S97fvbME+3hxzE3JUyUZ6vTewDACdE1stFuSfqMvM jomvZdYxIYyTUpC5Ag0ERND5ghAIAPwsO0B7BL+bz8sLlLoQktGxXwXQfS5cInvL17Dsgnr3 1AKa94j9EnXQyPEj7u0d+LmEe6CGEGDh1OcGFTMVrof2ZzkSy4+FkZwMKJpTiqeaShMh+Goj XlwIMDxyADYvBIg3eN5YdFKaPQpfgSqhT+7El7w+wSZZD8pPQuLAnie5iz9C8iKy4/cMSOrH YUK/tO+Nhw8Jjlw94Ik0T80iEhI2t+XBVjwdfjbq3HrJ0ehqdBwukyeJRYKmbn298KOFQVHO EVbHA4rF/37jzaMadK43FgJ0SAhPPF5l4l89z5oPu0b/+5e2inA3b8J3iGZxywjM+Csq1tqz hltEc7Q+E08AAwUIAL+15XH8bPbjNJdVyg2CMl10JNW2wWg2Q6qdljeaRqeR6zFus7EZTwtX sNzs5bP8y51PSUDJbeiy2RNCNKWFMndM22TZnk3GNG45nQd4OwYK0RZVrikalmJY5Q6m7Z16 4yrZgIXFdKj2t8F+x613/SJW1lIr9/bDp4U9tw0V1g3l2dFtD3p3ZrQ3hpoDtoK70ioIAjjH aIXIAcm3FGZFXy503DOA0KaTWwvOVdYCFLm3zWuSOmrX/GsEc7ovasOWwjPn878qVjbUKWwx Q4QkF4OhUV9zPtf9tDSAZ3x7QSwoKbCoRCZ/xbyTUPyQ1VvNy/mYrBcYlzHodsaqUDjHuW+I SQQYEQIACQUCRND5ggIbDAAKCRBy3lIGd+N/BCO8AJ9j1dWVQWxw/YdTbEyrRKOY8YZNwwCf afMAg8QvmOWnHx3wl8WslCaXaE8= Message-ID: <13b91b06-b75b-55d7-64b6-d05e0a2a1c2c@FreeBSD.org> Date: Wed, 9 Sep 2020 12:55:16 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: 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.33 Precedence: list List-Id: "SVN commit messages 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, 09 Sep 2020 19:55:18 -0000 On 9/4/20 8:33 AM, John Baldwin wrote: > On 9/3/20 11:39 AM, Eugene Grosbein wrote: >> 04.09.2020 1:16, Eugene Grosbein wrote: >> Additional rollback of r365277 gave me successfull buildworld. > > Ah, it is MODULES_WITH_WORLD that is tripping you up. What is probably > needed to fix this is merging kmod.opts.mk. I can work on that. This should all be fixed now. -- John Baldwin From owner-svn-src-all@freebsd.org Wed Sep 9 20:48:58 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A0D0E3DC468; Wed, 9 Sep 2020 20:48:58 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BmvJB3mpCz3ZXc; Wed, 9 Sep 2020 20:48:58 +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 60924272D3; Wed, 9 Sep 2020 20:48:58 +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 089Kmwwv058285; Wed, 9 Sep 2020 20:48:58 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 089KmwqV058284; Wed, 9 Sep 2020 20:48:58 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202009092048.089KmwqV058284@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 9 Sep 2020 20:48:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365509 - head/lib/libcompiler_rt X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: head/lib/libcompiler_rt X-SVN-Commit-Revision: 365509 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.33 Precedence: list List-Id: "SVN commit messages 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, 09 Sep 2020 20:48:58 -0000 Author: dim Date: Wed Sep 9 20:48:57 2020 New Revision: 365509 URL: https://svnweb.freebsd.org/changeset/base/365509 Log: Follow-up r364753 by enabling compiler-rt's atomic implementation only for clang, as it uses clang specific builtins, and does not compile correctly with gcc. Note that gcc packages usually come with their own libatomic, providing these primitives. PR: 230888 MFC after: 3 days X-MFC-With: r364753 Modified: head/lib/libcompiler_rt/Makefile.inc Modified: head/lib/libcompiler_rt/Makefile.inc ============================================================================== --- head/lib/libcompiler_rt/Makefile.inc Wed Sep 9 19:07:34 2020 (r365508) +++ head/lib/libcompiler_rt/Makefile.inc Wed Sep 9 20:48:57 2020 (r365509) @@ -18,7 +18,6 @@ SRCF+= ashldi3 SRCF+= ashlti3 SRCF+= ashrdi3 SRCF+= ashrti3 -SRCF+= atomic SRCF+= bswapdi2 SRCF+= bswapsi2 SRCF+= clear_cache @@ -122,6 +121,12 @@ SRCF+= udivti3 SRCF+= umoddi3 SRCF+= umodsi3 SRCF+= umodti3 + +# Enable compiler-rt's atomic implementation only for clang, as it uses clang +# specific builtins, and gcc packages usually come with their own libatomic. +.if "${COMPILER_TYPE}" == "clang" +SRCF+= atomic +.endif # Avoid using SSE2 instructions on i386, if unsupported. .if ${MACHINE_CPUARCH} == "i386" && empty(MACHINE_CPU:Msse2) From owner-svn-src-all@freebsd.org Wed Sep 9 21:00:11 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DDC693DC93F; Wed, 9 Sep 2020 21:00: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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BmvY75ZRLz3Zxq; Wed, 9 Sep 2020 21:00: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 A2CD9276F7; Wed, 9 Sep 2020 21:00: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 089L0BQ0064492; Wed, 9 Sep 2020 21:00:11 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 089L0BHY064491; Wed, 9 Sep 2020 21:00:11 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202009092100.089L0BHY064491@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 9 Sep 2020 21:00:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365510 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 365510 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.33 Precedence: list List-Id: "SVN commit messages 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, 09 Sep 2020 21:00:11 -0000 Author: kib Date: Wed Sep 9 21:00:11 2020 New Revision: 365510 URL: https://svnweb.freebsd.org/changeset/base/365510 Log: uipc_shm.c: Move comment where it belongs. Reviewed by: markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D24652 Modified: head/sys/kern/uipc_shm.c Modified: head/sys/kern/uipc_shm.c ============================================================================== --- head/sys/kern/uipc_shm.c Wed Sep 9 20:48:57 2020 (r365509) +++ head/sys/kern/uipc_shm.c Wed Sep 9 21:00:11 2020 (r365510) @@ -684,11 +684,6 @@ shm_access(struct shmfd *shmfd, struct ucred *ucred, i return (error); } -/* - * Dictionary management. We maintain an in-kernel dictionary to map - * paths to shmfd objects. We use the FNV hash on the path to store - * the mappings in a hash table. - */ static void shm_init(void *arg) { @@ -702,6 +697,11 @@ shm_init(void *arg) } SYSINIT(shm_init, SI_SUB_SYSV_SHM, SI_ORDER_ANY, shm_init, NULL); +/* + * Dictionary management. We maintain an in-kernel dictionary to map + * paths to shmfd objects. We use the FNV hash on the path to store + * the mappings in a hash table. + */ static struct shmfd * shm_lookup(char *path, Fnv32_t fnv) { From owner-svn-src-all@freebsd.org Wed Sep 9 21:01:37 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6DBD43DC960; Wed, 9 Sep 2020 21:01:37 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BmvZn2Mlvz3bRK; Wed, 9 Sep 2020 21:01:37 +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 34DB0274F9; Wed, 9 Sep 2020 21:01:37 +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 089L1alY069282; Wed, 9 Sep 2020 21:01:36 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 089L1aWC069281; Wed, 9 Sep 2020 21:01:36 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202009092101.089L1aWC069281@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 9 Sep 2020 21:01:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365511 - head/sys/amd64/amd64 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/amd64/amd64 X-SVN-Commit-Revision: 365511 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.33 Precedence: list List-Id: "SVN commit messages 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, 09 Sep 2020 21:01:37 -0000 Author: kib Date: Wed Sep 9 21:01:36 2020 New Revision: 365511 URL: https://svnweb.freebsd.org/changeset/base/365511 Log: amd64: report support for 1G superpages in getpagesizes(2). Reviewed by: markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D24652 Modified: head/sys/amd64/amd64/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Wed Sep 9 21:00:11 2020 (r365510) +++ head/sys/amd64/amd64/pmap.c Wed Sep 9 21:01:36 2020 (r365511) @@ -2382,6 +2382,11 @@ pmap_init(void) KASSERT(MAXPAGESIZES > 1 && pagesizes[1] == 0, ("pmap_init: can't assign to pagesizes[1]")); pagesizes[1] = NBPDR; + if ((amd_feature & AMDID_PAGE1GB) != 0) { + KASSERT(MAXPAGESIZES > 1 && pagesizes[2] == 0, + ("pmap_init: can't assign to pagesizes[2]")); + pagesizes[2] = NBPDP; + } } /* From owner-svn-src-all@freebsd.org Wed Sep 9 21:08:46 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 601CD3DCCBE; Wed, 9 Sep 2020 21:08:46 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bmvl21zTXz3bwS; Wed, 9 Sep 2020 21:08: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 2861627A55; Wed, 9 Sep 2020 21:08: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 089L8kG9070389; Wed, 9 Sep 2020 21:08:46 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 089L8kXW070388; Wed, 9 Sep 2020 21:08:46 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202009092108.089L8kXW070388@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 9 Sep 2020 21:08:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365512 - head/sys/amd64/amd64 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/amd64/amd64 X-SVN-Commit-Revision: 365512 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.33 Precedence: list List-Id: "SVN commit messages 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, 09 Sep 2020 21:08:46 -0000 Author: kib Date: Wed Sep 9 21:08:45 2020 New Revision: 365512 URL: https://svnweb.freebsd.org/changeset/base/365512 Log: amd64 pmap: teach functions walking user page tables about PG_PS bit in PDPE. Only unmanaged 1G superpages are handled. Reviewed by: markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D24652 Modified: head/sys/amd64/amd64/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Wed Sep 9 21:01:36 2020 (r365511) +++ head/sys/amd64/amd64/pmap.c Wed Sep 9 21:08:45 2020 (r365512) @@ -48,7 +48,7 @@ */ /*- * Copyright (c) 2003 Networks Associates Technology, Inc. - * Copyright (c) 2014-2019 The FreeBSD Foundation + * Copyright (c) 2014-2020 The FreeBSD Foundation * All rights reserved. * * This software was developed for the FreeBSD Project by Jake Burkholder, @@ -1415,6 +1415,8 @@ pmap_pde(pmap_t pmap, vm_offset_t va) pdpe = pmap_pdpe(pmap, va); if (pdpe == NULL || (*pdpe & PG_V) == 0) return (NULL); + KASSERT((*pdpe & PG_PS) == 0, + ("pmap_pde for 1G page, pmap %p va %#lx", pmap, va)); return (pmap_pdpe_to_pde(pdpe, va)); } @@ -3570,6 +3572,7 @@ pmap_extract(pmap_t pmap, vm_offset_t va) vm_page_t pmap_extract_and_hold(pmap_t pmap, vm_offset_t va, vm_prot_t prot) { + pdp_entry_t pdpe, *pdpep; pd_entry_t pde, *pdep; pt_entry_t pte, PG_RW, PG_V; vm_page_t m; @@ -3577,23 +3580,38 @@ pmap_extract_and_hold(pmap_t pmap, vm_offset_t va, vm_ m = NULL; PG_RW = pmap_rw_bit(pmap); PG_V = pmap_valid_bit(pmap); - PMAP_LOCK(pmap); - pdep = pmap_pde(pmap, va); - if (pdep != NULL && (pde = *pdep)) { - if (pde & PG_PS) { - if ((pde & PG_RW) != 0 || (prot & VM_PROT_WRITE) == 0) - m = PHYS_TO_VM_PAGE((pde & PG_PS_FRAME) | - (va & PDRMASK)); - } else { - pte = *pmap_pde_to_pte(pdep, va); - if ((pte & PG_V) != 0 && - ((pte & PG_RW) != 0 || (prot & VM_PROT_WRITE) == 0)) - m = PHYS_TO_VM_PAGE(pte & PG_FRAME); - } - if (m != NULL && !vm_page_wire_mapped(m)) - m = NULL; + + pdpep = pmap_pdpe(pmap, va); + if (pdpep == NULL || ((pdpe = *pdpep) & PG_V) == 0) + goto out; + if ((pdpe & PG_PS) != 0) { + if ((pdpe & PG_RW) == 0 && (prot & VM_PROT_WRITE) != 0) + goto out; + m = PHYS_TO_VM_PAGE((pdpe & PG_PS_FRAME) | (va & PDPMASK)); + goto check_page; } + + pdep = pmap_pdpe_to_pde(pdpep, va); + if (pdep == NULL || ((pde = *pdep) & PG_V) == 0) + goto out; + if ((pde & PG_PS) != 0) { + if ((pde & PG_RW) == 0 && (prot & VM_PROT_WRITE) != 0) + goto out; + m = PHYS_TO_VM_PAGE((pde & PG_PS_FRAME) | (va & PDRMASK)); + goto check_page; + } + + pte = *pmap_pde_to_pte(pdep, va); + if ((pte & PG_V) == 0 || + ((pte & PG_RW) == 0 && (prot & VM_PROT_WRITE) != 0)) + goto out; + m = PHYS_TO_VM_PAGE(pte & PG_FRAME); + +check_page: + if (m != NULL && !vm_page_wire_mapped(m)) + m = NULL; +out: PMAP_UNLOCK(pmap); return (m); } @@ -5854,6 +5872,7 @@ void pmap_remove(pmap_t pmap, vm_offset_t sva, vm_offset_t eva) { struct rwlock *lock; + vm_page_t mt; vm_offset_t va_next; pml5_entry_t *pml5e; pml4_entry_t *pml4e; @@ -5917,13 +5936,28 @@ pmap_remove(pmap_t pmap, vm_offset_t sva, vm_offset_t } pdpe = pmap_pml4e_to_pdpe(pml4e, sva); + va_next = (sva + NBPDP) & ~PDPMASK; if ((*pdpe & PG_V) == 0) { - va_next = (sva + NBPDP) & ~PDPMASK; if (va_next < sva) va_next = eva; continue; } + KASSERT((*pdpe & PG_PS) == 0 || va_next <= eva, + ("pmap_remove of non-transient 1G page " + "pdpe %#lx sva %#lx eva %#lx va_next %#lx", + *pdpe, sva, eva, va_next)); + if ((*pdpe & PG_PS) != 0) { + MPASS(pmap != kernel_pmap); /* XXXKIB */ + MPASS((*pdpe & (PG_MANAGED | PG_G)) == 0); + anyvalid = 1; + *pdpe = 0; + pmap_resident_count_dec(pmap, NBPDP / PAGE_SIZE); + mt = PHYS_TO_VM_PAGE(*pmap_pml4e(pmap, sva) & PG_FRAME); + pmap_unwire_ptp(pmap, sva, mt, &free); + continue; + } + /* * Calculate index for next page table. */ @@ -6139,11 +6173,13 @@ retry: void pmap_protect(pmap_t pmap, vm_offset_t sva, vm_offset_t eva, vm_prot_t prot) { + vm_page_t m; vm_offset_t va_next; pml4_entry_t *pml4e; pdp_entry_t *pdpe; pd_entry_t ptpaddr, *pde; pt_entry_t *pte, PG_G, PG_M, PG_RW, PG_V; + pt_entry_t obits, pbits; boolean_t anychanged; KASSERT((prot & ~VM_PROT_ALL) == 0, ("invalid prot %x", prot)); @@ -6193,13 +6229,36 @@ pmap_protect(pmap_t pmap, vm_offset_t sva, vm_offset_t } pdpe = pmap_pml4e_to_pdpe(pml4e, sva); + va_next = (sva + NBPDP) & ~PDPMASK; if ((*pdpe & PG_V) == 0) { - va_next = (sva + NBPDP) & ~PDPMASK; if (va_next < sva) va_next = eva; continue; } + KASSERT((*pdpe & PG_PS) == 0 || va_next <= eva, + ("pmap_remove of non-transient 1G page " + "pdpe %#lx sva %#lx eva %#lx va_next %#lx", + *pdpe, sva, eva, va_next)); + if ((*pdpe & PG_PS) != 0) { +retry_pdpe: + obits = pbits = *pdpe; + MPASS((pbits & (PG_MANAGED | PG_G)) == 0); + MPASS(pmap != kernel_pmap); /* XXXKIB */ + if ((prot & VM_PROT_WRITE) == 0) + pbits &= ~(PG_RW | PG_M); + if ((prot & VM_PROT_EXECUTE) == 0) + pbits |= pg_nx; + + if (pbits != obits) { + if (!atomic_cmpset_long(pdpe, obits, pbits)) + /* PG_PS cannot be cleared under us, */ + goto retry_pdpe; + anychanged = TRUE; + } + continue; + } + va_next = (sva + NBPDR) & ~PDRMASK; if (va_next < sva) va_next = eva; @@ -6242,9 +6301,6 @@ pmap_protect(pmap_t pmap, vm_offset_t sva, vm_offset_t for (pte = pmap_pde_to_pte(pde, sva); sva != va_next; pte++, sva += PAGE_SIZE) { - pt_entry_t obits, pbits; - vm_page_t m; - retry: obits = pbits = *pte; if ((pbits & PG_V) == 0) @@ -7184,9 +7240,10 @@ pmap_unwire(pmap_t pmap, vm_offset_t sva, vm_offset_t pml4_entry_t *pml4e; pdp_entry_t *pdpe; pd_entry_t *pde; - pt_entry_t *pte, PG_V; + pt_entry_t *pte, PG_V, PG_G; PG_V = pmap_valid_bit(pmap); + PG_G = pmap_global_bit(pmap); PMAP_LOCK(pmap); for (; sva < eva; sva = va_next) { pml4e = pmap_pml4e(pmap, sva); @@ -7197,12 +7254,23 @@ pmap_unwire(pmap_t pmap, vm_offset_t sva, vm_offset_t continue; } pdpe = pmap_pml4e_to_pdpe(pml4e, sva); - if ((*pdpe & PG_V) == 0) { - va_next = (sva + NBPDP) & ~PDPMASK; - if (va_next < sva) - va_next = eva; + va_next = (sva + NBPDP) & ~PDPMASK; + if (va_next < sva) + va_next = eva; + if ((*pdpe & PG_V) == 0) continue; + KASSERT((*pdpe & PG_PS) == 0 || va_next <= eva, + ("pmap_unwire of non-transient 1G page " + "pdpe %#lx sva %#lx eva %#lx va_next %#lx", + *pdpe, sva, eva, va_next)); + if ((*pdpe & PG_PS) != 0) { + MPASS(pmap != kernel_pmap); /* XXXKIB */ + MPASS((*pdpe & (PG_MANAGED | PG_G)) == 0); + atomic_clear_long(pdpe, PG_W); + pmap->pm_stats.wired_count -= NBPDP / PAGE_SIZE; + continue; } + va_next = (sva + NBPDR) & ~PDRMASK; if (va_next < sva) va_next = eva; @@ -7319,6 +7387,12 @@ pmap_copy(pmap_t dst_pmap, pmap_t src_pmap, vm_offset_ } va_next = (addr + NBPDR) & ~PDRMASK; + KASSERT((*pdpe & PG_PS) == 0 || va_next <= end_addr, + ("pmap_copy of partial non-transient 1G page " + "pdpe %#lx sva %#lx eva %#lx va_next %#lx", + *pdpe, addr, end_addr, va_next)); + if ((*pdpe & PG_PS) != 0) + continue; if (va_next < addr) va_next = end_addr; @@ -8375,6 +8449,12 @@ pmap_advise(pmap_t pmap, vm_offset_t sva, vm_offset_t va_next = (sva + NBPDR) & ~PDRMASK; if (va_next < sva) va_next = eva; + KASSERT((*pdpe & PG_PS) == 0 || va_next <= eva, + ("pmap_advise of non-transient 1G page " + "pdpe %#lx sva %#lx eva %#lx va_next %#lx", + *pdpe, sva, eva, va_next)); + if ((*pdpe & PG_PS) != 0) + continue; pde = pmap_pdpe_to_pde(pdpe, sva); oldpde = *pde; if ((oldpde & PG_V) == 0) @@ -9136,6 +9216,7 @@ pmap_demote_DMAP(vm_paddr_t base, vm_size_t len, boole int pmap_mincore(pmap_t pmap, vm_offset_t addr, vm_paddr_t *pap) { + pdp_entry_t *pdpe; pd_entry_t *pdep; pt_entry_t pte, PG_A, PG_M, PG_RW, PG_V; vm_paddr_t pa; @@ -9147,23 +9228,32 @@ pmap_mincore(pmap_t pmap, vm_offset_t addr, vm_paddr_t PG_RW = pmap_rw_bit(pmap); PMAP_LOCK(pmap); - pdep = pmap_pde(pmap, addr); - if (pdep != NULL && (*pdep & PG_V)) { - if (*pdep & PG_PS) { - pte = *pdep; - /* Compute the physical address of the 4KB page. */ - pa = ((*pdep & PG_PS_FRAME) | (addr & PDRMASK)) & + pte = 0; + pa = 0; + val = 0; + pdpe = pmap_pdpe(pmap, addr); + if ((*pdpe & PG_V) != 0) { + if ((*pdpe & PG_PS) != 0) { + pte = *pdpe; + pa = ((pte & PG_PS_PDP_FRAME) | (addr & PDPMASK)) & PG_FRAME; - val = MINCORE_PSIND(1); + val = MINCORE_PSIND(2); } else { - pte = *pmap_pde_to_pte(pdep, addr); - pa = pte & PG_FRAME; - val = 0; + pdep = pmap_pde(pmap, addr); + if (pdep != NULL && (*pdep & PG_V) != 0) { + if ((*pdep & PG_PS) != 0) { + pte = *pdep; + /* Compute the physical address of the 4KB page. */ + pa = ((pte & PG_PS_FRAME) | (addr & + PDRMASK)) & PG_FRAME; + val = MINCORE_PSIND(1); + } else { + pte = *pmap_pde_to_pte(pdep, addr); + pa = pte & PG_FRAME; + val = 0; + } + } } - } else { - pte = 0; - pa = 0; - val = 0; } if ((pte & PG_V) != 0) { val |= MINCORE_INCORE; From owner-svn-src-all@freebsd.org Wed Sep 9 21:34:32 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9F5D83DD53D; Wed, 9 Sep 2020 21:34:32 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BmwJm3nHBz3d4X; Wed, 9 Sep 2020 21:34:32 +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 64F2927F4B; Wed, 9 Sep 2020 21:34:32 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 089LYWaD088608; Wed, 9 Sep 2020 21:34:32 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 089LYVLe088605; Wed, 9 Sep 2020 21:34:31 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202009092134.089LYVLe088605@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 9 Sep 2020 21:34:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365513 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 365513 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.33 Precedence: list List-Id: "SVN commit messages 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, 09 Sep 2020 21:34:32 -0000 Author: kib Date: Wed Sep 9 21:34:31 2020 New Revision: 365513 URL: https://svnweb.freebsd.org/changeset/base/365513 Log: Prepare to handle non-trivial errors from vm_map_delete(). Reviewed by: markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D24652 Modified: head/sys/vm/vm_map.c head/sys/vm/vm_mmap.c head/sys/vm/vm_unix.c Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Wed Sep 9 21:08:45 2020 (r365512) +++ head/sys/vm/vm_map.c Wed Sep 9 21:34:31 2020 (r365513) @@ -1868,8 +1868,11 @@ vm_map_fixed(vm_map_t map, vm_object_t object, vm_ooff ("vm_map_fixed: non-NULL backing object for stack")); vm_map_lock(map); VM_MAP_RANGE_CHECK(map, start, end); - if ((cow & MAP_CHECK_EXCL) == 0) - vm_map_delete(map, start, end); + if ((cow & MAP_CHECK_EXCL) == 0) { + result = vm_map_delete(map, start, end); + if (result != KERN_SUCCESS) + goto out; + } if ((cow & (MAP_STACK_GROWS_DOWN | MAP_STACK_GROWS_UP)) != 0) { result = vm_map_stack_locked(map, start, length, sgrowsiz, prot, max, cow); @@ -1877,6 +1880,7 @@ vm_map_fixed(vm_map_t map, vm_object_t object, vm_ooff result = vm_map_insert(map, object, offset, start, end, prot, max, cow); } +out: vm_map_unlock(map); return (result); } @@ -2115,7 +2119,9 @@ again: rv = KERN_INVALID_ADDRESS; goto done; } - vm_map_delete(map, *addr, *addr + length); + rv = vm_map_delete(map, *addr, *addr + length); + if (rv != KERN_SUCCESS) + goto done; } if ((cow & (MAP_STACK_GROWS_DOWN | MAP_STACK_GROWS_UP)) != 0) { rv = vm_map_stack_locked(map, *addr, length, sgrowsiz, prot, Modified: head/sys/vm/vm_mmap.c ============================================================================== --- head/sys/vm/vm_mmap.c Wed Sep 9 21:08:45 2020 (r365512) +++ head/sys/vm/vm_mmap.c Wed Sep 9 21:34:31 2020 (r365513) @@ -577,6 +577,7 @@ kern_munmap(struct thread *td, uintptr_t addr0, size_t vm_offset_t addr, end; vm_size_t pageoff; vm_map_t map; + int rv; if (size == 0) return (EINVAL); @@ -614,10 +615,10 @@ kern_munmap(struct thread *td, uintptr_t addr0, size_t } } #endif - vm_map_delete(map, addr, end); + rv = vm_map_delete(map, addr, end); #ifdef HWPMC_HOOKS - if (__predict_false(pmc_handled)) { + if (rv == KERN_SUCCESS && __predict_false(pmc_handled)) { /* downgrade the lock to prevent a LOR with the pmc-sx lock */ vm_map_lock_downgrade(map); if (pkm.pm_address != (uintptr_t) NULL) @@ -627,8 +628,7 @@ kern_munmap(struct thread *td, uintptr_t addr0, size_t #endif vm_map_unlock(map); - /* vm_map_delete returns nothing but KERN_SUCCESS anyway */ - return (0); + return (vm_mmap_to_errno(rv)); } #ifndef _SYS_SYSPROTO_H_ Modified: head/sys/vm/vm_unix.c ============================================================================== --- head/sys/vm/vm_unix.c Wed Sep 9 21:08:45 2020 (r365512) +++ head/sys/vm/vm_unix.c Wed Sep 9 21:34:31 2020 (r365513) @@ -188,7 +188,7 @@ kern_break(struct thread *td, uintptr_t *addr) rv = vm_map_wire_locked(map, old, new, VM_MAP_WIRE_USER | VM_MAP_WIRE_NOHOLES); if (rv != KERN_SUCCESS) - vm_map_delete(map, old, new); + (void)vm_map_delete(map, old, new); } if (rv != KERN_SUCCESS) { #ifdef RACCT From owner-svn-src-all@freebsd.org Wed Sep 9 21:35:45 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5C83E3DD0F4; Wed, 9 Sep 2020 21:35:45 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BmwL911RJz3d5L; Wed, 9 Sep 2020 21:35:45 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0650A27DE9; Wed, 9 Sep 2020 21:35:45 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 089LZib1088721; Wed, 9 Sep 2020 21:35:44 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 089LZinY088720; Wed, 9 Sep 2020 21:35:44 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202009092135.089LZinY088720@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 9 Sep 2020 21:35:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365514 - head/sys/amd64/amd64 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/amd64/amd64 X-SVN-Commit-Revision: 365514 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.33 Precedence: list List-Id: "SVN commit messages 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, 09 Sep 2020 21:35:45 -0000 Author: kib Date: Wed Sep 9 21:35:44 2020 New Revision: 365514 URL: https://svnweb.freebsd.org/changeset/base/365514 Log: Fix assert. Noted by: alc MFC after: 1 week Modified: head/sys/amd64/amd64/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Wed Sep 9 21:34:31 2020 (r365513) +++ head/sys/amd64/amd64/pmap.c Wed Sep 9 21:35:44 2020 (r365514) @@ -2385,7 +2385,7 @@ pmap_init(void) ("pmap_init: can't assign to pagesizes[1]")); pagesizes[1] = NBPDR; if ((amd_feature & AMDID_PAGE1GB) != 0) { - KASSERT(MAXPAGESIZES > 1 && pagesizes[2] == 0, + KASSERT(MAXPAGESIZES > 2 && pagesizes[2] == 0, ("pmap_init: can't assign to pagesizes[2]")); pagesizes[2] = NBPDP; } From owner-svn-src-all@freebsd.org Wed Sep 9 21:39:07 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D266E3DD5D1; Wed, 9 Sep 2020 21:39:07 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BmwQ35G64z3dN9; Wed, 9 Sep 2020 21:39:07 +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 995E127F52; Wed, 9 Sep 2020 21:39:07 +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 089Ld7KW088927; Wed, 9 Sep 2020 21:39:07 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 089Ld7wK088924; Wed, 9 Sep 2020 21:39:07 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202009092139.089Ld7wK088924@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 9 Sep 2020 21:39:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365515 - in head/sys: sys vm X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys: sys vm X-SVN-Commit-Revision: 365515 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.33 Precedence: list List-Id: "SVN commit messages 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, 09 Sep 2020 21:39:07 -0000 Author: kib Date: Wed Sep 9 21:39:06 2020 New Revision: 365515 URL: https://svnweb.freebsd.org/changeset/base/365515 Log: Move MAP_32BIT_MAX_ADDR definition to sys/mman.h. Reviewed by: markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D24652 Modified: head/sys/sys/mman.h head/sys/vm/vm_map.c Modified: head/sys/sys/mman.h ============================================================================== --- head/sys/sys/mman.h Wed Sep 9 21:35:44 2020 (r365514) +++ head/sys/sys/mman.h Wed Sep 9 21:39:06 2020 (r365515) @@ -296,6 +296,9 @@ void shm_drop(struct shmfd *shmfd); int shm_dotruncate(struct shmfd *shmfd, off_t length); extern struct fileops shm_ops; + +#define MAP_32BIT_MAX_ADDR ((vm_offset_t)1 << 31) + #else /* !_KERNEL */ __BEGIN_DECLS Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Wed Sep 9 21:35:44 2020 (r365514) +++ head/sys/vm/vm_map.c Wed Sep 9 21:39:06 2020 (r365515) @@ -1913,8 +1913,6 @@ SYSCTL_LONG(_vm, OID_AUTO, aslr_restarts, CTLFLAG_RD, &aslr_restarts, 0, "Number of aslr failures"); -#define MAP_32BIT_MAX_ADDR ((vm_offset_t)1 << 31) - /* * Searches for the specified amount of free space in the given map with the * specified alignment. Performs an address-ordered, first-fit search from From owner-svn-src-all@freebsd.org Wed Sep 9 21:45:00 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2DC1B3DD87F; Wed, 9 Sep 2020 21:45:00 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BmwXr0GGBz3dyd; Wed, 9 Sep 2020 21:45:00 +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 DC19884F1; Wed, 9 Sep 2020 21:44:59 +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 089LixPo094840; Wed, 9 Sep 2020 21:44:59 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 089LixkA094838; Wed, 9 Sep 2020 21:44:59 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202009092144.089LixkA094838@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 9 Sep 2020 21:44:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365516 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 365516 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.33 Precedence: list List-Id: "SVN commit messages 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, 09 Sep 2020 21:45:00 -0000 Author: kib Date: Wed Sep 9 21:44:59 2020 New Revision: 365516 URL: https://svnweb.freebsd.org/changeset/base/365516 Log: Add vm_map_find_aligned(9). Reviewed by: markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D24652 Modified: head/sys/vm/vm_map.c head/sys/vm/vm_map.h Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Wed Sep 9 21:39:06 2020 (r365515) +++ head/sys/vm/vm_map.c Wed Sep 9 21:44:59 2020 (r365516) @@ -1980,6 +1980,19 @@ vm_map_alignspace(vm_map_t map, vm_object_t object, vm } } +int +vm_map_find_aligned(vm_map_t map, vm_offset_t *addr, vm_size_t length, + vm_offset_t max_addr, vm_offset_t alignment) +{ + /* XXXKIB ASLR eh ? */ + *addr = vm_map_findspace(map, *addr, length); + if (*addr + length > vm_map_max(map) || + (max_addr != 0 && *addr + length > max_addr)) + return (KERN_NO_SPACE); + return (vm_map_alignspace(map, NULL, 0, addr, length, max_addr, + alignment)); +} + /* * vm_map_find finds an unallocated region in the target address * map with the given length. The search is defined to be Modified: head/sys/vm/vm_map.h ============================================================================== --- head/sys/vm/vm_map.h Wed Sep 9 21:39:06 2020 (r365515) +++ head/sys/vm/vm_map.h Wed Sep 9 21:44:59 2020 (r365516) @@ -460,6 +460,8 @@ int vm_map_find(vm_map_t, vm_object_t, vm_ooffset_t, v vm_offset_t, int, vm_prot_t, vm_prot_t, int); int vm_map_find_min(vm_map_t, vm_object_t, vm_ooffset_t, vm_offset_t *, vm_size_t, vm_offset_t, vm_offset_t, int, vm_prot_t, vm_prot_t, int); +int vm_map_find_aligned(vm_map_t map, vm_offset_t *addr, vm_size_t length, + vm_offset_t max_addr, vm_offset_t alignment); int vm_map_fixed(vm_map_t, vm_object_t, vm_ooffset_t, vm_offset_t, vm_size_t, vm_prot_t, vm_prot_t, int); vm_offset_t vm_map_findspace(vm_map_t, vm_offset_t, vm_size_t); From owner-svn-src-all@freebsd.org Wed Sep 9 21:45:19 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A69583DD965; Wed, 9 Sep 2020 21:45:19 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BmwYC3d9zz3dwM; Wed, 9 Sep 2020 21:45:19 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 60C4B27FFC; Wed, 9 Sep 2020 21:45:19 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 089LjJ8a094918; Wed, 9 Sep 2020 21:45:19 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 089LjJSZ094917; Wed, 9 Sep 2020 21:45:19 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <202009092145.089LjJSZ094917@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Wed, 9 Sep 2020 21:45:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365517 - head/sys/net/route X-SVN-Group: head X-SVN-Commit-Author: melifaro X-SVN-Commit-Paths: head/sys/net/route X-SVN-Commit-Revision: 365517 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.33 Precedence: list List-Id: "SVN commit messages 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, 09 Sep 2020 21:45:19 -0000 Author: melifaro Date: Wed Sep 9 21:45:18 2020 New Revision: 365517 URL: https://svnweb.freebsd.org/changeset/base/365517 Log: Retain marking net.fibs sysctl as a tunable. Suggested by: avg Modified: head/sys/net/route/route_tables.c Modified: head/sys/net/route/route_tables.c ============================================================================== --- head/sys/net/route/route_tables.c Wed Sep 9 21:44:59 2020 (r365516) +++ head/sys/net/route/route_tables.c Wed Sep 9 21:45:18 2020 (r365517) @@ -140,8 +140,8 @@ sysctl_fibs(SYSCTL_HANDLER_ARGS) return (error); } SYSCTL_PROC(_net, OID_AUTO, fibs, - CTLFLAG_VNET | CTLTYPE_U32 | CTLFLAG_MPSAFE, NULL, 0, - &sysctl_fibs, "IU", + CTLFLAG_VNET | CTLTYPE_U32 | CTLFLAG_RWTUN | CTLFLAG_NOFETCH | CTLFLAG_MPSAFE, + NULL, 0, &sysctl_fibs, "IU", "set number of fibs"); /* From owner-svn-src-all@freebsd.org Wed Sep 9 21:47:40 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3E9B63DDE53; Wed, 9 Sep 2020 21:47:40 +0000 (UTC) (envelope-from melifaro@ipfw.ru) Received: from forward501j.mail.yandex.net (forward501j.mail.yandex.net [IPv6:2a02:6b8:0:801:2::111]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bmwbv4s5Xz3fXK; Wed, 9 Sep 2020 21:47:39 +0000 (UTC) (envelope-from melifaro@ipfw.ru) Received: from mxback9o.mail.yandex.net (mxback9o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::23]) by forward501j.mail.yandex.net (Yandex) with ESMTP id 37F113380EA6; Thu, 10 Sep 2020 00:47:35 +0300 (MSK) Received: from localhost (localhost [::1]) by mxback9o.mail.yandex.net (mxback/Yandex) with ESMTP id nGAiy4Tsmb-lYomNl7C; Thu, 10 Sep 2020 00:47:34 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfw.ru; s=mail; t=1599688054; bh=BmVqQBEvR+5oLo+X6GlbVigmqQqsEpuroDSDEw+r3z8=; h=Message-Id:Subject:In-Reply-To:Date:References:To:From; b=syK3GVKQ/b+kxhbrCIfEtJliqPL64D4Ytii7IcEGGNhYqvlV0kF8Fs/vVeUVFw2Er WMk1K23U3CKWXAP8WFjTi0YcA3e8fL6J2Kn67u+BpDyudjnAKyMG9ANZOjK8utV/pf HqtdqKeVlLj3xoSexkt4zQS4NntWOWZbZJF4D+ow= Received: by sas8-75f070ddfcf3.qloud-c.yandex.net with HTTP; Thu, 10 Sep 2020 00:47:34 +0300 From: Alexander V. Chernikov Envelope-From: melifaro@ipfw.ru To: Andriy Gapon , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" In-Reply-To: <05bfa3f4-8c95-3ad4-80b5-c5e48cd6370d@FreeBSD.org> References: <202008212134.07LLYq3K071532@repo.freebsd.org> <69399f59-4eca-ee29-7230-678a02cf6eff@FreeBSD.org> <93541599601730@mail.yandex.ru> <05bfa3f4-8c95-3ad4-80b5-c5e48cd6370d@FreeBSD.org> Subject: Re: svn commit: r364465 - in head/sys: conf net net/route MIME-Version: 1.0 X-Mailer: Yamail [ http://yandex.ru ] 5.0 Date: Wed, 09 Sep 2020 22:47:34 +0100 Message-Id: <74621599687936@mail.yandex.ru> Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=utf-8 X-Rspamd-Queue-Id: 4Bmwbv4s5Xz3fXK X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:13238, ipnet:2a02:6b8::/32, country:RU] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 09 Sep 2020 21:47:40 -0000 09.09.2020, 07:13, "Andriy Gapon" : > On 09/09/2020 00:50, Alexander V. Chernikov wrote: >>  08.09.2020, 21:03, "Andriy Gapon" : >>>  On 22/08/2020 00:34, Alexander V. Chernikov wrote: >>>>   Author: melifaro >>>>   Date: Fri Aug 21 21:34:52 2020 >>>>   New Revision: 364465 >>>>   URL: https://svnweb.freebsd.org/changeset/base/364465 >>>> >>>>   Log: >>>>     Make net.fibs growable. >>>> >>>>     Allow to dynamically grow the amount of fibs in each vnet. >>>> >>>>     This change alters current behavior. Currently, if one defines >>>>      ROUTETABLES > 1 in the kernel config, each vnet will be created >>>>      with the number of fibs defined in the kernel config. >>>>      After this commit vnets will be created with fibs=1. >>>> >>>>     Dynamic net.fibs is not compatible with net.add_addr_allfibs. >>>>      The plan is to deprecate the latter and make >>>>      net.add_addr_allfibs=0 default behaviour. >>>> >>>>     Reviewed by: glebius >>>>     Relnotes: yes >>>>     Differential Revision: https://reviews.freebsd.org/D26062 >>> >>>  I wonder why no one reported a problem that I am seeing after upgrading past >>>  this revision. Maybe because I do have net.fibs=2 in my loader.conf? >>  Hi Andriy, >> >>  Does r365475 fix the problem for you? >>  CTLFLAG_RWTUN flag got slipped through the cracks somewhere :-( > > I am not sure that it does, I haven't tried it, but I agree with Ryan's comment. It should. > In general, I would keep CTLFLAG_RWTUN as the knob is a tunable indeed and some > tools query that flag. Thanks for the suggestion, I've updated the params to include CTLFLAG_NOFETCH in r365517. > So, I would like to re-iterate my earlier suggestion to use CTLFLAG_NOFETCH > paired with explicit TUNABLE_INT_FETCH (which seems to be there already). > >>>  The problem -- unfortunately I only have a screenshot -- but it's a page fault >>>  trap in this call chain: >>>  sysctl_register_all -> sysctl_load_tunable_by_oid_locked -> sysctl_fibs -> >>>  _sx_xlock. >>> >>>  The crash is on the RTABLES_LOCK() line. >>>  And it's kind of obvious why. >>> >>>  The tunables, including net.fibs which is declared as RWTUN, are set at >>>  SI_SUB_TUNABLES stage, but RTABLES_LOCK_INIT() is not called until >>>  SI_SUB_PROTO_DOMAIN much later. In other words, sysctal_fibs can be called >>>  earlier than vnet_rtables_init. >>> >>>  I think that the best way to handle the problem would be to add CTLFLAG_NOFETCH >>>  to the sysctl declaration and then to add -- if necessary at all -- an explicit >>>  query of the kenv. >>> >>>  -- >>>  Andriy Gapon > > -- > Andriy Gapon From owner-svn-src-all@freebsd.org Wed Sep 9 21:50:25 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AE64A3DE092; Wed, 9 Sep 2020 21:50:25 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bmwg5476Vz3fw3; Wed, 9 Sep 2020 21:50:25 +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 575178510; Wed, 9 Sep 2020 21:50:25 +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 089LoPG7095311; Wed, 9 Sep 2020 21:50:25 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 089LoPjv095309; Wed, 9 Sep 2020 21:50:25 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202009092150.089LoPjv095309@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 9 Sep 2020 21:50:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365518 - in head/sys: amd64/amd64 vm X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys: amd64/amd64 vm X-SVN-Commit-Revision: 365518 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.33 Precedence: list List-Id: "SVN commit messages 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, 09 Sep 2020 21:50:25 -0000 Author: kib Date: Wed Sep 9 21:50:24 2020 New Revision: 365518 URL: https://svnweb.freebsd.org/changeset/base/365518 Log: Add pmap_enter(9) PMAP_ENTER_LARGEPAGE flag and implement it on amd64. The flag requests entry of non-managed superpage mapping of size pagesizes[psind] into the page table. Pmap supports fake wiring of the largepage mappings. Only attributes of the largepage mapping can be changed by calling pmap_enter(9) over existing mapping, physical address of the page must be unchanged. Reviewed by: markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D24652 Modified: head/sys/amd64/amd64/pmap.c head/sys/vm/pmap.h Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Wed Sep 9 21:45:18 2020 (r365517) +++ head/sys/amd64/amd64/pmap.c Wed Sep 9 21:50:24 2020 (r365518) @@ -6475,6 +6475,119 @@ setpte: } #endif /* VM_NRESERVLEVEL > 0 */ +static int +pmap_enter_largepage(pmap_t pmap, vm_offset_t va, pt_entry_t newpte, int flags, + int psind) +{ + vm_page_t mp; + pt_entry_t origpte, *pml4e, *pdpe, *pde, pten, PG_V; + + PMAP_LOCK_ASSERT(pmap, MA_OWNED); + KASSERT(psind > 0 && psind < MAXPAGESIZES, + ("psind %d unexpected", psind)); + KASSERT(((newpte & PG_FRAME) & (pagesizes[psind] - 1)) == 0, + ("unaligned phys address %#lx newpte %#lx psind %d", + newpte & PG_FRAME, newpte, psind)); + KASSERT((va & (pagesizes[psind] - 1)) == 0, + ("unaligned va %#lx psind %d", va, psind)); + KASSERT(va < VM_MAXUSER_ADDRESS, + ("kernel mode non-transparent superpage")); /* XXXKIB */ + KASSERT(va + pagesizes[psind] < VM_MAXUSER_ADDRESS, + ("overflowing user map va %#lx psind %d", va, psind)); /* XXXKIB */ + + PG_V = pmap_valid_bit(pmap); + +restart: + pten = newpte; + if (va < VM_MAXUSER_ADDRESS && pmap->pm_type == PT_X86) + pten |= pmap_pkru_get(pmap, va); + + if (psind == 2) { /* 1G */ + if (!pmap_pkru_same(pmap, va, va + NBPDP)) + return (KERN_PROTECTION_FAILURE); + pml4e = pmap_pml4e(pmap, va); + if ((*pml4e & PG_V) == 0) { + mp = _pmap_allocpte(pmap, pmap_pml4e_pindex(va), + NULL, va); + if (mp == NULL) { + if ((flags & PMAP_ENTER_NOSLEEP) != 0) + return (KERN_RESOURCE_SHORTAGE); + PMAP_UNLOCK(pmap); + vm_wait(NULL); + PMAP_LOCK(pmap); + + /* + * Restart at least to recalcuate the pkru + * key. Our caller must keep the map locked + * so no paging structure can be validated + * under us. + */ + goto restart; + } + pdpe = pmap_pdpe(pmap, va); + KASSERT(pdpe != NULL, ("va %#lx lost pdpe", va)); + origpte = *pdpe; + MPASS(origpte == 0); + } else { + mp = PHYS_TO_VM_PAGE(*pml4e & PG_FRAME); + pdpe = pmap_pdpe(pmap, va); + KASSERT(pdpe != NULL, ("va %#lx lost pdpe", va)); + origpte = *pdpe; + if ((origpte & PG_V) == 0) + mp->ref_count++; + } + KASSERT((origpte & PG_V) == 0 || ((origpte & PG_PS) != 0 && + (origpte & PG_FRAME) == (newpte & PG_FRAME)), + ("va %#lx changing 1G phys page pdpe %#lx newpte %#lx", + va, origpte, newpte)); + if ((newpte & PG_W) != 0 && (origpte & PG_W) == 0) + pmap->pm_stats.wired_count += NBPDP / PAGE_SIZE; + else if ((newpte & PG_W) == 0 && (origpte & PG_W) != 0) + pmap->pm_stats.wired_count -= NBPDP / PAGE_SIZE; + *pdpe = newpte; + } else /* (psind == 1) */ { /* 2M */ + if (!pmap_pkru_same(pmap, va, va + NBPDR)) + return (KERN_PROTECTION_FAILURE); + pde = pmap_pde(pmap, va); + if (pde == NULL) { + mp = _pmap_allocpte(pmap, pmap_pdpe_pindex(va), + NULL, va); + if (mp == NULL) { + if ((flags & PMAP_ENTER_NOSLEEP) != 0) + return (KERN_RESOURCE_SHORTAGE); + PMAP_UNLOCK(pmap); + vm_wait(NULL); + PMAP_LOCK(pmap); + goto restart; + } + pde = (pd_entry_t *)PHYS_TO_DMAP(VM_PAGE_TO_PHYS(mp)); + pde = &pde[pmap_pde_index(va)]; + origpte = *pde; + MPASS(origpte == 0); + } else { + pdpe = pmap_pdpe(pmap, va); + MPASS(pdpe != NULL && (*pdpe & PG_V) != 0); + mp = PHYS_TO_VM_PAGE(*pdpe & PG_FRAME); + origpte = *pde; + if ((origpte & PG_V) == 0) + mp->ref_count++; + } + KASSERT((origpte & PG_V) == 0 || ((origpte & PG_PS) != 0 && + (origpte & PG_FRAME) == (newpte & PG_FRAME)), + ("va %#lx changing 2M phys page pde %#lx newpte %#lx", + va, origpte, newpte)); + if ((newpte & PG_W) != 0 && (origpte & PG_W) == 0) + pmap->pm_stats.wired_count += NBPDR / PAGE_SIZE; + else if ((newpte & PG_W) == 0 && (origpte & PG_W) != 0) + pmap->pm_stats.wired_count -= NBPDR / PAGE_SIZE; + *pde = newpte; + } + if ((origpte & PG_V) == 0) + pmap_resident_count_inc(pmap, pagesizes[psind] / PAGE_SIZE); + + return (KERN_SUCCESS); +} + /* * Insert the given physical page (p) at * the specified virtual address (v) in the @@ -6554,6 +6667,13 @@ pmap_enter(pmap_t pmap, vm_offset_t va, vm_page_t m, v lock = NULL; PMAP_LOCK(pmap); + if ((flags & PMAP_ENTER_LARGEPAGE) != 0) { + KASSERT((m->oflags & VPO_UNMANAGED) != 0, + ("managed largepage va %#lx flags %#x", va, flags)); + rv = pmap_enter_largepage(pmap, va, newpte | PG_PS, flags, + psind); + goto out; + } if (psind == 1) { /* Assert the required virtual and physical alignment. */ KASSERT((va & PDRMASK) == 0, ("pmap_enter: va unaligned")); Modified: head/sys/vm/pmap.h ============================================================================== --- head/sys/vm/pmap.h Wed Sep 9 21:45:18 2020 (r365517) +++ head/sys/vm/pmap.h Wed Sep 9 21:50:24 2020 (r365518) @@ -106,6 +106,7 @@ extern vm_offset_t kernel_vm_end; */ #define PMAP_ENTER_NOSLEEP 0x00000100 #define PMAP_ENTER_WIRED 0x00000200 +#define PMAP_ENTER_LARGEPAGE 0x00000400 #define PMAP_ENTER_RESERVED 0xFF000000 /* From owner-svn-src-all@freebsd.org Wed Sep 9 21:57:56 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 744973DE22B; Wed, 9 Sep 2020 21:57:56 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bmwqm2QFSz3gMc; Wed, 9 Sep 2020 21:57:56 +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 362E28624; Wed, 9 Sep 2020 21:57:56 +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 089LvuhK001796; Wed, 9 Sep 2020 21:57:56 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 089Lvu5J001795; Wed, 9 Sep 2020 21:57:56 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <202009092157.089Lvu5J001795@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Wed, 9 Sep 2020 21:57:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365519 - stable/12/sbin/init X-SVN-Group: stable-12 X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: stable/12/sbin/init X-SVN-Commit-Revision: 365519 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.33 Precedence: list List-Id: "SVN commit messages 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, 09 Sep 2020 21:57:56 -0000 Author: brooks Date: Wed Sep 9 21:57:55 2020 New Revision: 365519 URL: https://svnweb.freebsd.org/changeset/base/365519 Log: MFC r365279: Remove risky compatability with old kernels The badsys() handler for SIGSYS was added as a transtion aid for kernels lacking sysctl() in 1993. It is unsafe and unsound so remove it rather than running the risk of a privilege-dropping system call being silently omitted. This partially reverts SCCSID 6.12 (Berkeley) 03/03/93 "add code to change the system security level". Reviewed by: mckusick, imp, kevans Obtained from: CheriBSD Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D26289 Modified: stable/12/sbin/init/init.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/init/init.c ============================================================================== --- stable/12/sbin/init/init.c Wed Sep 9 21:50:24 2020 (r365518) +++ stable/12/sbin/init/init.c Wed Sep 9 21:57:55 2020 (r365519) @@ -106,7 +106,6 @@ static void stall(const char *, ...) __printflike(1, 2 static void warning(const char *, ...) __printflike(1, 2); static void emergency(const char *, ...) __printflike(1, 2); static void disaster(int); -static void badsys(int); static void revoke_ttys(void); static int runshutdown(void); static char *strk(char *); @@ -307,9 +306,8 @@ invalid: * We catch or block signals rather than ignore them, * so that they get reset on exec. */ - handle(badsys, SIGSYS, 0); - handle(disaster, SIGABRT, SIGFPE, SIGILL, SIGSEGV, SIGBUS, SIGXCPU, - SIGXFSZ, 0); + handle(disaster, SIGABRT, SIGFPE, SIGILL, SIGSEGV, SIGBUS, SIGSYS, + SIGXCPU, SIGXFSZ, 0); handle(transition_handler, SIGHUP, SIGINT, SIGEMT, SIGTERM, SIGTSTP, SIGUSR1, SIGUSR2, SIGWINCH, 0); handle(alrm_handler, SIGALRM, 0); @@ -504,22 +502,6 @@ emergency(const char *message, ...) vsyslog(LOG_EMERG, message, ap); va_end(ap); -} - -/* - * Catch a SIGSYS signal. - * - * These may arise if a system does not support sysctl. - * We tolerate up to 25 of these, then throw in the towel. - */ -static void -badsys(int sig) -{ - static int badcount = 0; - - if (badcount++ < 25) - return; - disaster(sig); } /* From owner-svn-src-all@freebsd.org Wed Sep 9 22:02:31 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 26DCE3DE584; Wed, 9 Sep 2020 22:02:31 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bmwx30gPNz3gPb; Wed, 9 Sep 2020 22:02:31 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EE33487CA; Wed, 9 Sep 2020 22:02:30 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 089M2UWl007424; Wed, 9 Sep 2020 22:02:30 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 089M2UbZ007422; Wed, 9 Sep 2020 22:02:30 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202009092202.089M2UbZ007422@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 9 Sep 2020 22:02:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365520 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 365520 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.33 Precedence: list List-Id: "SVN commit messages 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, 09 Sep 2020 22:02:31 -0000 Author: kib Date: Wed Sep 9 22:02:30 2020 New Revision: 365520 URL: https://svnweb.freebsd.org/changeset/base/365520 Log: vm_map: Add a map entry kind that can only be clipped at specific boundary. The entries and their clip boundaries must be aligned on supported superpages sizes from pagesizes[]. vm_map operations return Mach error KERN_INVALID_ARGUMENT, which is usually translated to EINVAL, if it would require clip not at the boundary. In other words, entries force preserving virtual addresses superpage properties. Reviewed by: markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D24652 Modified: head/sys/vm/vm_map.c head/sys/vm/vm_map.h Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Wed Sep 9 21:57:55 2020 (r365519) +++ head/sys/vm/vm_map.c Wed Sep 9 22:02:30 2020 (r365520) @@ -1554,13 +1554,17 @@ vm_map_insert(vm_map_t map, vm_object_t object, vm_oof struct ucred *cred; vm_eflags_t protoeflags; vm_inherit_t inheritance; + u_long bdry; + u_int bidx; VM_MAP_ASSERT_LOCKED(map); KASSERT(object != kernel_object || (cow & MAP_COPY_ON_WRITE) == 0, ("vm_map_insert: kernel object and COW")); - KASSERT(object == NULL || (cow & MAP_NOFAULT) == 0, - ("vm_map_insert: paradoxical MAP_NOFAULT request")); + KASSERT(object == NULL || (cow & MAP_NOFAULT) == 0 || + (cow & MAP_SPLIT_BOUNDARY_MASK) != 0, + ("vm_map_insert: paradoxical MAP_NOFAULT request, obj %p cow %#x", + object, cow)); KASSERT((prot & ~max) == 0, ("prot %#x is not subset of max_prot %#x", prot, max)); @@ -1615,6 +1619,17 @@ vm_map_insert(vm_map_t map, vm_object_t object, vm_oof inheritance = VM_INHERIT_SHARE; else inheritance = VM_INHERIT_DEFAULT; + if ((cow & MAP_SPLIT_BOUNDARY_MASK) != 0) { + /* This magically ignores index 0, for usual page size. */ + bidx = (cow & MAP_SPLIT_BOUNDARY_MASK) >> + MAP_SPLIT_BOUNDARY_SHIFT; + if (bidx >= MAXPAGESIZES) + return (KERN_INVALID_ARGUMENT); + bdry = pagesizes[bidx] - 1; + if ((start & bdry) != 0 || (end & bdry) != 0) + return (KERN_INVALID_ARGUMENT); + protoeflags |= bidx << MAP_ENTRY_SPLIT_BOUNDARY_SHIFT; + } cred = NULL; if ((cow & (MAP_ACC_NO_CHARGE | MAP_NOFAULT | MAP_CREATE_GUARD)) != 0) @@ -2342,31 +2357,40 @@ vm_map_entry_clone(vm_map_t map, vm_map_entry_t entry) * the specified address; if necessary, * it splits the entry into two. */ -static inline void -vm_map_clip_start(vm_map_t map, vm_map_entry_t entry, vm_offset_t start) +static int +vm_map_clip_start(vm_map_t map, vm_map_entry_t entry, vm_offset_t startaddr) { vm_map_entry_t new_entry; + int bdry_idx; if (!map->system_map) WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, "%s: map %p entry %p start 0x%jx", __func__, map, entry, - (uintmax_t)start); + (uintmax_t)startaddr); - if (start <= entry->start) - return; + if (startaddr <= entry->start) + return (KERN_SUCCESS); VM_MAP_ASSERT_LOCKED(map); - KASSERT(entry->end > start && entry->start < start, + KASSERT(entry->end > startaddr && entry->start < startaddr, ("%s: invalid clip of entry %p", __func__, entry)); + bdry_idx = (entry->eflags & MAP_ENTRY_SPLIT_BOUNDARY_MASK) >> + MAP_ENTRY_SPLIT_BOUNDARY_SHIFT; + if (bdry_idx != 0) { + if ((startaddr & (pagesizes[bdry_idx] - 1)) != 0) + return (KERN_INVALID_ARGUMENT); + } + new_entry = vm_map_entry_clone(map, entry); /* * Split off the front portion. Insert the new entry BEFORE this one, * so that this entry has the specified starting address. */ - new_entry->end = start; + new_entry->end = startaddr; vm_map_entry_link(map, new_entry); + return (KERN_SUCCESS); } /* @@ -2376,11 +2400,12 @@ vm_map_clip_start(vm_map_t map, vm_map_entry_t entry, * the interior of the entry. Return entry after 'start', and in * prev_entry set the entry before 'start'. */ -static inline vm_map_entry_t +static int vm_map_lookup_clip_start(vm_map_t map, vm_offset_t start, - vm_map_entry_t *prev_entry) + vm_map_entry_t *res_entry, vm_map_entry_t *prev_entry) { vm_map_entry_t entry; + int rv; if (!map->system_map) WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, @@ -2389,11 +2414,14 @@ vm_map_lookup_clip_start(vm_map_t map, vm_offset_t sta if (vm_map_lookup_entry(map, start, prev_entry)) { entry = *prev_entry; - vm_map_clip_start(map, entry, start); + rv = vm_map_clip_start(map, entry, start); + if (rv != KERN_SUCCESS) + return (rv); *prev_entry = vm_map_entry_pred(entry); } else entry = vm_map_entry_succ(*prev_entry); - return (entry); + *res_entry = entry; + return (KERN_SUCCESS); } /* @@ -2403,31 +2431,41 @@ vm_map_lookup_clip_start(vm_map_t map, vm_offset_t sta * the specified address; if necessary, * it splits the entry into two. */ -static inline void -vm_map_clip_end(vm_map_t map, vm_map_entry_t entry, vm_offset_t end) +static int +vm_map_clip_end(vm_map_t map, vm_map_entry_t entry, vm_offset_t endaddr) { vm_map_entry_t new_entry; + int bdry_idx; if (!map->system_map) WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, "%s: map %p entry %p end 0x%jx", __func__, map, entry, - (uintmax_t)end); + (uintmax_t)endaddr); - if (end >= entry->end) - return; + if (endaddr >= entry->end) + return (KERN_SUCCESS); VM_MAP_ASSERT_LOCKED(map); - KASSERT(entry->start < end && entry->end > end, + KASSERT(entry->start < endaddr && entry->end > endaddr, ("%s: invalid clip of entry %p", __func__, entry)); + bdry_idx = (entry->eflags & MAP_ENTRY_SPLIT_BOUNDARY_MASK) >> + MAP_ENTRY_SPLIT_BOUNDARY_SHIFT; + if (bdry_idx != 0) { + if ((endaddr & (pagesizes[bdry_idx] - 1)) != 0) + return (KERN_INVALID_ARGUMENT); + } + new_entry = vm_map_entry_clone(map, entry); /* * Split off the back portion. Insert the new entry AFTER this one, * so that this entry has the specified ending address. */ - new_entry->start = end; + new_entry->start = endaddr; vm_map_entry_link(map, new_entry); + + return (KERN_SUCCESS); } /* @@ -2469,12 +2507,17 @@ vm_map_submap( if (vm_map_lookup_entry(map, start, &entry) && entry->end >= end && (entry->eflags & MAP_ENTRY_COW) == 0 && entry->object.vm_object == NULL) { - vm_map_clip_start(map, entry, start); - vm_map_clip_end(map, entry, end); + result = vm_map_clip_start(map, entry, start); + if (result != KERN_SUCCESS) + goto unlock; + result = vm_map_clip_end(map, entry, end); + if (result != KERN_SUCCESS) + goto unlock; entry->object.sub_map = submap; entry->eflags |= MAP_ENTRY_IS_SUB_MAP; result = KERN_SUCCESS; } +unlock: vm_map_unlock(map); if (result != KERN_SUCCESS) { @@ -2661,11 +2704,18 @@ again: * of this loop early and let the next loop simplify the entries, since * some may now be mergeable. */ - rv = KERN_SUCCESS; - vm_map_clip_start(map, first_entry, start); + rv = vm_map_clip_start(map, first_entry, start); + if (rv != KERN_SUCCESS) { + vm_map_unlock(map); + return (rv); + } for (entry = first_entry; entry->start < end; entry = vm_map_entry_succ(entry)) { - vm_map_clip_end(map, entry, end); + rv = vm_map_clip_end(map, entry, end); + if (rv != KERN_SUCCESS) { + vm_map_unlock(map); + return (rv); + } if (set_max || ((new_prot & ~entry->protection) & VM_PROT_WRITE) == 0 || @@ -2785,6 +2835,7 @@ vm_map_madvise( int behav) { vm_map_entry_t entry, prev_entry; + int rv; bool modify_map; /* @@ -2830,13 +2881,22 @@ vm_map_madvise( * We clip the vm_map_entry so that behavioral changes are * limited to the specified address range. */ - for (entry = vm_map_lookup_clip_start(map, start, &prev_entry); - entry->start < end; - prev_entry = entry, entry = vm_map_entry_succ(entry)) { + rv = vm_map_lookup_clip_start(map, start, &entry, &prev_entry); + if (rv != KERN_SUCCESS) { + vm_map_unlock(map); + return (vm_mmap_to_errno(rv)); + } + + for (; entry->start < end; prev_entry = entry, + entry = vm_map_entry_succ(entry)) { if ((entry->eflags & MAP_ENTRY_IS_SUB_MAP) != 0) continue; - vm_map_clip_end(map, entry, end); + rv = vm_map_clip_end(map, entry, end); + if (rv != KERN_SUCCESS) { + vm_map_unlock(map); + return (vm_mmap_to_errno(rv)); + } switch (behav) { case MADV_NORMAL: @@ -2969,7 +3029,8 @@ int vm_map_inherit(vm_map_t map, vm_offset_t start, vm_offset_t end, vm_inherit_t new_inheritance) { - vm_map_entry_t entry, prev_entry; + vm_map_entry_t entry, lentry, prev_entry, start_entry; + int rv; switch (new_inheritance) { case VM_INHERIT_NONE: @@ -2984,18 +3045,37 @@ vm_map_inherit(vm_map_t map, vm_offset_t start, vm_off return (KERN_SUCCESS); vm_map_lock(map); VM_MAP_RANGE_CHECK(map, start, end); - for (entry = vm_map_lookup_clip_start(map, start, &prev_entry); - entry->start < end; - prev_entry = entry, entry = vm_map_entry_succ(entry)) { - vm_map_clip_end(map, entry, end); + rv = vm_map_lookup_clip_start(map, start, &start_entry, &prev_entry); + if (rv != KERN_SUCCESS) + goto unlock; + if (vm_map_lookup_entry(map, end - 1, &lentry)) { + rv = vm_map_clip_end(map, lentry, end); + if (rv != KERN_SUCCESS) + goto unlock; + } + if (new_inheritance == VM_INHERIT_COPY) { + for (entry = start_entry; entry->start < end; + prev_entry = entry, entry = vm_map_entry_succ(entry)) { + if ((entry->eflags & MAP_ENTRY_SPLIT_BOUNDARY_MASK) + != 0) { + rv = KERN_INVALID_ARGUMENT; + goto unlock; + } + } + } + for (entry = start_entry; entry->start < end; prev_entry = entry, + entry = vm_map_entry_succ(entry)) { + KASSERT(entry->end <= end, ("non-clipped entry %p end %jx %jx", + entry, (uintmax_t)entry->end, (uintmax_t)end)); if ((entry->eflags & MAP_ENTRY_GUARD) == 0 || new_inheritance != VM_INHERIT_ZERO) entry->inheritance = new_inheritance; vm_map_try_merge_entries(map, prev_entry, entry); } vm_map_try_merge_entries(map, prev_entry, entry); +unlock: vm_map_unlock(map); - return (KERN_SUCCESS); + return (rv); } /* @@ -3094,8 +3174,13 @@ vm_map_unwire(vm_map_t map, vm_offset_t start, vm_offs next_entry : NULL; continue; } - vm_map_clip_start(map, entry, start); - vm_map_clip_end(map, entry, end); + rv = vm_map_clip_start(map, entry, start); + if (rv != KERN_SUCCESS) + break; + rv = vm_map_clip_end(map, entry, end); + if (rv != KERN_SUCCESS) + break; + /* * Mark the entry in case the map lock is released. (See * above.) @@ -3262,8 +3347,8 @@ vm_map_wire_locked(vm_map_t map, vm_offset_t start, vm { vm_map_entry_t entry, first_entry, next_entry, prev_entry; vm_offset_t faddr, saved_end, saved_start; - u_long npages; - u_int last_timestamp; + u_long incr, npages; + u_int bidx, last_timestamp; int rv; bool holes_ok, need_wakeup, user_wire; vm_prot_t prot; @@ -3301,8 +3386,13 @@ vm_map_wire_locked(vm_map_t map, vm_offset_t start, vm next_entry : NULL; continue; } - vm_map_clip_start(map, entry, start); - vm_map_clip_end(map, entry, end); + rv = vm_map_clip_start(map, entry, start); + if (rv != KERN_SUCCESS) + goto done; + rv = vm_map_clip_end(map, entry, end); + if (rv != KERN_SUCCESS) + goto done; + /* * Mark the entry in case the map lock is released. (See * above.) @@ -3339,20 +3429,23 @@ vm_map_wire_locked(vm_map_t map, vm_offset_t start, vm saved_start = entry->start; saved_end = entry->end; last_timestamp = map->timestamp; + bidx = (entry->eflags & MAP_ENTRY_SPLIT_BOUNDARY_MASK) + >> MAP_ENTRY_SPLIT_BOUNDARY_SHIFT; + incr = pagesizes[bidx]; vm_map_busy(map); vm_map_unlock(map); - faddr = saved_start; - do { + for (faddr = saved_start; faddr < saved_end; + faddr += incr) { /* * Simulate a fault to get the page and enter * it into the physical map. */ - if ((rv = vm_fault(map, faddr, - VM_PROT_NONE, VM_FAULT_WIRE, NULL)) != - KERN_SUCCESS) + rv = vm_fault(map, faddr, VM_PROT_NONE, + VM_FAULT_WIRE, NULL); + if (rv != KERN_SUCCESS) break; - } while ((faddr += PAGE_SIZE) < saved_end); + } vm_map_lock(map); vm_map_unbusy(map); if (last_timestamp + 1 != map->timestamp) { @@ -3427,10 +3520,14 @@ done: * Moreover, another thread could be simultaneously * wiring this new mapping entry. Detect these cases * and skip any entries marked as in transition not by us. + * + * Another way to get an entry not marked with + * MAP_ENTRY_IN_TRANSITION is after failed clipping, + * which set rv to KERN_INVALID_ARGUMENT. */ if ((entry->eflags & MAP_ENTRY_IN_TRANSITION) == 0 || entry->wiring_thread != curthread) { - KASSERT(holes_ok, + KASSERT(holes_ok || rv == KERN_INVALID_ARGUMENT, ("vm_map_wire: !HOLESOK and new/changed entry")); continue; } @@ -3508,6 +3605,7 @@ vm_map_sync( vm_object_t object; vm_ooffset_t offset; unsigned int last_timestamp; + int bdry_idx; boolean_t failed; vm_map_lock_read(map); @@ -3519,14 +3617,26 @@ vm_map_sync( start = first_entry->start; end = first_entry->end; } + /* - * Make a first pass to check for user-wired memory and holes. + * Make a first pass to check for user-wired memory, holes, + * and partial invalidation of largepage mappings. */ for (entry = first_entry; entry->start < end; entry = next_entry) { - if (invalidate && - (entry->eflags & MAP_ENTRY_USER_WIRED) != 0) { - vm_map_unlock_read(map); - return (KERN_INVALID_ARGUMENT); + if (invalidate) { + if ((entry->eflags & MAP_ENTRY_USER_WIRED) != 0) { + vm_map_unlock_read(map); + return (KERN_INVALID_ARGUMENT); + } + bdry_idx = (entry->eflags & + MAP_ENTRY_SPLIT_BOUNDARY_MASK) >> + MAP_ENTRY_SPLIT_BOUNDARY_SHIFT; + if (bdry_idx != 0 && + ((start & (pagesizes[bdry_idx] - 1)) != 0 || + (end & (pagesizes[bdry_idx] - 1)) != 0)) { + vm_map_unlock_read(map); + return (KERN_INVALID_ARGUMENT); + } } next_entry = vm_map_entry_succ(entry); if (end > entry->end && @@ -3703,7 +3813,8 @@ vm_map_entry_delete(vm_map_t map, vm_map_entry_t entry int vm_map_delete(vm_map_t map, vm_offset_t start, vm_offset_t end) { - vm_map_entry_t entry, next_entry; + vm_map_entry_t entry, next_entry, scratch_entry; + int rv; VM_MAP_ASSERT_LOCKED(map); @@ -3714,8 +3825,10 @@ vm_map_delete(vm_map_t map, vm_offset_t start, vm_offs * Find the start of the region, and clip it. * Step through all entries in this region. */ - for (entry = vm_map_lookup_clip_start(map, start, &entry); - entry->start < end; entry = next_entry) { + rv = vm_map_lookup_clip_start(map, start, &entry, &scratch_entry); + if (rv != KERN_SUCCESS) + return (rv); + for (; entry->start < end; entry = next_entry) { /* * Wait for wiring or unwiring of an entry to complete. * Also wait for any system wirings to disappear on @@ -3739,13 +3852,19 @@ vm_map_delete(vm_map_t map, vm_offset_t start, vm_offs * Specifically, the entry may have been * clipped, merged, or deleted. */ - next_entry = vm_map_lookup_clip_start(map, - saved_start, &next_entry); + rv = vm_map_lookup_clip_start(map, saved_start, + &next_entry, &scratch_entry); + if (rv != KERN_SUCCESS) + break; } else next_entry = entry; continue; } - vm_map_clip_end(map, entry, end); + + /* XXXKIB or delete to the upper superpage boundary ? */ + rv = vm_map_clip_end(map, entry, end); + if (rv != KERN_SUCCESS) + break; next_entry = vm_map_entry_succ(entry); /* @@ -3775,7 +3894,7 @@ vm_map_delete(vm_map_t map, vm_offset_t start, vm_offs */ vm_map_entry_delete(map, entry); } - return (KERN_SUCCESS); + return (rv); } /* @@ -4219,7 +4338,8 @@ vmspace_fork(struct vmspace *vm1, vm_ooffset_t *fork_c new_entry->end = old_entry->end; new_entry->eflags = old_entry->eflags & ~(MAP_ENTRY_USER_WIRED | MAP_ENTRY_IN_TRANSITION | - MAP_ENTRY_WRITECNT | MAP_ENTRY_VN_EXEC); + MAP_ENTRY_WRITECNT | MAP_ENTRY_VN_EXEC | + MAP_ENTRY_SPLIT_BOUNDARY_MASK); new_entry->protection = old_entry->protection; new_entry->max_protection = old_entry->max_protection; new_entry->inheritance = VM_INHERIT_ZERO; Modified: head/sys/vm/vm_map.h ============================================================================== --- head/sys/vm/vm_map.h Wed Sep 9 21:57:55 2020 (r365519) +++ head/sys/vm/vm_map.h Wed Sep 9 22:02:30 2020 (r365520) @@ -149,6 +149,10 @@ struct vm_map_entry { #define MAP_ENTRY_STACK_GAP_UP 0x00040000 #define MAP_ENTRY_HEADER 0x00080000 +#define MAP_ENTRY_SPLIT_BOUNDARY_MASK 0x00300000 + +#define MAP_ENTRY_SPLIT_BOUNDARY_SHIFT 20 + #ifdef _KERNEL static __inline u_char vm_map_entry_behavior(vm_map_entry_t entry) @@ -373,6 +377,9 @@ long vmspace_resident_count(struct vmspace *vmspace); #define MAP_CREATE_STACK_GAP_UP 0x00010000 #define MAP_CREATE_STACK_GAP_DN 0x00020000 #define MAP_VN_EXEC 0x00040000 +#define MAP_SPLIT_BOUNDARY_MASK 0x00180000 + +#define MAP_SPLIT_BOUNDARY_SHIFT 19 /* * vm_fault option flags From owner-svn-src-all@freebsd.org Wed Sep 9 22:07:55 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8BD8D3DE59F; Wed, 9 Sep 2020 22:07:55 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bmx3H3WDQz3grL; Wed, 9 Sep 2020 22:07:55 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 57704865A; Wed, 9 Sep 2020 22:07:55 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 089M7tw3007951; Wed, 9 Sep 2020 22:07:55 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 089M7tlK007950; Wed, 9 Sep 2020 22:07:55 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <202009092207.089M7tlK007950@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Wed, 9 Sep 2020 22:07:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365521 - head/sys/net/route X-SVN-Group: head X-SVN-Commit-Author: melifaro X-SVN-Commit-Paths: head/sys/net/route X-SVN-Commit-Revision: 365521 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.33 Precedence: list List-Id: "SVN commit messages 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, 09 Sep 2020 22:07:55 -0000 Author: melifaro Date: Wed Sep 9 22:07:54 2020 New Revision: 365521 URL: https://svnweb.freebsd.org/changeset/base/365521 Log: Update nexthop handling for route addition/deletion in preparation for mpath. Currently kernel requests deletion for the certain routes with specified gateway, but this gateway is not actually checked. With multipath routes, internal gateway checking becomes mandatory. Add the logic performing this check. Generalise RTF_PINNED routes to the generic route priorities, simplifying the logic. Add lookup_prefix() function to perform exact match search based on data in @info. Differential Revision: https://reviews.freebsd.org/D26356 Modified: head/sys/net/route/route_ctl.c head/sys/net/route/route_var.h Modified: head/sys/net/route/route_ctl.c ============================================================================== --- head/sys/net/route/route_ctl.c Wed Sep 9 22:02:30 2020 (r365520) +++ head/sys/net/route/route_ctl.c Wed Sep 9 22:07:54 2020 (r365521) @@ -86,6 +86,10 @@ static int change_route(struct rib_head *rnh, struct r static int change_route_nhop(struct rib_head *rnh, struct rtentry *rt, struct rt_addrinfo *info, struct route_nhop_data *rnd, struct rib_cmd_info *rc); + +static int rt_unlinkrte(struct rib_head *rnh, struct rt_addrinfo *info, + struct rib_cmd_info *rc); + static void rib_notify(struct rib_head *rnh, enum rib_subscription_type type, struct rib_cmd_info *rc); @@ -172,6 +176,141 @@ get_rnh(uint32_t fibnum, const struct rt_addrinfo *inf } /* + * Check if specified @gw matches gw data in the nexthop @nh. + * + * Returns true if matches, false otherwise. + */ +static bool +match_nhop_gw(const struct nhop_object *nh, const struct sockaddr *gw) +{ + + if (nh->gw_sa.sa_family != gw->sa_family) + return (false); + + switch (gw->sa_family) { + case AF_INET: + return (nh->gw4_sa.sin_addr.s_addr == + ((const struct sockaddr_in *)gw)->sin_addr.s_addr); + case AF_INET6: + { + const struct sockaddr_in6 *gw6; + gw6 = (const struct sockaddr_in6 *)gw; + + /* + * Currently (2020-09) IPv6 gws in kernel have their + * scope embedded. Once this becomes false, this code + * has to be revisited. + */ + if (IN6_ARE_ADDR_EQUAL(&nh->gw6_sa.sin6_addr, + &gw6->sin6_addr)) + return (true); + return (false); + } + case AF_LINK: + { + const struct sockaddr_dl *sdl; + sdl = (const struct sockaddr_dl *)gw; + return (nh->gwl_sa.sdl_index == sdl->sdl_index); + } + default: + return (memcmp(&nh->gw_sa, gw, nh->gw_sa.sa_len) == 0); + } + + /* NOTREACHED */ + return (false); +} + +/* + * Checks if data in @info matches nexhop @nh. + * + * Returns 0 on success, + * ESRCH if not matched, + * ENOENT if filter function returned false + */ +int +check_info_match_nhop(const struct rt_addrinfo *info, const struct rtentry *rt, + const struct nhop_object *nh) +{ + const struct sockaddr *gw = info->rti_info[RTAX_GATEWAY]; + + if (info->rti_filter != NULL) { + if (info->rti_filter(rt, nh, info->rti_filterdata) == 0) + return (ENOENT); + else + return (0); + } + if ((gw != NULL) && !match_nhop_gw(nh, gw)) + return (ESRCH); + + return (0); +} + +/* + * Checks if nexhop @nh can be rewritten by data in @info because + * of higher "priority". Currently the only case for such scenario + * is kernel installing interface routes, marked by RTF_PINNED flag. + * + * Returns: + * 1 if @info data has higher priority + * 0 if priority is the same + * -1 if priority is lower + */ +int +can_override_nhop(const struct rt_addrinfo *info, const struct nhop_object *nh) +{ + + if (info->rti_flags & RTF_PINNED) { + return (NH_IS_PINNED(nh)) ? 0 : 1; + } else { + return (NH_IS_PINNED(nh)) ? -1 : 0; + } +} + +/* + * Runs exact prefix match based on @dst and @netmask. + * Returns matched @rtentry if found or NULL. + * If rtentry was found, saves nexthop / weight value into @rnd. + */ +static struct rtentry * +lookup_prefix_bysa(struct rib_head *rnh, const struct sockaddr *dst, + const struct sockaddr *netmask, struct route_nhop_data *rnd) +{ + struct rtentry *rt; + + RIB_LOCK_ASSERT(rnh); + + rt = (struct rtentry *)rnh->rnh_lookup(__DECONST(void *, dst), + __DECONST(void *, netmask), &rnh->head); + if (rt != NULL) { + rnd->rnd_nhop = rt->rt_nhop; + rnd->rnd_weight = rt->rt_weight; + } else { + rnd->rnd_nhop = NULL; + rnd->rnd_weight = 0; + } + + return (rt); +} + +/* + * Runs exact prefix match based on dst/netmask from @info. + * Assumes RIB lock is held. + * Returns matched @rtentry if found or NULL. + * If rtentry was found, saves nexthop / weight value into @rnd. + */ +struct rtentry * +lookup_prefix(struct rib_head *rnh, const struct rt_addrinfo *info, + struct route_nhop_data *rnd) +{ + struct rtentry *rt; + + rt = lookup_prefix_bysa(rnh, info->rti_info[RTAX_DST], + info->rti_info[RTAX_NETMASK], rnd); + + return (rt); +} + +/* * Adds route defined by @info into the kernel table specified by @fibnum and * sa_family in @info->rti_info[RTAX_DST]. * @@ -182,6 +321,7 @@ rib_add_route(uint32_t fibnum, struct rt_addrinfo *inf struct rib_cmd_info *rc) { struct rib_head *rnh; + int error; NET_EPOCH_ASSERT(); @@ -201,7 +341,11 @@ rib_add_route(uint32_t fibnum, struct rt_addrinfo *inf bzero(rc, sizeof(struct rib_cmd_info)); rc->rc_cmd = RTM_ADD; - return (add_route(rnh, info, rc)); + error = add_route(rnh, info, rc); + if (error == 0) + rib_notify(rnh, RIB_NOTIFY_DELAYED, rc); + + return (error); } /* @@ -291,10 +435,10 @@ static int add_route(struct rib_head *rnh, struct rt_addrinfo *info, struct rib_cmd_info *rc) { - struct sockaddr *ndst, *netmask; + struct nhop_object *nh_orig; struct route_nhop_data rnd; struct nhop_object *nh; - struct rtentry *rt; + struct rtentry *rt, *rt_orig; int error; error = create_rtentry(rnh, info, &rt); @@ -307,6 +451,7 @@ add_route(struct rib_head *rnh, struct rt_addrinfo *in RIB_WLOCK(rnh); #ifdef RADIX_MPATH + struct sockaddr *netmask; netmask = info->rti_info[RTAX_NETMASK]; /* do not permit exactly the same dst/mask/gw pair */ if (rt_mpath_capable(rnh) && @@ -320,38 +465,39 @@ add_route(struct rib_head *rnh, struct rt_addrinfo *in #endif error = add_route_nhop(rnh, rt, info, &rnd, rc); if (error == 0) { - rt = NULL; - nh = NULL; - } else if ((error == EEXIST) && ((info->rti_flags & RTF_PINNED) != 0)) { - struct rtentry *rt_orig; - struct nhop_object *nh_orig; - struct radix_node *rn; + RIB_WUNLOCK(rnh); + return (0); + } - ndst = (struct sockaddr *)rt_key(rt); - netmask = info->rti_info[RTAX_NETMASK]; - rn = rnh->rnh_lookup(ndst, netmask, &rnh->head); - rt_orig = (struct rtentry *)rn; - if (rt_orig != NULL) { - nh_orig = rt_orig->rt_nhop; - if ((nhop_get_rtflags(nh_orig) & RTF_PINNED) == 0) { - /* Current nexhop is not PINNED, can update */ - error = change_route_nhop(rnh, rt_orig, - info, &rnd, rc); - if (error == 0) - nh = NULL; - } - } else - error = ENOBUFS; + /* addition failed. Lookup prefix in the rib to determine the cause */ + rt_orig = lookup_prefix(rnh, info, &rnd); + if (rt_orig == NULL) { + /* No prefix -> rnh_addaddr() failed to allocate memory */ + RIB_WUNLOCK(rnh); + nhop_free(nh); + uma_zfree(V_rtzone, rt); + return (ENOMEM); } + + /* We have existing route in the RIB. */ + nh_orig = rnd.rnd_nhop; + /* Check if new route has higher preference */ + if (can_override_nhop(info, nh_orig) > 0) { + /* Update nexthop to the new route */ + change_route_nhop(rnh, rt_orig, info, &rnd, rc); + RIB_WUNLOCK(rnh); + uma_zfree(V_rtzone, rt); + nhop_free(nh_orig); + return (0); + } + RIB_WUNLOCK(rnh); - if (error == 0) - rib_notify(rnh, RIB_NOTIFY_DELAYED, rc); + /* Unable to add - another route with the same preference exists */ + error = EEXIST; - if (nh != NULL) - nhop_free(nh); - if (rt != NULL) - uma_zfree(V_rtzone, rt); + nhop_free(nh); + uma_zfree(V_rtzone, rt); return (error); } @@ -366,6 +512,9 @@ int rib_del_route(uint32_t fibnum, struct rt_addrinfo *info, struct rib_cmd_info *rc) { struct rib_head *rnh; + struct sockaddr *dst_orig, *netmask; + struct sockaddr_storage mdst; + int error; NET_EPOCH_ASSERT(); @@ -376,72 +525,66 @@ rib_del_route(uint32_t fibnum, struct rt_addrinfo *inf bzero(rc, sizeof(struct rib_cmd_info)); rc->rc_cmd = RTM_DELETE; - return (del_route(rnh, info, rc)); + dst_orig = info->rti_info[RTAX_DST]; + netmask = info->rti_info[RTAX_NETMASK]; + + if (netmask != NULL) { + /* Ensure @dst is always properly masked */ + if (dst_orig->sa_len > sizeof(mdst)) + return (EINVAL); + rt_maskedcopy(dst_orig, (struct sockaddr *)&mdst, netmask); + info->rti_info[RTAX_DST] = (struct sockaddr *)&mdst; + } + error = del_route(rnh, info, rc); + info->rti_info[RTAX_DST] = dst_orig; + + return (error); } /* * Conditionally unlinks rtentry matching data inside @info from @rnh. - * Returns unlinked, locked and referenced @rtentry on success, - * Returns NULL and sets @perror to: + * Returns 0 on success with operation result stored in @rc. + * On error, returns: * ESRCH - if prefix was not found, - * EADDRINUSE - if trying to delete PINNED route without appropriate flag. + * EADDRINUSE - if trying to delete higher priority route. * ENOENT - if supplied filter function returned 0 (not matched). */ -struct rtentry * -rt_unlinkrte(struct rib_head *rnh, struct rt_addrinfo *info, int *perror) +static int +rt_unlinkrte(struct rib_head *rnh, struct rt_addrinfo *info, struct rib_cmd_info *rc) { - struct sockaddr *dst, *netmask; struct rtentry *rt; struct nhop_object *nh; struct radix_node *rn; + struct route_nhop_data rnd; + int error; - dst = info->rti_info[RTAX_DST]; - netmask = info->rti_info[RTAX_NETMASK]; + rt = lookup_prefix(rnh, info, &rnd); + if (rt == NULL) + return (ESRCH); - rt = (struct rtentry *)rnh->rnh_lookup(dst, netmask, &rnh->head); - if (rt == NULL) { - *perror = ESRCH; - return (NULL); - } - nh = rt->rt_nhop; - if ((info->rti_flags & RTF_PINNED) == 0) { - /* Check if target route can be deleted */ - if (NH_IS_PINNED(nh)) { - *perror = EADDRINUSE; - return (NULL); - } - } + error = check_info_match_nhop(info, rt, nh); + if (error != 0) + return (error); - if (info->rti_filter != NULL) { - if (info->rti_filter(rt, nh, info->rti_filterdata)==0){ - /* Not matched */ - *perror = ENOENT; - return (NULL); - } + if (can_override_nhop(info, nh) < 0) + return (EADDRINUSE); - /* - * Filter function requested rte deletion. - * Ease the caller work by filling in remaining info - * from that particular entry. - */ - info->rti_info[RTAX_GATEWAY] = &nh->gw_sa; - } - /* * Remove the item from the tree and return it. * Complain if it is not there and do no more processing. */ - *perror = ESRCH; #ifdef RADIX_MPATH + info->rti_info[RTAX_GATEWAY] = &nh->gw_sa; if (rt_mpath_capable(rnh)) rn = rt_mpath_unlink(rnh, info, rt, perror); else #endif - rn = rnh->rnh_deladdr(dst, netmask, &rnh->head); + rn = rnh->rnh_deladdr(info->rti_info[RTAX_DST], + info->rti_info[RTAX_NETMASK], &rnh->head); if (rn == NULL) - return (NULL); + return (ESRCH); if (rn->rn_flags & (RNF_ACTIVE | RNF_ROOT)) panic ("rtrequest delete"); @@ -449,39 +592,25 @@ rt_unlinkrte(struct rib_head *rnh, struct rt_addrinfo rt = RNTORT(rn); rt->rte_flags &= ~RTF_UP; - *perror = 0; + /* Finalize notification */ + rnh->rnh_gen++; + rc->rc_cmd = RTM_DELETE; + rc->rc_rt = rt; + rc->rc_nh_old = rt->rt_nhop; + rc->rc_nh_weight = rt->rt_weight; + rib_notify(rnh, RIB_NOTIFY_IMMEDIATE, rc); - return (rt); + return (0); } static int del_route(struct rib_head *rnh, struct rt_addrinfo *info, struct rib_cmd_info *rc) { - struct sockaddr *dst, *netmask; - struct sockaddr_storage mdst; - struct rtentry *rt; int error; - dst = info->rti_info[RTAX_DST]; - netmask = info->rti_info[RTAX_NETMASK]; - - if (netmask) { - if (dst->sa_len > sizeof(mdst)) - return (EINVAL); - rt_maskedcopy(dst, (struct sockaddr *)&mdst, netmask); - dst = (struct sockaddr *)&mdst; - } - RIB_WLOCK(rnh); - rt = rt_unlinkrte(rnh, info, &error); - if (rt != NULL) { - /* Finalize notification */ - rnh->rnh_gen++; - rc->rc_rt = rt; - rc->rc_nh_old = rt->rt_nhop; - rib_notify(rnh, RIB_NOTIFY_IMMEDIATE, rc); - } + error = rt_unlinkrte(rnh, info, rc); RIB_WUNLOCK(rnh); if (error != 0) return (error); @@ -492,7 +621,7 @@ del_route(struct rib_head *rnh, struct rt_addrinfo *in * If the caller wants it, then it can have it, * the entry will be deleted after the end of the current epoch. */ - rtfree(rt); + rtfree(rc->rc_rt); return (0); } @@ -624,7 +753,7 @@ change_route(struct rib_head *rnh, struct rt_addrinfo /* * Insert @rt with nhop data from @rnd_new to @rnh. - * Returns 0 on success. + * Returns 0 on success and stores operation results in @rc. */ static int add_route_nhop(struct rib_head *rnh, struct rtentry *rt, @@ -830,28 +959,26 @@ rt_checkdelroute(struct radix_node *rn, void *arg) di = (struct rt_delinfo *)arg; rt = (struct rtentry *)rn; info = &di->info; - error = 0; info->rti_info[RTAX_DST] = rt_key(rt); info->rti_info[RTAX_NETMASK] = rt_mask(rt); info->rti_info[RTAX_GATEWAY] = &rt->rt_nhop->gw_sa; - rt = rt_unlinkrte(di->rnh, info, &error); - if (rt == NULL) { - /* Either not allowed or not matched. Skip entry */ - return (0); + error = rt_unlinkrte(di->rnh, info, &di->rc); + + /* + * Add deleted rtentries to the list to GC them + * after dropping the lock. + * + * XXX: Delayed notifications not implemented + * for nexthop updates. + */ + if (error == 0) { + /* Add to the list and return */ + rt->rt_chain = di->head; + di->head = rt; } - /* Entry was unlinked. Notify subscribers */ - di->rnh->rnh_gen++; - di->rc.rc_rt = rt; - di->rc.rc_nh_old = rt->rt_nhop; - rib_notify(di->rnh, RIB_NOTIFY_IMMEDIATE, &di->rc); - - /* Add to the list and return */ - rt->rt_chain = di->head; - di->head = rt; - return (0); } @@ -889,6 +1016,8 @@ rib_walk_del(u_int fibnum, int family, rt_filter_f_t * RIB_WUNLOCK(rnh); /* We might have something to reclaim. */ + bzero(&di.rc, sizeof(di.rc)); + di.rc.rc_cmd = RTM_DELETE; while (di.head != NULL) { rt = di.head; di.head = rt->rt_chain; Modified: head/sys/net/route/route_var.h ============================================================================== --- head/sys/net/route/route_var.h Wed Sep 9 22:02:30 2020 (r365520) +++ head/sys/net/route/route_var.h Wed Sep 9 22:07:54 2020 (r365521) @@ -224,6 +224,12 @@ struct route_nhop_data { int change_route_conditional(struct rib_head *rnh, struct rtentry *rt, struct rt_addrinfo *info, struct route_nhop_data *nhd_orig, struct route_nhop_data *nhd_new, struct rib_cmd_info *rc); +struct rtentry *lookup_prefix(struct rib_head *rnh, + const struct rt_addrinfo *info, struct route_nhop_data *rnd); +int check_info_match_nhop(const struct rt_addrinfo *info, + const struct rtentry *rt, const struct nhop_object *nh); +int can_override_nhop(const struct rt_addrinfo *info, + const struct nhop_object *nh); void vnet_rtzone_init(void); void vnet_rtzone_destroy(void); @@ -252,8 +258,5 @@ int nhop_create_from_nhop(struct rib_head *rnh, const void nhops_update_ifmtu(struct rib_head *rh, struct ifnet *ifp, uint32_t mtu); int nhops_dump_sysctl(struct rib_head *rh, struct sysctl_req *w); -/* route */ -struct rtentry *rt_unlinkrte(struct rib_head *rnh, struct rt_addrinfo *info, - int *perror); #endif From owner-svn-src-all@freebsd.org Wed Sep 9 22:12:53 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 810613DE65E; Wed, 9 Sep 2020 22:12:53 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bmx913Gy0z3yN0; Wed, 9 Sep 2020 22:12:53 +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 538A68B8F; Wed, 9 Sep 2020 22:12:53 +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 089MCrvc013823; Wed, 9 Sep 2020 22:12:53 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 089MCqZt013817; Wed, 9 Sep 2020 22:12:52 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202009092212.089MCqZt013817@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 9 Sep 2020 22:12:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365522 - in head/sys: kern sys vm X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys: kern sys vm X-SVN-Commit-Revision: 365522 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.33 Precedence: list List-Id: "SVN commit messages 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, 09 Sep 2020 22:12:53 -0000 Author: kib Date: Wed Sep 9 22:12:51 2020 New Revision: 365522 URL: https://svnweb.freebsd.org/changeset/base/365522 Log: Support for userspace non-transparent superpages (largepages). Created with shm_open2(SHM_LARGEPAGE) and then configured with FIOSSHMLPGCNF ioctl, largepages posix shared memory objects guarantee that all userspace mappings of it are served by superpage non-managed mappings. Only amd64 for now, both 2M and 1G superpages can be requested, the later requires CPU feature. Reviewed by: markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D24652 Modified: head/sys/kern/kern_umtx.c head/sys/kern/uipc_shm.c head/sys/sys/filio.h head/sys/sys/mman.h head/sys/vm/vm_fault.c head/sys/vm/vm_mmap.c Modified: head/sys/kern/kern_umtx.c ============================================================================== --- head/sys/kern/kern_umtx.c Wed Sep 9 22:07:54 2020 (r365521) +++ head/sys/kern/kern_umtx.c Wed Sep 9 22:12:51 2020 (r365522) @@ -3933,7 +3933,7 @@ umtx_shm_create_reg(struct thread *td, const struct um reg = uma_zalloc(umtx_shm_reg_zone, M_WAITOK | M_ZERO); reg->ushm_refcnt = 1; bcopy(key, ®->ushm_key, sizeof(*key)); - reg->ushm_obj = shm_alloc(td->td_ucred, O_RDWR); + reg->ushm_obj = shm_alloc(td->td_ucred, O_RDWR, false); reg->ushm_cred = crhold(cred); error = shm_dotruncate(reg->ushm_obj, PAGE_SIZE); if (error != 0) { Modified: head/sys/kern/uipc_shm.c ============================================================================== --- head/sys/kern/uipc_shm.c Wed Sep 9 22:07:54 2020 (r365521) +++ head/sys/kern/uipc_shm.c Wed Sep 9 22:12:51 2020 (r365522) @@ -2,6 +2,7 @@ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 2006, 2011, 2016-2017 Robert N. M. Watson + * Copyright 2020 The FreeBSD Foundation * All rights reserved. * * Portions of this software were developed by BAE Systems, the University of @@ -9,6 +10,9 @@ * contract FA8650-15-C-7558 ("CADETS"), as part of the DARPA Transparent * Computing (TC) research program. * + * Portions of this software were developed by Konstantin Belousov + * 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: @@ -80,6 +84,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -120,6 +125,8 @@ static void shm_init(void *arg); static void shm_insert(char *path, Fnv32_t fnv, struct shmfd *shmfd); static struct shmfd *shm_lookup(char *path, Fnv32_t fnv); static int shm_remove(char *path, Fnv32_t fnv, struct ucred *ucred); +static int shm_dotruncate_cookie(struct shmfd *shmfd, off_t length, + void *rl_cookie); static int shm_dotruncate_locked(struct shmfd *shmfd, off_t length, void *rl_cookie); static int shm_copyin_path(struct thread *td, const char *userpath_in, @@ -159,11 +166,19 @@ struct fileops shm_ops = { .fo_get_seals = shm_get_seals, .fo_add_seals = shm_add_seals, .fo_fallocate = shm_fallocate, - .fo_flags = DFLAG_PASSABLE | DFLAG_SEEKABLE + .fo_flags = DFLAG_PASSABLE | DFLAG_SEEKABLE, }; FEATURE(posix_shm, "POSIX shared memory"); +static SYSCTL_NODE(_vm, OID_AUTO, largepages, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, + ""); + +static int largepage_reclaim_tries = 1; +SYSCTL_INT(_vm_largepages, OID_AUTO, reclaim_tries, + CTLFLAG_RWTUN, &largepage_reclaim_tries, 0, + "Number of contig reclaims before giving up for default alloc policy"); + static int uiomove_object_page(vm_object_t obj, size_t len, struct uio *uio) { @@ -242,7 +257,90 @@ uiomove_object(vm_object_t obj, off_t obj_size, struct return (error); } +static u_long count_largepages[MAXPAGESIZES]; + static int +shm_largepage_phys_populate(vm_object_t object, vm_pindex_t pidx, + int fault_type, vm_prot_t max_prot, vm_pindex_t *first, vm_pindex_t *last) +{ + vm_page_t m; + int psind; + + psind = object->un_pager.phys.data_val; + if (psind == 0 || pidx >= object->size) + return (VM_PAGER_FAIL); + *first = rounddown2(pidx, pagesizes[psind] / PAGE_SIZE); + + /* + * We only busy the first page in the superpage run. It is + * useless to busy whole run since we only remove full + * superpage, and it takes too long to busy e.g. 512 * 512 == + * 262144 pages constituing 1G amd64 superage. + */ + m = vm_page_grab(object, *first, VM_ALLOC_NORMAL | VM_ALLOC_NOCREAT); + MPASS(m != NULL); + + *last = *first + atop(pagesizes[psind]) - 1; + return (VM_PAGER_OK); +} + +static boolean_t +shm_largepage_phys_haspage(vm_object_t object, vm_pindex_t pindex, + int *before, int *after) +{ + int psind; + + psind = object->un_pager.phys.data_val; + if (psind == 0 || pindex >= object->size) + return (FALSE); + if (before != NULL) { + *before = pindex - rounddown2(pindex, pagesizes[psind] / + PAGE_SIZE); + } + if (after != NULL) { + *after = roundup2(pindex, pagesizes[psind] / PAGE_SIZE) - + pindex; + } + return (TRUE); +} + +static void +shm_largepage_phys_ctor(vm_object_t object, vm_prot_t prot, + vm_ooffset_t foff, struct ucred *cred) +{ +} + +static void +shm_largepage_phys_dtor(vm_object_t object) +{ + int psind; + + psind = object->un_pager.phys.data_val; + if (psind != 0) { + atomic_subtract_long(&count_largepages[psind], + object->size / (pagesizes[psind] / PAGE_SIZE)); + vm_wire_sub(object->size); + } else { + KASSERT(object->size == 0, + ("largepage phys obj %p not initialized bit size %#jx > 0", + object, (uintmax_t)object->size)); + } +} + +static struct phys_pager_ops shm_largepage_phys_ops = { + .phys_pg_populate = shm_largepage_phys_populate, + .phys_pg_haspage = shm_largepage_phys_haspage, + .phys_pg_ctor = shm_largepage_phys_ctor, + .phys_pg_dtor = shm_largepage_phys_dtor, +}; + +bool +shm_largepage(struct shmfd *shmfd) +{ + return (shmfd->shm_object->type == OBJT_PHYS); +} + +static int shm_seek(struct file *fp, off_t offset, int whence, struct thread *td) { struct shmfd *shmfd; @@ -321,6 +419,8 @@ shm_write(struct file *fp, struct uio *uio, struct ucr if (error) return (error); #endif + if (shm_largepage(shmfd) && shmfd->shm_lp_psind == 0) + return (EINVAL); foffset_lock_uio(fp, uio, flags); if (uio->uio_resid > OFF_MAX - uio->uio_offset) { /* @@ -385,7 +485,11 @@ int shm_ioctl(struct file *fp, u_long com, void *data, struct ucred *active_cred, struct thread *td) { + struct shmfd *shmfd; + struct shm_largepage_conf *conf; + void *rl_cookie; + shmfd = fp->f_data; switch (com) { case FIONBIO: case FIOASYNC: @@ -394,6 +498,38 @@ shm_ioctl(struct file *fp, u_long com, void *data, str * just like it would on an unlinked regular file */ return (0); + case FIOSSHMLPGCNF: + if (!shm_largepage(shmfd)) + return (ENOTTY); + conf = data; + if (shmfd->shm_lp_psind != 0 && + conf->psind != shmfd->shm_lp_psind) + return (EINVAL); + if (conf->psind <= 0 || conf->psind >= MAXPAGESIZES || + pagesizes[conf->psind] == 0) + return (EINVAL); + if (conf->alloc_policy != SHM_LARGEPAGE_ALLOC_DEFAULT && + conf->alloc_policy != SHM_LARGEPAGE_ALLOC_NOWAIT && + conf->alloc_policy != SHM_LARGEPAGE_ALLOC_HARD) + return (EINVAL); + + rl_cookie = rangelock_wlock(&shmfd->shm_rl, 0, OFF_MAX, + &shmfd->shm_mtx); + shmfd->shm_lp_psind = conf->psind; + shmfd->shm_lp_alloc_policy = conf->alloc_policy; + shmfd->shm_object->un_pager.phys.data_val = conf->psind; + rangelock_unlock(&shmfd->shm_rl, rl_cookie, &shmfd->shm_mtx); + return (0); + case FIOGSHMLPGCNF: + if (!shm_largepage(shmfd)) + return (ENOTTY); + conf = data; + rl_cookie = rangelock_rlock(&shmfd->shm_rl, 0, OFF_MAX, + &shmfd->shm_mtx); + conf->psind = shmfd->shm_lp_psind; + conf->alloc_policy = shmfd->shm_lp_alloc_policy; + rangelock_unlock(&shmfd->shm_rl, rl_cookie, &shmfd->shm_mtx); + return (0); default: return (ENOTTY); } @@ -436,6 +572,8 @@ shm_stat(struct file *fp, struct stat *sb, struct ucre sb->st_dev = shm_dev_ino; sb->st_ino = shmfd->shm_ino; sb->st_nlink = shmfd->shm_object->ref_count; + sb->st_blocks = shmfd->shm_object->size / + (pagesizes[shmfd->shm_lp_psind] >> PAGE_SHIFT); return (0); } @@ -592,6 +730,108 @@ retry: return (0); } +static int +shm_dotruncate_largepage(struct shmfd *shmfd, off_t length, void *rl_cookie) +{ + vm_object_t object; + vm_page_t m; + vm_pindex_t newobjsz, oldobjsz; + int aflags, error, i, psind, try; + + KASSERT(length >= 0, ("shm_dotruncate: length < 0")); + object = shmfd->shm_object; + VM_OBJECT_ASSERT_WLOCKED(object); + rangelock_cookie_assert(rl_cookie, RA_WLOCKED); + + oldobjsz = object->size; + newobjsz = OFF_TO_IDX(length); + if (length == shmfd->shm_size) + return (0); + psind = shmfd->shm_lp_psind; + if (psind == 0 && length != 0) + return (EINVAL); + if ((length & (pagesizes[psind] - 1)) != 0) + return (EINVAL); + + if (length < shmfd->shm_size) { + if ((shmfd->shm_seals & F_SEAL_SHRINK) != 0) + return (EPERM); + if (shmfd->shm_kmappings > 0) + return (EBUSY); + return (ENOTSUP); /* Pages are unmanaged. */ +#if 0 + vm_object_page_remove(object, newobjsz, oldobjsz, 0); + object->size = newobjsz; + shmfd->shm_size = length; + return (0); +#endif + } + + aflags = VM_ALLOC_NORMAL | VM_ALLOC_ZERO; + if (shmfd->shm_lp_alloc_policy == SHM_LARGEPAGE_ALLOC_NOWAIT) + aflags |= VM_ALLOC_WAITFAIL; + try = 0; + + /* + * Extend shmfd and object, keeping all already fully + * allocated large pages intact even on error, because dropped + * object lock might allowed mapping of them. + */ + while (object->size < newobjsz) { + m = vm_page_alloc_contig(object, object->size, aflags, + pagesizes[psind] / PAGE_SIZE, 0, ~0, + pagesizes[psind], 0, + VM_MEMATTR_DEFAULT); + if (m == NULL) { + VM_OBJECT_WUNLOCK(object); + if (shmfd->shm_lp_alloc_policy == + SHM_LARGEPAGE_ALLOC_NOWAIT || + (shmfd->shm_lp_alloc_policy == + SHM_LARGEPAGE_ALLOC_DEFAULT && + try >= largepage_reclaim_tries)) { + VM_OBJECT_WLOCK(object); + return (ENOMEM); + } + error = vm_page_reclaim_contig(aflags, + pagesizes[psind] / PAGE_SIZE, 0, ~0, + pagesizes[psind], 0) ? 0 : + vm_wait_intr(object); + if (error != 0) { + VM_OBJECT_WLOCK(object); + return (error); + } + try++; + VM_OBJECT_WLOCK(object); + continue; + } + try = 0; + for (i = 0; i < pagesizes[psind] / PAGE_SIZE; i++) { + if ((m[i].flags & PG_ZERO) == 0) + pmap_zero_page(&m[i]); + vm_page_valid(&m[i]); + vm_page_xunbusy(&m[i]); + } + object->size += OFF_TO_IDX(pagesizes[psind]); + shmfd->shm_size += pagesizes[psind]; + atomic_add_long(&count_largepages[psind], 1); + vm_wire_add(atop(pagesizes[psind])); + } + return (0); +} + +static int +shm_dotruncate_cookie(struct shmfd *shmfd, off_t length, void *rl_cookie) +{ + int error; + + VM_OBJECT_WLOCK(shmfd->shm_object); + error = shm_largepage(shmfd) ? shm_dotruncate_largepage(shmfd, + length, rl_cookie) : shm_dotruncate_locked(shmfd, length, + rl_cookie); + VM_OBJECT_WUNLOCK(shmfd->shm_object); + return (error); +} + int shm_dotruncate(struct shmfd *shmfd, off_t length) { @@ -600,9 +840,7 @@ shm_dotruncate(struct shmfd *shmfd, off_t length) rl_cookie = rangelock_wlock(&shmfd->shm_rl, 0, OFF_MAX, &shmfd->shm_mtx); - VM_OBJECT_WLOCK(shmfd->shm_object); - error = shm_dotruncate_locked(shmfd, length, rl_cookie); - VM_OBJECT_WUNLOCK(shmfd->shm_object); + error = shm_dotruncate_cookie(shmfd, length, rl_cookie); rangelock_unlock(&shmfd->shm_rl, rl_cookie, &shmfd->shm_mtx); return (error); } @@ -612,7 +850,7 @@ shm_dotruncate(struct shmfd *shmfd, off_t length) * routines. */ struct shmfd * -shm_alloc(struct ucred *ucred, mode_t mode) +shm_alloc(struct ucred *ucred, mode_t mode, bool largepage) { struct shmfd *shmfd; @@ -621,8 +859,15 @@ shm_alloc(struct ucred *ucred, mode_t mode) shmfd->shm_uid = ucred->cr_uid; shmfd->shm_gid = ucred->cr_gid; shmfd->shm_mode = mode; - shmfd->shm_object = vm_pager_allocate(OBJT_SWAP, NULL, - shmfd->shm_size, VM_PROT_DEFAULT, 0, ucred); + if (largepage) { + shmfd->shm_object = phys_pager_allocate(NULL, + &shm_largepage_phys_ops, NULL, shmfd->shm_size, + VM_PROT_DEFAULT, 0, ucred); + shmfd->shm_lp_alloc_policy = SHM_LARGEPAGE_ALLOC_DEFAULT; + } else { + shmfd->shm_object = vm_pager_allocate(OBJT_SWAP, NULL, + shmfd->shm_size, VM_PROT_DEFAULT, 0, ucred); + } KASSERT(shmfd->shm_object != NULL, ("shm_create: vm_pager_allocate")); vfs_timestamp(&shmfd->shm_birthtime); shmfd->shm_atime = shmfd->shm_mtime = shmfd->shm_ctime = @@ -687,6 +932,8 @@ shm_access(struct shmfd *shmfd, struct ucred *ucred, i static void shm_init(void *arg) { + char name[32]; + int i; mtx_init(&shm_timestamp_lock, "shm timestamps", NULL, MTX_DEF); sx_init(&shm_dict_lock, "shm dictionary"); @@ -694,6 +941,24 @@ shm_init(void *arg) new_unrhdr64(&shm_ino_unr, 1); shm_dev_ino = devfs_alloc_cdp_inode(); KASSERT(shm_dev_ino > 0, ("shm dev inode not initialized")); + + for (i = 1; i < MAXPAGESIZES; i++) { + if (pagesizes[i] == 0) + break; +#define M (1024 * 1024) +#define G (1024 * M) + if (pagesizes[i] >= G) + snprintf(name, sizeof(name), "%luG", pagesizes[i] / G); + else if (pagesizes[i] >= M) + snprintf(name, sizeof(name), "%luM", pagesizes[i] / M); + else + snprintf(name, sizeof(name), "%lu", pagesizes[i]); +#undef G +#undef M + SYSCTL_ADD_ULONG(NULL, SYSCTL_STATIC_CHILDREN(_vm_largepages), + OID_AUTO, name, CTLFLAG_RD, &count_largepages[i], + "number of non-transient largepages allocated"); + } } SYSINIT(shm_init, SI_SUB_SYSV_SHM, SI_ORDER_ANY, shm_init, NULL); @@ -773,8 +1038,10 @@ kern_shm_open2(struct thread *td, const char *userpath Fnv32_t fnv; mode_t cmode; int error, fd, initial_seals; + bool largepage; - if ((shmflags & ~(SHM_ALLOW_SEALING | SHM_GROW_ON_WRITE)) != 0) + if ((shmflags & ~(SHM_ALLOW_SEALING | SHM_GROW_ON_WRITE | + SHM_LARGEPAGE)) != 0) return (EINVAL); initial_seals = F_SEAL_SEAL; @@ -798,6 +1065,12 @@ kern_shm_open2(struct thread *td, const char *userpath if ((flags & ~(O_ACCMODE | O_CREAT | O_EXCL | O_TRUNC | O_CLOEXEC)) != 0) return (EINVAL); + largepage = (shmflags & SHM_LARGEPAGE) != 0; +#if !defined(__amd64__) + if (largepage) + return (ENOTTY); +#endif + /* * Currently only F_SEAL_SEAL may be set when creating or opening shmfd. * If the decision is made later to allow additional seals, care must be @@ -831,7 +1104,7 @@ kern_shm_open2(struct thread *td, const char *userpath fdrop(fp, td); return (EINVAL); } - shmfd = shm_alloc(td->td_ucred, cmode); + shmfd = shm_alloc(td->td_ucred, cmode, largepage); shmfd->shm_seals = initial_seals; shmfd->shm_flags = shmflags; } else { @@ -854,7 +1127,8 @@ kern_shm_open2(struct thread *td, const char *userpath path); if (error == 0) { #endif - shmfd = shm_alloc(td->td_ucred, cmode); + shmfd = shm_alloc(td->td_ucred, cmode, + largepage); shmfd->shm_seals = initial_seals; shmfd->shm_flags = shmflags; shm_insert(path, fnv, shmfd); @@ -1139,7 +1413,118 @@ out: return (error); } -int +static int +shm_mmap_large(struct shmfd *shmfd, vm_map_t map, vm_offset_t *addr, + vm_size_t size, vm_prot_t prot, vm_prot_t max_prot, int flags, + vm_ooffset_t foff, bool writecounted, struct thread *td) +{ + struct vmspace *vms; + vm_map_entry_t next_entry, prev_entry; + vm_offset_t align, mask, maxaddr; + int docow, error, rv, try; + bool curmap; + + if (shmfd->shm_lp_psind == 0) + return (EINVAL); + + /* MAP_PRIVATE is disabled */ + if ((flags & ~(MAP_SHARED | MAP_FIXED | MAP_EXCL | + MAP_NOCORE | +#ifdef MAP_32BIT + MAP_32BIT | +#endif + MAP_ALIGNMENT_MASK)) != 0) + return (EINVAL); + + vms = td->td_proc->p_vmspace; + curmap = map == &vms->vm_map; + if (curmap) { + error = kern_mmap_racct_check(td, map, size); + if (error != 0) + return (error); + } + + docow = shmfd->shm_lp_psind << MAP_SPLIT_BOUNDARY_SHIFT; + docow |= MAP_INHERIT_SHARE; + if ((flags & MAP_NOCORE) != 0) + docow |= MAP_DISABLE_COREDUMP; + if (writecounted) + docow |= MAP_WRITECOUNT; + + mask = pagesizes[shmfd->shm_lp_psind] - 1; + if ((foff & mask) != 0) + return (EINVAL); + maxaddr = vm_map_max(map); +#ifdef MAP_32BIT + if ((flags & MAP_32BIT) != 0 && maxaddr > MAP_32BIT_MAX_ADDR) + maxaddr = MAP_32BIT_MAX_ADDR; +#endif + if (size == 0 || (size & mask) != 0 || + (*addr != 0 && ((*addr & mask) != 0 || + *addr + size < *addr || *addr + size > maxaddr))) + return (EINVAL); + + align = flags & MAP_ALIGNMENT_MASK; + if (align == 0) { + align = pagesizes[shmfd->shm_lp_psind]; + } else if (align == MAP_ALIGNED_SUPER) { + if (shmfd->shm_lp_psind != 1) + return (EINVAL); + align = pagesizes[1]; + } else { + align >>= MAP_ALIGNMENT_SHIFT; + align = 1ULL << align; + /* Also handles overflow. */ + if (align < pagesizes[shmfd->shm_lp_psind]) + return (EINVAL); + } + + vm_map_lock(map); + if ((flags & MAP_FIXED) == 0) { + try = 1; + if (curmap && (*addr == 0 || + (*addr >= round_page((vm_offset_t)vms->vm_taddr) && + *addr < round_page((vm_offset_t)vms->vm_daddr + + lim_max(td, RLIMIT_DATA))))) { + *addr = roundup2((vm_offset_t)vms->vm_daddr + + lim_max(td, RLIMIT_DATA), + pagesizes[shmfd->shm_lp_psind]); + } +again: + rv = vm_map_find_aligned(map, addr, size, maxaddr, align); + if (rv != KERN_SUCCESS) { + if (try == 1) { + try = 2; + *addr = vm_map_min(map); + if ((*addr & mask) != 0) + *addr = (*addr + mask) & mask; + goto again; + } + goto fail1; + } + } else if ((flags & MAP_EXCL) == 0) { + rv = vm_map_delete(map, *addr, *addr + size); + if (rv != KERN_SUCCESS) + goto fail1; + } else { + error = ENOSPC; + if (vm_map_lookup_entry(map, *addr, &prev_entry)) + goto fail; + next_entry = vm_map_entry_succ(prev_entry); + if (next_entry->start < *addr + size) + goto fail; + } + + rv = vm_map_insert(map, shmfd->shm_object, foff, *addr, *addr + size, + prot, max_prot, docow); +fail1: + error = vm_mmap_to_errno(rv); +fail: + vm_map_unlock(map); + return (error); +} + +static int shm_mmap(struct file *fp, vm_map_t map, vm_offset_t *addr, vm_size_t objsize, vm_prot_t prot, vm_prot_t cap_maxprot, int flags, vm_ooffset_t foff, struct thread *td) @@ -1211,8 +1596,13 @@ shm_mmap(struct file *fp, vm_map_t map, vm_offset_t *a if (writecnt) vm_pager_update_writecount(shmfd->shm_object, 0, objsize); - error = vm_mmap_object(map, addr, objsize, prot, maxprot, flags, - shmfd->shm_object, foff, writecnt, td); + if (shm_largepage(shmfd)) { + error = shm_mmap_large(shmfd, map, addr, objsize, prot, + maxprot, flags, foff, writecnt, td); + } else { + error = vm_mmap_object(map, addr, objsize, prot, maxprot, flags, + shmfd->shm_object, foff, writecnt, td); + } if (error != 0) { if (writecnt) vm_pager_release_writecount(shmfd->shm_object, 0, @@ -1503,11 +1893,8 @@ shm_fallocate(struct file *fp, off_t offset, off_t len */ rl_cookie = rangelock_wlock(&shmfd->shm_rl, offset, size, &shmfd->shm_mtx); - if (size > shmfd->shm_size) { - VM_OBJECT_WLOCK(shmfd->shm_object); - error = shm_dotruncate_locked(shmfd, size, rl_cookie); - VM_OBJECT_WUNLOCK(shmfd->shm_object); - } + if (size > shmfd->shm_size) + error = shm_dotruncate_cookie(shmfd, size, rl_cookie); rangelock_unlock(&shmfd->shm_rl, rl_cookie, &shmfd->shm_mtx); /* Translate to posix_fallocate(2) return value as needed. */ if (error == ENOMEM) Modified: head/sys/sys/filio.h ============================================================================== --- head/sys/sys/filio.h Wed Sep 9 22:07:54 2020 (r365521) +++ head/sys/sys/filio.h Wed Sep 9 22:12:51 2020 (r365522) @@ -70,6 +70,9 @@ struct fiobmap2_arg { }; /* Get the file's bmap info for the logical block bn. */ #define FIOBMAP2 _IOWR('f', 99, struct fiobmap2_arg) +/* POSIX shm largepage set/get config */ +#define FIOSSHMLPGCNF _IOW('f', 100, struct shm_largepage_conf) +#define FIOGSHMLPGCNF _IOR('f', 101, struct shm_largepage_conf) #ifdef _KERNEL #ifdef COMPAT_FREEBSD32 Modified: head/sys/sys/mman.h ============================================================================== --- head/sys/sys/mman.h Wed Sep 9 22:07:54 2020 (r365521) +++ head/sys/sys/mman.h Wed Sep 9 22:12:51 2020 (r365522) @@ -192,14 +192,24 @@ */ #define SHM_ALLOW_SEALING 0x00000001 #define SHM_GROW_ON_WRITE 0x00000002 +#define SHM_LARGEPAGE 0x00000004 +#define SHM_LARGEPAGE_ALLOC_DEFAULT 0 +#define SHM_LARGEPAGE_ALLOC_NOWAIT 1 +#define SHM_LARGEPAGE_ALLOC_HARD 2 + +struct shm_largepage_conf { + int psind; + int alloc_policy; + int pad[10]; +}; + /* * Flags for memfd_create(). */ #define MFD_CLOEXEC 0x00000001 #define MFD_ALLOW_SEALING 0x00000002 -/* UNSUPPORTED */ #define MFD_HUGETLB 0x00000004 #define MFD_HUGE_MASK 0xFC000000 @@ -282,6 +292,10 @@ struct shmfd { int shm_flags; int shm_seals; + + /* largepage config */ + int shm_lp_psind; + int shm_lp_alloc_policy; }; #endif @@ -290,10 +304,11 @@ int shm_map(struct file *fp, size_t size, off_t offset int shm_unmap(struct file *fp, void *mem, size_t size); int shm_access(struct shmfd *shmfd, struct ucred *ucred, int flags); -struct shmfd *shm_alloc(struct ucred *ucred, mode_t mode); +struct shmfd *shm_alloc(struct ucred *ucred, mode_t mode, bool largepage); struct shmfd *shm_hold(struct shmfd *shmfd); void shm_drop(struct shmfd *shmfd); int shm_dotruncate(struct shmfd *shmfd, off_t length); +bool shm_largepage(struct shmfd *shmfd); extern struct fileops shm_ops; @@ -332,6 +347,7 @@ int shm_unlink(const char *); #endif #if __BSD_VISIBLE int memfd_create(const char *, unsigned int); +int shm_create_largepage(const char *, int, int, int, mode_t); int shm_rename(const char *, const char *, int); #endif __END_DECLS Modified: head/sys/vm/vm_fault.c ============================================================================== --- head/sys/vm/vm_fault.c Wed Sep 9 22:07:54 2020 (r365521) +++ head/sys/vm/vm_fault.c Wed Sep 9 22:12:51 2020 (r365522) @@ -420,7 +420,7 @@ vm_fault_populate(struct faultstate *fs) vm_offset_t vaddr; vm_page_t m; vm_pindex_t map_first, map_last, pager_first, pager_last, pidx; - int i, npages, psind, rv; + int bdry_idx, i, npages, psind, rv; MPASS(fs->object == fs->first_object); VM_OBJECT_ASSERT_WLOCKED(fs->first_object); @@ -442,7 +442,8 @@ vm_fault_populate(struct faultstate *fs) * to the driver. */ rv = vm_pager_populate(fs->first_object, fs->first_pindex, - fs->fault_type, fs->entry->max_protection, &pager_first, &pager_last); + fs->fault_type, fs->entry->max_protection, &pager_first, + &pager_last); VM_OBJECT_ASSERT_WLOCKED(fs->first_object); if (rv == VM_PAGER_BAD) { @@ -465,15 +466,57 @@ vm_fault_populate(struct faultstate *fs) MPASS(pager_last < fs->first_object->size); vm_fault_restore_map_lock(fs); + bdry_idx = (fs->entry->eflags & MAP_ENTRY_SPLIT_BOUNDARY_MASK) >> + MAP_ENTRY_SPLIT_BOUNDARY_SHIFT; if (fs->map->timestamp != fs->map_generation) { - vm_fault_populate_cleanup(fs->first_object, pager_first, - pager_last); + if (bdry_idx == 0) { + vm_fault_populate_cleanup(fs->first_object, pager_first, + pager_last); + } else { + m = vm_page_lookup(fs->first_object, pager_first); + if (m != fs->m) + vm_page_xunbusy(m); + } return (KERN_RESTART); } /* * The map is unchanged after our last unlock. Process the fault. * + * First, the special case of largepage mappings, where + * populate only busies the first page in superpage run. + */ + if (bdry_idx != 0) { + m = vm_page_lookup(fs->first_object, pager_first); + vm_fault_populate_check_page(m); + VM_OBJECT_WUNLOCK(fs->first_object); + vaddr = fs->entry->start + IDX_TO_OFF(pager_first) - + fs->entry->offset; + /* assert alignment for entry */ + KASSERT((vaddr & (pagesizes[bdry_idx] - 1)) == 0, + ("unaligned superpage start %#jx pager_first %#jx offset %#jx vaddr %#jx", + (uintmax_t)fs->entry->start, (uintmax_t)pager_first, + (uintmax_t)fs->entry->offset, (uintmax_t)vaddr)); + KASSERT((VM_PAGE_TO_PHYS(m) & (pagesizes[bdry_idx] - 1)) == 0, + ("unaligned superpage m %p %#jx", m, + (uintmax_t)VM_PAGE_TO_PHYS(m))); + rv = pmap_enter(fs->map->pmap, vaddr, m, fs->prot, + fs->fault_type | (fs->wired ? PMAP_ENTER_WIRED : 0) | + PMAP_ENTER_LARGEPAGE, bdry_idx); + VM_OBJECT_WLOCK(fs->first_object); + vm_page_xunbusy(m); + if ((fs->fault_flags & VM_FAULT_WIRE) != 0) { + for (i = 0; i < atop(pagesizes[bdry_idx]); i++) + vm_page_wire(m + i); + } + if (fs->m_hold != NULL) { + *fs->m_hold = m + (fs->first_pindex - pager_first); + vm_page_wire(*fs->m_hold); + } + goto out; + } + + /* * The range [pager_first, pager_last] that is given to the * pager is only a hint. The pager may populate any range * within the object that includes the requested page index. @@ -539,6 +582,7 @@ vm_fault_populate(struct faultstate *fs) vm_page_xunbusy(&m[i]); } } +out: curthread->td_ru.ru_majflt++; return (KERN_SUCCESS); } @@ -1253,6 +1297,7 @@ RetryFault: * multiple page faults of a similar type to run in parallel. */ if (fs.vp == NULL /* avoid locked vnode leak */ && + (fs.entry->eflags & MAP_ENTRY_SPLIT_BOUNDARY_MASK) == 0 && (fs.fault_flags & (VM_FAULT_WIRE | VM_FAULT_DIRTY)) == 0) { VM_OBJECT_RLOCK(fs.first_object); rv = vm_fault_soft_fast(&fs); @@ -1285,6 +1330,27 @@ RetryFault: */ fs.object = fs.first_object; fs.pindex = fs.first_pindex; + + if ((fs.entry->eflags & MAP_ENTRY_SPLIT_BOUNDARY_MASK) != 0) { + rv = vm_fault_allocate(&fs); + switch (rv) { + case KERN_RESTART: + unlock_and_deallocate(&fs); + /* FALLTHROUGH */ + case KERN_RESOURCE_SHORTAGE: + goto RetryFault; + case KERN_SUCCESS: + case KERN_FAILURE: + case KERN_OUT_OF_BOUNDS: + unlock_and_deallocate(&fs); + return (rv); + case KERN_NOT_RECEIVER: + break; + default: + panic("vm_fault: Unhandled rv %d", rv); + } + } + while (TRUE) { KASSERT(fs.m == NULL, ("page still set %p at loop start", fs.m)); Modified: head/sys/vm/vm_mmap.c ============================================================================== --- head/sys/vm/vm_mmap.c Wed Sep 9 22:07:54 2020 (r365521) +++ head/sys/vm/vm_mmap.c Wed Sep 9 22:12:51 2020 (r365522) @@ -219,14 +219,14 @@ kern_mmap_req(struct thread *td, const struct mmap_req struct file *fp; struct proc *p; off_t pos; - vm_offset_t addr; + vm_offset_t addr, orig_addr; vm_size_t len, pageoff, size; vm_prot_t cap_maxprot; int align, error, fd, flags, max_prot, prot; cap_rights_t rights; mmap_check_fp_fn check_fp_fn; - addr = mrp->mr_hint; + orig_addr = addr = mrp->mr_hint; len = mrp->mr_len; prot = mrp->mr_prot; flags = mrp->mr_flags; @@ -422,6 +422,8 @@ kern_mmap_req(struct thread *td, const struct mmap_req if (error != 0) goto done; } + if (fp->f_ops == &shm_ops && shm_largepage(fp->f_data)) + addr = orig_addr; /* This relies on VM_PROT_* matching PROT_*. */ error = fo_mmap(fp, &vms->vm_map, &addr, size, prot, max_prot & cap_maxprot, flags, pos, td); @@ -1104,7 +1106,14 @@ kern_mlock(struct proc *proc, struct ucred *cred, uint PROC_UNLOCK(proc); } #endif - return (error == KERN_SUCCESS ? 0 : ENOMEM); + switch (error) { + case KERN_SUCCESS: + return (0); + case KERN_INVALID_ARGUMENT: + return (EINVAL); + default: + return (ENOMEM); + } } #ifndef _SYS_SYSPROTO_H_ From owner-svn-src-all@freebsd.org Wed Sep 9 22:18:45 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9DEED3DE8BE; Wed, 9 Sep 2020 22:18:45 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BmxHn3FyNz3yXD; Wed, 9 Sep 2020 22:18:45 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5450C8C80; Wed, 9 Sep 2020 22:18:45 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 089MIjTm014135; Wed, 9 Sep 2020 22:18:45 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 089MIjSJ014134; Wed, 9 Sep 2020 22:18:45 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202009092218.089MIjSJ014134@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 9 Sep 2020 22:18:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365523 - head/lib/libsysdecode X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/lib/libsysdecode X-SVN-Commit-Revision: 365523 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.33 Precedence: list List-Id: "SVN commit messages 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, 09 Sep 2020 22:18:45 -0000 Author: kib Date: Wed Sep 9 22:18:44 2020 New Revision: 365523 URL: https://svnweb.freebsd.org/changeset/base/365523 Log: Fix compilation of libsysdecode after r365522, should have been part of it. Reviewed by: markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D24652 Modified: head/lib/libsysdecode/mkioctls Modified: head/lib/libsysdecode/mkioctls ============================================================================== --- head/lib/libsysdecode/mkioctls Wed Sep 9 22:12:51 2020 (r365522) +++ head/lib/libsysdecode/mkioctls Wed Sep 9 22:18:44 2020 (r365523) @@ -51,6 +51,7 @@ BEGIN { print "#include " print "#include " print "#include " + print "#include " print "#include " print "#include " print "#include " From owner-svn-src-all@freebsd.org Wed Sep 9 22:20:37 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 095EE3DEB5E; Wed, 9 Sep 2020 22:20:37 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BmxKw6Vydz3yfT; Wed, 9 Sep 2020 22:20:36 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C279887F6; Wed, 9 Sep 2020 22:20:36 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 089MKaJd015889; Wed, 9 Sep 2020 22:20:36 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 089MKabx015887; Wed, 9 Sep 2020 22:20:36 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202009092220.089MKabx015887@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 9 Sep 2020 22:20:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365524 - head/lib/libc/sys X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/lib/libc/sys X-SVN-Commit-Revision: 365524 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.33 Precedence: list List-Id: "SVN commit messages 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, 09 Sep 2020 22:20:37 -0000 Author: kib Date: Wed Sep 9 22:20:36 2020 New Revision: 365524 URL: https://svnweb.freebsd.org/changeset/base/365524 Log: Add shm_create_largepage(3) helper for creation and configuration of largepage shm objects. And since we can, add memfd_create(MFD_HUGETLB) support, hopefully close enough to the Linux feature. Reviewed by: markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D24652 Modified: head/lib/libc/sys/Symbol.map head/lib/libc/sys/shm_open.c Modified: head/lib/libc/sys/Symbol.map ============================================================================== --- head/lib/libc/sys/Symbol.map Wed Sep 9 22:18:44 2020 (r365523) +++ head/lib/libc/sys/Symbol.map Wed Sep 9 22:20:36 2020 (r365524) @@ -411,6 +411,7 @@ FBSD_1.6 { getfhat; funlinkat; memfd_create; + shm_create_largepage; shm_rename; }; @@ -919,6 +920,7 @@ FBSDprivate_1.0 { __sys_setuid; _shm_open; __sys_shm_open; + __sys_shm_open2; _shm_unlink; __sys_shm_unlink; _shmat; Modified: head/lib/libc/sys/shm_open.c ============================================================================== --- head/lib/libc/sys/shm_open.c Wed Sep 9 22:18:44 2020 (r365523) +++ head/lib/libc/sys/shm_open.c Wed Sep 9 22:20:36 2020 (r365524) @@ -31,14 +31,17 @@ #include __FBSDID("$FreeBSD$"); -#include +#include +#include #include #include #include #include +#include #include #include +#include #include "libc_private.h" @@ -54,6 +57,51 @@ shm_open(const char *path, int flags, mode_t mode) return (__sys_shm_open2(path, flags | O_CLOEXEC, mode, 0, NULL)); } +int +shm_create_largepage(const char *path, int flags, int psind, int alloc_policy, + mode_t mode) +{ + struct shm_largepage_conf slc; + int error, fd, saved_errno; + + fd = __sys_shm_open2(path, flags | O_CREAT, mode, SHM_LARGEPAGE, NULL); + if (error == -1) + return (-1); + + memset(&slc, 0, sizeof(slc)); + slc.psind = psind; + slc.alloc_policy = alloc_policy; + error = ioctl(fd, FIOSSHMLPGCNF, &slc); + if (error == -1) { + saved_errno = errno; + close(fd); + errno = saved_errno; + return (-1); + } + return (fd); +} + +#define K(x) ((size_t)(x) * 1024) +#define M(x) (K(x) * 1024) +#define G(x) (M(x) * 1024) +static const struct { + int mask; + size_t pgsize; +} mfd_huge_sizes[] = { + { .mask = MFD_HUGE_64KB, .pgsize = K(64) }, + { .mask = MFD_HUGE_512KB, .pgsize = K(512) }, + { .mask = MFD_HUGE_1MB, .pgsize = M(1) }, + { .mask = MFD_HUGE_2MB, .pgsize = M(2) }, + { .mask = MFD_HUGE_8MB, .pgsize = M(8) }, + { .mask = MFD_HUGE_16MB, .pgsize = M(16) }, + { .mask = MFD_HUGE_32MB, .pgsize = M(32) }, + { .mask = MFD_HUGE_256MB, .pgsize = M(256) }, + { .mask = MFD_HUGE_512MB, .pgsize = M(512) }, + { .mask = MFD_HUGE_1GB, .pgsize = G(1) }, + { .mask = MFD_HUGE_2GB, .pgsize = G(2) }, + { .mask = MFD_HUGE_16GB, .pgsize = G(16) }, +}; + /* * The path argument is passed to the kernel, but the kernel doesn't currently * do anything with it. Linux exposes it in linprocfs for debugging purposes @@ -63,8 +111,9 @@ int memfd_create(const char *name, unsigned int flags) { char memfd_name[NAME_MAX + 1]; - size_t namelen; - int oflags, shmflags; + size_t namelen, *pgs; + struct shm_largepage_conf slc; + int error, fd, i, npgs, oflags, pgidx, saved_errno, shmflags; if (name == NULL) return (EBADF); @@ -75,11 +124,9 @@ memfd_create(const char *name, unsigned int flags) MFD_HUGE_MASK)) != 0) return (EINVAL); /* Size specified but no HUGETLB. */ - if ((flags & MFD_HUGE_MASK) != 0 && (flags & MFD_HUGETLB) == 0) + if (((flags & MFD_HUGE_MASK) != 0 && (flags & MFD_HUGETLB) == 0) || + __bitcount(flags & MFD_HUGE_MASK) > 1) return (EINVAL); - /* We don't actually support HUGETLB. */ - if ((flags & MFD_HUGETLB) != 0) - return (ENOSYS); /* We've already validated that we're sufficiently sized. */ snprintf(memfd_name, NAME_MAX + 1, "%s%s", MEMFD_NAME_PREFIX, name); @@ -89,5 +136,57 @@ memfd_create(const char *name, unsigned int flags) oflags |= O_CLOEXEC; if ((flags & MFD_ALLOW_SEALING) != 0) shmflags |= SHM_ALLOW_SEALING; - return (__sys_shm_open2(SHM_ANON, oflags, 0, shmflags, memfd_name)); + if ((flags & MFD_HUGETLB) == 0) + shmflags |= SHM_LARGEPAGE; + fd = __sys_shm_open2(SHM_ANON, oflags, 0, shmflags, memfd_name); + if (fd == -1 || (flags & MFD_HUGETLB) == 0) + return (fd); + + pgs = NULL; + npgs = getpagesizes(NULL, 0); + if (npgs == -1) + goto clean; + pgs = calloc(npgs, sizeof(size_t)); + if (pgs == NULL) + goto clean; + error = getpagesizes(pgs, npgs); + if (error == -1) + goto clean; + if ((flags & MFD_HUGE_MASK) == 0) { + if (npgs == 1) { + errno = EOPNOTSUPP; + goto clean; + } + pgidx = 1; + } else { + for (i = 0; i < nitems(mfd_huge_sizes); i++) { + if (mfd_huge_sizes[i].mask == (flags & MFD_HUGE_MASK)) + break; + } + for (pgidx = 0; pgidx < npgs; pgidx++) { + if (mfd_huge_sizes[i].pgsize == pgs[pgidx]) + break; + } + if (pgidx == npgs) { + errno = EOPNOTSUPP; + goto clean; + } + } + free(pgs); + pgs = NULL; + + memset(&slc, 0, sizeof(slc)); + slc.psind = pgidx; + slc.alloc_policy = SHM_LARGEPAGE_ALLOC_DEFAULT; + error = ioctl(fd, FIOSSHMLPGCNF, &slc); + if (error == -1) + goto clean; + return (fd); + +clean: + saved_errno = errno; + close(fd); + free(pgs); + errno = saved_errno; + return (-1); } From owner-svn-src-all@freebsd.org Wed Sep 9 22:22:02 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CB4303DEC42; Wed, 9 Sep 2020 22:22:02 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BmxMZ4Nlkz400R; Wed, 9 Sep 2020 22:22:02 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7B40C8C2A; Wed, 9 Sep 2020 22:22:02 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 089MM2gv018347; Wed, 9 Sep 2020 22:22:02 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 089MM2ko018346; Wed, 9 Sep 2020 22:22:02 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202009092222.089MM2ko018346@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 9 Sep 2020 22:22:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365525 - head/usr.bin/posixshmcontrol X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/usr.bin/posixshmcontrol X-SVN-Commit-Revision: 365525 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.33 Precedence: list List-Id: "SVN commit messages 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, 09 Sep 2020 22:22:02 -0000 Author: kib Date: Wed Sep 9 22:22:02 2020 New Revision: 365525 URL: https://svnweb.freebsd.org/changeset/base/365525 Log: Add posixshmcontrol(1) support for largepage shm objects. Create op with -l option can create it, stat displays configured page size. Reviewed by: markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D24652 Modified: head/usr.bin/posixshmcontrol/posixshmcontrol.c Modified: head/usr.bin/posixshmcontrol/posixshmcontrol.c ============================================================================== --- head/usr.bin/posixshmcontrol/posixshmcontrol.c Wed Sep 9 22:20:36 2020 (r365524) +++ head/usr.bin/posixshmcontrol/posixshmcontrol.c Wed Sep 9 22:22:02 2020 (r365525) @@ -30,8 +30,10 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include +#include #include #include #include @@ -50,7 +52,7 @@ usage(void) { fprintf(stderr, "Usage:\n" - "posixshmcontrol create [-m ] ...\n" + "posixshmcontrol create [-m ] [-l ] ...\n" "posixshmcontrol rm ...\n" "posixshmcontrol ls [-h] [-n]\n" "posixshmcontrol dump ...\n" @@ -59,14 +61,23 @@ usage(void) } static int -create_one_shm(const char *path, long mode) +create_one_shm(const char *path, long mode, int idx) { int fd; - fd = shm_open(path, O_RDWR | O_CREAT, mode); - if (fd == -1) { - warn("create %s", path); - return (1); + if (idx == -1) { + fd = shm_open(path, O_RDWR | O_CREAT, mode); + if (fd == -1) { + warn("create %s", path); + return (1); + } + } else { + fd = shm_create_largepage(path, O_RDWR, idx, + SHM_LARGEPAGE_ALLOC_DEFAULT, mode); + if (fd == -1) { + warn("shm_create_largepage %s psind %d", path, idx); + return (1); + } } close(fd); return (0); @@ -76,20 +87,60 @@ static int create_shm(int argc, char **argv) { char *end; + size_t *pagesizes; long mode; - int c, i, ret, ret1; + uint64_t pgsz; + int c, i, idx, pn, ret, ret1; + bool printed; mode = 0600; - while ((c = getopt(argc, argv, "m:")) != -1) { + idx = -1; + while ((c = getopt(argc, argv, "l:m:")) != -1) { switch (c) { case 'm': errno = 0; mode = strtol(optarg, &end, 0); if (mode == 0 && errno != 0) - err(1, "mode:"); + err(1, "mode"); if (*end != '\0') errx(1, "non-integer mode"); break; + case 'l': + if (expand_number(optarg, &pgsz) == -1) + err(1, "size"); + pn = getpagesizes(NULL, 0); + if (pn == -1) + err(1, "getpagesizes"); + pagesizes = malloc(sizeof(size_t) * pn); + if (pagesizes == NULL) + err(1, "malloc"); + if (getpagesizes(pagesizes, pn) == -1) + err(1, "gtpagesizes"); + for (idx = 0; idx < pn; idx++) { + if (pagesizes[idx] == pgsz) + break; + } + if (idx == pn) { + fprintf(stderr, + "pagesize should be superpagesize, supported sizes:"); + printed = false; + for (i = 0; i < pn; i++) { + if (pagesizes[i] == 0 || + pagesizes[i] == (size_t) + getpagesize()) + continue; + printed = true; + fprintf(stderr, " %zu", pagesizes[i]); + } + if (!printed) + fprintf(stderr, " none"); + fprintf(stderr, "\n"); + exit(1); + } + if (pgsz == (uint64_t)getpagesize()) + errx(1, "pagesize should be large"); + free(pagesizes); + break; case '?': default: usage(); @@ -101,7 +152,7 @@ create_shm(int argc, char **argv) argv += optind; ret = 0; for (i = 0; i < argc; i++) { - ret1 = create_one_shm(argv[i], mode); + ret1 = create_one_shm(argv[i], mode, idx); if (ret1 != 0 && ret == 0) ret = ret1; } @@ -349,6 +400,9 @@ stat_one_shm(const char *path, bool hsize, bool uname) (long)st.st_ctim.tv_nsec); printf("birth\t%ld.%09ld\n", (long)st.st_birthtim.tv_sec, (long)st.st_birthtim.tv_nsec); + if (st.st_blocks != 0) + printf("pagesz\t%jd\n", roundup((uintmax_t)st.st_size, + PAGE_SIZE) / st.st_blocks); } close(fd); return (ret); From owner-svn-src-all@freebsd.org Wed Sep 9 22:22:39 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A14C03DEBF2; Wed, 9 Sep 2020 22:22: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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BmxNH3kV3z40bm; Wed, 9 Sep 2020 22:22:39 +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 5AE278C2D; Wed, 9 Sep 2020 22:22:39 +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 089MMdmo020213; Wed, 9 Sep 2020 22:22:39 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 089MMdGo020212; Wed, 9 Sep 2020 22:22:39 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202009092222.089MMdGo020212@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 9 Sep 2020 22:22:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365526 - stable/12/usr.bin/uname X-SVN-Group: stable-12 X-SVN-Commit-Author: imp X-SVN-Commit-Paths: stable/12/usr.bin/uname X-SVN-Commit-Revision: 365526 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.33 Precedence: list List-Id: "SVN commit messages 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, 09 Sep 2020 22:22:39 -0000 Author: imp Date: Wed Sep 9 22:22:38 2020 New Revision: 365526 URL: https://svnweb.freebsd.org/changeset/base/365526 Log: MFC r360993: r360993 | imp | 2020-05-12 16:44:51 -0600 (Tue, 12 May 2020) | 6 lines Refine the history of uname. It appeared in 4.4BSD. It was not in v7 unix. It was one of the additions in PWB, and appeared in System III and later commercial versions of Unix. The different args to uname weren't aded until System III. Add a quick note to note the late entry into the BSD fork of Unix since PWB otherwise implies a pre-fork date. Modified: stable/12/usr.bin/uname/uname.1 Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.bin/uname/uname.1 ============================================================================== --- stable/12/usr.bin/uname/uname.1 Wed Sep 9 22:22:02 2020 (r365525) +++ stable/12/usr.bin/uname/uname.1 Wed Sep 9 22:22:38 2020 (r365526) @@ -144,7 +144,11 @@ specification. .Sh HISTORY The .Nm -command appeared in PWB UNIX. +command appeared in PWB UNIX 1.0, however +.Bx 4.4 +was the first Berkeley release with the +.Nm +command. .Pp The .Fl K From owner-svn-src-all@freebsd.org Wed Sep 9 22:24:10 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9CDF13DEC6C; Wed, 9 Sep 2020 22:24:10 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BmxQ23dpXz40ZQ; Wed, 9 Sep 2020 22:24:10 +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 60D0A8D1D; Wed, 9 Sep 2020 22:24:10 +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 089MOA8v020353; Wed, 9 Sep 2020 22:24:10 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 089MOAHv020352; Wed, 9 Sep 2020 22:24:10 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202009092224.089MOAHv020352@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 9 Sep 2020 22:24:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365527 - stable/12/share/misc X-SVN-Group: stable-12 X-SVN-Commit-Author: imp X-SVN-Commit-Paths: stable/12/share/misc X-SVN-Commit-Revision: 365527 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.33 Precedence: list List-Id: "SVN commit messages 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, 09 Sep 2020 22:24:10 -0000 Author: imp Date: Wed Sep 9 22:24:09 2020 New Revision: 365527 URL: https://svnweb.freebsd.org/changeset/base/365527 Log: MFC r361673: r361673 | imp | 2020-05-31 15:38:33 -0600 (Sun, 31 May 2020) | 14 lines Correct the release date for 2.11BSD 2.11BSD was announced on March 14, 1991 in comp.bugs.2bsd by Steven M. Schultz. The document has a 'revised January 1991' date at the top. Patch/1 in the official repo is dated March 31, 1991, and an identical copy of it was posted to comp.bugs.2bsd on May 5, 1991. Patch 2 in 22 parts was likewise posted May 18, 1991. This makes the Feb 1992 date too late. It's possible it's a typo for Feb 1991 since that lines up with the announcement being 2 weeks later. Without an extant copy of the 2.11 tape, however, it's hard to say for sure. Go with the date we have the most independent, direct evidence for, which is the announcement date. Modified: stable/12/share/misc/bsd-family-tree Directory Properties: stable/12/ (props changed) Modified: stable/12/share/misc/bsd-family-tree ============================================================================== --- stable/12/share/misc/bsd-family-tree Wed Sep 9 22:22:38 2020 (r365526) +++ stable/12/share/misc/bsd-family-tree Wed Sep 9 22:24:09 2020 (r365527) @@ -456,7 +456,7 @@ Tenth Edition 1989-10-xx [QCU] 2.9BSD-Seismo 1985-08-xx [SMS] 2.10BSD 1987-04-xx [KKK] 2.10.1BSD 1989-01-xx [SMS] -2.11BSD 1992-02-xx [SMS] +2.11BSD 1991-03-14 [SMS] 2.11BSD rev #430 1999-12-13 [SMS] 32V 1978-1[01]-xx [QCU] 1979-03-26 [TUHS] From owner-svn-src-all@freebsd.org Wed Sep 9 22:29:45 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 739ED3DF122; Wed, 9 Sep 2020 22:29:45 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BmxXT2WxGz40hZ; Wed, 9 Sep 2020 22:29:45 +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 21E918BC2; Wed, 9 Sep 2020 22:29:45 +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 089MTjXH020767; Wed, 9 Sep 2020 22:29:45 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 089MTjQT020766; Wed, 9 Sep 2020 22:29:45 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202009092229.089MTjQT020766@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 9 Sep 2020 22:29:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365528 - stable/12/share/man/man4 X-SVN-Group: stable-12 X-SVN-Commit-Author: imp X-SVN-Commit-Paths: stable/12/share/man/man4 X-SVN-Commit-Revision: 365528 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.33 Precedence: list List-Id: "SVN commit messages 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, 09 Sep 2020 22:29:45 -0000 Author: imp Date: Wed Sep 9 22:29:44 2020 New Revision: 365528 URL: https://svnweb.freebsd.org/changeset/base/365528 Log: MFC r361867: r361867 | imp | 2020-06-06 00:21:20 -0600 (Sat, 06 Jun 2020) | 4 lines Document all the sysctl values for the nda devices. Include some minimal documentation on namespace support for nda devices. Fix a few typos and formatting nits to apease igor. Modified: stable/12/share/man/man4/nda.4 Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man4/nda.4 ============================================================================== --- stable/12/share/man/man4/nda.4 Wed Sep 9 22:24:09 2020 (r365527) +++ stable/12/share/man/man4/nda.4 Wed Sep 9 22:29:44 2020 (r365528) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 20, 2017 +.Dd June 6, 2020 .Dt NDA 4 .Os .Sh NAME @@ -48,36 +48,156 @@ variables and .Xr loader 8 tunables: .Bl -tag -width 12 +.It Va hw.nvme.use_nvd +The +.Xr nvme 4 +driver will create +.Nm +device nodes for block storage when set to 0. +Create +.Xr nvd 4 +device nodes for block storage when set to 1. +See +.Xr nvd 4 +when set to 1. +.It Va kern.cam.nda.nvd_compat +When set to 1, +.Xr nvd 4 +aliases will be created for all +.Nm +devices, including partitions and other +.Xr goem 4 +providers that take their names from the disk's name. +.Xr nvd +devices will not, however, be reported in the +.Va kern.disks +.Xr sysctl 8 . .It Va kern.cam.nda.sort_io_queue -.Pp This variable determines whether the software queued entries are sorted in LBA order or not. Sorting is almost always a waste of time. The default is to not sort. +.It Va kern.cam.nda.enable_biospeedup +This variable determines if the +.Nm +devices participate in the speedup protocol. +When the device participates in the speedup, then when the upper layers +send a +.Va BIO_SPEEDUP , +all current +.Va BIO_DELETE +requests not yet sent to the hardware are completed successfully immediate +without sending them to the hardware. +Used in low disk space scenarios when the filesystem encounters +a critical shortage and needs blocks immediately. +Since trims have maximum benefit when the LBA is unused for a long time, +skipping the trim when space is needed for immediate writes results in little to +no excess wear. +When participation is disabled, +.Va BIO_SPEEDUP +requests are ignored. +.It Va kern.cam.nda.max_trim +The maximum number of LBA ranges to be collected together for each DSM trims +send to the hardware. +Defaults to 256, which is the maximum number of ranges the protocol supports. +Sometimes poor trim performance can be mitigated by limiting the number of +ranges sent to the device. +This value must be between 1 and 256 inclusive. .El .Pp The following report per-device settings, and are read-only unless -otherwise indicated. Replace +otherwise indicated. +Replace .Va N with the device unit number. .Bl -tag -width 12 .It Va kern.cam.nda.N.rotating -.Pp This variable reports whether the storage volume is spinning or flash. -It's value is hard coded to 0 indicating flash. +Its value is hard coded to 0 indicating flash. .It Va kern.cam.nda.N.unmapped_io This variable reports whether the .Nm driver accepts unmapped I/O for this unit. +.It Va kern.cam.nda.N.flags +This variable reports the current flags. +.Bl -tag -width 12 +.It Va OPEN +The device is open. +.It Va DIRTY +Set when a write to the drive is scheduled. +Cleared after flush commands. +.It Va SCTX_INIT +Internal flag set after +.Xr sysctl 8 +nodes have been created. +.El +.It Va kern.cam.nda.N.sort_io_queue +Same as the +.Va kern.cam.nda.sort_io_queue +tunable. +.It Va kern.cam.nda.N.trim_ticks +Writable. +When greater than zero, hold trims for up to this many ticks before sending +to the drive. +Sometimes waiting a little bit to collect more trims to send at one time +improves trim performance. +When 0, no delaying of trims are done. +.It Va kern.cam.nda.N.trim_goal +Writable. +When delaying a bit to collect multiple trims, send the accumulated DSM TRIM to +the drive. +.It Va kern.cam.nda.N.trim_lbas +Total number of LBAs that have been trimmed. +.It Va kern.cam.nda.N.trim_ranges +Total number of LBA ranges that have been trimmed. +.It Va kern.cam.nda.N.trim_count +Total number of trims sent to the hardware. +.It Va kern.cam.nda.N.deletes +Total number of +.Va BIO_DELETE +requests queued to the device. +.El +.Sh NAMESPACE MAPPING +Each +.Xr nvme 4 +drive has one or more namespaces associated with it. +One instance of the +.Nm +driver will be created for each of the namespaces on +the drive. +All the +.Nm +nodes for a +.Xr nvme 4 +device are at target 0. +However, the namespace ID maps to the CAM lun, as reported +in kernel messages and in the +.Va devlist +sub command of +.Xr camcontrol 8 . +.Pp +Namespaces are managed with the +.Va ns +sub command of +.Xr nvmecontrol 8 . +Not all drives support namespace management, +but all drives support at least one namespace. +Device nodes for +.Nm +will be created and destroyed dynamically as +namespaces are activated or detached. .Sh FILES .Bl -tag -width ".Pa /dev/nda*" -compact .It Pa /dev/nda* NVMe storage device nodes .El .Sh SEE ALSO +.Xr cam 4 , +.Xr geom 4 , +.Xr nvd 4 , .Xr nvme 4 , -.Xr nvd 4 +.Xr gpart 8 .Sh HISTORY The .Nm From owner-svn-src-all@freebsd.org Wed Sep 9 22:30:44 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 226ED3DF21C; Wed, 9 Sep 2020 22:30:44 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BmxYc08LRz40nG; Wed, 9 Sep 2020 22:30:44 +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 DDD128BC6; Wed, 9 Sep 2020 22:30:43 +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 089MUhBU023415; Wed, 9 Sep 2020 22:30:43 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 089MUhQt023414; Wed, 9 Sep 2020 22:30:43 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202009092230.089MUhQt023414@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 9 Sep 2020 22:30:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365529 - stable/12/share/man/man4 X-SVN-Group: stable-12 X-SVN-Commit-Author: imp X-SVN-Commit-Paths: stable/12/share/man/man4 X-SVN-Commit-Revision: 365529 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.33 Precedence: list List-Id: "SVN commit messages 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, 09 Sep 2020 22:30:44 -0000 Author: imp Date: Wed Sep 9 22:30:43 2020 New Revision: 365529 URL: https://svnweb.freebsd.org/changeset/base/365529 Log: MFC: r361868: r361868 | imp | 2020-06-06 00:49:06 -0600 (Sat, 06 Jun 2020) | 4 lines Fix typo Submitted by: Yuri Pankov Modified: stable/12/share/man/man4/nda.4 Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man4/nda.4 ============================================================================== --- stable/12/share/man/man4/nda.4 Wed Sep 9 22:29:44 2020 (r365528) +++ stable/12/share/man/man4/nda.4 Wed Sep 9 22:30:43 2020 (r365529) @@ -66,7 +66,7 @@ When set to 1, aliases will be created for all .Nm devices, including partitions and other -.Xr goem 4 +.Xr geom 4 providers that take their names from the disk's name. .Xr nvd devices will not, however, be reported in the From owner-svn-src-all@freebsd.org Wed Sep 9 22:33:12 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9FE713DF06F; Wed, 9 Sep 2020 22:33:12 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BmxcS3hD6z413J; Wed, 9 Sep 2020 22:33:12 +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 6201F8BE4; Wed, 9 Sep 2020 22:33:12 +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 089MXC90026804; Wed, 9 Sep 2020 22:33:12 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 089MXCUr026803; Wed, 9 Sep 2020 22:33:12 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202009092233.089MXCUr026803@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 9 Sep 2020 22:33:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365530 - stable/12/share/man/man4 X-SVN-Group: stable-12 X-SVN-Commit-Author: imp X-SVN-Commit-Paths: stable/12/share/man/man4 X-SVN-Commit-Revision: 365530 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.33 Precedence: list List-Id: "SVN commit messages 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, 09 Sep 2020 22:33:12 -0000 Author: imp Date: Wed Sep 9 22:33:11 2020 New Revision: 365530 URL: https://svnweb.freebsd.org/changeset/base/365530 Log: MFC: r361882: r361882 | imp | 2020-06-06 20:40:21 -0600 (Sat, 06 Jun 2020) | 2 lines Mention nda where we mention nvd. Modified: stable/12/share/man/man4/nvme.4 Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man4/nvme.4 ============================================================================== --- stable/12/share/man/man4/nvme.4 Wed Sep 9 22:30:43 2020 (r365529) +++ stable/12/share/man/man4/nvme.4 Wed Sep 9 22:33:11 2020 (r365530) @@ -33,7 +33,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 6, 2020 +.Dd June 6, 2020 .Dt NVME 4 .Os .Sh NAME @@ -54,6 +54,8 @@ nvme_load="YES" .Pp Most users will also want to enable .Xr nvd 4 +or +.Xr nda 4 to expose NVM Express namespaces as disk devices which can be partitioned. Note that in NVM Express terms, a namespace is roughly equivalent to a From owner-svn-src-all@freebsd.org Wed Sep 9 22:35:39 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CBA843DF179; Wed, 9 Sep 2020 22:35: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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BmxgH51Wwz41QV; Wed, 9 Sep 2020 22:35:39 +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 8B2C88E40; Wed, 9 Sep 2020 22:35:39 +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 089MZdKC026988; Wed, 9 Sep 2020 22:35:39 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 089MZdoV026987; Wed, 9 Sep 2020 22:35:39 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202009092235.089MZdoV026987@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 9 Sep 2020 22:35:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365531 - stable/12/share/misc X-SVN-Group: stable-12 X-SVN-Commit-Author: imp X-SVN-Commit-Paths: stable/12/share/misc X-SVN-Commit-Revision: 365531 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.33 Precedence: list List-Id: "SVN commit messages 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, 09 Sep 2020 22:35:39 -0000 Author: imp Date: Wed Sep 9 22:35:39 2020 New Revision: 365531 URL: https://svnweb.freebsd.org/changeset/base/365531 Log: MFC r362420: r362420 | imp | 2020-06-19 22:07:44 -0600 (Fri, 19 Jun 2020) | 13 lines Correct 1BSD release date. The Quarter Century of Unix book said that 1BSD was released March 1979. However, the 1BSD tape image that's on Kirk's historical unix collection has an earlier date. It was common practice, at the time, to create a new copy of the tape from the master system when a new tape was to go out, so several different versions of 1BSD, etc were shipped from Berkerely. The date on the 1BSD tape in the Berkeley archives on Kirk's DVD is dated in January 16 1979 on the label, and has dates as late as Jan 29 (there's an UPDATE file that says this includes updates through this date). Note this date as well. Modified: stable/12/share/misc/bsd-family-tree Directory Properties: stable/12/ (props changed) Modified: stable/12/share/misc/bsd-family-tree ============================================================================== --- stable/12/share/misc/bsd-family-tree Wed Sep 9 22:33:11 2020 (r365530) +++ stable/12/share/misc/bsd-family-tree Wed Sep 9 22:35:39 2020 (r365531) @@ -440,6 +440,7 @@ Ninth Edition 1986-09-xx [QCU] Tenth Edition 1989-10-xx [QCU] 1BSD late 1977 + 1978-01-16 [DOC] 1978-03-09 [QCU] PDP-11, Pascal, ex(1) 30 free copies of 1BSD sent out From owner-svn-src-all@freebsd.org Wed Sep 9 22:38:19 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CEB2F3DF4A5; Wed, 9 Sep 2020 22:38:19 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BmxkM5601z41ds; Wed, 9 Sep 2020 22:38:19 +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 8E6238E42; Wed, 9 Sep 2020 22:38:19 +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 089McJ3G027156; Wed, 9 Sep 2020 22:38:19 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 089McJJu027154; Wed, 9 Sep 2020 22:38:19 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202009092238.089McJJu027154@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 9 Sep 2020 22:38:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365532 - in stable/12: lib/libc/sys usr.sbin/chroot X-SVN-Group: stable-12 X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in stable/12: lib/libc/sys usr.sbin/chroot X-SVN-Commit-Revision: 365532 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.33 Precedence: list List-Id: "SVN commit messages 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, 09 Sep 2020 22:38:19 -0000 Author: imp Date: Wed Sep 9 22:38:18 2020 New Revision: 365532 URL: https://svnweb.freebsd.org/changeset/base/365532 Log: MFC r362664, r362665: r362664 | imp | 2020-06-26 16:05:23 -0600 (Fri, 26 Jun 2020) | 21 lines Chroot(2) actually appeared in 7th Edition Unix. ... r362665 | imp | 2020-06-26 16:23:15 -0600 (Fri, 26 Jun 2020) | 10 lines Chroot(8) first appeared in 4.3-Reno, not in 4.4 in the BSD world, but in System III in the AT&T world. Examination of the TUHS archives shows this was present in 4.3-Reno and System III. Reviewed by: 0mp@, allanjude@ MFC After: 3 days Differential Revision: https://reviews.freebsd.org/D25479 Modified: stable/12/lib/libc/sys/chroot.2 stable/12/usr.sbin/chroot/chroot.8 Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/libc/sys/chroot.2 ============================================================================== --- stable/12/lib/libc/sys/chroot.2 Wed Sep 9 22:35:39 2020 (r365531) +++ stable/12/lib/libc/sys/chroot.2 Wed Sep 9 22:38:18 2020 (r365532) @@ -28,7 +28,7 @@ .\" @(#)chroot.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd March 30, 2020 +.Dd June 26, 2020 .Dt CHROOT 2 .Os .Sh NAME @@ -131,7 +131,7 @@ Corrupted data was detected while reading from the fil The .Fn chroot system call appeared in -.Bx 4.2 . +.At v7 . It was marked as .Dq legacy in Modified: stable/12/usr.sbin/chroot/chroot.8 ============================================================================== --- stable/12/usr.sbin/chroot/chroot.8 Wed Sep 9 22:35:39 2020 (r365531) +++ stable/12/usr.sbin/chroot/chroot.8 Wed Sep 9 22:38:18 2020 (r365532) @@ -28,7 +28,7 @@ .\" @(#)chroot.8 8.1 (Berkeley) 6/9/93 .\" $FreeBSD$ .\" -.Dd June 7, 2003 +.Dd June 27, 2020 .Dt CHROOT 8 .Os .Sh NAME @@ -91,4 +91,6 @@ is used. The .Nm utility first appeared in -.Bx 4.4 . +.At III +and +.Bx 4.3 Reno . From owner-svn-src-all@freebsd.org Wed Sep 9 22:40:15 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 561533DF5AC; Wed, 9 Sep 2020 22:40:15 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bmxmb1XGvz41cn; Wed, 9 Sep 2020 22:40:15 +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 18E898EC3; Wed, 9 Sep 2020 22:40:15 +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 089MeEV5027333; Wed, 9 Sep 2020 22:40:14 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 089MeEI8027332; Wed, 9 Sep 2020 22:40:14 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202009092240.089MeEI8027332@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 9 Sep 2020 22:40:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365533 - stable/12/libexec/getty X-SVN-Group: stable-12 X-SVN-Commit-Author: imp X-SVN-Commit-Paths: stable/12/libexec/getty X-SVN-Commit-Revision: 365533 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.33 Precedence: list List-Id: "SVN commit messages 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, 09 Sep 2020 22:40:15 -0000 Author: imp Date: Wed Sep 9 22:40:14 2020 New Revision: 365533 URL: https://svnweb.freebsd.org/changeset/base/365533 Log: MFC r363408: r363408 | imp | 2020-07-21 18:44:47 -0600 (Tue, 21 Jul 2020) | 4 lines getty appears to date from 3rd edition research unix. That's the oldest man page on TUHS and its 'unix 1972' restoration effort has assembler sources that look like simpler version of what's in the 5th edition. Modified: stable/12/libexec/getty/getty.8 Directory Properties: stable/12/ (props changed) Modified: stable/12/libexec/getty/getty.8 ============================================================================== --- stable/12/libexec/getty/getty.8 Wed Sep 9 22:38:18 2020 (r365532) +++ stable/12/libexec/getty/getty.8 Wed Sep 9 22:40:14 2020 (r365533) @@ -28,7 +28,7 @@ .\" from: @(#)getty.8 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" " -.Dd March 2, 2018 +.Dd July 21, 2020 .Dt GETTY 8 .Os .Sh NAME @@ -122,4 +122,4 @@ does not exist. A .Nm utility appeared in -.At v6 . +.At v3 . From owner-svn-src-all@freebsd.org Wed Sep 9 22:40:39 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C95AD3DF79D; Wed, 9 Sep 2020 22:40:39 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bmxn34yBkz41gP; Wed, 9 Sep 2020 22:40:39 +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 8D683905A; Wed, 9 Sep 2020 22:40:39 +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 089Medh5027405; Wed, 9 Sep 2020 22:40:39 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 089MedNr027404; Wed, 9 Sep 2020 22:40:39 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <202009092240.089MedNr027404@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Wed, 9 Sep 2020 22:40: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: r365534 - stable/11/sbin/init X-SVN-Group: stable-11 X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: stable/11/sbin/init X-SVN-Commit-Revision: 365534 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.33 Precedence: list List-Id: "SVN commit messages 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, 09 Sep 2020 22:40:39 -0000 Author: brooks Date: Wed Sep 9 22:40:39 2020 New Revision: 365534 URL: https://svnweb.freebsd.org/changeset/base/365534 Log: MFC r365279: Remove risky compatability with old kernels The badsys() handler for SIGSYS was added as a transtion aid for kernels lacking sysctl() in 1993. It is unsafe and unsound so remove it rather than running the risk of a privilege-dropping system call being silently omitted. This partially reverts SCCSID 6.12 (Berkeley) 03/03/93 "add code to change the system security level". Reviewed by: mckusick, imp, kevans Obtained from: CheriBSD Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D26289 Modified: stable/11/sbin/init/init.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/init/init.c ============================================================================== --- stable/11/sbin/init/init.c Wed Sep 9 22:40:14 2020 (r365533) +++ stable/11/sbin/init/init.c Wed Sep 9 22:40:39 2020 (r365534) @@ -104,7 +104,6 @@ static void stall(const char *, ...) __printflike(1, 2 static void warning(const char *, ...) __printflike(1, 2); static void emergency(const char *, ...) __printflike(1, 2); static void disaster(int); -static void badsys(int); static void revoke_ttys(void); static int runshutdown(void); static char *strk(char *); @@ -305,9 +304,8 @@ invalid: * We catch or block signals rather than ignore them, * so that they get reset on exec. */ - handle(badsys, SIGSYS, 0); - handle(disaster, SIGABRT, SIGFPE, SIGILL, SIGSEGV, SIGBUS, SIGXCPU, - SIGXFSZ, 0); + handle(disaster, SIGABRT, SIGFPE, SIGILL, SIGSEGV, SIGBUS, SIGSYS, + SIGXCPU, SIGXFSZ, 0); handle(transition_handler, SIGHUP, SIGINT, SIGEMT, SIGTERM, SIGTSTP, SIGUSR1, SIGUSR2, 0); handle(alrm_handler, SIGALRM, 0); @@ -502,22 +500,6 @@ emergency(const char *message, ...) vsyslog(LOG_EMERG, message, ap); va_end(ap); -} - -/* - * Catch a SIGSYS signal. - * - * These may arise if a system does not support sysctl. - * We tolerate up to 25 of these, then throw in the towel. - */ -static void -badsys(int sig) -{ - static int badcount = 0; - - if (badcount++ < 25) - return; - disaster(sig); } /* From owner-svn-src-all@freebsd.org Wed Sep 9 22:42:14 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 76EE13DF6FE; Wed, 9 Sep 2020 22:42:14 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from hz.grosbein.net (hz.grosbein.net [IPv6:2a01:4f8:c2c:26d8::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "hz.grosbein.net", Issuer "hz.grosbein.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bmxpr4Pnmz42F7; Wed, 9 Sep 2020 22:42:12 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from eg.sd.rdtc.ru (eg.sd.rdtc.ru [IPv6:2a03:3100:c:13:0:0:0:5]) by hz.grosbein.net (8.15.2/8.15.2) with ESMTPS id 089MfoNo058630 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 9 Sep 2020 22:41:53 GMT (envelope-from eugen@grosbein.net) X-Envelope-From: eugen@grosbein.net X-Envelope-To: jhb@FreeBSD.org Received: from [10.58.0.10] (dadvw [10.58.0.10]) by eg.sd.rdtc.ru (8.16.1/8.16.1) with ESMTPS id 089MfrOR024531 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Thu, 10 Sep 2020 05:41:54 +0700 (+07) (envelope-from eugen@grosbein.net) Subject: Re: svn commit: r365281 - in stable: 11/sys/conf 11/sys/modules 11/sys/modules/tcp 12/sys/conf 12/sys/modules 12/sys/modules/tcp To: John Baldwin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org References: <202009022136.082LatjO029946@repo.freebsd.org> <7795ab88-6220-150b-38e9-0ffae40a6093@grosbein.net> <13b91b06-b75b-55d7-64b6-d05e0a2a1c2c@FreeBSD.org> From: Eugene Grosbein Message-ID: <40c61507-42c8-3dda-d25a-467a984582bb@grosbein.net> Date: Thu, 10 Sep 2020 05:41:45 +0700 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <13b91b06-b75b-55d7-64b6-d05e0a2a1c2c@FreeBSD.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,LOCAL_FROM, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Report: * -2.3 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record * -0.0 SPF_PASS SPF: sender matches SPF record * 2.6 LOCAL_FROM From my domains * -1.6 NICE_REPLY_A Looks like a legit reply (A) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on hz.grosbein.net X-Rspamd-Queue-Id: 4Bmxpr4Pnmz42F7 X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=permerror (mx1.freebsd.org: domain of eugen@grosbein.net uses mechanism not recognized by this client) smtp.mailfrom=eugen@grosbein.net X-Spamd-Result: default: False [-1.64 / 15.00]; MID_RHS_MATCH_FROM(0.00)[]; ARC_NA(0.00)[]; FREEFALL_USER(0.00)[eugen]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-0.97)[-0.965]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[grosbein.net]; NEURAL_HAM_MEDIUM(-0.92)[-0.920]; RCPT_COUNT_FIVE(0.00)[5]; RCVD_COUNT_THREE(0.00)[3]; NEURAL_SPAM_SHORT(0.35)[0.348]; R_SPF_PERMFAIL(0.00)[empty SPF record]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:24940, ipnet:2a01:4f8::/29, country:DE]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[svn-src-stable-12,svn-src-stable,svn-src-all] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 09 Sep 2020 22:42:14 -0000 10.09.2020 2:55, John Baldwin wrote: > On 9/4/20 8:33 AM, John Baldwin wrote: >> On 9/3/20 11:39 AM, Eugene Grosbein wrote: >>> 04.09.2020 1:16, Eugene Grosbein wrote: >>> Additional rollback of r365277 gave me successfull buildworld. >> >> Ah, it is MODULES_WITH_WORLD that is tripping you up. What is probably >> needed to fix this is merging kmod.opts.mk. I can work on that. > > This should all be fixed now. Thank you, it is really fixed. From owner-svn-src-all@freebsd.org Wed Sep 9 22:42:15 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6D0BD3DFB09; Wed, 9 Sep 2020 22:42:15 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bmxpv0tsDz42HQ; Wed, 9 Sep 2020 22:42:15 +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 F39DB913E; Wed, 9 Sep 2020 22:42:14 +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 089MgENn030536; Wed, 9 Sep 2020 22:42:14 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 089MgEnE030535; Wed, 9 Sep 2020 22:42:14 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202009092242.089MgEnE030535@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 9 Sep 2020 22:42:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365535 - stable/12/usr.bin/patch X-SVN-Group: stable-12 X-SVN-Commit-Author: imp X-SVN-Commit-Paths: stable/12/usr.bin/patch X-SVN-Commit-Revision: 365535 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.33 Precedence: list List-Id: "SVN commit messages 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, 09 Sep 2020 22:42:15 -0000 Author: imp Date: Wed Sep 9 22:42:14 2020 New Revision: 365535 URL: https://svnweb.freebsd.org/changeset/base/365535 Log: MFC r364291: r364291 | imp | 2020-08-16 17:55:23 -0600 (Sun, 16 Aug 2020) | 33 lines Remove heuristic for dealing with trailing newlines being truncated by mailers. ... Modified: stable/12/usr.bin/patch/pch.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.bin/patch/pch.c ============================================================================== --- stable/12/usr.bin/patch/pch.c Wed Sep 9 22:40:39 2020 (r365534) +++ stable/12/usr.bin/patch/pch.c Wed Sep 9 22:42:14 2020 (r365535) @@ -587,16 +587,11 @@ another_hunk(void) len = pgets(true); p_input_line++; if (len == 0) { - if (p_max - p_end < 4) { - /* assume blank lines got chopped */ - strlcpy(buf, " \n", buf_size); - } else { - if (repl_beginning && repl_could_be_missing) { - repl_missing = true; - goto hunk_done; - } - fatal("unexpected end of file in patch\n"); + if (repl_beginning && repl_could_be_missing) { + repl_missing = true; + goto hunk_done; } + fatal("unexpected end of file in patch\n"); } p_end++; if (p_end >= hunkmax) From owner-svn-src-all@freebsd.org Wed Sep 9 22:45:13 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 26E223DF9FB; Wed, 9 Sep 2020 22:45:13 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BmxtJ6FY2z42DY; Wed, 9 Sep 2020 22:45:12 +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 B590E8E59; Wed, 9 Sep 2020 22:45:12 +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 089MjCsl033083; Wed, 9 Sep 2020 22:45:12 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 089MjBRX033079; Wed, 9 Sep 2020 22:45:11 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202009092245.089MjBRX033079@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 9 Sep 2020 22:45:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365536 - in stable/12: sbin/devd share/man/man4 sys/dev/pccard X-SVN-Group: stable-12 X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in stable/12: sbin/devd share/man/man4 sys/dev/pccard X-SVN-Commit-Revision: 365536 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.33 Precedence: list List-Id: "SVN commit messages 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, 09 Sep 2020 22:45:13 -0000 Author: imp Date: Wed Sep 9 22:45:11 2020 New Revision: 365536 URL: https://svnweb.freebsd.org/changeset/base/365536 Log: MFC r364335,r364336,r364337,r364351 r364335 | imp | 2020-08-18 00:07:34 -0600 (Tue, 18 Aug 2020) | 6 lines Modernize a bit. Remove PC Card specific information. It's of little value these days and on the way out after most of its drivers have been removed. Use iwn instead of wi device. r364336 | imp | 2020-08-18 00:18:18 -0600 (Tue, 18 Aug 2020) | 9 lines Document that PC Card will likely be removed before 13. This was discussed in arch@ a while ago. Most of the 16-bit drivers that it relied on have been removed. There's only a few other drivers remaining that support it, and those are very rare the days (even the once ubiquitious wi(1) is now quite rare). Indvidual drivers will be handled separately before pccard itself is removed. r364337 | imp | 2020-08-18 00:34:56 -0600 (Tue, 18 Aug 2020) | 2 lines Use better gone_in_dev rather than just gone_in to print the device name. r364351 | imp | 2020-08-18 11:29:01 -0600 (Tue, 18 Aug 2020) | 4 lines bt(4) has already been removed. Add a deprecation notice. MFC After: 1 day Modified: stable/12/sbin/devd/devd.conf.5 stable/12/share/man/man4/bt.4 stable/12/share/man/man4/pccard.4 stable/12/sys/dev/pccard/pccard.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/devd/devd.conf.5 ============================================================================== --- stable/12/sbin/devd/devd.conf.5 Wed Sep 9 22:42:14 2020 (r365535) +++ stable/12/sbin/devd/devd.conf.5 Wed Sep 9 22:45:11 2020 (r365536) @@ -41,7 +41,7 @@ .\" ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS .\" SOFTWARE. .\" -.Dd May 31, 2019 +.Dd August 18, 2020 .Dt DEVD.CONF 5 .Os .Sh NAME @@ -253,10 +253,6 @@ Device name of parent bus. Device node path if one is created by the .Xr devfs 5 filesystem. -.It Li cisproduct -CIS-product. -.It Li cisvendor -CIS-vendor. .It Li class Device class. .It Li comm @@ -285,8 +281,6 @@ Interface Protocol (USB). Interface Sub-class (USB). .It Li jail Jail name for the process triggering the rule (RCTL). -.It Li manufacturer -Manufacturer ID (pccard). .It Li mode Peripheral mode (USB). .It Li notify @@ -300,7 +294,7 @@ PID of the process triggering the rule (RCTL). .It Li port Hub port number (USB). .It Li product -Product ID (pccard/USB). +Product ID (USB). .It Li release Hardware revision (USB). .It Li ruid @@ -312,9 +306,9 @@ Serial Number (USB). .It Li slot Card slot. .It Li subvendor -Sub-vendor ID. +Sub-vendor ID (PCI). .It Li subdevice -Sub-device ID. +Sub-device ID (PCI). .It Li subsystem Matches a subsystem of a system, see below. .It Li system @@ -641,20 +635,20 @@ notify 0 { }; # -# Try to configure ath and wi devices with pccard_ether +# Try to configure ath and iwn devices with pccard_ether # as they are attached. # attach 0 { - device-name "(ath|wi)[0-9]+"; + device-name "(ath|iwn)[0-9]+"; action "/etc/pccard_ether $device-name start"; }; # -# Stop ath and wi devices as they are detached from +# Stop ath and iwn devices as they are detached from # the system. # detach 0 { - device-name "(ath|wi)[0-9]+"; + device-name "(ath|iwn)[0-9]+"; action "/etc/pccard_ether $device-name stop"; }; .Ed Modified: stable/12/share/man/man4/bt.4 ============================================================================== --- stable/12/share/man/man4/bt.4 Wed Sep 9 22:42:14 2020 (r365535) +++ stable/12/share/man/man4/bt.4 Wed Sep 9 22:45:11 2020 (r365536) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 15, 2017 +.Dd August 18, 2020 .Dt BT 4 .Os .Sh NAME @@ -46,6 +46,9 @@ In .Cd hint.bt.0.at="isa" .Cd hint.bt.0.port="0x330" .Ed +.Sh DEPRECATION NOTICE +This driver is scheduled for removal prior to the release of +.Fx 13.0 . .Sh DESCRIPTION This driver provides access to the .Tn SCSI Modified: stable/12/share/man/man4/pccard.4 ============================================================================== --- stable/12/share/man/man4/pccard.4 Wed Sep 9 22:42:14 2020 (r365535) +++ stable/12/share/man/man4/pccard.4 Wed Sep 9 22:45:11 2020 (r365536) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 9, 2002 +.Dd August 18, 2020 .Dt PCCARD 4 .Os .Sh NAME @@ -32,6 +32,9 @@ .Nd PC Card bus driver .Sh SYNOPSIS .Cd device pccard +.Sh DEPRECATION NOTICE +This driver is scheduled for removal prior to the release of +.Fx 13.0 .Sh DESCRIPTION The .Nm Modified: stable/12/sys/dev/pccard/pccard.c ============================================================================== --- stable/12/sys/dev/pccard/pccard.c Wed Sep 9 22:42:14 2020 (r365535) +++ stable/12/sys/dev/pccard/pccard.c Wed Sep 9 22:45:11 2020 (r365536) @@ -843,6 +843,7 @@ pccard_attach(device_t dev) sc->sc_enabled_count = 0; if ((err = pccard_device_create(sc)) != 0) return (err); + gone_in_dev(dev, 13, "PC Card to be removed."); STAILQ_INIT(&sc->card.pf_head); return (bus_generic_attach(dev)); } From owner-svn-src-all@freebsd.org Wed Sep 9 22:49:44 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1B9263DFD93; Wed, 9 Sep 2020 22:49:44 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BmxzW714Xz42hk; Wed, 9 Sep 2020 22:49:43 +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 B99009180; Wed, 9 Sep 2020 22:49:43 +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 089MnhIH033361; Wed, 9 Sep 2020 22:49:43 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 089MnhUO033360; Wed, 9 Sep 2020 22:49:43 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202009092249.089MnhUO033360@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 9 Sep 2020 22:49:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365537 - stable/12/sbin/devd X-SVN-Group: stable-12 X-SVN-Commit-Author: imp X-SVN-Commit-Paths: stable/12/sbin/devd X-SVN-Commit-Revision: 365537 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.33 Precedence: list List-Id: "SVN commit messages 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, 09 Sep 2020 22:49:44 -0000 Author: imp Date: Wed Sep 9 22:49:43 2020 New Revision: 365537 URL: https://svnweb.freebsd.org/changeset/base/365537 Log: MFC r364359, r364360, r364361, r364362, r364364, r364370 r364359 | imp | 2020-08-18 15:26:39 -0600 (Tue, 18 Aug 2020) | 9 lines Move the possible event types into a column table to make it easier to read. Sort system type alphabetically. Remove some commas that aren't in the devd notification messages. MFC After: 3 days Reviewed by: 0mp (earlier versions), jhb (useful feedback on earlier versions) Differential Revision: https://reviews.freebsd.org/D26105 r364360 | imp | 2020-08-18 15:26:45 -0600 (Tue, 18 Aug 2020) | 4 lines GEOM::rotation_rate changes are also signaled via devctl. MFC After: 3 days r364361 | imp | 2020-08-18 15:26:50 -0600 (Tue, 18 Aug 2020) | 8 lines Document the PMU system The pmu(4) and adb(4) drivers on powerpc generate PMU events. Document them. The allwinner power modules also generate these events. Document those as well. MFC After: 3 days r364362 | imp | 2020-08-18 15:26:54 -0600 (Tue, 18 Aug 2020) | 4 lines Document the AEON subsystem for the Amiga's power button. MFC After: 3 days r364364 | imp | 2020-08-18 15:42:02 -0600 (Tue, 18 Aug 2020) | 5 lines Fix two typos. Submitted by: rpokala@ MFC After: 3 days r364370 | imp | 2020-08-18 20:18:11 -0600 (Tue, 18 Aug 2020) | 8 lines Three typos: Amiga is a proper noun Condition is traditionally spelled starting with 'c' Some, but not all, of the over/under-voltage instances were hyphenated. Since they are all adverb phrases, they all need to be hyphenated. Pointy hat: imp Modified: stable/12/sbin/devd/devd.conf.5 Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/devd/devd.conf.5 ============================================================================== --- stable/12/sbin/devd/devd.conf.5 Wed Sep 9 22:45:11 2020 (r365536) +++ stable/12/sbin/devd/devd.conf.5 Wed Sep 9 22:49:43 2020 (r365537) @@ -322,96 +322,118 @@ Vendor ID. A partial list of systems, subsystems, and types used within the .Ic notify mechanism. +.\" +.\" Please keep these tables sorted. Also, please use the same parameters +.\" for each of the tables so that things line up in columns nicely. +.\" Please do not omit the type column for notifiers that omit it. .Pp -.Bl -tag -width ".Li coretemp" -compact -.It Sy System -.It Li ACPI -Events related to the ACPI subsystem. -.Bl -tag -width ".Sy Subsystem" -compact -.It Sy Subsystem -.It Li ACAD +.Bl -column "System" "Subsystem" "1234567" -compact +.Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description" +.It Li ACPI Ta Ta Ta +Events related to the ACPI Subsystem. +.It Li ACPI Ta Li ACAD Ta Ta AC line state ($notify=0x00 is offline, 0x01 is online). -.It Li Button +.It Li ACPI Ta Li Button Ta Ta Button state ($notify=0x00 is power, 0x01 is sleep). -.It Li CMBAT +.It Li ACPI Ta Li CMBAT Ta Ta Battery events. -.It Li Dock +.It Li ACPI Ta Li Dock Ta Ta Dock state ($notify=0x00 is undocked, 0x01 is docked). -.It Li Lid +.It Li ACPI Ta Li Lid Ta Ta Lid state ($notify=0x00 is closed, 0x01 is open). -.It Li PROCESSOR +.It Li ACPI Ta Li PROCESSOR Ta Ta Processor state/configuration ($notify=0x81 is a change in available Cx states). -.It Li Resume +.It Li ACPI Ta Li Resume Ta Ta Resume notification. -.It Li Suspend +.It Li ACPI Ta Li Suspend Ta Ta Suspend notification. -.It Li Thermal +.It Li ACPI Ta Li Thermal Ta Ta Thermal zone events. .El .Pp -.It Li CARP +.Bl -column "System" "Subsystem" "1234567" -compact +.Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description" +.It Li AEON Ta Li power Ta Li press Ta +The power button on an Amiga has been pressed. +.El +.Pp +.Bl -column "System" "Subsystem" "1234567" -compact +.Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description" +.It Li CAM Ta Ta Ta Events related to the +.Xr cam 4 +system. +.It Li CAM Ta Li periph Ta Ta +Events related to peripheral devices. +.It Li CAM Ta Li periph Ta Li error Ta +Generic errors. +.It Li CAM Ta Li periph Ta Li timeout Ta +Command timeouts. +.El +.Pp +.Bl -column "System" "Subsystem" "1234567" -compact +.Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description" +.It Li CARP Ta Ta Ta +Events related to the .Xr carp 4 protocol. -.Bl -tag -width ".Sy Subsystem" -compact -.It Sy Subsystem -.It Ar vhid@interface +.It CARP Ta Ar vhid@inet Ta Ta The .Dq subsystem contains the actual CARP vhid and the name of the network interface on which the event took place. -.Bl -tag -width ".Li MASTER" -compact -.It Sy Type -.It Li MASTER +.It CARP Ta Ar vhid@inet Ta MASTER Ta Node become the master for a virtual host. -.It Li BACKUP +.It CARP Ta Ar vhid@inet Ta BACKUP Ta Node become the backup for a virtual host. .El +.Pp +.Bl -column "System" "Subsystem" "1234567" -compact +.Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description" +.It Li coretemp Ta Ta Ta +Events related to the +.Xr coretemp 4 +device. +.It Li coretemp Ta Li Thermal Ta Ta +Notification that the CPU core has reached critical temperature. +.It Li coretemp Ta Li Thermal Ta Li temperature Ta +String containing the temperature of the core that has become too hot. .El .Pp +.Bl -column "System" "Subsystem" "1234567" -compact +.Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description" .It Li IFNET -Events related to the network subsystem. -.Bl -tag -width ".Sy Subsystem" -compact -.It Sy Subsystem -.It Ar interface +.It Li IFNET Ta Ar inet Ta Ta The .Dq subsystem is the actual name of the network interface on which the event took place. -.Bl -tag -width ".Li LINK_DOWN" -compact -.It Sy Type -.It Li LINK_UP +.It Li IFNET Ta Ar inet Ta Li LINK_UP Ta Carrier status changed to UP. -.It Li LINK_DOWN +.It Li IFNET Ta Ar inet Ta Li LINK_DOWN Ta Carrier status changed to DOWN. -.It Li ATTACH +.It Li IFNET Ta Ar inet Ta Li ATTACH Ta The network interface is attached to the system. -.It Li DETACH +.It Li IFNET Ta Ar inet Ta Li DETACH Ta The network interface is detached from the system. .El -.El .Pp +.Bl -column "System" "Subsystem" "1234567" -compact +.Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description" .It Li DEVFS -Events related to the -.Xr devfs 5 -filesystem. -.Bl -tag -width ".Sy Subsystem" -compact -.It Sy Subsystem -.It Li CDEV -.Bl -tag -width ".Li DESTROY" -compact -.It Sy Type -.It Li CREATE +.It Li DEVFS Ta Li CDEV Ta Li CREATE Ta The .Xr devfs 5 node is created. -.It Li DESTROY +.It Li DEVFS Ta Li CDEV Ta Li DESTROY Ta The .Xr devfs 5 node is destroyed. .El -.El .Pp -.It Li GEOM +.Bl -column "System" "Subsystem" "1234567" -compact +.Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description" +.It Li GEOM Ta Ta Ta Events related to the .Xr geom 4 framework. @@ -420,131 +442,151 @@ The difference compared to is that .Li GEOM only includes disk-like devices. -.Bl -tag -width ".Sy Subsystem" -compact -.It Sy Subsystem -.It Li DEV -.Bl -tag -width ".Li MEDIACHANGE" -compact -.It Sy Type -.It Li CREATE +.It Li GEOM Ta Li DEV Ta Li CREATE Ta A .Xr geom 4 device node is created. -.It Li DESTROY +.It Li GEOM Ta Li DEV Ta Li DESTROY Ta A .Xr geom 4 device node is destroyed. -.It Li GEOM::physpath +.It Li GEOM Ta Li DEV Ta Li GEOM::physpath Ta The physical path of a device has changed. -.It Li MEDIACHANGE +.It Li GEOM Ta Li DEV Ta Li GEOM::rotation_rate Ta +The rotation rate of the disk has changed. +.It Li GEOM Ta Li DEV Ta Li MEDIACHANGE Ta Physical media has changed. +.It Li GEOM Ta Li DEV Ta Li SIZECHANGE Ta +A +.Xr geom 4 +provider size has changed. .El +.Pp +.Bl -column "System" "Subsystem" "1234567" -compact +.Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description" +.It Li kern Ta Li power Ta Li resume Ta +Notification that the system has woken from the suspended state. .El .Pp -.It Li RCTL +.Pp +.Bl -column "System" "Subsystem" "1234567" -compact +.Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description" +.It Li kernel Ta Li signal Ta Li coredump Ta +Notification that a process has crashed and dumped core. +.El +.Pp +.Bl -column "System" "Subsystem" "1234567" -compact +.Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description" +.It Li PMU Ta Ta Ta +Notification of events from various types of Power Management Units. +.It Li PMU Ta Li "AC" Ta Ta +Notifications of AC power related events. +.It Li PMU Ta Li "AC" Ta Li overvoltage Ta +An over-voltage condition was detected on the AC power line. +.It Li PMU Ta Li "AC" Ta Li plugged Ta +Power has been applied to the AC power line. +.It Li PMU Ta Li "AC" Ta Li unplugged Ta +Power has been removed from the AC power line. +.It Li PMU Ta Li Battery Ta Ta +.It Li PMU Ta Li Battery Ta absent Ta +Battery is no longer absent. +.It Li PMU Ta Li Battery Ta charged Ta +The battery has become charged. +.It Li PMU Ta Li Battery Ta charging Ta +The battery has started charging. +.It Li PMU Ta Li Battery Ta disconnected Ta +The battery has been disconnected. +.It Li PMU Ta Li Battery Ta high-temp Ta +The battery reported a temperature over the limit. +.It Li PMU Ta Li Battery Ta low-temp Ta +The battery reported a temperature under the limit. +.It Li PMU Ta Li Battery Ta plugged Ta +The battery has become plugged (eg connected). +.It Li PMU Ta Li Battery Ta shutdown-threshold Ta +The power in the battery has fallen below the shutdown threshold. +.It Li PMU Ta Li Battery Ta warning-threshold Ta +The power in the battery has fallen below the warn the user threshold. +.It Li PMU Ta Li Button Ta pressed Ta +A button on a +.Xr adb 4 +or +.Xr pmu 4 +has been pressed. +.It Li PMU Ta Li keys Ta Ta +One of the keys on the +.Xr adb 4 +keyboard has been pressed. +.It Li PMU Ta Li keys Ta brightness Ta +A brightness level change has been requested. +Direction is in the $notify variable. +.It Li PMU Ta Li keys Ta mute Ta +The mute key +.It Li PMU Ta Li keys Ta volume Ta +A volume level change has been requested. +Direction is in the $notify variable. +.It Li PMU Ta Li keys Ta eject Ta +An ejection has been requested. +.It Li PMU Ta Li lid Ta close Ta +The +.Xr pmc 4 +device has detected the lid closing. +.It Li PMU Ta Li lid Ta open Ta +The +.Xr pmc 4 +device has detected the lid openinging. +.It Li PMU Ta Li POWER Ta ACLINE Ta +The +.Xr pmc 4 +device has deteted an AC line state ($notify=0x00 is offline, 0x01 is online). +.It Li PMU Ta Li USB Ta overvoltage Ta +An over-voltage condition on the power lines for the USB power pins. +.It Li PMU Ta Li USB Ta plugged Ta +A device has been plugged into a USB device. +.It Li PMU Ta Li USB Ta undervoltage Ta +An under-voltage condition on the power lines for the USB power pins. +.It Li PMU Ta Li USB Ta unplugged Ta +A device has been unplugged into a USB device. +.El +.Pp +.Bl -column "System" "Subsystem" "1234567" -compact +.Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description" +.It Li RCTL Ta Ta Ta Events related to the .Xr rctl 8 framework. -.Bl -tag -width ".Sy Subsystem" -compact -.It Sy Subsystem -.It Li rule -.Bl -tag -width ".Li matched" -compact -.It Sy Type -.It Li matched +.It Li RCTL Ta Li rule Ta Li matched Ta A rule with action specified as "devctl" was triggered. .El -.El .Pp -.It Li USB +.Bl -column "System" "Subsystem" "1234567" -compact +.Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description" +.It Li USB Ta Ta Ta Events related to the USB subsystem. -.Bl -tag -width ".Sy Subsystem" -compact -.It Sy Subsystem -.It Li DEVICE -.Bl -tag -width ".Li DETACH" -compact -.It Sy Type -.It Li ATTACH +.It Li USB Ta Li DEVICE Ta Li ATTACH Ta USB device is attached to the system. -.It Li DETACH -USB device is detached from the system. -.El -.It Li INTERFACE -.Bl -tag -width ".Li DETACH" -compact -.It Sy Type -.It Li ATTACH +.It Li USB Ta Li DEVICE Ta Li DETACH Ta +USB device is detached to the system. +.It Li USB Ta Li INTERFACE Ta Li ATTACH Ta USB interface is attached to a device. -.It Li DETACH +.It Li USB Ta Li INTERFACE Ta Li DETACH Ta USB interface is detached from a device. .El -.El .Pp -.It Li coretemp -Events related to the -.Xr coretemp 4 -device. -.Bl -tag -width ".Sy Subsystem" -compact -.It Sy Subsystem -.It Li Thermal -Notification that the CPU core has reached critical temperature. -.Bl -tag -width ".Ar temperature" -compact -.It Sy Type -.It Ar temperature -String containing the temperature of the core that has become too hot. -.El -.El -.Pp -.It Li kern -Events related to the kernel. -.Bl -tag -width ".Sy Subsystem" -compact -.It Sy Subsystem -.It Li power -.Bl -tag -width ".li resume" -compact -.It Sy Type -.It Li resume -Notification that the system has woken from the suspended state. -.El -.El -.Pp -.It Li kernel -More events related to the kernel. -.Bl -tag -width ".Sy Subsystem" -compact -.It Sy Subsystem -.It Li signal -.Bl -tag -width ".li resume" -compact -.It Sy Type -.It Li coredump -Notification that a process has crashed and dumped core. -.El -.El -.Pp -.It Li CAM -Events related to the -.Xr cam 4 -system. -.Bl -tag -width ".Sy Subsystem" -compact -.It Sy Subsystem -.It Li periph -Events related to peripheral devices. -.Bl -tag -width ".li timeout" -compact -.It Sy Type -.It Li error -Generic errors. -.It Li timeout -Command timeouts. -.El -.El -.El -.Pp +.\" +.\" End of tables +.\" A link state change to UP on the interface .Dq Li fxp0 would result in the following notify event: .Bd -literal -offset indent -system=IFNET, subsystem=fxp0, type=LINK_UP +system=IFNET subsystem=fxp0 type=LINK_UP .Ed .Pp An AC line state change to .Dq offline would result in the following event: .Bd -literal -offset indent -system=ACPI, subsystem=ACAD, notify=0x00 +system=ACPI subsystem=ACAD notify=0x00 .Ed .Ss Comments Comments may appear anywhere that whitespace may appear in a From owner-svn-src-all@freebsd.org Wed Sep 9 22:51:59 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 81D133DFCEC; Wed, 9 Sep 2020 22:51:59 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bmy272wDRz430w; Wed, 9 Sep 2020 22:51:59 +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 4841E8CD7; Wed, 9 Sep 2020 22:51:59 +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 089MpxAs037276; Wed, 9 Sep 2020 22:51:59 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 089Mpxc5037275; Wed, 9 Sep 2020 22:51:59 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202009092251.089Mpxc5037275@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 9 Sep 2020 22:51:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365538 - stable/12/share/man/man9 X-SVN-Group: stable-12 X-SVN-Commit-Author: imp X-SVN-Commit-Paths: stable/12/share/man/man9 X-SVN-Commit-Revision: 365538 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.33 Precedence: list List-Id: "SVN commit messages 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, 09 Sep 2020 22:51:59 -0000 Author: imp Date: Wed Sep 9 22:51:58 2020 New Revision: 365538 URL: https://svnweb.freebsd.org/changeset/base/365538 Log: MFC r364424: r364424 | imp | 2020-08-20 10:52:34 -0600 (Thu, 20 Aug 2020) | 5 lines Fix function name in zone.9 uma_zone_prealloc -> uma_prealloc. There's no uma_zone_prealloc defined and the docs for it describe uma_prealloc exactly. Modified: stable/12/share/man/man9/zone.9 Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man9/zone.9 ============================================================================== --- stable/12/share/man/man9/zone.9 Wed Sep 9 22:49:43 2020 (r365537) +++ stable/12/share/man/man9/zone.9 Wed Sep 9 22:51:58 2020 (r365538) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 30, 2019 +.Dd August 20, 2020 .Dt UMA 9 .Os .Sh NAME @@ -401,7 +401,7 @@ This function infers the domain from the pointer and d argument. .Pp The -.Fn uma_zone_prealloc +.Fn uma_prealloc function allocates slabs for the requested number of items, typically following the initial creation of a zone. Subsequent allocations from the zone will be satisfied using the pre-allocated @@ -409,7 +409,7 @@ slabs. Note that slab allocation is performed with the .Dv M_WAITOK flag, so -.Fn uma_zone_prealloc +.Fn uma_prealloc may sleep. .Pp The From owner-svn-src-all@freebsd.org Wed Sep 9 22:54:14 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B798F3DFE3B; Wed, 9 Sep 2020 22:54:14 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bmy4k4TPFz43Mn; Wed, 9 Sep 2020 22:54:14 +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 7E1759371; Wed, 9 Sep 2020 22:54:14 +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 089MsEeM039264; Wed, 9 Sep 2020 22:54:14 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 089MsAhQ039244; Wed, 9 Sep 2020 22:54:10 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202009092254.089MsAhQ039244@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 9 Sep 2020 22:54:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365539 - in stable/12: share/man/man4 sys/dev/an sys/dev/ata sys/dev/cmx sys/dev/fdc sys/dev/if_ndis sys/dev/puc sys/dev/uart sys/dev/wi sys/netgraph/bluetooth/drivers/bt3c X-SVN-Group: stable-12 X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in stable/12: share/man/man4 sys/dev/an sys/dev/ata sys/dev/cmx sys/dev/fdc sys/dev/if_ndis sys/dev/puc sys/dev/uart sys/dev/wi sys/netgraph/bluetooth/drivers/bt3c X-SVN-Commit-Revision: 365539 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.33 Precedence: list List-Id: "SVN commit messages 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, 09 Sep 2020 22:54:14 -0000 Author: imp Date: Wed Sep 9 22:54:09 2020 New Revision: 365539 URL: https://svnweb.freebsd.org/changeset/base/365539 Log: MFC: 364430: r364430 | imp | 2020-08-20 11:19:40 -0600 (Thu, 20 Aug 2020) | 6 lines Tag pccard drivers with gone in 13. MFC After: 3 days Reviewed by: emaste, brooks, adrian (on twitter) Differential Revision: https://reviews.freebsd.org/D26095 Modified: stable/12/share/man/man4/an.4 stable/12/share/man/man4/ata.4 stable/12/share/man/man4/cmx.4 stable/12/share/man/man4/fdc.4 stable/12/share/man/man4/ndis.4 stable/12/share/man/man4/ng_bt3c.4 stable/12/share/man/man4/pccard.4 stable/12/share/man/man4/puc.4 stable/12/share/man/man4/uart.4 stable/12/share/man/man4/wi.4 stable/12/sys/dev/an/if_an_pccard.c stable/12/sys/dev/ata/ata-card.c stable/12/sys/dev/cmx/cmx_pccard.c stable/12/sys/dev/fdc/fdc_pccard.c stable/12/sys/dev/if_ndis/if_ndis_pccard.c stable/12/sys/dev/puc/puc_pccard.c stable/12/sys/dev/uart/uart_bus_pccard.c stable/12/sys/dev/wi/if_wi_pccard.c stable/12/sys/netgraph/bluetooth/drivers/bt3c/ng_bt3c_pccard.c Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man4/an.4 ============================================================================== --- stable/12/share/man/man4/an.4 Wed Sep 9 22:51:58 2020 (r365538) +++ stable/12/share/man/man4/an.4 Wed Sep 9 22:54:09 2020 (r365539) @@ -51,6 +51,9 @@ module at boot time, place the following line in .Bd -literal -offset indent if_an_load="YES" .Ed +.Sh DEPRECATION NOTICE +This driver is scheduled for removal prior to the release of +.Fx 13.0 .Sh DESCRIPTION The .Nm Modified: stable/12/share/man/man4/ata.4 ============================================================================== --- stable/12/share/man/man4/ata.4 Wed Sep 9 22:51:58 2020 (r365538) +++ stable/12/share/man/man4/ata.4 Wed Sep 9 22:54:09 2020 (r365539) @@ -222,6 +222,9 @@ Unknown ATA chipsets are supported in PIO modes, and i busmaster DMA registers are present and contain valid setup, DMA is also enabled, although the max mode is limited to UDMA33, as it is not known what the chipset can do and how to program it. +.Sh DEPRECATION NOTICE +The PC Card attachment of this driver is scheduled for removal prior to the release of +.Fx 13.0 .Sh NOTES Please remember that in order to use UDMA4/ATA66 and above modes you .Em must Modified: stable/12/share/man/man4/cmx.4 ============================================================================== --- stable/12/share/man/man4/cmx.4 Wed Sep 9 22:51:58 2020 (r365538) +++ stable/12/share/man/man4/cmx.4 Wed Sep 9 22:54:09 2020 (r365539) @@ -34,6 +34,9 @@ .Nd Omnikey CardMan 4040 smartcard reader device driver .Sh SYNOPSIS .Cd device cmx +.Sh DEPRECATION NOTICE +This driver is scheduled for removal prior to the release of +.Fx 13.0 .Sh DESCRIPTION The .Nm Modified: stable/12/share/man/man4/fdc.4 ============================================================================== --- stable/12/share/man/man4/fdc.4 Wed Sep 9 22:51:58 2020 (r365538) +++ stable/12/share/man/man4/fdc.4 Wed Sep 9 22:54:09 2020 (r365539) @@ -313,6 +313,9 @@ Third argument is a pointer to This type is the same as being used in the per-drive configuration flags, or in the CMOS configuration data or ACPI namespace on IA32 systems. .El +.Sh DEPRECATION NOTICE +The PC Card attachment of this driver is scheduled for removal prior to the release of +.Fx 13.0 .Sh FILES .Bl -tag -width ".Pa /dev/fd*" -compact .It Pa /dev/fd* Modified: stable/12/share/man/man4/ndis.4 ============================================================================== --- stable/12/share/man/man4/ndis.4 Wed Sep 9 22:51:58 2020 (r365538) +++ stable/12/share/man/man4/ndis.4 Wed Sep 9 22:54:09 2020 (r365539) @@ -120,6 +120,9 @@ driver-specific registry keys to control the media set which can be configured via the .Xr sysctl 8 command. +.Sh DEPRECATION NOTICE +The PC Card attachment of this driver is scheduled for removal prior to the release of +.Fx 13.0 .Sh DIAGNOSTICS .Bl -diag .It "ndis%d: watchdog timeout" Modified: stable/12/share/man/man4/ng_bt3c.4 ============================================================================== --- stable/12/share/man/man4/ng_bt3c.4 Wed Sep 9 22:51:58 2020 (r365538) +++ stable/12/share/man/man4/ng_bt3c.4 Wed Sep 9 22:54:09 2020 (r365539) @@ -34,6 +34,9 @@ .Sh SYNOPSIS .In sys/types.h .In netgraph/bluetooth/include/ng_bt3c.h +.Sh DEPRECATION NOTICE +This driver is scheduled for removal prior to the release of +.Fx 13.0 .Sh DESCRIPTION The .Nm btccc Modified: stable/12/share/man/man4/pccard.4 ============================================================================== --- stable/12/share/man/man4/pccard.4 Wed Sep 9 22:51:58 2020 (r365538) +++ stable/12/share/man/man4/pccard.4 Wed Sep 9 22:54:09 2020 (r365539) @@ -34,7 +34,7 @@ .Cd device pccard .Sh DEPRECATION NOTICE This driver is scheduled for removal prior to the release of -.Fx 13.0 +.Fx 13.0 . .Sh DESCRIPTION The .Nm Modified: stable/12/share/man/man4/puc.4 ============================================================================== --- stable/12/share/man/man4/puc.4 Wed Sep 9 22:51:58 2020 (r365538) +++ stable/12/share/man/man4/puc.4 Wed Sep 9 22:54:09 2020 (r365539) @@ -47,6 +47,9 @@ driver. The list of supported devices is in .Pa sys/dev/puc/pucdata.c . Support for new cards should be added there. +.Sh DEPRECATION NOTICE +The PC Card attachment of this driver is scheduled for removal prior to the release of +.Fx 13.0 .Sh SEE ALSO .Xr ppc 4 , .Xr uart 4 Modified: stable/12/share/man/man4/uart.4 ============================================================================== --- stable/12/share/man/man4/uart.4 Wed Sep 9 22:51:58 2020 (r365538) +++ stable/12/share/man/man4/uart.4 Wed Sep 9 22:54:09 2020 (r365539) @@ -271,6 +271,9 @@ be locked for devices that support more than one setti The CLOCAL flag on callin ports should be locked off for logins to avoid certain security holes, but this needs to be done by getty if the callin port is used for anything else. +.Sh DEPRECATION NOTICE +The PC Card attachment of this driver is scheduled for removal prior to the release of +.Fx 13.0 .Sh FILES .Bl -tag -width "/dev/ttyu?.init" -compact .It Pa /dev/ttyu? Modified: stable/12/share/man/man4/wi.4 ============================================================================== --- stable/12/share/man/man4/wi.4 Wed Sep 9 22:51:58 2020 (r365538) +++ stable/12/share/man/man4/wi.4 Wed Sep 9 22:54:09 2020 (r365539) @@ -52,6 +52,9 @@ module at boot time, place the following line in .Bd -literal -offset indent if_wi_load="YES" .Ed +.Sh DEPRECATION NOTICE +This driver is scheduled for removal prior to the release of +.Fx 13.0 .Sh DESCRIPTION The .Nm Modified: stable/12/sys/dev/an/if_an_pccard.c ============================================================================== --- stable/12/sys/dev/an/if_an_pccard.c Wed Sep 9 22:51:58 2020 (r365538) +++ stable/12/sys/dev/an/if_an_pccard.c Wed Sep 9 22:54:09 2020 (r365539) @@ -156,5 +156,7 @@ an_pccard_attach(device_t dev) fail: if (error) an_release_resources(dev); + else + gone_in_dev(dev, 13, "pccard removed"); return (error); } Modified: stable/12/sys/dev/ata/ata-card.c ============================================================================== --- stable/12/sys/dev/ata/ata-card.c Wed Sep 9 22:51:58 2020 (r365538) +++ stable/12/sys/dev/ata/ata-card.c Wed Sep 9 22:54:09 2020 (r365539) @@ -144,6 +144,7 @@ ata_pccard_attach(device_t dev) err = ata_probe(dev); if (err > 0) return (err); + gone_in_dev(dev, 13, "pccard removed"); return (ata_attach(dev)); } Modified: stable/12/sys/dev/cmx/cmx_pccard.c ============================================================================== --- stable/12/sys/dev/cmx/cmx_pccard.c Wed Sep 9 22:51:58 2020 (r365538) +++ stable/12/sys/dev/cmx/cmx_pccard.c Wed Sep 9 22:54:09 2020 (r365539) @@ -95,7 +95,7 @@ cmx_pccard_attach(device_t dev) return rv; } - device_printf(dev, "attached\n"); + gone_in_dev(dev, 13, "pccard removed"); return 0; } Modified: stable/12/sys/dev/fdc/fdc_pccard.c ============================================================================== --- stable/12/sys/dev/fdc/fdc_pccard.c Wed Sep 9 22:51:58 2020 (r365538) +++ stable/12/sys/dev/fdc/fdc_pccard.c Wed Sep 9 22:54:09 2020 (r365539) @@ -111,9 +111,10 @@ fdc_pccard_attach(device_t dev) device_set_flags(child, 0x24); error = bus_generic_attach(dev); } - if (error == 0) + if (error == 0) { + gone_in_dev(dev, 13, "pccard removed"); fdc_start_worker(dev); - else + } else fdc_release_resources(fdc); return (error); } Modified: stable/12/sys/dev/if_ndis/if_ndis_pccard.c ============================================================================== --- stable/12/sys/dev/if_ndis/if_ndis_pccard.c Wed Sep 9 22:51:58 2020 (r365538) +++ stable/12/sys/dev/if_ndis/if_ndis_pccard.c Wed Sep 9 22:54:09 2020 (r365539) @@ -303,6 +303,8 @@ ndis_attach_pccard(dev) } error = ndis_attach(dev); + if (error == 0) + gone_in_dev(dev, 13, "pccard removed"); fail: return(error); Modified: stable/12/sys/dev/puc/puc_pccard.c ============================================================================== --- stable/12/sys/dev/puc/puc_pccard.c Wed Sep 9 22:51:58 2020 (r365538) +++ stable/12/sys/dev/puc/puc_pccard.c Wed Sep 9 22:54:09 2020 (r365539) @@ -73,10 +73,21 @@ puc_pccard_probe(device_t dev) return (ENXIO); } +static int +puc_pccard_attach(device_t dev) +{ + int error; + + error = puc_bfe_attach(dev); + if (error == 0) + gone_in_dev(dev, 13, "pccard removed"); + return (error); +} + static device_method_t puc_pccard_methods[] = { /* Device interface */ DEVMETHOD(device_probe, puc_pccard_probe), - DEVMETHOD(device_attach, puc_bfe_attach), + DEVMETHOD(device_attach, puc_pccard_attach), DEVMETHOD(device_detach, puc_bfe_detach), DEVMETHOD(bus_alloc_resource, puc_bus_alloc_resource), Modified: stable/12/sys/dev/uart/uart_bus_pccard.c ============================================================================== --- stable/12/sys/dev/uart/uart_bus_pccard.c Wed Sep 9 22:51:58 2020 (r365538) +++ stable/12/sys/dev/uart/uart_bus_pccard.c Wed Sep 9 22:54:09 2020 (r365539) @@ -98,6 +98,7 @@ uart_pccard_attach(device_t dev) error = uart_bus_probe(dev, 0, 0, 0, 0, 0, 0); if (error > 0) return (error); + gone_in_dev(dev, 13, "pccard removed"); return (uart_bus_attach(dev)); } Modified: stable/12/sys/dev/wi/if_wi_pccard.c ============================================================================== --- stable/12/sys/dev/wi/if_wi_pccard.c Wed Sep 9 22:51:58 2020 (r365538) +++ stable/12/sys/dev/wi/if_wi_pccard.c Wed Sep 9 22:54:09 2020 (r365539) @@ -200,6 +200,7 @@ wi_pccard_attach(device_t dev) error = wi_attach(dev); if (error != 0) wi_free(dev); + gone_in_dev(dev, 13, "pccard removed"); } return error; } Modified: stable/12/sys/netgraph/bluetooth/drivers/bt3c/ng_bt3c_pccard.c ============================================================================== --- stable/12/sys/netgraph/bluetooth/drivers/bt3c/ng_bt3c_pccard.c Wed Sep 9 22:51:58 2020 (r365538) +++ stable/12/sys/netgraph/bluetooth/drivers/bt3c/ng_bt3c_pccard.c Wed Sep 9 22:54:09 2020 (r365539) @@ -677,6 +677,8 @@ bt3c_pccard_attach(device_t dev) NG_NODE_SET_PRIVATE(sc->node, sc); + gone_in_dev(dev, 13, "pccard removed"); + return (0); bad: if (sc->ith != NULL) { From owner-svn-src-all@freebsd.org Wed Sep 9 22:59:48 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 595C53E00B2; Wed, 9 Sep 2020 22:59:48 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BmyC81mCBz43V9; Wed, 9 Sep 2020 22:59:48 +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 1F7A68E6D; Wed, 9 Sep 2020 22:59:48 +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 089MxmcP039618; Wed, 9 Sep 2020 22:59:48 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 089Mxldo039615; Wed, 9 Sep 2020 22:59:47 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202009092259.089Mxldo039615@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 9 Sep 2020 22:59:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365540 - in stable/12: . sbin/devd sys/kern X-SVN-Group: stable-12 X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in stable/12: . sbin/devd sys/kern X-SVN-Commit-Revision: 365540 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.33 Precedence: list List-Id: "SVN commit messages 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, 09 Sep 2020 22:59:48 -0000 Author: imp Date: Wed Sep 9 22:59:47 2020 New Revision: 365540 URL: https://svnweb.freebsd.org/changeset/base/365540 Log: MFC r364725, r364726 r364725 | imp | 2020-08-24 13:35:15 -0600 (Mon, 24 Aug 2020) | 9 lines Change the resume notification event from 'kern' to 'kernel' We have both a system of 'kern' and of 'kernel'. Prefer the latter and convert this notification to use 'kernel' instead of 'kern'. As a transition period, continue to also generate the 'kern' notification until sometime after FreeBSD 13 is branched. r364726 | imp | 2020-08-24 13:35:27 -0600 (Mon, 24 Aug 2020) | 4 lines Document the kern -> kernel name change for resume events. Relnotes: YES Modified: stable/12/UPDATING stable/12/sbin/devd/devd.conf.5 stable/12/sys/kern/subr_bus.c Directory Properties: stable/12/ (props changed) Modified: stable/12/UPDATING ============================================================================== --- stable/12/UPDATING Wed Sep 9 22:54:09 2020 (r365539) +++ stable/12/UPDATING Wed Sep 9 22:59:47 2020 (r365540) @@ -16,6 +16,12 @@ 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. +20200909: + The resume code now notifies devd with the 'kernel' system + rather than the old 'kern' subsystem to be consistent with + other use. The old notification will be created as well, but + will be removed prior to FreeBSD 14.0. + 20200722: Clang, llvm, lld, lldb, compiler-rt, libc++, libunwind and openmp have been upgraded to 10.0.1. Please see the 20141231 entry below for Modified: stable/12/sbin/devd/devd.conf.5 ============================================================================== --- stable/12/sbin/devd/devd.conf.5 Wed Sep 9 22:54:09 2020 (r365539) +++ stable/12/sbin/devd/devd.conf.5 Wed Sep 9 22:59:47 2020 (r365540) @@ -466,6 +466,8 @@ provider size has changed. .Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description" .It Li kern Ta Li power Ta Li resume Ta Notification that the system has woken from the suspended state. +Note: this notification is deprecated and will be removed in +.Fx 14.0 . .El .Pp .Pp @@ -473,6 +475,8 @@ Notification that the system has woken from the suspen .Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description" .It Li kernel Ta Li signal Ta Li coredump Ta Notification that a process has crashed and dumped core. +.It Li kernel Ta Li power Ta Li resume Ta +Notification that the system has woken from the suspended state. .El .Pp .Bl -column "System" "Subsystem" "1234567" -compact Modified: stable/12/sys/kern/subr_bus.c ============================================================================== --- stable/12/sys/kern/subr_bus.c Wed Sep 9 22:54:09 2020 (r365539) +++ stable/12/sys/kern/subr_bus.c Wed Sep 9 22:59:47 2020 (r365540) @@ -5024,8 +5024,10 @@ root_resume(device_t dev) int error; error = bus_generic_resume(dev); - if (error == 0) - devctl_notify("kern", "power", "resume", NULL); + if (error == 0) { + devctl_notify("kern", "power", "resume", NULL); /* Deprecated gone in 14 */ + devctl_notify("kernel", "power", "resume", NULL); + } return (error); } From owner-svn-src-all@freebsd.org Wed Sep 9 23:01:55 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D7FAA3E0291; Wed, 9 Sep 2020 23:01:55 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BmyFb5Q5fz43gv; Wed, 9 Sep 2020 23:01:55 +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 9D21F8CF5; Wed, 9 Sep 2020 23:01:55 +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 089N1tDA042353; Wed, 9 Sep 2020 23:01:55 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 089N1tMi042352; Wed, 9 Sep 2020 23:01:55 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202009092301.089N1tMi042352@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 9 Sep 2020 23:01:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365541 - stable/12/share/man/man9 X-SVN-Group: stable-12 X-SVN-Commit-Author: imp X-SVN-Commit-Paths: stable/12/share/man/man9 X-SVN-Commit-Revision: 365541 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.33 Precedence: list List-Id: "SVN commit messages 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, 09 Sep 2020 23:01:55 -0000 Author: imp Date: Wed Sep 9 23:01:55 2020 New Revision: 365541 URL: https://svnweb.freebsd.org/changeset/base/365541 Log: MFC r364824: r364824 | imp | 2020-08-26 11:06:16 -0600 (Wed, 26 Aug 2020) | 8 lines Make sbuf_setpos match the implementation. sbuf_setpos can only be used to truncate the buffer, never to make it longer. Update the documentation to reflect this. Reviewed By: allanjude, phk Differential Revision: https://reviews.freebsd.org/D26198 Modified: stable/12/share/man/man9/sbuf.9 Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man9/sbuf.9 ============================================================================== --- stable/12/share/man/man9/sbuf.9 Wed Sep 9 22:59:47 2020 (r365540) +++ stable/12/share/man/man9/sbuf.9 Wed Sep 9 23:01:55 2020 (r365541) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 23, 2018 +.Dd August 26, 2020 .Dt SBUF 9 .Os .Sh NAME @@ -348,9 +348,8 @@ function sets the .Fa sbuf Ns 's end position to .Fa pos , -which is a value between zero and one less than the size of the -storage buffer. -This effectively truncates the sbuf at the new position. +which is a value between zero and the current position in the buffer. +It can only truncate the sbuf to the new position. .Pp The .Fn sbuf_bcat From owner-svn-src-all@freebsd.org Wed Sep 9 23:04:41 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A910D3E0504; Wed, 9 Sep 2020 23:04: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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BmyJn40Fnz44C2; Wed, 9 Sep 2020 23:04: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 678C2950A; Wed, 9 Sep 2020 23:04: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 089N4fi6045963; Wed, 9 Sep 2020 23:04:41 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 089N4eY3045960; Wed, 9 Sep 2020 23:04:40 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202009092304.089N4eY3045960@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 9 Sep 2020 23:04:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365542 - in stable/12: share/man/man4/man4.i386 sys/i386/bios X-SVN-Group: stable-12 X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in stable/12: share/man/man4/man4.i386 sys/i386/bios X-SVN-Commit-Revision: 365542 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.33 Precedence: list List-Id: "SVN commit messages 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, 09 Sep 2020 23:04:41 -0000 Author: imp Date: Wed Sep 9 23:04:40 2020 New Revision: 365542 URL: https://svnweb.freebsd.org/changeset/base/365542 Log: MFC: r365009 r365009 | imp | 2020-08-31 15:04:00 -0600 (Mon, 31 Aug 2020) | 10 lines Add deprecation notice for apm BIOS Add deprecation notice for apm bios, aka the apm(4) device. The apm(8) command will remain, at least for a while, since ACPI emulates the apm ioctl interface. Discussed on: arch@ Relnotes: yes MFC After: 3 days Modified: stable/12/share/man/man4/man4.i386/apm.4 stable/12/sys/i386/bios/apm.c Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man4/man4.i386/apm.4 ============================================================================== --- stable/12/share/man/man4/man4.i386/apm.4 Wed Sep 9 23:01:55 2020 (r365541) +++ stable/12/share/man/man4/man4.i386/apm.4 Wed Sep 9 23:04:40 2020 (r365542) @@ -19,6 +19,9 @@ .Nd APM BIOS interface .Sh SYNOPSIS .Cd device apm +.Sh DEPRECATION NOTICE +This driver is scheduled for removal prior to the release of +.Fx 13.0 . .Sh DESCRIPTION .Nm is an interface to the Intel / Microsoft APM (Advanced Power Management) BIOS Modified: stable/12/sys/i386/bios/apm.c ============================================================================== --- stable/12/sys/i386/bios/apm.c Wed Sep 9 23:01:55 2020 (r365541) +++ stable/12/sys/i386/bios/apm.c Wed Sep 9 23:04:40 2020 (r365542) @@ -1214,6 +1214,8 @@ apm_attach(device_t dev) sc->sc_resume.ah_arg = sc; apm_hook_establish(APM_HOOK_RESUME, &sc->sc_resume); + gone_in_dev(dev, 13, "APM support has been removed."); + return 0; } From owner-svn-src-all@freebsd.org Wed Sep 9 23:05:49 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5C53C3DFBDC; Wed, 9 Sep 2020 23:05:49 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BmyL51msrz44Cp; Wed, 9 Sep 2020 23:05:49 +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 209BD91C3; Wed, 9 Sep 2020 23:05:49 +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 089N5nOj046080; Wed, 9 Sep 2020 23:05:49 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 089N5lB3046072; Wed, 9 Sep 2020 23:05:47 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202009092305.089N5lB3046072@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 9 Sep 2020 23:05:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365543 - in stable/12/sys/dev: an wi X-SVN-Group: stable-12 X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in stable/12/sys/dev: an wi X-SVN-Commit-Revision: 365543 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.33 Precedence: list List-Id: "SVN commit messages 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, 09 Sep 2020 23:05:49 -0000 Author: imp Date: Wed Sep 9 23:05:47 2020 New Revision: 365543 URL: https://svnweb.freebsd.org/changeset/base/365543 Log: MFC r365015: r365015 | imp | 2020-08-31 17:31:16 -0600 (Mon, 31 Aug 2020) | 12 lines Warn for the non pccard attachments These devices have non-pccard attachments. Warn for those as well. Both an and wi don't do the modern cyrpto needed to use these cards on secure wifi networks. an needs firmware from Cisco, which I don't think was ever produced. wi could in theory do it with raw frames and on-host encryption, but nobody has written that in the 15 years since WEP was cracked. MFC After: 3 days Noticed by: rgrimes Differential Revision: https://reviews.freebsd.org/D26138 Modified: stable/12/sys/dev/an/if_an_isa.c stable/12/sys/dev/an/if_an_pccard.c stable/12/sys/dev/an/if_an_pci.c stable/12/sys/dev/wi/if_wi_macio.c stable/12/sys/dev/wi/if_wi_pccard.c stable/12/sys/dev/wi/if_wi_pci.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/an/if_an_isa.c ============================================================================== --- stable/12/sys/dev/an/if_an_isa.c Wed Sep 9 23:04:40 2020 (r365542) +++ stable/12/sys/dev/an/if_an_isa.c Wed Sep 9 23:05:47 2020 (r365543) @@ -127,6 +127,7 @@ an_attach_isa(device_t dev) an_release_resources(dev); return (error); } + gone_in_dev(dev, 13, "pccard removed, an doesn't support modern crypto"); return (0); } Modified: stable/12/sys/dev/an/if_an_pccard.c ============================================================================== --- stable/12/sys/dev/an/if_an_pccard.c Wed Sep 9 23:04:40 2020 (r365542) +++ stable/12/sys/dev/an/if_an_pccard.c Wed Sep 9 23:05:47 2020 (r365543) @@ -157,6 +157,6 @@ fail: if (error) an_release_resources(dev); else - gone_in_dev(dev, 13, "pccard removed"); + gone_in_dev(dev, 13, "pccard removed, an doesn't support modern crypto"); return (error); } Modified: stable/12/sys/dev/an/if_an_pci.c ============================================================================== --- stable/12/sys/dev/an/if_an_pci.c Wed Sep 9 23:04:40 2020 (r365542) +++ stable/12/sys/dev/an/if_an_pci.c Wed Sep 9 23:05:47 2020 (r365543) @@ -230,7 +230,8 @@ an_attach_pci(dev) NULL, an_intr, sc, &sc->irq_handle); if (error) device_printf(dev, "couldn't setup interrupt\n"); - + else + gone_in_dev(dev, 13, "pccard removed, an doesn't support modern crypto"); fail: if (error) an_release_resources(dev); Modified: stable/12/sys/dev/wi/if_wi_macio.c ============================================================================== --- stable/12/sys/dev/wi/if_wi_macio.c Wed Sep 9 23:04:40 2020 (r365542) +++ stable/12/sys/dev/wi/if_wi_macio.c Wed Sep 9 23:05:47 2020 (r365543) @@ -142,6 +142,8 @@ wi_macio_attach(device_t dev) error = wi_attach(dev); if (error != 0) wi_free(dev); + else + gone_in_dev(dev, 13, "pccard removed, wi doesn't support modern crypto"); } return error; } Modified: stable/12/sys/dev/wi/if_wi_pccard.c ============================================================================== --- stable/12/sys/dev/wi/if_wi_pccard.c Wed Sep 9 23:04:40 2020 (r365542) +++ stable/12/sys/dev/wi/if_wi_pccard.c Wed Sep 9 23:05:47 2020 (r365543) @@ -200,7 +200,7 @@ wi_pccard_attach(device_t dev) error = wi_attach(dev); if (error != 0) wi_free(dev); - gone_in_dev(dev, 13, "pccard removed"); + gone_in_dev(dev, 13, "pccard removed, wi doesn't support modern crypto"); } return error; } Modified: stable/12/sys/dev/wi/if_wi_pci.c ============================================================================== --- stable/12/sys/dev/wi/if_wi_pci.c Wed Sep 9 23:04:40 2020 (r365542) +++ stable/12/sys/dev/wi/if_wi_pci.c Wed Sep 9 23:05:47 2020 (r365543) @@ -233,6 +233,8 @@ wi_pci_attach(device_t dev) error = wi_attach(dev); if (error != 0) wi_free(dev); + else + gone_in_dev(dev, 13, "pccard removed, wi doesn't support modern crypto"); return (error); } From owner-svn-src-all@freebsd.org Wed Sep 9 23:06:36 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A53C73E03CC; Wed, 9 Sep 2020 23:06:36 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BmyM03vT2z44V3; Wed, 9 Sep 2020 23:06:36 +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 690B693A3; Wed, 9 Sep 2020 23:06: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 089N6aBD046172; Wed, 9 Sep 2020 23:06:36 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 089N6aNA046171; Wed, 9 Sep 2020 23:06:36 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202009092306.089N6aNA046171@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 9 Sep 2020 23:06:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365544 - stable/12/sbin/devd X-SVN-Group: stable-12 X-SVN-Commit-Author: imp X-SVN-Commit-Paths: stable/12/sbin/devd X-SVN-Commit-Revision: 365544 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.33 Precedence: list List-Id: "SVN commit messages 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, 09 Sep 2020 23:06:36 -0000 Author: imp Date: Wed Sep 9 23:06:35 2020 New Revision: 365544 URL: https://svnweb.freebsd.org/changeset/base/365544 Log: MFC r365016 | imp | 2020-08-31 17:48:23 -0600 (Mon, 31 Aug 2020) | 2 lines Add documentation for ETHERNET events. Modified: stable/12/sbin/devd/devd.conf.5 Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/devd/devd.conf.5 ============================================================================== --- stable/12/sbin/devd/devd.conf.5 Wed Sep 9 23:05:47 2020 (r365543) +++ stable/12/sbin/devd/devd.conf.5 Wed Sep 9 23:06:35 2020 (r365544) @@ -433,6 +433,14 @@ node is destroyed. .Pp .Bl -column "System" "Subsystem" "1234567" -compact .Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description" +.It Li ETHERNET Ta Ar inet Ta IFATTACH Ta +Notification when the default VNET instance of the +.Ar inet +interface is attached. +.El +.Pp +.Bl -column "System" "Subsystem" "1234567" -compact +.Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description" .It Li GEOM Ta Ta Ta Events related to the .Xr geom 4 From owner-svn-src-all@freebsd.org Wed Sep 9 23:11:55 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B3C223E026E; Wed, 9 Sep 2020 23:11:55 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BmyT74PgXz44Y8; Wed, 9 Sep 2020 23:11:55 +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 7B9C79781; Wed, 9 Sep 2020 23:11:55 +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 089NBtQr051286; Wed, 9 Sep 2020 23:11:55 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 089NBtjr051285; Wed, 9 Sep 2020 23:11:55 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <202009092311.089NBtjr051285@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Wed, 9 Sep 2020 23:11:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365545 - stable/12/sys/kern X-SVN-Group: stable-12 X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: stable/12/sys/kern X-SVN-Commit-Revision: 365545 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.33 Precedence: list List-Id: "SVN commit messages 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, 09 Sep 2020 23:11:55 -0000 Author: brooks Date: Wed Sep 9 23:11:55 2020 New Revision: 365545 URL: https://svnweb.freebsd.org/changeset/base/365545 Log: MFC r365284: Always report ENOSYS in init While rare, encountering an unimplemented system call early in init is catastrophic and difficult to debug. Even after a SIGSYS handler is registered, such configurations are problematic. As such, always report such events for pid 1 (following kern.lognosys if non-zero). Reviewed by: kevans, imp Obtained from: CheriBSD (plus suggestions from kevans) Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D26288 Modified: stable/12/sys/kern/kern_sig.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/kern_sig.c ============================================================================== --- stable/12/sys/kern/kern_sig.c Wed Sep 9 23:06:35 2020 (r365544) +++ stable/12/sys/kern/kern_sig.c Wed Sep 9 23:11:55 2020 (r365545) @@ -3760,7 +3760,8 @@ nosys(struct thread *td, struct nosys_args *args) uprintf("pid %d comm %s: nosys %d\n", p->p_pid, p->p_comm, td->td_sa.code); } - if (kern_lognosys == 2 || kern_lognosys == 3) { + if (kern_lognosys == 2 || kern_lognosys == 3 || + (p->p_pid == 1 && (kern_lognosys & 3) == 0)) { printf("pid %d comm %s: nosys %d\n", p->p_pid, p->p_comm, td->td_sa.code); } From owner-svn-src-all@freebsd.org Thu Sep 10 00:46:39 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9692B3E1DDB; Thu, 10 Sep 2020 00:46:39 +0000 (UTC) (envelope-from rscheff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bn0ZR3BlGz48m3; Thu, 10 Sep 2020 00:46:39 +0000 (UTC) (envelope-from rscheff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 518ACA6A5; Thu, 10 Sep 2020 00:46:39 +0000 (UTC) (envelope-from rscheff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08A0kdRQ007723; Thu, 10 Sep 2020 00:46:39 GMT (envelope-from rscheff@FreeBSD.org) Received: (from rscheff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08A0kdYE007722; Thu, 10 Sep 2020 00:46:39 GMT (envelope-from rscheff@FreeBSD.org) Message-Id: <202009100046.08A0kdYE007722@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rscheff set sender to rscheff@FreeBSD.org using -f From: Richard Scheffenegger Date: Thu, 10 Sep 2020 00:46:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365546 - head/sys/netinet/cc X-SVN-Group: head X-SVN-Commit-Author: rscheff X-SVN-Commit-Paths: head/sys/netinet/cc X-SVN-Commit-Revision: 365546 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.33 Precedence: list List-Id: "SVN commit messages 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, 10 Sep 2020 00:46:39 -0000 Author: rscheff Date: Thu Sep 10 00:46:38 2020 New Revision: 365546 URL: https://svnweb.freebsd.org/changeset/base/365546 Log: cc_mod: remove unused CCF_DELACK definition During the DCTCP improvements, use of CCF_DELACK was removed. This change is just to rename the unused flag bit to prevent use of it, without also re-implementing the tcp_input and tcp_output interfaces. No functional change. Reviewed by: chengc_netapp.com, tuexen MFC after: 2 weeks Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D26181 Modified: head/sys/netinet/cc/cc.h Modified: head/sys/netinet/cc/cc.h ============================================================================== --- head/sys/netinet/cc/cc.h Wed Sep 9 23:11:55 2020 (r365545) +++ head/sys/netinet/cc/cc.h Thu Sep 10 00:46:38 2020 (r365546) @@ -96,7 +96,7 @@ struct cc_var { /* cc_var flags. */ #define CCF_ABC_SENTAWND 0x0001 /* ABC counted cwnd worth of bytes? */ #define CCF_CWND_LIMITED 0x0002 /* Are we currently cwnd limited? */ -#define CCF_DELACK 0x0004 /* Is this ack delayed? */ +#define CCF_UNUSED1 0x0004 /* unused */ #define CCF_ACKNOW 0x0008 /* Will this ack be sent now? */ #define CCF_IPHDR_CE 0x0010 /* Does this packet set CE bit? */ #define CCF_TCPHDR_CWR 0x0020 /* Does this packet set CWR bit? */ From owner-svn-src-all@freebsd.org Thu Sep 10 00:50:19 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3DE653E204A; Thu, 10 Sep 2020 00:50:19 +0000 (UTC) (envelope-from rscheff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bn0fg0vyTz49QV; Thu, 10 Sep 2020 00:50:19 +0000 (UTC) (envelope-from rscheff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 F1FCBA6AB; Thu, 10 Sep 2020 00:50:18 +0000 (UTC) (envelope-from rscheff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08A0oIbb007960; Thu, 10 Sep 2020 00:50:18 GMT (envelope-from rscheff@FreeBSD.org) Received: (from rscheff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08A0oI08007958; Thu, 10 Sep 2020 00:50:18 GMT (envelope-from rscheff@FreeBSD.org) Message-Id: <202009100050.08A0oI08007958@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rscheff set sender to rscheff@FreeBSD.org using -f From: Richard Scheffenegger Date: Thu, 10 Sep 2020 00:50:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365547 - head/sbin/ping6 X-SVN-Group: head X-SVN-Commit-Author: rscheff X-SVN-Commit-Paths: head/sbin/ping6 X-SVN-Commit-Revision: 365547 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.33 Precedence: list List-Id: "SVN commit messages 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, 10 Sep 2020 00:50:19 -0000 Author: rscheff Date: Thu Sep 10 00:50:18 2020 New Revision: 365547 URL: https://svnweb.freebsd.org/changeset/base/365547 Log: Add -z "TOS" option to ping6, to test DSCP/ECN values ping has the option to add the (deprecated) TOS byte using the -z option. Adding the same option, with the same (deprecated) Traffic Class Byte (nowadays actually DSCP and ECN fields) to ping6 to validate proper QoS processing in network switches. Reviewed by: tuexen MFC after: 2 weeks Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D26384 Modified: head/sbin/ping6/ping6.8 head/sbin/ping6/ping6.c Modified: head/sbin/ping6/ping6.8 ============================================================================== --- head/sbin/ping6/ping6.8 Thu Sep 10 00:46:38 2020 (r365546) +++ head/sbin/ping6/ping6.8 Thu Sep 10 00:50:18 2020 (r365547) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 20, 2019 +.Dd September 10, 2020 .Dt PING6 8 .Os .Sh NAME @@ -87,6 +87,9 @@ packets to network hosts .Op Fl W Ar waittime .Ek .Bk -words +.Op Fl z Ar tclass +.Ek +.Bk -words .Op Ar hops ... .Ek .Bk -words @@ -329,6 +332,8 @@ This option is present for backward compatibility. has no effect if .Fl y is specified. +.It Fl z Ar tclass +Use the specified traffic class when sending. .It Ar hops IPv6 addresses for intermediate nodes, which will be put into type 0 routing header. Modified: head/sbin/ping6/ping6.c ============================================================================== --- head/sbin/ping6/ping6.c Thu Sep 10 00:46:38 2020 (r365546) +++ head/sbin/ping6/ping6.c Thu Sep 10 00:50:18 2020 (r365547) @@ -229,6 +229,7 @@ static char *hostname; static int ident; /* process id to identify our packets */ static u_int8_t nonce[8]; /* nonce field for node information */ static int hoplimit = -1; /* hoplimit */ +static int tclass = -1; /* traffic class */ static u_char *packet = NULL; static cap_channel_t *capdns; @@ -352,7 +353,7 @@ main(int argc, char *argv[]) #endif /*IPSEC_POLICY_IPSEC*/ #endif while ((ch = getopt(argc, argv, - "k:b:c:DdfHe:m:I:i:l:unNop:qaAS:s:OvyYW:t:" ADDOPTS)) != -1) { + "k:b:c:DdfHe:m:I:i:l:unNop:qaAS:s:OvyYW:t:z:" ADDOPTS)) != -1) { #undef ADDOPTS switch (ch) { case 'k': @@ -585,6 +586,14 @@ main(int argc, char *argv[]) err(1, "setitimer"); } break; + case 'z': /* traffic class */ + tclass = strtol(optarg, &e, 10); + if (*optarg == '\0' || *e != '\0') + errx(1, "illegal traffic class %s", optarg); + if (255 < tclass || tclass < -1) + errx(1, + "illegal traffic class -- %s", optarg); + break; #ifdef IPSEC #ifdef IPSEC_POLICY_IPSEC case 'P': @@ -935,6 +944,12 @@ main(int argc, char *argv[]) memcpy(CMSG_DATA(scmsgp), &hoplimit, sizeof(hoplimit)); scmsgp = CMSG_NXTHDR(&smsghdr, scmsgp); + } + + if (tclass != -1) { + if (setsockopt(ssend, IPPROTO_IPV6, IPV6_TCLASS, + &tclass, sizeof(tclass)) == -1) + err(1, "setsockopt(IPV6_TCLASS)"); } if (argc > 1) { /* some intermediate addrs are specified */ From owner-svn-src-all@freebsd.org Thu Sep 10 01:49:54 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8E1233E44D0; Thu, 10 Sep 2020 01:49:54 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bn1zQ3FXdz4Fl0; Thu, 10 Sep 2020 01:49:54 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 52DF2B05C; Thu, 10 Sep 2020 01:49:54 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08A1nsn6045127; Thu, 10 Sep 2020 01:49:54 GMT (envelope-from bdragon@FreeBSD.org) Received: (from bdragon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08A1nsou045126; Thu, 10 Sep 2020 01:49:54 GMT (envelope-from bdragon@FreeBSD.org) Message-Id: <202009100149.08A1nsou045126@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdragon set sender to bdragon@FreeBSD.org using -f From: Brandon Bergren Date: Thu, 10 Sep 2020 01:49:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365548 - head/sys/powerpc/powernv X-SVN-Group: head X-SVN-Commit-Author: bdragon X-SVN-Commit-Paths: head/sys/powerpc/powernv X-SVN-Commit-Revision: 365548 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.33 Precedence: list List-Id: "SVN commit messages 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, 10 Sep 2020 01:49:54 -0000 Author: bdragon Date: Thu Sep 10 01:49:53 2020 New Revision: 365548 URL: https://svnweb.freebsd.org/changeset/base/365548 Log: [PowerPC] Fix setting of time in OPAL There were multiple bugs in the OPAL RTC code which had never been discovered, as the default configuration of OPAL machines is to have the BMC / FSP control the RTC. * Fix calling convention for setting the time -- the variables are passed directly in CPU registers, not via memory. * Fix bug in the bcd encoding routines. (from jhibbits) Tested on POWER9 Talos II (BE) and POWER9 Blackbird (LE). Reviewed by: jhibbits (in irc) Sponsored by: Tag1 Consulting, Inc. Modified: head/sys/powerpc/powernv/opal_dev.c Modified: head/sys/powerpc/powernv/opal_dev.c ============================================================================== --- head/sys/powerpc/powernv/opal_dev.c Thu Sep 10 00:50:18 2020 (r365547) +++ head/sys/powerpc/powernv/opal_dev.c Thu Sep 10 01:49:53 2020 (r365548) @@ -256,15 +256,15 @@ bin2bcd32(int bin) int tmp; tmp = bin % 100; - out += bin2bcd(tmp) * 1; + out += bin2bcd(tmp) * 0x1; bin = bin / 100; tmp = bin % 100; - out += bin2bcd(tmp) * 100; + out += bin2bcd(tmp) * 0x100; bin = bin / 100; tmp = bin % 100; - out += bin2bcd(tmp) * 10000; + out += bin2bcd(tmp) * 0x10000; return (out); } @@ -297,7 +297,7 @@ opal_gettime(device_t dev, struct timespec *ts) ct.day = bcd2bin((ymd & 0x000000ff) >> 0); ct.mon = bcd2bin((ymd & 0x0000ff00) >> 8); - ct.year = bcd2bin32((ymd & 0xffff0000) >> 16); + ct.year = bcd2bin32((ymd & 0xffff0000) >> 16); return (clock_ct_to_ts(&ct, ts)); } @@ -321,11 +321,12 @@ opal_settime(device_t dev, struct timespec *ts) hmsm |= ((uint64_t)bin2bcd(ct.min) << 48); hmsm |= ((uint64_t)bin2bcd(ct.hour) << 56); - hmsm = htobe64(hmsm); - ymd = htobe32(ymd); - + /* + * We do NOT swap endian here, because the values are being sent + * via registers instead of indirect via memory. + */ do { - rv = opal_call(OPAL_RTC_WRITE, vtophys(&ymd), vtophys(&hmsm)); + rv = opal_call(OPAL_RTC_WRITE, ymd, hmsm); if (rv == OPAL_BUSY_EVENT) { rv = opal_call(OPAL_POLL_EVENTS, 0); pause("opalrtc", 1); From owner-svn-src-all@freebsd.org Thu Sep 10 02:48:56 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2D7C33E59E3; Thu, 10 Sep 2020 02:48:56 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bn3HX0VJCz4JBK; Thu, 10 Sep 2020 02:48:56 +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 E86ACBEB4; Thu, 10 Sep 2020 02:48:55 +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 08A2mtnC081446; Thu, 10 Sep 2020 02:48:55 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08A2mtaY081445; Thu, 10 Sep 2020 02:48:55 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <202009100248.08A2mtaY081445@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Thu, 10 Sep 2020 02:48:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365549 - head/bin/cp X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/bin/cp X-SVN-Commit-Revision: 365549 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.33 Precedence: list List-Id: "SVN commit messages 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, 10 Sep 2020 02:48:56 -0000 Author: asomers Date: Thu Sep 10 02:48:55 2020 New Revision: 365549 URL: https://svnweb.freebsd.org/changeset/base/365549 Log: cp: use copy_file_range(2) This has three advantages over write(2)/read(2): * Fewer context switches and data copies * Mostly preserves a file's sparseness * On some file systems (currently NFS 4.2) the file system will perform the copy in an especially efficient way. Reviewed by: rmacklem MFC after: 2 weeks Sponsored by: Axcient Differential Revision: https://reviews.freebsd.org/D26377 Modified: head/bin/cp/utils.c Modified: head/bin/cp/utils.c ============================================================================== --- head/bin/cp/utils.c Thu Sep 10 01:49:53 2020 (r365548) +++ head/bin/cp/utils.c Thu Sep 10 02:48:55 2020 (r365549) @@ -212,27 +212,16 @@ copy_file(const FTSENT *entp, int dne) err(1, "Not enough memory"); } wtotal = 0; - while ((rcount = read(from_fd, buf, bufsize)) > 0) { - for (bufp = buf, wresid = rcount; ; - bufp += wcount, wresid -= wcount) { - wcount = write(to_fd, bufp, wresid); - if (wcount <= 0) - break; - wtotal += wcount; - if (info) { - info = 0; - (void)fprintf(stderr, - "%s -> %s %3d%%\n", - entp->fts_path, to.p_path, - cp_pct(wtotal, fs->st_size)); - } - if (wcount >= (ssize_t)wresid) - break; - } - if (wcount != (ssize_t)wresid) { - warn("%s", to.p_path); - rval = 1; - break; + while ((rcount = copy_file_range(from_fd, NULL, + to_fd, NULL, bufsize, 0)) > 0) + { + wtotal += rcount; + if (info) { + info = 0; + (void)fprintf(stderr, + "%s -> %s %3d%%\n", + entp->fts_path, to.p_path, + cp_pct(wtotal, fs->st_size)); } } if (rcount < 0) { From owner-svn-src-all@freebsd.org Thu Sep 10 04:00:13 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E7BFA3E91D9; Thu, 10 Sep 2020 04:00:13 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bn4sn5wSrz4P1C; Thu, 10 Sep 2020 04:00:13 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 AFA28CCAC; Thu, 10 Sep 2020 04:00:13 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08A40DPb025856; Thu, 10 Sep 2020 04:00:13 GMT (envelope-from erj@FreeBSD.org) Received: (from erj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08A40DI2025855; Thu, 10 Sep 2020 04:00:13 GMT (envelope-from erj@FreeBSD.org) Message-Id: <202009100400.08A40DI2025855@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: erj set sender to erj@FreeBSD.org using -f From: Eric Joyner Date: Thu, 10 Sep 2020 04:00:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365550 - head/sys/contrib/dev/ice X-SVN-Group: head X-SVN-Commit-Author: erj X-SVN-Commit-Paths: head/sys/contrib/dev/ice X-SVN-Commit-Revision: 365550 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.33 Precedence: list List-Id: "SVN commit messages 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, 10 Sep 2020 04:00:14 -0000 Author: erj Date: Thu Sep 10 04:00:13 2020 New Revision: 365550 URL: https://svnweb.freebsd.org/changeset/base/365550 Log: ice_ddp: Fix 1.3.16.0 package The version uploaded in the previous commit was far too small. This one should be the right size. MFC after: 1 day Sponsored by: Intel Corporation Modified: head/sys/contrib/dev/ice/ice-1.3.16.0.pkg Modified: head/sys/contrib/dev/ice/ice-1.3.16.0.pkg ============================================================================== Binary file (source and/or target). No diff available. From owner-svn-src-all@freebsd.org Thu Sep 10 04:17:05 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C3E983E9E45; Thu, 10 Sep 2020 04:17:05 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bn5FF4qqTz4QjT; Thu, 10 Sep 2020 04:17:05 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 89092D10A; Thu, 10 Sep 2020 04:17:05 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08A4H5TJ038020; Thu, 10 Sep 2020 04:17:05 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08A4H5oS038019; Thu, 10 Sep 2020 04:17:05 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <202009100417.08A4H5oS038019@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Thu, 10 Sep 2020 04:17:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365551 - stable/12/share/man/man4 X-SVN-Group: stable-12 X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: stable/12/share/man/man4 X-SVN-Commit-Revision: 365551 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.33 Precedence: list List-Id: "SVN commit messages 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, 10 Sep 2020 04:17:05 -0000 Author: lwhsu Date: Thu Sep 10 04:17:05 2020 New Revision: 365551 URL: https://svnweb.freebsd.org/changeset/base/365551 Log: MFC r365403: Slightly improve usb(4) - Mention USB 3.0 - Update links - Fix `mandoc -T lint` warnings Reviewed by: bcr, hselasky Differential Revision: https://reviews.freebsd.org/D26349 Modified: stable/12/share/man/man4/usb.4 Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man4/usb.4 ============================================================================== --- stable/12/share/man/man4/usb.4 Thu Sep 10 04:00:13 2020 (r365550) +++ stable/12/share/man/man4/usb.4 Thu Sep 10 04:17:05 2020 (r365551) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 24, 2018 +.Dd September 7, 2020 .Dt USB 4 .Os .Sh NAME @@ -52,8 +52,7 @@ for more information. .Sh DESCRIPTION .Fx provides machine-independent bus support and drivers for -.Tn USB -devices in host and device side mode. +USB devices in host and device side mode. .Pp The .Nm @@ -67,32 +66,25 @@ driver has three layers: The controller attaches to a physical bus like .Xr pci 4 . -The -.Tn USB -bus attaches to the controller, and the root hub attaches +The USB bus attaches to the controller, and the root hub attaches to the controller. Any devices attached to the bus will attach to the root hub -or another hub attached to the -.Tn USB -bus. +or another hub attached to the USB bus. .Pp The .Nm uhub device will always be present as it is needed for the root hub. .Sh INTRODUCTION TO USB -The -.Tn USB -is a system where external devices can be connected to a PC. +The USB is a system where external devices can be connected to a PC. The most common USB speeds are: .Bl -tag -width 6n -offset indent -.It Low Speed (1.5MBit/sec) -.It Full Speed (12MBit/sec) -.It High Speed (480MBit/sec) +.It Low Speed (1.5 MBit/sec) +.It Full Speed (12 MBit/sec) +.It High Speed (480 MBit/sec) +.It SuperSpeed (5 GBit/sec) .El .Pp -Each -.Tn USB -has a USB controller that is the master of the bus. +Each USB has a USB controller that is the master of the bus. The physical communication is simplex which means the host controller only communicates with one USB device at a time. .Pp @@ -122,9 +114,7 @@ A device may operate in different configurations. Depending on the configuration, the device may present different sets of endpoints and interfaces. .Pp -The bus enumeration of the -.Tn USB -bus proceeds in several steps: +The bus enumeration of the USB bus proceeds in several steps: .Bl -enum .It Any interface specific driver can attach to the device. @@ -143,11 +133,9 @@ Debug output level, where 0 is debugging disabled and debug message verbosity. Default is 0. .Sh SEE ALSO -The -.Tn USB -specifications can be found at: +The USB specifications can be found at: .Pp -.D1 Pa http://www.usb.org/developers/docs/ +.D1 Pa https://www.usb.org/documents .Pp .Xr libusb 3 , .Xr aue 4 , @@ -177,7 +165,7 @@ specifications can be found at: .Sh STANDARDS The .Nm -module complies with the USB 2.0 standard. +module complies with the USB 3.0 standard. .Sh HISTORY The .Nm From owner-svn-src-all@freebsd.org Thu Sep 10 04:17:23 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id ECA113E9C62; Thu, 10 Sep 2020 04:17:23 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bn5Fb646Sz4QpN; Thu, 10 Sep 2020 04:17:23 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 B2730CFB6; Thu, 10 Sep 2020 04:17:23 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08A4HNHp038079; Thu, 10 Sep 2020 04:17:23 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08A4HNw4038078; Thu, 10 Sep 2020 04:17:23 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <202009100417.08A4HNw4038078@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Thu, 10 Sep 2020 04:17: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: r365552 - stable/11/share/man/man4 X-SVN-Group: stable-11 X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: stable/11/share/man/man4 X-SVN-Commit-Revision: 365552 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.33 Precedence: list List-Id: "SVN commit messages 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, 10 Sep 2020 04:17:24 -0000 Author: lwhsu Date: Thu Sep 10 04:17:23 2020 New Revision: 365552 URL: https://svnweb.freebsd.org/changeset/base/365552 Log: MFC r365403: Slightly improve usb(4) - Mention USB 3.0 - Update links - Fix `mandoc -T lint` warnings Reviewed by: bcr, hselasky Differential Revision: https://reviews.freebsd.org/D26349 Modified: stable/11/share/man/man4/usb.4 Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man4/usb.4 ============================================================================== --- stable/11/share/man/man4/usb.4 Thu Sep 10 04:17:05 2020 (r365551) +++ stable/11/share/man/man4/usb.4 Thu Sep 10 04:17:23 2020 (r365552) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 29, 2017 +.Dd September 7, 2020 .Dt USB 4 .Os .Sh NAME @@ -52,8 +52,7 @@ for more information. .Sh DESCRIPTION .Fx provides machine-independent bus support and drivers for -.Tn USB -devices in host and device side mode. +USB devices in host and device side mode. .Pp The .Nm @@ -67,32 +66,25 @@ driver has three layers: The controller attaches to a physical bus like .Xr pci 4 . -The -.Tn USB -bus attaches to the controller, and the root hub attaches +The USB bus attaches to the controller, and the root hub attaches to the controller. Any devices attached to the bus will attach to the root hub -or another hub attached to the -.Tn USB -bus. +or another hub attached to the USB bus. .Pp The .Nm uhub device will always be present as it is needed for the root hub. .Sh INTRODUCTION TO USB -The -.Tn USB -is a system where external devices can be connected to a PC. +The USB is a system where external devices can be connected to a PC. The most common USB speeds are: .Bl -tag -width 6n -offset indent -.It Low Speed (1.5MBit/sec) -.It Full Speed (12MBit/sec) -.It High Speed (480MBit/sec) +.It Low Speed (1.5 MBit/sec) +.It Full Speed (12 MBit/sec) +.It High Speed (480 MBit/sec) +.It SuperSpeed (5 GBit/sec) .El .Pp -Each -.Tn USB -has a USB controller that is the master of the bus. +Each USB has a USB controller that is the master of the bus. The physical communication is simplex which means the host controller only communicates with one USB device at a time. .Pp @@ -122,9 +114,7 @@ A device may operate in different configurations. Depending on the configuration, the device may present different sets of endpoints and interfaces. .Pp -The bus enumeration of the -.Tn USB -bus proceeds in several steps: +The bus enumeration of the USB bus proceeds in several steps: .Bl -enum .It Any interface specific driver can attach to the device. @@ -132,11 +122,9 @@ Any interface specific driver can attach to the device If none is found, generic interface class drivers can attach. .El .Sh SEE ALSO -The -.Tn USB -specifications can be found at: +The USB specifications can be found at: .Pp -.D1 Pa http://www.usb.org/developers/docs/ +.D1 Pa https://www.usb.org/documents .Pp .Xr libusb 3 , .Xr aue 4 , @@ -166,7 +154,7 @@ specifications can be found at: .Sh STANDARDS The .Nm -module complies with the USB 2.0 standard. +module complies with the USB 3.0 standard. .Sh HISTORY The .Nm From owner-svn-src-all@freebsd.org Thu Sep 10 05:15:24 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 072A63EB125; Thu, 10 Sep 2020 05:15:24 +0000 (UTC) (envelope-from agapon@gmail.com) Received: from mail-lf1-f44.google.com (mail-lf1-f44.google.com [209.85.167.44]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bn6XV26FRz4T4N; Thu, 10 Sep 2020 05:15:22 +0000 (UTC) (envelope-from agapon@gmail.com) Received: by mail-lf1-f44.google.com with SMTP id b12so2841361lfp.9; Wed, 09 Sep 2020 22:15:21 -0700 (PDT) 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=JLEVaAtapnz98VBj1ik+VnNfea5ToFm4GmXrL3rSmzU=; b=i5l/LOjDWiyY16x4asgU0zQUcUT4czEKbsSr0um6ltXYG1EB8mC9D4zCl5KMhUYY8C 8vL8zHqWOLP6r+EYicJ5E+oZMhREiJejQhFuSkpR5S3mgUAmBHQeJK22FLn7Qf3sk3vk Nb/qs3cCFaOvD+JXTPVX2DnUNVTaJRV5DkYqg1J2cnV0fLnBQNmBCz/U1N+Bi2coWFJr 5DdahcZLoJPtpf5maAAav6FzADcbn2bTRwdlov6HmsJc/85Z80t79E8v7SSATvun++o7 7KTP8aZ5UwnmMPi14FVImg9aVGUMBBd4S52c/7PYz2g+ywglmZ6Q+svlOzNZQIbK5SjY /wXw== X-Gm-Message-State: AOAM531ScpJ6pTezlg7cE0AxDeUYUfjdi+AXX54Q/Ij3LrfhQUgWujOa uZzsPlOiSc9JXCtE+/wQk7xRyoxIuJo= X-Google-Smtp-Source: ABdhPJwVi+5J9L/WHxLukNS3tBHaSukLicJ5cETeci37v+ALoRFLbi3VNOGNLlmfendP9MN+iYLu8g== X-Received: by 2002:ac2:4c07:: with SMTP id t7mr3384688lfq.194.1599714919968; Wed, 09 Sep 2020 22:15:19 -0700 (PDT) Received: from [192.168.0.88] (east.meadow.volia.net. [93.72.151.96]) by smtp.googlemail.com with ESMTPSA id l4sm49053ljc.85.2020.09.09.22.15.18 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 09 Sep 2020 22:15:19 -0700 (PDT) Subject: Re: svn commit: r365517 - head/sys/net/route To: "Alexander V. Chernikov" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202009092145.089LjJSZ094917@repo.freebsd.org> From: Andriy Gapon Openpgp: preference=signencrypt Autocrypt: addr=avg@FreeBSD.org; prefer-encrypt=mutual; keydata= mDMEX1iFDhYJKwYBBAHaRw8BAQdAiu8JG/oLFkVkOAJqJc7Dx5KI/Q6C3SBI20EQm+DXnAu0 HkFuZHJpeSBHYXBvbiA8YXZnQEZyZWVCU0Qub3JnPoiWBBMWCAA+FiEEyCHHZM09l0OE3Ir/ 1A1+Gq8+L1EFAl9YhQ4CGwMFCQeEzgAFCwkIBwIGFQoJCAsCBBYCAwECHgECF4AACgkQ1A1+ Gq8+L1Fc0wD/ZjmhHfbCJywZU3aOxXIPjcz73FYEGMvqMCCLAWyLbSABALFL+1ZNrjV3BGjq 889cOYFuboA/Yn3eWezS+tfqYBsGuDgEX1iFDhIKKwYBBAGXVQEFAQEHQL6B20Xi600TrkpG P9fWjl7JtHNxqrHKhX6Kg7kgb4ILAwEIB4h+BBgWCAAmFiEEyCHHZM09l0OE3Ir/1A1+Gq8+ L1EFAl9YhQ4CGwwFCQeEzgAACgkQ1A1+Gq8+L1F3cgEAktp4h+IJUJxL1vn6zMOt//znni/J TanKfQuA8wGXcGkBAKpZJhqMkg+pKk7MGvJhgJ6nCpTZ+rMK6vZVZLUWc3QF Message-ID: Date: Thu, 10 Sep 2020 08:15:18 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Firefox/60.0 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <202009092145.089LjJSZ094917@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4Bn6XV26FRz4T4N X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of agapon@gmail.com designates 209.85.167.44 as permitted sender) smtp.mailfrom=agapon@gmail.com X-Spamd-Result: default: False [-2.69 / 15.00]; RCVD_TLS_ALL(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; ARC_NA(0.00)[]; DMARC_NA(0.00)[FreeBSD.org]; NEURAL_HAM_LONG(-0.94)[-0.939]; RCVD_COUNT_THREE(0.00)[3]; NEURAL_HAM_MEDIUM(-0.88)[-0.884]; NEURAL_HAM_SHORT(-0.87)[-0.872]; RCVD_IN_DNSWL_NONE(0.00)[209.85.167.44:from]; RECEIVED_SPAMHAUS_PBL(0.00)[93.72.151.96:received]; FORGED_SENDER(0.30)[avg@FreeBSD.org,agapon@gmail.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.167.44:from]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; MIME_TRACE(0.00)[0:+]; FROM_NEQ_ENVFROM(0.00)[avg@FreeBSD.org,agapon@gmail.com]; MAILMAN_DEST(0.00)[svn-src-head,svn-src-all] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 10 Sep 2020 05:15:24 -0000 On 10/09/2020 00:45, Alexander V. Chernikov wrote: > Author: melifaro > Date: Wed Sep 9 21:45:18 2020 > New Revision: 365517 > URL: https://svnweb.freebsd.org/changeset/base/365517 > > Log: > Retain marking net.fibs sysctl as a tunable. > > Suggested by: avg > > Modified: > head/sys/net/route/route_tables.c > > Modified: head/sys/net/route/route_tables.c > ============================================================================== > --- head/sys/net/route/route_tables.c Wed Sep 9 21:44:59 2020 (r365516) > +++ head/sys/net/route/route_tables.c Wed Sep 9 21:45:18 2020 (r365517) > @@ -140,8 +140,8 @@ sysctl_fibs(SYSCTL_HANDLER_ARGS) > return (error); > } > SYSCTL_PROC(_net, OID_AUTO, fibs, > - CTLFLAG_VNET | CTLTYPE_U32 | CTLFLAG_MPSAFE, NULL, 0, > - &sysctl_fibs, "IU", > + CTLFLAG_VNET | CTLTYPE_U32 | CTLFLAG_RWTUN | CTLFLAG_NOFETCH | CTLFLAG_MPSAFE, > + NULL, 0, &sysctl_fibs, "IU", > "set number of fibs"); > > /* > Just upgraded and this version works perfectly. Thank you! -- Andriy Gapon From owner-svn-src-all@freebsd.org Thu Sep 10 05:56:43 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 80C253EBDBB; Thu, 10 Sep 2020 05:56:43 +0000 (UTC) (envelope-from ohartmann@walstatt.org) Received: from mout.gmx.net (mout.gmx.net [212.227.15.15]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "mout.gmx.net", Issuer "TeleSec ServerPass Class 2 CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bn7SB2NbXz4VcR; Thu, 10 Sep 2020 05:56:42 +0000 (UTC) (envelope-from ohartmann@walstatt.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1599717400; bh=/G7/SvTCvLK64lT5qibkcrshDw1wmaNpbPFyDriK28Q=; h=X-UI-Sender-Class:Date:From:To:Cc:Subject:In-Reply-To:References; b=HrIyIplsO38E09R0UPd7ScoBCeLvrc30R66DF857da9OxTu//LhGVdhY/WQllIsJ3 n1O5BVTOL7HVQJABtz8jKkAQkTa3y8Ompro59KiHF5fQ5Rmn2f+UOo0nx4B6n2hyTh zzm1nGORsmGZBnJQPg1+P/Tw6GeDKpw/MKX0GALc= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from hermann.fritz.box ([77.183.33.128]) by mail.gmx.com (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MIwzA-1jwwZR47UA-00KTUW; Thu, 10 Sep 2020 07:56:40 +0200 Date: Thu, 10 Sep 2020 07:56:38 +0200 From: "Hartmann, O." To: "Alexander V. Chernikov" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r365521 - head/sys/net/route Message-ID: <20200910075638.0e9a3c19@hermann.fritz.box> In-Reply-To: <202009092207.089M7tlK007950@repo.freebsd.org> References: <202009092207.089M7tlK007950@repo.freebsd.org> Organization: walstatt.org MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:m3/u1f3iRPNcSx7l76FV5PVqfmR9luGY61LZDNKyZvS8lJPt5xd acfG6iCWMbOlA565b7kykpMC4dJqmLSLFNMui0EsK7xC3qlYEmAzxeUBb8DhA3hSxrnglHE nJ8rm4F1/V6t/jV/7EZF6w4T/Wzp4ihrkAMw+DnkAfTlexg8QTcLHxj/Epy71nGq65dzCCY 0mJ2lQYYk8XvQTlgG/r4Q== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:T1a/9Drio3E=:8B483TPPssh6SL3xdNiIjU hi/g/SI6QwWDbaf8W7LNb5Vg0HwQ01ci9GwO0YIy5SX5F6A4e+mFcDcABpIMnYcimw0Buopge XQanC11wVnvCxILxmMcJL2XjrmiOAVyPq2JqxiheJQ7UZ1Cbl9sUa7Ihi2f4pYqqUxGGdZGl0 jfkuPqit1mHceYN6GMbFVtIxQCVveIWwCtrsMDPDXhVHypBJLx4lGAi/iCbusEr32KllmEB94 0helNm08WF8YF0W7OTxJIezUAGWtaLVS3IoWz40O5BQIZfuB/Uy1o9T/hQRDSWZU9k9z1cOjL B6FkHm23UJMxSxIr2glmzh8fa4bQzfXx6ro6tyOBWj4clWzyzzXh5H++2+chgDLaWiO3AYXtm fnGJgMJudmYyZNlPRlu/tOB1I2nGOvM4IiCtgwwNK2lAD3OhaAK6xravKW4gRxLSbXhEHuYpt lzte/D6Is1nbQ8nvxL4sD0xbGJuakFP1oSvw/j7x+vZ8VdyMSFjIpMTgw5G8HbSQqM9kHAL1g qdl++ejMC7w83I2gVsrGqzUbx8Mp+KI22OFFCFdJFXbdomAQr1eqzry4Q6Lls2BFuXULRi9g4 jLOLQndxCtOyikxi0QvBiD+FiAs/m7LkB9vyIfHXE/gi80AcUiQ0vBSJ77rhF1kdPZd1V3MUJ U+E4XlUhEKNkm6MJDHX6uPKBB8T9tgi/F6FasWI2fcVLU+lktVML3bk2QcPYMUNZ7gW/Vu1IY GLb4VWtN1GZpAGdKnhpgFNnQdOoZ298CUEJwrJmg8H+unK7jN5H044c19/dPPax8E6/dhcZPb oGICB3rqVWCFlF1scFdOphYm5uKf12d4tFL1wB9Wr3ULGZGKvOJvmy0AamYpBTNikqvhgejwW HgGJMU7z8lcCI8a32lmOEBMd5IAE5ZgEM7qKN1R3Qgq1yg2bFaZIft86Qfj8gcMEF+7FoPa/Z WHG52Esvq3OEM4PVOd2TVka47GLbVpZpuxGFqcwVgOahn/ZqvdIggAICPEUu2Sn4ntnAZtyw1 qaEG/zjcyCOp5jRy0a50RyuoPPHbfydprhCPNzPauAFaZYOGsiXK4y0uKGIZI68mnaACDwIyc lKHr9emvi9NL4ZzMnvF2omJBWaI7RQ24I0/wRjTRlEZdcSfYwiX6Ir9z2zNRbcpPIbFD5M/Vt v/CqkhWw2r7kNuQg2mTyxHfa23VOrNMLZFsrjP6Mrxl0SxJgc5IDy7HIfs2kSXWRJbH0am/Ew PtcUMzQTV2FJg0Aoj0I9mS2kmPeVrzq63Nv4mIg== X-Rspamd-Queue-Id: 4Bn7SB2NbXz4VcR X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmx.net header.s=badeba3b8450 header.b=HrIyIpls; dmarc=none; spf=none (mx1.freebsd.org: domain of ohartmann@walstatt.org has no SPF policy when checking 212.227.15.15) smtp.mailfrom=ohartmann@walstatt.org X-Spamd-Result: default: False [-2.47 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[gmx.net:s=badeba3b8450]; RCVD_IN_DNSWL_LOW(-0.10)[212.227.15.15:from]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[walstatt.org]; NEURAL_HAM_LONG(-0.91)[-0.912]; HAS_ORG_HEADER(0.00)[]; RWL_MAILSPIKE_POSSIBLE(0.00)[212.227.15.15:from]; NEURAL_HAM_MEDIUM(-0.69)[-0.687]; DKIM_TRACE(0.00)[gmx.net:+]; NEURAL_HAM_SHORT(-0.47)[-0.468]; RECEIVED_SPAMHAUS_PBL(0.00)[77.183.33.128:received]; R_SPF_NA(0.00)[no SPF record]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:8560, ipnet:212.227.0.0/16, country:DE]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[svn-src-all,svn-src-head]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 10 Sep 2020 05:56:43 -0000 On Wed, 9 Sep 2020 22:07:55 +0000 (UTC) "Alexander V. Chernikov" wrote: > Author: melifaro > Date: Wed Sep 9 22:07:54 2020 > New Revision: 365521 > URL: https://svnweb.freebsd.org/changeset/base/365521 > > Log: > Update nexthop handling for route addition/deletion in preparation > for mpath. > Currently kernel requests deletion for the certain routes with > specified gateway, but this gateway is not actually checked. With > multipath routes, internal gateway checking becomes mandatory. Add > the logic performing this check. > Generalise RTF_PINNED routes to the generic route priorities, > simplifying the logic. > Add lookup_prefix() function to perform exact match search based on > data in @info. > Differential Revision: https://reviews.freebsd.org/D26356 > > Modified: > head/sys/net/route/route_ctl.c > head/sys/net/route/route_var.h > > Modified: head/sys/net/route/route_ctl.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D > --- head/sys/net/route/route_ctl.c Wed Sep 9 22:02:30 > 2020 (r365520) +++ head/sys/net/route/route_ctl.c Wed > Sep 9 22:07:54 2020 (r365521) @@ -86,6 +86,10 @@ static int > change_route(struct rib_head *rnh, struct r static int > change_route_nhop(struct rib_head *rnh, struct rtentry *rt, struct > rt_addrinfo *info, struct route_nhop_data *rnd, struct rib_cmd_info > *rc); + > +static int rt_unlinkrte(struct rib_head *rnh, struct rt_addrinfo > *info, > + struct rib_cmd_info *rc); > + > static void rib_notify(struct rib_head *rnh, enum > rib_subscription_type type, struct rib_cmd_info *rc); > > @@ -172,6 +176,141 @@ get_rnh(uint32_t fibnum, const struct > rt_addrinfo *inf } > > /* > + * Check if specified @gw matches gw data in the nexthop @nh. > + * > + * Returns true if matches, false otherwise. > + */ > +static bool > +match_nhop_gw(const struct nhop_object *nh, const struct sockaddr > *gw) +{ > + > + if (nh->gw_sa.sa_family !=3D gw->sa_family) > + return (false); > + > + switch (gw->sa_family) { > + case AF_INET: > + return (nh->gw4_sa.sin_addr.s_addr =3D=3D > + ((const struct sockaddr_in > *)gw)->sin_addr.s_addr); > + case AF_INET6: > + { > + const struct sockaddr_in6 *gw6; > + gw6 =3D (const struct sockaddr_in6 *)gw; > + > + /* > + * Currently (2020-09) IPv6 gws in kernel > have their > + * scope embedded. Once this becomes false, > this code > + * has to be revisited. > + */ > + if (IN6_ARE_ADDR_EQUAL(&nh->gw6_sa.sin6_addr, > + &gw6->sin6_addr)) > + return (true); > + return (false); > + } > + case AF_LINK: > + { > + const struct sockaddr_dl *sdl; > + sdl =3D (const struct sockaddr_dl *)gw; > + return (nh->gwl_sa.sdl_index =3D=3D > sdl->sdl_index); > + } > + default: > + return (memcmp(&nh->gw_sa, gw, nh->gw_sa.sa_len) =3D=3D > 0); > + } > + > + /* NOTREACHED */ > + return (false); > +} > + > +/* > + * Checks if data in @info matches nexhop @nh. > + * > + * Returns 0 on success, > + * ESRCH if not matched, > + * ENOENT if filter function returned false > + */ > +int > +check_info_match_nhop(const struct rt_addrinfo *info, const struct > rtentry *rt, > + const struct nhop_object *nh) > +{ > + const struct sockaddr *gw =3D info->rti_info[RTAX_GATEWAY]; > + > + if (info->rti_filter !=3D NULL) { > + if (info->rti_filter(rt, nh, info->rti_filterdata) =3D=3D 0) > + return (ENOENT); > + else > + return (0); > + } > + if ((gw !=3D NULL) && !match_nhop_gw(nh, gw)) > + return (ESRCH); > + > + return (0); > +} > + > +/* > + * Checks if nexhop @nh can be rewritten by data in @info because > + * of higher "priority". Currently the only case for such scenario > + * is kernel installing interface routes, marked by RTF_PINNED flag. > + * > + * Returns: > + * 1 if @info data has higher priority > + * 0 if priority is the same > + * -1 if priority is lower > + */ > +int > +can_override_nhop(const struct rt_addrinfo *info, const struct > nhop_object *nh) +{ > + > + if (info->rti_flags & RTF_PINNED) { > + return (NH_IS_PINNED(nh)) ? 0 : 1; > + } else { > + return (NH_IS_PINNED(nh)) ? -1 : 0; > + } > +} > + > +/* > + * Runs exact prefix match based on @dst and @netmask. > + * Returns matched @rtentry if found or NULL. > + * If rtentry was found, saves nexthop / weight value into @rnd. > + */ > +static struct rtentry * > +lookup_prefix_bysa(struct rib_head *rnh, const struct sockaddr *dst, > + const struct sockaddr *netmask, struct route_nhop_data *rnd) > +{ > + struct rtentry *rt; > + > + RIB_LOCK_ASSERT(rnh); > + > + rt =3D (struct rtentry *)rnh->rnh_lookup(__DECONST(void *, > dst), > + __DECONST(void *, netmask), &rnh->head); > + if (rt !=3D NULL) { > + rnd->rnd_nhop =3D rt->rt_nhop; > + rnd->rnd_weight =3D rt->rt_weight; > + } else { > + rnd->rnd_nhop =3D NULL; > + rnd->rnd_weight =3D 0; > + } > + > + return (rt); > +} > + > +/* > + * Runs exact prefix match based on dst/netmask from @info. > + * Assumes RIB lock is held. > + * Returns matched @rtentry if found or NULL. > + * If rtentry was found, saves nexthop / weight value into @rnd. > + */ > +struct rtentry * > +lookup_prefix(struct rib_head *rnh, const struct rt_addrinfo *info, > + struct route_nhop_data *rnd) > +{ > + struct rtentry *rt; > + > + rt =3D lookup_prefix_bysa(rnh, info->rti_info[RTAX_DST], > + info->rti_info[RTAX_NETMASK], rnd); > + > + return (rt); > +} > + > +/* > * Adds route defined by @info into the kernel table specified by > @fibnum and > * sa_family in @info->rti_info[RTAX_DST]. > * > @@ -182,6 +321,7 @@ rib_add_route(uint32_t fibnum, struct rt_addrinfo > *inf struct rib_cmd_info *rc) > { > struct rib_head *rnh; > + int error; > > NET_EPOCH_ASSERT(); > > @@ -201,7 +341,11 @@ rib_add_route(uint32_t fibnum, struct > rt_addrinfo *inf bzero(rc, sizeof(struct rib_cmd_info)); > rc->rc_cmd =3D RTM_ADD; > > - return (add_route(rnh, info, rc)); > + error =3D add_route(rnh, info, rc); > + if (error =3D=3D 0) > + rib_notify(rnh, RIB_NOTIFY_DELAYED, rc); > + > + return (error); > } > > /* > @@ -291,10 +435,10 @@ static int > add_route(struct rib_head *rnh, struct rt_addrinfo *info, > struct rib_cmd_info *rc) > { > - struct sockaddr *ndst, *netmask; > + struct nhop_object *nh_orig; > struct route_nhop_data rnd; > struct nhop_object *nh; > - struct rtentry *rt; > + struct rtentry *rt, *rt_orig; > int error; > > error =3D create_rtentry(rnh, info, &rt); > @@ -307,6 +451,7 @@ add_route(struct rib_head *rnh, struct > rt_addrinfo *in > RIB_WLOCK(rnh); > #ifdef RADIX_MPATH > + struct sockaddr *netmask; > netmask =3D info->rti_info[RTAX_NETMASK]; > /* do not permit exactly the same dst/mask/gw pair */ > if (rt_mpath_capable(rnh) && > @@ -320,38 +465,39 @@ add_route(struct rib_head *rnh, struct > rt_addrinfo *in #endif > error =3D add_route_nhop(rnh, rt, info, &rnd, rc); > if (error =3D=3D 0) { > - rt =3D NULL; > - nh =3D NULL; > - } else if ((error =3D=3D EEXIST) && ((info->rti_flags & > RTF_PINNED) !=3D 0)) { > - struct rtentry *rt_orig; > - struct nhop_object *nh_orig; > - struct radix_node *rn; > + RIB_WUNLOCK(rnh); > + return (0); > + } > > - ndst =3D (struct sockaddr *)rt_key(rt); > - netmask =3D info->rti_info[RTAX_NETMASK]; > - rn =3D rnh->rnh_lookup(ndst, netmask, &rnh->head); > - rt_orig =3D (struct rtentry *)rn; > - if (rt_orig !=3D NULL) { > - nh_orig =3D rt_orig->rt_nhop; > - if ((nhop_get_rtflags(nh_orig) & RTF_PINNED) > =3D=3D 0) { > - /* Current nexhop is not PINNED, can > update */ > - error =3D change_route_nhop(rnh, > rt_orig, > - info, &rnd, rc); > - if (error =3D=3D 0) > - nh =3D NULL; > - } > - } else > - error =3D ENOBUFS; > + /* addition failed. Lookup prefix in the rib to determine > the cause */ > + rt_orig =3D lookup_prefix(rnh, info, &rnd); > + if (rt_orig =3D=3D NULL) { > + /* No prefix -> rnh_addaddr() failed to allocate > memory */ > + RIB_WUNLOCK(rnh); > + nhop_free(nh); > + uma_zfree(V_rtzone, rt); > + return (ENOMEM); > } > + > + /* We have existing route in the RIB. */ > + nh_orig =3D rnd.rnd_nhop; > + /* Check if new route has higher preference */ > + if (can_override_nhop(info, nh_orig) > 0) { > + /* Update nexthop to the new route */ > + change_route_nhop(rnh, rt_orig, info, &rnd, rc); > + RIB_WUNLOCK(rnh); > + uma_zfree(V_rtzone, rt); > + nhop_free(nh_orig); > + return (0); > + } > + > RIB_WUNLOCK(rnh); > > - if (error =3D=3D 0) > - rib_notify(rnh, RIB_NOTIFY_DELAYED, rc); > + /* Unable to add - another route with the same preference > exists */ > + error =3D EEXIST; > > - if (nh !=3D NULL) > - nhop_free(nh); > - if (rt !=3D NULL) > - uma_zfree(V_rtzone, rt); > + nhop_free(nh); > + uma_zfree(V_rtzone, rt); > > return (error); > } > @@ -366,6 +512,9 @@ int > rib_del_route(uint32_t fibnum, struct rt_addrinfo *info, struct > rib_cmd_info *rc) { > struct rib_head *rnh; > + struct sockaddr *dst_orig, *netmask; > + struct sockaddr_storage mdst; > + int error; > > NET_EPOCH_ASSERT(); > > @@ -376,72 +525,66 @@ rib_del_route(uint32_t fibnum, struct > rt_addrinfo *inf bzero(rc, sizeof(struct rib_cmd_info)); > rc->rc_cmd =3D RTM_DELETE; > > - return (del_route(rnh, info, rc)); > + dst_orig =3D info->rti_info[RTAX_DST]; > + netmask =3D info->rti_info[RTAX_NETMASK]; > + > + if (netmask !=3D NULL) { > + /* Ensure @dst is always properly masked */ > + if (dst_orig->sa_len > sizeof(mdst)) > + return (EINVAL); > + rt_maskedcopy(dst_orig, (struct sockaddr *)&mdst, > netmask); > + info->rti_info[RTAX_DST] =3D (struct sockaddr *)&mdst; > + } > + error =3D del_route(rnh, info, rc); > + info->rti_info[RTAX_DST] =3D dst_orig; > + > + return (error); > } > > /* > * Conditionally unlinks rtentry matching data inside @info from > @rnh. > - * Returns unlinked, locked and referenced @rtentry on success, > - * Returns NULL and sets @perror to: > + * Returns 0 on success with operation result stored in @rc. > + * On error, returns: > * ESRCH - if prefix was not found, > - * EADDRINUSE - if trying to delete PINNED route without appropriate > flag. > + * EADDRINUSE - if trying to delete higher priority route. > * ENOENT - if supplied filter function returned 0 (not matched). > */ > -struct rtentry * > -rt_unlinkrte(struct rib_head *rnh, struct rt_addrinfo *info, int > *perror) +static int > +rt_unlinkrte(struct rib_head *rnh, struct rt_addrinfo *info, struct > rib_cmd_info *rc) { > - struct sockaddr *dst, *netmask; > struct rtentry *rt; > struct nhop_object *nh; > struct radix_node *rn; > + struct route_nhop_data rnd; > + int error; > > - dst =3D info->rti_info[RTAX_DST]; > - netmask =3D info->rti_info[RTAX_NETMASK]; > + rt =3D lookup_prefix(rnh, info, &rnd); > + if (rt =3D=3D NULL) > + return (ESRCH); > > - rt =3D (struct rtentry *)rnh->rnh_lookup(dst, netmask, > &rnh->head); > - if (rt =3D=3D NULL) { > - *perror =3D ESRCH; > - return (NULL); > - } > - > nh =3D rt->rt_nhop; > > - if ((info->rti_flags & RTF_PINNED) =3D=3D 0) { > - /* Check if target route can be deleted */ > - if (NH_IS_PINNED(nh)) { > - *perror =3D EADDRINUSE; > - return (NULL); > - } > - } > + error =3D check_info_match_nhop(info, rt, nh); > + if (error !=3D 0) > + return (error); > > - if (info->rti_filter !=3D NULL) { > - if (info->rti_filter(rt, nh, > info->rti_filterdata)=3D=3D0){ > - /* Not matched */ > - *perror =3D ENOENT; > - return (NULL); > - } > + if (can_override_nhop(info, nh) < 0) > + return (EADDRINUSE); > > - /* > - * Filter function requested rte deletion. > - * Ease the caller work by filling in remaining info > - * from that particular entry. > - */ > - info->rti_info[RTAX_GATEWAY] =3D &nh->gw_sa; > - } > - > /* > * Remove the item from the tree and return it. > * Complain if it is not there and do no more processing. > */ > - *perror =3D ESRCH; > #ifdef RADIX_MPATH > + info->rti_info[RTAX_GATEWAY] =3D &nh->gw_sa; > if (rt_mpath_capable(rnh)) > rn =3D rt_mpath_unlink(rnh, info, rt, perror); > else > #endif > - rn =3D rnh->rnh_deladdr(dst, netmask, &rnh->head); > + rn =3D rnh->rnh_deladdr(info->rti_info[RTAX_DST], > + info->rti_info[RTAX_NETMASK], &rnh->head); > if (rn =3D=3D NULL) > - return (NULL); > + return (ESRCH); > > if (rn->rn_flags & (RNF_ACTIVE | RNF_ROOT)) > panic ("rtrequest delete"); > @@ -449,39 +592,25 @@ rt_unlinkrte(struct rib_head *rnh, struct > rt_addrinfo rt =3D RNTORT(rn); > rt->rte_flags &=3D ~RTF_UP; > > - *perror =3D 0; > + /* Finalize notification */ > + rnh->rnh_gen++; > + rc->rc_cmd =3D RTM_DELETE; > + rc->rc_rt =3D rt; > + rc->rc_nh_old =3D rt->rt_nhop; > + rc->rc_nh_weight =3D rt->rt_weight; > + rib_notify(rnh, RIB_NOTIFY_IMMEDIATE, rc); > > - return (rt); > + return (0); > } > > static int > del_route(struct rib_head *rnh, struct rt_addrinfo *info, > struct rib_cmd_info *rc) > { > - struct sockaddr *dst, *netmask; > - struct sockaddr_storage mdst; > - struct rtentry *rt; > int error; > > - dst =3D info->rti_info[RTAX_DST]; > - netmask =3D info->rti_info[RTAX_NETMASK]; > - > - if (netmask) { > - if (dst->sa_len > sizeof(mdst)) > - return (EINVAL); > - rt_maskedcopy(dst, (struct sockaddr *)&mdst, > netmask); > - dst =3D (struct sockaddr *)&mdst; > - } > - > RIB_WLOCK(rnh); > - rt =3D rt_unlinkrte(rnh, info, &error); > - if (rt !=3D NULL) { > - /* Finalize notification */ > - rnh->rnh_gen++; > - rc->rc_rt =3D rt; > - rc->rc_nh_old =3D rt->rt_nhop; > - rib_notify(rnh, RIB_NOTIFY_IMMEDIATE, rc); > - } > + error =3D rt_unlinkrte(rnh, info, rc); > RIB_WUNLOCK(rnh); > if (error !=3D 0) > return (error); > @@ -492,7 +621,7 @@ del_route(struct rib_head *rnh, struct > rt_addrinfo *in > * If the caller wants it, then it can have it, > * the entry will be deleted after the end of the current > epoch. */ > - rtfree(rt); > + rtfree(rc->rc_rt); > > return (0); > } > @@ -624,7 +753,7 @@ change_route(struct rib_head *rnh, struct > rt_addrinfo > /* > * Insert @rt with nhop data from @rnd_new to @rnh. > - * Returns 0 on success. > + * Returns 0 on success and stores operation results in @rc. > */ > static int > add_route_nhop(struct rib_head *rnh, struct rtentry *rt, > @@ -830,28 +959,26 @@ rt_checkdelroute(struct radix_node *rn, void > *arg) di =3D (struct rt_delinfo *)arg; > rt =3D (struct rtentry *)rn; > info =3D &di->info; > - error =3D 0; > > info->rti_info[RTAX_DST] =3D rt_key(rt); > info->rti_info[RTAX_NETMASK] =3D rt_mask(rt); > info->rti_info[RTAX_GATEWAY] =3D &rt->rt_nhop->gw_sa; > > - rt =3D rt_unlinkrte(di->rnh, info, &error); > - if (rt =3D=3D NULL) { > - /* Either not allowed or not matched. Skip entry */ > - return (0); > + error =3D rt_unlinkrte(di->rnh, info, &di->rc); > + > + /* > + * Add deleted rtentries to the list to GC them > + * after dropping the lock. > + * > + * XXX: Delayed notifications not implemented > + * for nexthop updates. > + */ > + if (error =3D=3D 0) { > + /* Add to the list and return */ > + rt->rt_chain =3D di->head; > + di->head =3D rt; > } > > - /* Entry was unlinked. Notify subscribers */ > - di->rnh->rnh_gen++; > - di->rc.rc_rt =3D rt; > - di->rc.rc_nh_old =3D rt->rt_nhop; > - rib_notify(di->rnh, RIB_NOTIFY_IMMEDIATE, &di->rc); > - > - /* Add to the list and return */ > - rt->rt_chain =3D di->head; > - di->head =3D rt; > - > return (0); > } > > @@ -889,6 +1016,8 @@ rib_walk_del(u_int fibnum, int family, > rt_filter_f_t * RIB_WUNLOCK(rnh); > > /* We might have something to reclaim. */ > + bzero(&di.rc, sizeof(di.rc)); > + di.rc.rc_cmd =3D RTM_DELETE; > while (di.head !=3D NULL) { > rt =3D di.head; > di.head =3D rt->rt_chain; > > Modified: head/sys/net/route/route_var.h > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D > --- head/sys/net/route/route_var.h Wed Sep 9 22:02:30 > 2020 (r365520) +++ head/sys/net/route/route_var.h Wed > Sep 9 22:07:54 2020 (r365521) @@ -224,6 +224,12 @@ struct > route_nhop_data { int change_route_conditional(struct rib_head *rnh, > struct rtentry *rt, struct rt_addrinfo *info, struct route_nhop_data > *nhd_orig, struct route_nhop_data *nhd_new, struct rib_cmd_info *rc); > +struct rtentry *lookup_prefix(struct rib_head *rnh, > + const struct rt_addrinfo *info, struct route_nhop_data *rnd); > +int check_info_match_nhop(const struct rt_addrinfo *info, > + const struct rtentry *rt, const struct nhop_object *nh); > +int can_override_nhop(const struct rt_addrinfo *info, > + const struct nhop_object *nh); > > void vnet_rtzone_init(void); > void vnet_rtzone_destroy(void); > @@ -252,8 +258,5 @@ int nhop_create_from_nhop(struct rib_head *rnh, > const void nhops_update_ifmtu(struct rib_head *rh, struct ifnet *ifp, > uint32_t mtu); int nhops_dump_sysctl(struct rib_head *rh, struct > sysctl_req *w); > -/* route */ > -struct rtentry *rt_unlinkrte(struct rib_head *rnh, struct > rt_addrinfo *info, > - int *perror); > > #endif > _______________________________________________ > svn-src-head@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to > "svn-src-head-unsubscribe@freebsd.org" This commit makes make buildkernel on our systems to fail: [...] =2D-- route_ctl.o --- /usr/src/sys/net/route/route_ctl.c:581:39: error: use of undeclared identifier 'perror' --- modules-all --- =2D-- x86 --- x86 -> /usr/src/sys/x86/include =2D-- route_ctl.o --- rn =3D rt_mpath_unlink(rnh, info, rt, perror); ^ =2D-- modules-all --- Kind regards, oh From owner-svn-src-all@freebsd.org Thu Sep 10 06:32:26 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9B8713EC4CE; Thu, 10 Sep 2020 06:32:26 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bn8FQ3c2Lz4XJD; Thu, 10 Sep 2020 06:32:26 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 5F90EE8F3; Thu, 10 Sep 2020 06:32:26 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08A6WQcd023046; Thu, 10 Sep 2020 06:32:26 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08A6WPlo023043; Thu, 10 Sep 2020 06:32:25 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <202009100632.08A6WPlo023043@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Thu, 10 Sep 2020 06:32:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365553 - in head: . share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: in head: . share/man/man9 X-SVN-Commit-Revision: 365553 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.33 Precedence: list List-Id: "SVN commit messages 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, 10 Sep 2020 06:32:26 -0000 Author: lwhsu Date: Thu Sep 10 06:32:25 2020 New Revision: 365553 URL: https://svnweb.freebsd.org/changeset/base/365553 Log: Remove vm_map_create(9) KPI's manpage according to r364302 Submitted by: Ka Ho Ng Reviewed by: markj Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D26372 Deleted: head/share/man/man9/vm_map_create.9 Modified: head/ObsoleteFiles.inc head/share/man/man9/Makefile head/share/man/man9/vm_map.9 Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Thu Sep 10 04:17:23 2020 (r365552) +++ head/ObsoleteFiles.inc Thu Sep 10 06:32:25 2020 (r365553) @@ -36,6 +36,9 @@ # xargs -n1 | sort | uniq -d; # done +# 20200910: remove vm_map_create(9) to sync with the code +OLD_FILES+=usr/share/man/man9/vm_map_create.9.gz + # 20200820: Removal of the ufm driver. OLD_FILES+=usr/share/man/man4/ufm.4.gz Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Thu Sep 10 04:17:23 2020 (r365552) +++ head/share/man/man9/Makefile Thu Sep 10 06:32:25 2020 (r365553) @@ -361,7 +361,6 @@ MAN= accept_filter.9 \ vm_fault_prefault.9 \ vm_map.9 \ vm_map_check_protection.9 \ - vm_map_create.9 \ vm_map_delete.9 \ vm_map_entry_resize_free.9 \ vm_map_find.9 \ Modified: head/share/man/man9/vm_map.9 ============================================================================== --- head/share/man/man9/vm_map.9 Thu Sep 10 04:17:23 2020 (r365552) +++ head/share/man/man9/vm_map.9 Thu Sep 10 06:32:25 2020 (r365553) @@ -310,7 +310,6 @@ is backed by a .Sh SEE ALSO .Xr pmap 9 , .Xr vm_map_check_protection 9 , -.Xr vm_map_create 9 , .Xr vm_map_delete 9 , .Xr vm_map_entry_resize_free 9 , .Xr vm_map_find 9 , From owner-svn-src-all@freebsd.org Thu Sep 10 07:05:31 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C14503ECE56; Thu, 10 Sep 2020 07:05:31 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bn8zb4cpkz4YpB; Thu, 10 Sep 2020 07:05:31 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 7F942F09C; Thu, 10 Sep 2020 07:05:31 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08A75V0g041642; Thu, 10 Sep 2020 07:05:31 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08A75Vx2041641; Thu, 10 Sep 2020 07:05:31 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <202009100705.08A75Vx2041641@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Thu, 10 Sep 2020 07:05:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365554 - head/sys/net/route X-SVN-Group: head X-SVN-Commit-Author: melifaro X-SVN-Commit-Paths: head/sys/net/route X-SVN-Commit-Revision: 365554 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.33 Precedence: list List-Id: "SVN commit messages 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, 10 Sep 2020 07:05:31 -0000 Author: melifaro Date: Thu Sep 10 07:05:31 2020 New Revision: 365554 URL: https://svnweb.freebsd.org/changeset/base/365554 Log: Fix RADIX_MPATH build broken by r365521. Reported by: jenkins, Hartmann, O. Modified: head/sys/net/route/route_ctl.c Modified: head/sys/net/route/route_ctl.c ============================================================================== --- head/sys/net/route/route_ctl.c Thu Sep 10 06:32:25 2020 (r365553) +++ head/sys/net/route/route_ctl.c Thu Sep 10 07:05:31 2020 (r365554) @@ -577,9 +577,11 @@ rt_unlinkrte(struct rib_head *rnh, struct rt_addrinfo */ #ifdef RADIX_MPATH info->rti_info[RTAX_GATEWAY] = &nh->gw_sa; - if (rt_mpath_capable(rnh)) - rn = rt_mpath_unlink(rnh, info, rt, perror); - else + if (rt_mpath_capable(rnh)) { + rn = rt_mpath_unlink(rnh, info, rt, &error); + if (error != 0) + return (error); + } else #endif rn = rnh->rnh_deladdr(info->rti_info[RTAX_DST], info->rti_info[RTAX_NETMASK], &rnh->head); From owner-svn-src-all@freebsd.org Thu Sep 10 09:02:00 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0AA663EF37C; Thu, 10 Sep 2020 09:02:00 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BnCYz6bNyz4gDG; Thu, 10 Sep 2020 09:01:59 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C57FA10710; Thu, 10 Sep 2020 09:01:59 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08A91xbN014011; Thu, 10 Sep 2020 09:01:59 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08A91xtl014010; Thu, 10 Sep 2020 09:01:59 GMT (envelope-from avg@FreeBSD.org) Message-Id: <202009100901.08A91xtl014010@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 10 Sep 2020 09:01:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365555 - stable/12/sys/dev/iicbus/twsi X-SVN-Group: stable-12 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/12/sys/dev/iicbus/twsi X-SVN-Commit-Revision: 365555 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.33 Precedence: list List-Id: "SVN commit messages 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, 10 Sep 2020 09:02:00 -0000 Author: avg Date: Thu Sep 10 09:01:59 2020 New Revision: 365555 URL: https://svnweb.freebsd.org/changeset/base/365555 Log: MFC r365289: twsi: no need to compare boolean with boolean constant Modified: stable/12/sys/dev/iicbus/twsi/twsi.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/iicbus/twsi/twsi.c ============================================================================== --- stable/12/sys/dev/iicbus/twsi/twsi.c Thu Sep 10 07:05:31 2020 (r365554) +++ stable/12/sys/dev/iicbus/twsi/twsi.c Thu Sep 10 09:01:59 2020 (r365555) @@ -484,7 +484,7 @@ twsi_transfer(device_t dev, struct iic_msg *msgs, uint sc = device_get_softc(dev); - if (sc->have_intr == false) + if (!sc->have_intr) return (iicbus_transfer_gen(dev, msgs, nmsgs)); sc->error = 0; From owner-svn-src-all@freebsd.org Thu Sep 10 09:10:34 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 06F803EF965; Thu, 10 Sep 2020 09:10:34 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BnCls6S1Lz3SCJ; Thu, 10 Sep 2020 09:10:33 +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 C0C7310887; Thu, 10 Sep 2020 09:10:33 +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 08A9AXB4015475; Thu, 10 Sep 2020 09:10:33 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08A9AXxS015474; Thu, 10 Sep 2020 09:10:33 GMT (envelope-from avg@FreeBSD.org) Message-Id: <202009100910.08A9AXxS015474@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 10 Sep 2020 09:10:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365556 - stable/12/sys/dev/iicbus/twsi X-SVN-Group: stable-12 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/12/sys/dev/iicbus/twsi X-SVN-Commit-Revision: 365556 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.33 Precedence: list List-Id: "SVN commit messages 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, 10 Sep 2020 09:10:34 -0000 Author: avg Date: Thu Sep 10 09:10:33 2020 New Revision: 365556 URL: https://svnweb.freebsd.org/changeset/base/365556 Log: MFC r365288: twsi: replace a couple of errno codes with i2c error codes Modified: stable/12/sys/dev/iicbus/twsi/twsi.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/iicbus/twsi/twsi.c ============================================================================== --- stable/12/sys/dev/iicbus/twsi/twsi.c Thu Sep 10 09:01:59 2020 (r365555) +++ stable/12/sys/dev/iicbus/twsi/twsi.c Thu Sep 10 09:10:33 2020 (r365556) @@ -573,7 +573,7 @@ twsi_intr(void *arg) case TWSI_STATUS_ADDR_R_NACK: debugf(sc->dev, "No ack received after transmitting the address\n"); sc->transfer = 0; - sc->error = ETIMEDOUT; + sc->error = IIC_ENOACK; sc->control_val = 0; wakeup(sc); break; @@ -642,7 +642,7 @@ twsi_intr(void *arg) default: debugf(sc->dev, "status=%x hot handled\n", status); sc->transfer = 0; - sc->error = ENXIO; + sc->error = IIC_EBUSERR; sc->control_val = 0; wakeup(sc); break; From owner-svn-src-all@freebsd.org Thu Sep 10 09:37:30 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EC7953D01DE; Thu, 10 Sep 2020 09:37:30 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BnDLy64bTz3TjC; Thu, 10 Sep 2020 09:37:30 +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 B3D4D10D1C; Thu, 10 Sep 2020 09:37:30 +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 08A9bUKV033797; Thu, 10 Sep 2020 09:37:30 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08A9bUcB033796; Thu, 10 Sep 2020 09:37:30 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <202009100937.08A9bUcB033796@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Thu, 10 Sep 2020 09:37:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365557 - head/sys/dev/gpio X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/dev/gpio X-SVN-Commit-Revision: 365557 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.33 Precedence: list List-Id: "SVN commit messages 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, 10 Sep 2020 09:37:31 -0000 Author: andrew Date: Thu Sep 10 09:37:30 2020 New Revision: 365557 URL: https://svnweb.freebsd.org/changeset/base/365557 Log: Use the correct variable to check which interrupt mode to use In the PL061 driver we incorrectly used the mask rather than mode to find how to configure the interrupt. Sponsored by: Innovate UK Modified: head/sys/dev/gpio/pl061.c Modified: head/sys/dev/gpio/pl061.c ============================================================================== --- head/sys/dev/gpio/pl061.c Thu Sep 10 09:10:33 2020 (r365556) +++ head/sys/dev/gpio/pl061.c Thu Sep 10 09:37:30 2020 (r365557) @@ -335,22 +335,22 @@ pl061_pic_setup_intr(device_t dev, struct intr_irqsrc PL061_LOCK(sc); - if (mask & GPIO_INTR_EDGE_BOTH) { + if (mode & GPIO_INTR_EDGE_BOTH) { mask_and_set(sc, PL061_INTBOTHEDGES, mask, mask); mask_and_set(sc, PL061_INTSENSE, mask, 0); - } else if (mask & GPIO_INTR_EDGE_RISING) { + } else if (mode & GPIO_INTR_EDGE_RISING) { mask_and_set(sc, PL061_INTBOTHEDGES, mask, 0); mask_and_set(sc, PL061_INTSENSE, mask, 0); mask_and_set(sc, PL061_INTEVENT, mask, mask); - } else if (mask & GPIO_INTR_EDGE_FALLING) { + } else if (mode & GPIO_INTR_EDGE_FALLING) { mask_and_set(sc, PL061_INTBOTHEDGES, mask, 0); mask_and_set(sc, PL061_INTSENSE, mask, 0); mask_and_set(sc, PL061_INTEVENT, mask, 0); - } else if (mask & GPIO_INTR_LEVEL_HIGH) { + } else if (mode & GPIO_INTR_LEVEL_HIGH) { mask_and_set(sc, PL061_INTBOTHEDGES, mask, 0); mask_and_set(sc, PL061_INTSENSE, mask, mask); mask_and_set(sc, PL061_INTEVENT, mask, mask); - } else if (mask & GPIO_INTR_LEVEL_LOW) { + } else if (mode & GPIO_INTR_LEVEL_LOW) { mask_and_set(sc, PL061_INTBOTHEDGES, mask, 0); mask_and_set(sc, PL061_INTSENSE, mask, mask); mask_and_set(sc, PL061_INTEVENT, mask, 0); From owner-svn-src-all@freebsd.org Thu Sep 10 09:42:40 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 087AA3D04DD; Thu, 10 Sep 2020 09:42:39 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BnDSv4KJnz3VH4; Thu, 10 Sep 2020 09:42:39 +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 AC3CC10D40; Thu, 10 Sep 2020 09:42:38 +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 08A9gcu1039919; Thu, 10 Sep 2020 09:42:38 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08A9gcEu039918; Thu, 10 Sep 2020 09:42:38 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <202009100942.08A9gcEu039918@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Thu, 10 Sep 2020 09:42:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365558 - head/sys/dev/gpio X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/dev/gpio X-SVN-Commit-Revision: 365558 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.33 Precedence: list List-Id: "SVN commit messages 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, 10 Sep 2020 09:42:41 -0000 Author: andrew Date: Thu Sep 10 09:42:37 2020 New Revision: 365558 URL: https://svnweb.freebsd.org/changeset/base/365558 Log: Only manage ofw gpio providers on ofw systems On arm64 we may boot via ACPI. In this case we will still try to manage the gpio providers as if we are using FDT. Fix this by checking if the FDT node is valid before registering a cross reference. Sponsored by: Innovate UK Modified: head/sys/dev/gpio/ofw_gpiobus.c Modified: head/sys/dev/gpio/ofw_gpiobus.c ============================================================================== --- head/sys/dev/gpio/ofw_gpiobus.c Thu Sep 10 09:37:30 2020 (r365557) +++ head/sys/dev/gpio/ofw_gpiobus.c Thu Sep 10 09:42:37 2020 (r365558) @@ -197,7 +197,8 @@ ofw_gpiobus_register_provider(device_t provider) phandle_t node; node = ofw_bus_get_node(provider); - OF_device_register_xref(OF_xref_from_node(node), provider); + if (node != -1) + OF_device_register_xref(OF_xref_from_node(node), provider); } void @@ -206,7 +207,8 @@ ofw_gpiobus_unregister_provider(device_t provider) phandle_t node; node = ofw_bus_get_node(provider); - OF_device_register_xref(OF_xref_from_node(node), NULL); + if (node != -1) + OF_device_register_xref(OF_xref_from_node(node), NULL); } static struct ofw_gpiobus_devinfo * From owner-svn-src-all@freebsd.org Thu Sep 10 09:50:44 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 944E03D08FA; Thu, 10 Sep 2020 09:50:44 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BnDfD3C9nz3VgK; Thu, 10 Sep 2020 09:50:44 +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 5220310CDD; Thu, 10 Sep 2020 09:50:44 +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 08A9oiWq040390; Thu, 10 Sep 2020 09:50:44 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08A9ohKg040389; Thu, 10 Sep 2020 09:50:43 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <202009100950.08A9ohKg040389@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Thu, 10 Sep 2020 09:50:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365559 - head/sys/dev/gpio X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/dev/gpio X-SVN-Commit-Revision: 365559 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.33 Precedence: list List-Id: "SVN commit messages 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, 10 Sep 2020 09:50:44 -0000 Author: andrew Date: Thu Sep 10 09:50:43 2020 New Revision: 365559 URL: https://svnweb.freebsd.org/changeset/base/365559 Log: Switch the name of the pl061 driver to gpio We need it to be named gpio for gpiobus to work. Sponsored by: Innovate UK Modified: head/sys/dev/gpio/pl061.c head/sys/dev/gpio/pl061_acpi.c Modified: head/sys/dev/gpio/pl061.c ============================================================================== --- head/sys/dev/gpio/pl061.c Thu Sep 10 09:42:37 2020 (r365558) +++ head/sys/dev/gpio/pl061.c Thu Sep 10 09:50:43 2020 (r365559) @@ -577,4 +577,4 @@ static device_method_t pl061_methods[] = { DEVMETHOD_END }; -DEFINE_CLASS_0(pl061, pl061_driver, pl061_methods, sizeof(struct pl061_softc)); +DEFINE_CLASS_0(gpio, pl061_driver, pl061_methods, sizeof(struct pl061_softc)); Modified: head/sys/dev/gpio/pl061_acpi.c ============================================================================== --- head/sys/dev/gpio/pl061_acpi.c Thu Sep 10 09:42:37 2020 (r365558) +++ head/sys/dev/gpio/pl061_acpi.c Thu Sep 10 09:50:43 2020 (r365559) @@ -93,7 +93,7 @@ static device_method_t pl061_acpi_methods[] = { DEVMETHOD_END }; -DEFINE_CLASS_1(pl061, pl061_acpi_driver, pl061_acpi_methods, +DEFINE_CLASS_1(gpio, pl061_acpi_driver, pl061_acpi_methods, sizeof(struct pl061_softc), pl061_driver); static devclass_t pl061_devclass; From owner-svn-src-all@freebsd.org Thu Sep 10 10:50:01 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DD3883D215C; Thu, 10 Sep 2020 10:50:01 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BnFyd5tyvz3YyS; Thu, 10 Sep 2020 10:50:01 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 AD96A11AA4; Thu, 10 Sep 2020 10:50:01 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08AAo1Nk077610; Thu, 10 Sep 2020 10:50:01 GMT (envelope-from grehan@FreeBSD.org) Received: (from grehan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08AAnx2F077560; Thu, 10 Sep 2020 10:49:59 GMT (envelope-from grehan@FreeBSD.org) Message-Id: <202009101049.08AAnx2F077560@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: grehan set sender to grehan@FreeBSD.org using -f From: Peter Grehan Date: Thu, 10 Sep 2020 10:49:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365560 - in stable/12/sys: amd64/amd64 amd64/include amd64/vmm amd64/vmm/intel i386/i386 x86/include X-SVN-Group: stable-12 X-SVN-Commit-Author: grehan X-SVN-Commit-Paths: in stable/12/sys: amd64/amd64 amd64/include amd64/vmm amd64/vmm/intel i386/i386 x86/include X-SVN-Commit-Revision: 365560 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.33 Precedence: list List-Id: "SVN commit messages 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, 10 Sep 2020 10:50:01 -0000 Author: grehan Date: Thu Sep 10 10:49:59 2020 New Revision: 365560 URL: https://svnweb.freebsd.org/changeset/base/365560 Log: MFC r364340, r364343, r364656 r364340 Support guest rdtscp and rdpid instructions on Intel VT-x Follow-on commits: r364343 Export a routine to provide the TSC_AUX MSR value and use this in vmm r364656 assert caller is preventing CPU migration Submitted by: adam_fenn.io Differential Revision: https://reviews.freebsd.org/D26003 Modified: stable/12/sys/amd64/amd64/initcpu.c stable/12/sys/amd64/include/vmm.h stable/12/sys/amd64/vmm/intel/vmx.c stable/12/sys/amd64/vmm/intel/vmx.h stable/12/sys/amd64/vmm/intel/vmx_msr.c stable/12/sys/amd64/vmm/intel/vmx_msr.h stable/12/sys/amd64/vmm/x86.c stable/12/sys/i386/i386/initcpu.c stable/12/sys/x86/include/x86_var.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/amd64/amd64/initcpu.c ============================================================================== --- stable/12/sys/amd64/amd64/initcpu.c Thu Sep 10 09:50:43 2020 (r365559) +++ stable/12/sys/amd64/amd64/initcpu.c Thu Sep 10 10:49:59 2020 (r365560) @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -218,6 +219,18 @@ init_via(void) } /* + * The value for the TSC_AUX MSR and rdtscp/rdpid on the invoking CPU. + * + * Caller should prevent CPU migration. + */ +u_int +cpu_auxmsr(void) +{ + KASSERT((read_rflags() & PSL_I) == 0, ("context switch possible")); + return (PCPU_GET(cpuid)); +} + +/* * Initialize CPU control registers */ void @@ -283,7 +296,7 @@ initializecpu(void) if ((amd_feature & AMDID_RDTSCP) != 0 || (cpu_stdext_feature2 & CPUID_STDEXT2_RDPID) != 0) - wrmsr(MSR_TSC_AUX, PCPU_GET(cpuid)); + wrmsr(MSR_TSC_AUX, cpu_auxmsr()); } void Modified: stable/12/sys/amd64/include/vmm.h ============================================================================== --- stable/12/sys/amd64/include/vmm.h Thu Sep 10 09:50:43 2020 (r365559) +++ stable/12/sys/amd64/include/vmm.h Thu Sep 10 10:49:59 2020 (r365560) @@ -436,6 +436,8 @@ enum vm_cap_type { VM_CAP_UNRESTRICTED_GUEST, VM_CAP_ENABLE_INVPCID, VM_CAP_BPT_EXIT, + VM_CAP_RDPID, + VM_CAP_RDTSCP, VM_CAP_MAX }; Modified: stable/12/sys/amd64/vmm/intel/vmx.c ============================================================================== --- stable/12/sys/amd64/vmm/intel/vmx.c Thu Sep 10 09:50:43 2020 (r365559) +++ stable/12/sys/amd64/vmm/intel/vmx.c Thu Sep 10 10:49:59 2020 (r365560) @@ -160,6 +160,14 @@ static int cap_pause_exit; SYSCTL_INT(_hw_vmm_vmx_cap, OID_AUTO, pause_exit, CTLFLAG_RD, &cap_pause_exit, 0, "PAUSE triggers a VM-exit"); +static int cap_rdpid; +SYSCTL_INT(_hw_vmm_vmx_cap, OID_AUTO, rdpid, CTLFLAG_RD, &cap_rdpid, 0, + "Guests are allowed to use RDPID"); + +static int cap_rdtscp; +SYSCTL_INT(_hw_vmm_vmx_cap, OID_AUTO, rdtscp, CTLFLAG_RD, &cap_rdtscp, 0, + "Guests are allowed to use RDTSCP"); + static int cap_unrestricted_guest; SYSCTL_INT(_hw_vmm_vmx_cap, OID_AUTO, unrestricted_guest, CTLFLAG_RD, &cap_unrestricted_guest, 0, "Unrestricted guests"); @@ -293,6 +301,18 @@ static int vmx_getreg(void *arg, int vcpu, int reg, ui static int vmxctx_setreg(struct vmxctx *vmxctx, int reg, uint64_t val); static void vmx_inject_pir(struct vlapic *vlapic); +static inline bool +host_has_rdpid(void) +{ + return ((cpu_stdext_feature2 & CPUID_STDEXT2_RDPID) != 0); +} + +static inline bool +host_has_rdtscp(void) +{ + return ((amd_feature & AMDID_RDTSCP) != 0); +} + #ifdef KTR static const char * exit_reason_to_str(int reason) @@ -745,6 +765,43 @@ vmx_init(int ipinum) PROCBASED_PAUSE_EXITING, 0, &tmp) == 0); + /* + * Check support for RDPID and/or RDTSCP. + * + * Support a pass-through-based implementation of these via the + * "enable RDTSCP" VM-execution control and the "RDTSC exiting" + * VM-execution control. + * + * The "enable RDTSCP" VM-execution control applies to both RDPID + * and RDTSCP (see SDM volume 3, section 25.3, "Changes to + * Instruction Behavior in VMX Non-root operation"); this is why + * only this VM-execution control needs to be enabled in order to + * enable passing through whichever of RDPID and/or RDTSCP are + * supported by the host. + * + * The "RDTSC exiting" VM-execution control applies to both RDTSC + * and RDTSCP (again, per SDM volume 3, section 25.3), and is + * already set up for RDTSC and RDTSCP pass-through by the current + * implementation of RDTSC. + * + * Although RDPID and RDTSCP are optional capabilities, since there + * does not currently seem to be a use case for enabling/disabling + * these via libvmmapi, choose not to support this and, instead, + * just statically always enable or always disable this support + * across all vCPUs on all VMs. (Note that there may be some + * complications to providing this functionality, e.g., the MSR + * bitmap is currently per-VM rather than per-vCPU while the + * capability API wants to be able to control capabilities on a + * per-vCPU basis). + */ + error = vmx_set_ctlreg(MSR_VMX_PROCBASED_CTLS2, + MSR_VMX_PROCBASED_CTLS2, + PROCBASED2_ENABLE_RDTSCP, 0, &tmp); + cap_rdpid = error == 0 && host_has_rdpid(); + cap_rdtscp = error == 0 && host_has_rdtscp(); + if (cap_rdpid || cap_rdtscp) + procbased_ctls2 |= PROCBASED2_ENABLE_RDTSCP; + cap_unrestricted_guest = (vmx_set_ctlreg(MSR_VMX_PROCBASED_CTLS2, MSR_VMX_PROCBASED_CTLS2, PROCBASED2_UNRESTRICTED_GUEST, 0, @@ -997,6 +1054,15 @@ vmx_vminit(struct vm *vm, pmap_t pmap) * the "use TSC offsetting" execution control is enabled and the * difference between the host TSC and the guest TSC is written * into the TSC offset in the VMCS. + * + * Guest TSC_AUX support is enabled if any of guest RDPID and/or + * guest RDTSCP support are enabled (since, as per Table 2-2 in SDM + * volume 4, TSC_AUX is supported if any of RDPID and/or RDTSCP are + * supported). If guest TSC_AUX support is enabled, TSC_AUX is + * exposed read-only so that the VMM can do one fewer MSR read per + * exit than if this register were exposed read-write; the guest + * restore value can be updated during guest writes (expected to be + * rare) instead of during all exits (common). */ if (guest_msr_rw(vmx, MSR_GSBASE) || guest_msr_rw(vmx, MSR_FSBASE) || @@ -1004,7 +1070,8 @@ vmx_vminit(struct vm *vm, pmap_t pmap) guest_msr_rw(vmx, MSR_SYSENTER_ESP_MSR) || guest_msr_rw(vmx, MSR_SYSENTER_EIP_MSR) || guest_msr_rw(vmx, MSR_EFER) || - guest_msr_ro(vmx, MSR_TSC)) + guest_msr_ro(vmx, MSR_TSC) || + ((cap_rdpid || cap_rdtscp) && guest_msr_ro(vmx, MSR_TSC_AUX))) panic("vmx_vminit: error setting guest msr access"); vpid_alloc(vpid, VM_MAXCPU); @@ -1083,6 +1150,8 @@ vmx_vminit(struct vm *vm, pmap_t pmap) KASSERT(error == 0, ("vmx_vminit: error customizing the vmcs")); vmx->cap[i].set = 0; + vmx->cap[i].set |= cap_rdpid != 0 ? 1 << VM_CAP_RDPID : 0; + vmx->cap[i].set |= cap_rdtscp != 0 ? 1 << VM_CAP_RDTSCP : 0; vmx->cap[i].proc_ctls = procbased_ctls; vmx->cap[i].proc_ctls2 = procbased_ctls2; vmx->cap[i].exc_bitmap = exc_bitmap; @@ -2989,11 +3058,30 @@ vmx_run(void *arg, int vcpu, register_t rip, pmap_t pm sidt(&idtr); ldt_sel = sldt(); + /* + * The TSC_AUX MSR must be saved/restored while interrupts + * are disabled so that it is not possible for the guest + * TSC_AUX MSR value to be overwritten by the resume + * portion of the IPI_SUSPEND codepath. This is why the + * transition of this MSR is handled separately from those + * handled by vmx_msr_guest_{enter,exit}(), which are ok to + * be transitioned with preemption disabled but interrupts + * enabled. + * + * These vmx_msr_guest_{enter,exit}_tsc_aux() calls can be + * anywhere in this loop so long as they happen with + * interrupts disabled. This location is chosen for + * simplicity. + */ + vmx_msr_guest_enter_tsc_aux(vmx, vcpu); + vmx_run_trace(vmx, vcpu); vmx_dr_enter_guest(vmxctx); rc = vmx_enter_guest(vmxctx, vmx, launched); vmx_dr_leave_guest(vmxctx); + vmx_msr_guest_exit_tsc_aux(vmx, vcpu); + bare_lgdt(&gdtr); lidt(&idtr); lldt(ldt_sel); @@ -3331,6 +3419,14 @@ vmx_getcap(void *arg, int vcpu, int type, int *retval) if (cap_monitor_trap) ret = 0; break; + case VM_CAP_RDPID: + if (cap_rdpid) + ret = 0; + break; + case VM_CAP_RDTSCP: + if (cap_rdtscp) + ret = 0; + break; case VM_CAP_UNRESTRICTED_GUEST: if (cap_unrestricted_guest) ret = 0; @@ -3394,6 +3490,17 @@ vmx_setcap(void *arg, int vcpu, int type, int val) flag = PROCBASED_PAUSE_EXITING; reg = VMCS_PRI_PROC_BASED_CTLS; } + break; + case VM_CAP_RDPID: + case VM_CAP_RDTSCP: + if (cap_rdpid || cap_rdtscp) + /* + * Choose not to support enabling/disabling + * RDPID/RDTSCP via libvmmapi since, as per the + * discussion in vmx_init(), RDPID/RDTSCP are + * either always enabled or always disabled. + */ + error = EOPNOTSUPP; break; case VM_CAP_UNRESTRICTED_GUEST: if (cap_unrestricted_guest) { Modified: stable/12/sys/amd64/vmm/intel/vmx.h ============================================================================== --- stable/12/sys/amd64/vmm/intel/vmx.h Thu Sep 10 09:50:43 2020 (r365559) +++ stable/12/sys/amd64/vmm/intel/vmx.h Thu Sep 10 10:49:59 2020 (r365560) @@ -117,6 +117,7 @@ enum { IDX_MSR_SF_MASK, IDX_MSR_KGSBASE, IDX_MSR_PAT, + IDX_MSR_TSC_AUX, GUEST_MSR_NUM /* must be the last enumeration */ }; @@ -152,5 +153,19 @@ int vmx_set_tsc_offset(struct vmx *vmx, int vcpu, uint extern char vmx_exit_guest[]; extern char vmx_exit_guest_flush_rsb[]; + +static inline bool +vmx_have_msr_tsc_aux(struct vmx *vmx) +{ + int rdpid_rdtscp_bits = ((1 << VM_CAP_RDPID) | (1 << VM_CAP_RDTSCP)); + + /* + * Since the values of these bits are uniform across all vCPUs + * (see discussion in vmx_init() and initialization of these bits + * in vmx_vminit()), just always use vCPU-zero's capability set and + * remove the need to require a vcpuid argument. + */ + return ((vmx->cap[0].set & rdpid_rdtscp_bits) != 0); +} #endif Modified: stable/12/sys/amd64/vmm/intel/vmx_msr.c ============================================================================== --- stable/12/sys/amd64/vmm/intel/vmx_msr.c Thu Sep 10 09:50:43 2020 (r365559) +++ stable/12/sys/amd64/vmm/intel/vmx_msr.c Thu Sep 10 10:49:59 2020 (r365560) @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include "vmx.h" #include "vmx_msr.h" +#include "x86.h" static bool vmx_ctl_allows_one_setting(uint64_t msr_val, int bitpos) @@ -361,6 +362,16 @@ vmx_msr_guest_enter(struct vmx *vmx, int vcpuid) } void +vmx_msr_guest_enter_tsc_aux(struct vmx *vmx, int vcpuid) +{ + uint64_t guest_tsc_aux = vmx->guest_msrs[vcpuid][IDX_MSR_TSC_AUX]; + uint32_t host_aux = cpu_auxmsr(); + + if (vmx_have_msr_tsc_aux(vmx) && guest_tsc_aux != host_aux) + wrmsr(MSR_TSC_AUX, guest_tsc_aux); +} + +void vmx_msr_guest_exit(struct vmx *vmx, int vcpuid) { uint64_t *guest_msrs = vmx->guest_msrs[vcpuid]; @@ -381,6 +392,23 @@ vmx_msr_guest_exit(struct vmx *vmx, int vcpuid) /* MSR_KGSBASE will be restored on the way back to userspace */ } +void +vmx_msr_guest_exit_tsc_aux(struct vmx *vmx, int vcpuid) +{ + uint64_t guest_tsc_aux = vmx->guest_msrs[vcpuid][IDX_MSR_TSC_AUX]; + uint32_t host_aux = cpu_auxmsr(); + + if (vmx_have_msr_tsc_aux(vmx) && guest_tsc_aux != host_aux) + /* + * Note that it is not necessary to save the guest value + * here; vmx->guest_msrs[vcpuid][IDX_MSR_TSC_AUX] always + * contains the current value since it is updated whenever + * the guest writes to it (which is expected to be very + * rare). + */ + wrmsr(MSR_TSC_AUX, host_aux); +} + int vmx_rdmsr(struct vmx *vmx, int vcpuid, u_int num, uint64_t *val, bool *retu) { @@ -472,6 +500,17 @@ vmx_wrmsr(struct vmx *vmx, int vcpuid, u_int num, uint break; case MSR_TSC: error = vmx_set_tsc_offset(vmx, vcpuid, val - rdtsc()); + break; + case MSR_TSC_AUX: + if (vmx_have_msr_tsc_aux(vmx)) + /* + * vmx_msr_guest_enter_tsc_aux() will apply this + * value when it is called immediately before guest + * entry. + */ + guest_msrs[IDX_MSR_TSC_AUX] = val; + else + vm_inject_gp(vmx->vm, vcpuid); break; default: error = EINVAL; Modified: stable/12/sys/amd64/vmm/intel/vmx_msr.h ============================================================================== --- stable/12/sys/amd64/vmm/intel/vmx_msr.h Thu Sep 10 09:50:43 2020 (r365559) +++ stable/12/sys/amd64/vmm/intel/vmx_msr.h Thu Sep 10 10:49:59 2020 (r365560) @@ -35,8 +35,10 @@ struct vmx; void vmx_msr_init(void); void vmx_msr_guest_init(struct vmx *vmx, int vcpuid); +void vmx_msr_guest_enter_tsc_aux(struct vmx *vmx, int vcpuid); void vmx_msr_guest_enter(struct vmx *vmx, int vcpuid); void vmx_msr_guest_exit(struct vmx *vmx, int vcpuid); +void vmx_msr_guest_exit_tsc_aux(struct vmx *vmx, int vcpuid); int vmx_rdmsr(struct vmx *, int vcpuid, u_int num, uint64_t *val, bool *retu); int vmx_wrmsr(struct vmx *, int vcpuid, u_int num, uint64_t val, bool *retu); Modified: stable/12/sys/amd64/vmm/x86.c ============================================================================== --- stable/12/sys/amd64/vmm/x86.c Thu Sep 10 09:50:43 2020 (r365559) +++ stable/12/sys/amd64/vmm/x86.c Thu Sep 10 10:49:59 2020 (r365560) @@ -91,7 +91,8 @@ x86_emulate_cpuid(struct vm *vm, int vcpu_id, { const struct xsave_limits *limits; uint64_t cr4; - int error, enable_invpcid, level, width, x2apic_id; + int error, enable_invpcid, enable_rdpid, enable_rdtscp, level, + width, x2apic_id; unsigned int func, regs[4], logical_cpus; enum x2apic_state x2apic_state; uint16_t cores, maxcpus, sockets, threads; @@ -194,11 +195,13 @@ x86_emulate_cpuid(struct vm *vm, int vcpu_id, /* Hide mwaitx/monitorx capability from the guest */ regs[2] &= ~AMDID2_MWAITX; - /* - * Hide rdtscp/ia32_tsc_aux until we know how - * to deal with them. - */ - regs[3] &= ~AMDID_RDTSCP; + /* Advertise RDTSCP if it is enabled. */ + error = vm_get_capability(vm, vcpu_id, + VM_CAP_RDTSCP, &enable_rdtscp); + if (error == 0 && enable_rdtscp) + regs[3] |= AMDID_RDTSCP; + else + regs[3] &= ~AMDID_RDTSCP; break; case CPUID_8000_0007: @@ -441,6 +444,12 @@ x86_emulate_cpuid(struct vm *vm, int vcpu_id, CPUID_STDEXT_AVX512CD | CPUID_STDEXT_SHA); regs[2] = 0; regs[3] &= CPUID_STDEXT3_MD_CLEAR; + + /* Advertise RDPID if it is enabled. */ + error = vm_get_capability(vm, vcpu_id, + VM_CAP_RDPID, &enable_rdpid); + if (error == 0 && enable_rdpid) + regs[2] |= CPUID_STDEXT2_RDPID; /* Advertise INVPCID if it is enabled. */ error = vm_get_capability(vm, vcpu_id, Modified: stable/12/sys/i386/i386/initcpu.c ============================================================================== --- stable/12/sys/i386/i386/initcpu.c Thu Sep 10 09:50:43 2020 (r365559) +++ stable/12/sys/i386/i386/initcpu.c Thu Sep 10 10:49:59 2020 (r365560) @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -627,6 +628,18 @@ init_transmeta(void) } #endif +/* + * The value for the TSC_AUX MSR and rdtscp/rdpid on the invoking CPU. + * + * Caller should prevent CPU migration. + */ +u_int +cpu_auxmsr(void) +{ + KASSERT((read_eflags() & PSL_I) == 0, ("context switch possible")); + return (PCPU_GET(cpuid)); +} + extern int elf32_nxstack; void @@ -756,7 +769,7 @@ initializecpu(void) #endif if ((amd_feature & AMDID_RDTSCP) != 0 || (cpu_stdext_feature2 & CPUID_STDEXT2_RDPID) != 0) - wrmsr(MSR_TSC_AUX, PCPU_GET(cpuid)); + wrmsr(MSR_TSC_AUX, cpu_auxmsr()); } void Modified: stable/12/sys/x86/include/x86_var.h ============================================================================== --- stable/12/sys/x86/include/x86_var.h Thu Sep 10 09:50:43 2020 (r365559) +++ stable/12/sys/x86/include/x86_var.h Thu Sep 10 10:49:59 2020 (r365560) @@ -123,6 +123,7 @@ cpu_getmaxphyaddr(void) bool acpi_get_fadt_bootflags(uint16_t *flagsp); void *alloc_fpusave(int flags); void busdma_swi(void); +u_int cpu_auxmsr(void); bool cpu_mwait_usable(void); void cpu_probe_amdc1e(void); void cpu_setregs(void); From owner-svn-src-all@freebsd.org Thu Sep 10 11:43:24 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5C08E3D3414; Thu, 10 Sep 2020 11:43:24 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BnH8D1gzrz3cfd; Thu, 10 Sep 2020 11:43:24 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1D08612599; Thu, 10 Sep 2020 11:43:24 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08ABhNAY013736; Thu, 10 Sep 2020 11:43:23 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08ABhN3r013735; Thu, 10 Sep 2020 11:43:23 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202009101143.08ABhN3r013735@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 10 Sep 2020 11:43:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365561 - stable/12/sys/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/12/sys/netinet X-SVN-Commit-Revision: 365561 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.33 Precedence: list List-Id: "SVN commit messages 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, 10 Sep 2020 11:43:24 -0000 Author: tuexen Date: Thu Sep 10 11:43:23 2020 New Revision: 365561 URL: https://svnweb.freebsd.org/changeset/base/365561 Log: MFC r361750: Restrict enabling TCP-FASTOPEN to end-points in CLOSED or LISTEN state Enabling TCP-FASTOPEN on an end-point which is in a state other than CLOSED or LISTEN, is a bug in the application. So it should not work. Also the TCP code does not (and needs not to) handle this. While there, also simplify the setting of the TF_FASTOPEN flag. Modified: stable/12/sys/netinet/tcp_usrreq.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/tcp_usrreq.c ============================================================================== --- stable/12/sys/netinet/tcp_usrreq.c Thu Sep 10 10:49:59 2020 (r365560) +++ stable/12/sys/netinet/tcp_usrreq.c Thu Sep 10 11:43:23 2020 (r365561) @@ -2082,6 +2082,11 @@ unlock_and_done: return (error); INP_WLOCK_RECHECK(inp); + if ((tp->t_state != TCPS_CLOSED) && + (tp->t_state != TCPS_LISTEN)) { + error = EINVAL; + goto unlock_and_done; + } if (tfo_optval.enable) { if (tp->t_state == TCPS_LISTEN) { if (!V_tcp_fastopen_server_enable) { @@ -2089,7 +2094,6 @@ unlock_and_done: goto unlock_and_done; } - tp->t_flags |= TF_FASTOPEN; if (tp->t_tfo_pending == NULL) tp->t_tfo_pending = tcp_fastopen_alloc_counter(); @@ -2108,8 +2112,8 @@ unlock_and_done: tp->t_tfo_client_cookie_len = TCP_FASTOPEN_PSK_LEN; } - tp->t_flags |= TF_FASTOPEN; } + tp->t_flags |= TF_FASTOPEN; } else tp->t_flags &= ~TF_FASTOPEN; goto unlock_and_done; From owner-svn-src-all@freebsd.org Thu Sep 10 11:45:03 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C62473D3467; Thu, 10 Sep 2020 11:45:03 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BnHB74rLQz3cJd; Thu, 10 Sep 2020 11:45:03 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 88E2A124B5; Thu, 10 Sep 2020 11:45:03 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08ABj38l013892; Thu, 10 Sep 2020 11:45:03 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08ABj3kI013891; Thu, 10 Sep 2020 11:45:03 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202009101145.08ABj3kI013891@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 10 Sep 2020 11:45:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365562 - stable/12/sys/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/12/sys/netinet X-SVN-Commit-Revision: 365562 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.33 Precedence: list List-Id: "SVN commit messages 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, 10 Sep 2020 11:45:03 -0000 Author: tuexen Date: Thu Sep 10 11:45:03 2020 New Revision: 365562 URL: https://svnweb.freebsd.org/changeset/base/365562 Log: MFC r364054: Improve the ECN negotiation when the TCP SYN-cache is used by making sure that * ECN is disabled if the client sends an non-ECN-setup SYN segment. * ECN is disabled is the ECN-setup SYN-ACK segment is retransmitted more than net.inet.tcp.ecn.maxretries times. Modified: stable/12/sys/netinet/tcp_syncache.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/tcp_syncache.c ============================================================================== --- stable/12/sys/netinet/tcp_syncache.c Thu Sep 10 11:43:23 2020 (r365561) +++ stable/12/sys/netinet/tcp_syncache.c Thu Sep 10 11:45:03 2020 (r365562) @@ -477,6 +477,9 @@ syncache_timer(void *xsch) sch->sch_nextc = sc->sc_rxttime; continue; } + if (sc->sc_rxmits > V_tcp_ecn_maxretries) { + sc->sc_flags &= ~SCF_ECN; + } if (sc->sc_rxmits > V_tcp_syncache.rexmt_limit) { if ((s = tcp_log_addrs(&sc->sc_inc, NULL, NULL, NULL))) { log(LOG_DEBUG, "%s; %s: Retransmits exhausted, " @@ -1430,6 +1433,13 @@ syncache_add(struct in_conninfo *inc, struct tcpopt *t sc->sc_tsreflect = to->to_tsval; else sc->sc_flags &= ~SCF_TIMESTAMP; + /* + * Disable ECN if needed. + */ + if ((sc->sc_flags & SCF_ECN) && + ((th->th_flags & (TH_ECE|TH_CWR)) != (TH_ECE|TH_CWR))) { + sc->sc_flags &= ~SCF_ECN; + } #ifdef MAC /* * Since we have already unconditionally allocated label From owner-svn-src-all@freebsd.org Thu Sep 10 11:46:37 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 18CC73D3AA0; Thu, 10 Sep 2020 11:46:37 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BnHCw6pRHz3cq6; Thu, 10 Sep 2020 11:46:36 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CCEFE1270E; Thu, 10 Sep 2020 11:46:36 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08ABkaSF014009; Thu, 10 Sep 2020 11:46:36 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08ABka4M014007; Thu, 10 Sep 2020 11:46:36 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202009101146.08ABka4M014007@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 10 Sep 2020 11:46:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365563 - stable/12/sys/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/12/sys/netinet X-SVN-Commit-Revision: 365563 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.33 Precedence: list List-Id: "SVN commit messages 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, 10 Sep 2020 11:46:37 -0000 Author: tuexen Date: Thu Sep 10 11:46:36 2020 New Revision: 365563 URL: https://svnweb.freebsd.org/changeset/base/365563 Log: MFC r364089: Fix the following issues related to the TCP SYN-cache: * Let the accepted TCP/IPv4 socket inherit the configured TTL and TOS value. * Let the accepted TCP/IPv6 socket inherit the configured Hop Limit. * Use the configured Hop Limit and Traffic Class when sending IPv6 packets. Modified: stable/12/sys/netinet/tcp_syncache.c stable/12/sys/netinet/tcp_syncache.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/tcp_syncache.c ============================================================================== --- stable/12/sys/netinet/tcp_syncache.c Thu Sep 10 11:45:03 2020 (r365562) +++ stable/12/sys/netinet/tcp_syncache.c Thu Sep 10 11:46:36 2020 (r365563) @@ -768,6 +768,8 @@ syncache_socket(struct syncache *sc, struct socket *ls inp->inp_vflag &= ~INP_IPV6; inp->inp_vflag |= INP_IPV4; #endif + inp->inp_ip_ttl = sc->sc_ip_ttl; + inp->inp_ip_tos = sc->sc_ip_tos; inp->inp_laddr = sc->sc_inc.inc_laddr; #ifdef INET6 } @@ -800,6 +802,7 @@ syncache_socket(struct syncache *sc, struct socket *ls if (oinp->in6p_outputopts) inp->in6p_outputopts = ip6_copypktopts(oinp->in6p_outputopts, M_NOWAIT); + inp->in6p_hops = oinp->in6p_hops; } if (sc->sc_inc.inc_flags & INC_ISIPV6) { @@ -1321,12 +1324,28 @@ syncache_add(struct in_conninfo *inc, struct tcpopt *t cred = crhold(so->so_cred); #ifdef INET6 - if ((inc->inc_flags & INC_ISIPV6) && - (inp->inp_flags & IN6P_AUTOFLOWLABEL)) - autoflowlabel = 1; + if (inc->inc_flags & INC_ISIPV6) { + if (inp->inp_flags & IN6P_AUTOFLOWLABEL) { + autoflowlabel = 1; + } + ip_ttl = in6_selecthlim(inp, NULL); + if ((inp->in6p_outputopts == NULL) || + (inp->in6p_outputopts->ip6po_tclass == -1)) { + ip_tos = 0; + } else { + ip_tos = inp->in6p_outputopts->ip6po_tclass; + } + } #endif - ip_ttl = inp->inp_ip_ttl; - ip_tos = inp->inp_ip_tos; +#if defined(INET6) && defined(INET) + else +#endif +#ifdef INET + { + ip_ttl = inp->inp_ip_ttl; + ip_tos = inp->inp_ip_tos; + } +#endif win = so->sol_sbrcv_hiwat; ltflags = (tp->t_flags & (TF_NOOPT | TF_SIGNATURE)); @@ -1512,13 +1531,8 @@ skip_alloc: cred = NULL; sc->sc_ipopts = ipopts; bcopy(inc, &sc->sc_inc, sizeof(struct in_conninfo)); -#ifdef INET6 - if (!(inc->inc_flags & INC_ISIPV6)) -#endif - { - sc->sc_ip_tos = ip_tos; - sc->sc_ip_ttl = ip_ttl; - } + sc->sc_ip_tos = ip_tos; + sc->sc_ip_ttl = ip_ttl; #ifdef TCP_OFFLOAD sc->sc_tod = tod; sc->sc_todctx = todctx; @@ -1715,6 +1729,7 @@ syncache_respond(struct syncache *sc, struct syncache_ /* Zero out traffic class and flow label. */ ip6->ip6_flow &= ~IPV6_FLOWINFO_MASK; ip6->ip6_flow |= sc->sc_flowlabel; + ip6->ip6_flow |= htonl(sc->sc_ip_tos << 20); th = (struct tcphdr *)(ip6 + 1); } @@ -1843,7 +1858,7 @@ syncache_respond(struct syncache *sc, struct syncache_ m->m_pkthdr.csum_flags = CSUM_TCP_IPV6; th->th_sum = in6_cksum_pseudo(ip6, tlen + optlen - hlen, IPPROTO_TCP, 0); - ip6->ip6_hlim = in6_selecthlim(NULL, NULL); + ip6->ip6_hlim = sc->sc_ip_ttl; #ifdef TCP_OFFLOAD if (ADDED_BY_TOE(sc)) { struct toedev *tod = sc->sc_tod; Modified: stable/12/sys/netinet/tcp_syncache.h ============================================================================== --- stable/12/sys/netinet/tcp_syncache.h Thu Sep 10 11:45:03 2020 (r365562) +++ stable/12/sys/netinet/tcp_syncache.h Thu Sep 10 11:46:36 2020 (r365563) @@ -63,8 +63,8 @@ struct syncache { struct mbuf *sc_ipopts; /* source route */ u_int16_t sc_peer_mss; /* peer's MSS */ u_int16_t sc_wnd; /* advertised window */ - u_int8_t sc_ip_ttl; /* IPv4 TTL */ - u_int8_t sc_ip_tos; /* IPv4 TOS */ + u_int8_t sc_ip_ttl; /* TTL / Hop Limit */ + u_int8_t sc_ip_tos; /* TOS / Traffic Class */ u_int8_t sc_requested_s_scale:4, sc_requested_r_scale:4; u_int16_t sc_flags; From owner-svn-src-all@freebsd.org Thu Sep 10 11:55:46 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8612A3D3B9D; Thu, 10 Sep 2020 11:55:46 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BnHQV2x2sz3d2C; Thu, 10 Sep 2020 11:55:46 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2DBB012734; Thu, 10 Sep 2020 11:55:46 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08ABtjxU020176; Thu, 10 Sep 2020 11:55:45 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08ABtjTq020175; Thu, 10 Sep 2020 11:55:45 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202009101155.08ABtjTq020175@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 10 Sep 2020 11:55:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365564 - stable/12/sys/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/12/sys/netinet X-SVN-Commit-Revision: 365564 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.33 Precedence: list List-Id: "SVN commit messages 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, 10 Sep 2020 11:55:46 -0000 Author: tuexen Date: Thu Sep 10 11:55:45 2020 New Revision: 365564 URL: https://svnweb.freebsd.org/changeset/base/365564 Log: MFC r361752: We should never allow either the broadcast or IN_ADDR_ANY to be connected to or sent to. This was fond when working with Michael Tuexen and Skyzaller. Skyzaller seems to want to use either of these two addresses to connect to at times. And it really is an error to do so, so lets not allow that behavior. MFC r363256: (Re)-allow 0.0.0.0 to be used as an address in connect() for TCP In r361752 an error handling was introduced for using 0.0.0.0 or 255.255.255.255 as the address in connect() for TCP, since both addresses can't be used. However, the stack maps 0.0.0.0 implicitly to a local address and at least two regressions were reported. Therefore, re-allow the usage of 0.0.0.0. While there, change the error indicated when using 255.255.255.255 from EAFNOSUPPORT to EACCES as mentioned in the man-page of connect(). Modified: stable/12/sys/netinet/tcp_usrreq.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/tcp_usrreq.c ============================================================================== --- stable/12/sys/netinet/tcp_usrreq.c Thu Sep 10 11:46:36 2020 (r365563) +++ stable/12/sys/netinet/tcp_usrreq.c Thu Sep 10 11:55:45 2020 (r365564) @@ -543,6 +543,9 @@ tcp_usr_connect(struct socket *so, struct sockaddr *na if (sinp->sin_family == AF_INET && IN_MULTICAST(ntohl(sinp->sin_addr.s_addr))) return (EAFNOSUPPORT); + if ((sinp->sin_family == AF_INET) && + (ntohl(sinp->sin_addr.s_addr) == INADDR_BROADCAST)) + return (EACCES); if ((error = prison_remote_ip4(td->td_ucred, &sinp->sin_addr)) != 0) return (error); @@ -639,6 +642,10 @@ tcp6_usr_connect(struct socket *so, struct sockaddr *n error = EAFNOSUPPORT; goto out; } + if (ntohl(sin.sin_addr.s_addr) == INADDR_BROADCAST) { + error = EACCES; + goto out; + } if ((error = prison_remote_ip4(td->td_ucred, &sin.sin_addr)) != 0) goto out; @@ -994,6 +1001,12 @@ tcp_usr_send(struct socket *so, int flags, struct mbuf if (m) m_freem(m); error = EAFNOSUPPORT; + goto out; + } + if (ntohl(sinp->sin_addr.s_addr) == INADDR_BROADCAST) { + if (m) + m_freem(m); + error = EACCES; goto out; } if ((error = prison_remote_ip4(td->td_ucred, From owner-svn-src-all@freebsd.org Thu Sep 10 12:01:36 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 600203D477F; Thu, 10 Sep 2020 12:01:36 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BnHYD1xV3z3dgd; Thu, 10 Sep 2020 12:01:36 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2681612835; Thu, 10 Sep 2020 12:01:36 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08AC1aM0022857; Thu, 10 Sep 2020 12:01:36 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08AC1aGe022856; Thu, 10 Sep 2020 12:01:36 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202009101201.08AC1aGe022856@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 10 Sep 2020 12:01:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365565 - stable/12/sys/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/12/sys/netinet X-SVN-Commit-Revision: 365565 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.33 Precedence: list List-Id: "SVN commit messages 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, 10 Sep 2020 12:01:36 -0000 Author: tuexen Date: Thu Sep 10 12:01:35 2020 New Revision: 365565 URL: https://svnweb.freebsd.org/changeset/base/365565 Log: MFC r361081: Allow only IPv4 addresses in sendto() for TCP on AF_INET sockets. This problem was found by looking at syzkaller reproducers for some other problems. Modified: stable/12/sys/netinet/tcp_usrreq.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/tcp_usrreq.c ============================================================================== --- stable/12/sys/netinet/tcp_usrreq.c Thu Sep 10 11:55:45 2020 (r365564) +++ stable/12/sys/netinet/tcp_usrreq.c Thu Sep 10 12:01:35 2020 (r365565) @@ -1032,6 +1032,12 @@ tcp_usr_send(struct socket *so, int flags, struct mbuf error = EINVAL; goto out; } + if ((inp->inp_vflag & INP_IPV6PROTO) == 0) { + if (m != NULL) + m_freem(m); + error = EAFNOSUPPORT; + goto out; + } if (IN6_IS_ADDR_MULTICAST(&sin6->sin6_addr)) { if (m) m_freem(m); From owner-svn-src-all@freebsd.org Thu Sep 10 12:41:03 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3C54B3D608D; Thu, 10 Sep 2020 12:41:03 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BnJQl0rbBz3gvj; Thu, 10 Sep 2020 12:41:03 +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 01ADA1318C; Thu, 10 Sep 2020 12:41:03 +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 08ACf2qM049591; Thu, 10 Sep 2020 12:41:02 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08ACf2cY049587; Thu, 10 Sep 2020 12:41:02 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202009101241.08ACf2cY049587@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 10 Sep 2020 12:41:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365566 - in stable/12/cddl: contrib/opensolaris/lib/libdtrace/common usr.sbin/dtrace/tests/tools X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in stable/12/cddl: contrib/opensolaris/lib/libdtrace/common usr.sbin/dtrace/tests/tools X-SVN-Commit-Revision: 365566 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.33 Precedence: list List-Id: "SVN commit messages 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, 10 Sep 2020 12:41:03 -0000 Author: markj Date: Thu Sep 10 12:41:01 2020 New Revision: 365566 URL: https://svnweb.freebsd.org/changeset/base/365566 Log: MFC r364438, r364440, r364483: Enable creation of static userspace probes in incremental builds. Modified: stable/12/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c stable/12/cddl/contrib/opensolaris/lib/libdtrace/common/dt_strtab.c stable/12/cddl/contrib/opensolaris/lib/libdtrace/common/dt_strtab.h stable/12/cddl/usr.sbin/dtrace/tests/tools/exclude.sh Directory Properties: stable/12/ (props changed) Modified: stable/12/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c ============================================================================== --- stable/12/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c Thu Sep 10 12:01:35 2020 (r365565) +++ stable/12/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c Thu Sep 10 12:41:01 2020 (r365566) @@ -770,6 +770,7 @@ dt_symtab_lookup(Elf_Data *data_sym, int start, int en #define DT_OP_RET 0xd65f03c0 #define DT_OP_CALL26 0x94000000 #define DT_OP_JUMP26 0x14000000 +#define DT_REL_NONE R_AARCH64_NONE static int dt_modtext(dtrace_hdl_t *dtp, char *p, int isenabled, GElf_Rela *rela, @@ -828,7 +829,8 @@ dt_modtext(dtrace_hdl_t *dtp, char *p, int isenabled, return (0); } #elif defined(__arm__) -/* XXX */ +#define DT_REL_NONE R_ARM_NONE + static int dt_modtext(dtrace_hdl_t *dtp, char *p, int isenabled, GElf_Rela *rela, uint32_t *off) @@ -838,7 +840,8 @@ dt_modtext(dtrace_hdl_t *dtp, char *p, int isenabled, return (-1); } #elif defined(__mips__) -/* XXX */ +#define DT_REL_NONE R_MIPS_NONE + static int dt_modtext(dtrace_hdl_t *dtp, char *p, int isenabled, GElf_Rela *rela, uint32_t *off) @@ -858,7 +861,8 @@ dt_modtext(dtrace_hdl_t *dtp, char *p, int isenabled, #define DT_IS_BRANCH(inst) ((inst & 0xfc000000) == 0x48000000) #define DT_IS_BL(inst) (DT_IS_BRANCH(inst) && (inst & 0x01)) -/* XXX */ +#define DT_REL_NONE R_PPC_NONE + static int dt_modtext(dtrace_hdl_t *dtp, char *p, int isenabled, GElf_Rela *rela, uint32_t *off) @@ -875,7 +879,8 @@ dt_modtext(dtrace_hdl_t *dtp, char *p, int isenabled, * We only know about some specific relocation types. */ if (GELF_R_TYPE(rela->r_info) != R_PPC_REL24 && - GELF_R_TYPE(rela->r_info) != R_PPC_PLTREL24) + GELF_R_TYPE(rela->r_info) != R_PPC_PLTREL24 && + GELF_R_TYPE(rela->r_info) != R_PPC_NONE) return (-1); /* @@ -929,7 +934,7 @@ dt_modtext(dtrace_hdl_t *dtp, char *p, int isenabled, return (0); } #elif defined(__riscv) -/* XXX */ +#define DT_REL_NONE R_RISCV_NONE static int dt_modtext(dtrace_hdl_t *dtp, char *p, int isenabled, GElf_Rela *rela, uint32_t *off) @@ -949,6 +954,8 @@ dt_modtext(dtrace_hdl_t *dtp, char *p, int isenabled, #define DT_OP_XOR_EAX_0 0x33 #define DT_OP_XOR_EAX_1 0xc0 +#define DT_REL_NONE R_386_NONE + static int dt_modtext(dtrace_hdl_t *dtp, char *p, int isenabled, GElf_Rela *rela, uint32_t *off) @@ -971,7 +978,8 @@ dt_modtext(dtrace_hdl_t *dtp, char *p, int isenabled, * x86 architectures. */ if (GELF_R_TYPE(rela->r_info) != R_386_PC32 && - GELF_R_TYPE(rela->r_info) != R_386_PLT32) + GELF_R_TYPE(rela->r_info) != R_386_PLT32 && + GELF_R_TYPE(rela->r_info) != R_386_NONE) return (-1); /* @@ -1267,6 +1275,11 @@ process_obj(dtrace_hdl_t *dtp, const char *obj, int *e * We take a first pass through all the relocations to * populate our string table and count the number of extra * symbols we'll require. + * + * We also handle the case where the object has already been + * processed, to support incremental rebuilds. Relocations + * of interest are converted to type NONE, but all information + * needed to reconstruct the output DOF is retained. */ strtab = dt_strtab_create(1); nsym = 0; @@ -1274,7 +1287,6 @@ process_obj(dtrace_hdl_t *dtp, const char *obj, int *e istr = data_str->d_size; for (i = 0; i < shdr_rel.sh_size / shdr_rel.sh_entsize; i++) { - if (shdr_rel.sh_type == SHT_RELA) { if (gelf_getrela(data_rel, i, &rela) == NULL) continue; @@ -1339,7 +1351,12 @@ process_obj(dtrace_hdl_t *dtp, const char *obj, int *e objkey, s); if (dt_strtab_index(strtab, p) == -1) { - nsym++; + /* + * Do not add new symbols if this object file + * has already been processed. + */ + if (GELF_R_TYPE(rela.r_info) != DT_REL_NONE) + nsym++; (void) dt_strtab_insert(strtab, p); } @@ -1347,13 +1364,14 @@ process_obj(dtrace_hdl_t *dtp, const char *obj, int *e } /* - * If any probes were found, allocate the additional space for - * the symbol table and string table, copying the old data into - * the new buffers, and marking the buffers as dirty. We inject - * those newly allocated buffers into the libelf data + * If any new probes were found, allocate the additional space + * for the symbol table and string table, copying the old data + * into the new buffers, and marking the buffers as dirty. We + * inject those newly allocated buffers into the libelf data * structures, but are still responsible for freeing them once * we're done with the elf handle. */ + osym = isym; if (nsym > 0) { /* * The first byte of the string table is reserved for @@ -1405,9 +1423,8 @@ process_obj(dtrace_hdl_t *dtp, const char *obj, int *e shdr_sym.sh_size += nsym * symsize; (void) gelf_update_shdr(scn_sym, &shdr_sym); - osym = isym; nsym += isym; - } else { + } else if (dt_strtab_empty(strtab)) { dt_strtab_destroy(strtab); continue; } @@ -1417,7 +1434,6 @@ process_obj(dtrace_hdl_t *dtp, const char *obj, int *e * modifications described above. */ for (i = 0; i < shdr_rel.sh_size / shdr_rel.sh_entsize; i++) { - if (shdr_rel.sh_type == SHT_RELA) { if (gelf_getrela(data_rel, i, &rela) == NULL) continue; @@ -1484,32 +1500,51 @@ process_obj(dtrace_hdl_t *dtp, const char *obj, int *e bind = GELF_ST_BIND(fsym.st_info) == STB_WEAK ? STB_WEAK : STB_GLOBAL; - - /* - * Emit an alias for the symbol. It needs to be - * non-preemptible so that .SUNW_dof relocations - * may be resolved at static link time. Aliases - * of weak symbols are given a non-unique name - * so that they may be merged by the linker. - */ - dsym = fsym; - dsym.st_name = istr; - dsym.st_info = GELF_ST_INFO(bind, STT_FUNC); - dsym.st_other = GELF_ST_VISIBILITY(STV_HIDDEN); - (void) gelf_update_sym(data_sym, isym, &dsym); - r = (char *) data_str->d_buf + istr; s = (char *) data_str->d_buf + fsym.st_name; - if (bind == STB_WEAK) - istr += sprintf(r, dt_weaksymfmt, - dt_symprefix, s); - else - istr += sprintf(r, dt_symfmt, - dt_symprefix, objkey, s); - istr++; - isym++; - assert(isym <= nsym); - } else + if (GELF_R_TYPE(rela.r_info) != DT_REL_NONE) { + /* + * Emit an alias for the symbol. It + * needs to be non-preemptible so that + * .SUNW_dof relocations may be resolved + * at static link time. Aliases of weak + * symbols are given a non-unique name + * so that they may be merged by the + * linker. + */ + dsym = fsym; + dsym.st_name = istr; + dsym.st_info = GELF_ST_INFO(bind, + STT_FUNC); + dsym.st_other = + GELF_ST_VISIBILITY(STV_HIDDEN); + (void) gelf_update_sym(data_sym, isym, + &dsym); + isym++; + assert(isym <= nsym); + + r = (char *) data_str->d_buf + istr; + if (bind == STB_WEAK) { + istr += sprintf(r, + dt_weaksymfmt, dt_symprefix, + s); + } else { + istr += sprintf(r, dt_symfmt, + dt_symprefix, objkey, s); + } + istr++; + } else { + if (bind == STB_WEAK) { + (void) asprintf(&r, + dt_weaksymfmt, dt_symprefix, + s); + } else { + (void) asprintf(&r, dt_symfmt, + dt_symprefix, objkey, s); + } + } + } else { goto err; + } if ((pvp = dt_provider_lookup(dtp, pname)) == NULL) { return (dt_link_error(dtp, elf, fd, bufs, @@ -1538,24 +1573,18 @@ process_obj(dtrace_hdl_t *dtp, const char *obj, int *e } /* - * Our linker doesn't understand the SUNW_IGNORE ndx and - * will try to use this relocation when we build the - * final executable. Since we are done processing this - * relocation, mark it as inexistant and let libelf - * remove it from the file. - * If this wasn't done, we would have garbage added to - * the executable file as the symbol is going to be - * change from UND to ABS. + * We are done with this relocation, but it must be + * preserved in order to support incremental rebuilds. */ if (shdr_rel.sh_type == SHT_RELA) { - rela.r_offset = 0; - rela.r_info = 0; - rela.r_addend = 0; + rela.r_info = GELF_R_INFO( + GELF_R_SYM(rela.r_info), DT_REL_NONE); (void) gelf_update_rela(data_rel, i, &rela); } else { GElf_Rel rel; - rel.r_offset = 0; - rel.r_info = 0; + rel.r_offset = rela.r_offset; + rel.r_info = GELF_R_INFO( + GELF_R_SYM(rela.r_info), DT_REL_NONE); (void) gelf_update_rel(data_rel, i, &rel); } @@ -1607,19 +1636,6 @@ dtrace_program_link(dtrace_hdl_t *dtp, dtrace_prog_t * char *cmd, tmp; size_t len; int eprobes = 0, ret = 0; - - if (access(file, R_OK) == 0) { - fprintf(stderr, "dtrace: target object (%s) already exists. " - "Please remove the target\ndtrace: object and rebuild all " - "the source objects if you wish to run the DTrace\n" - "dtrace: linking process again\n", file); - /* - * Several build infrastructures run DTrace twice (e.g. - * postgres) and we don't want the build to fail. Return - * 0 here since this isn't really a fatal error. - */ - return (0); - } /* * A NULL program indicates a special use in which we just link Modified: stable/12/cddl/contrib/opensolaris/lib/libdtrace/common/dt_strtab.c ============================================================================== --- stable/12/cddl/contrib/opensolaris/lib/libdtrace/common/dt_strtab.c Thu Sep 10 12:01:35 2020 (r365565) +++ stable/12/cddl/contrib/opensolaris/lib/libdtrace/common/dt_strtab.c Thu Sep 10 12:41:01 2020 (r365566) @@ -206,6 +206,13 @@ err: return (-1); } +boolean_t +dt_strtab_empty(dt_strtab_t *sp) +{ + /* Always contains "\0". */ + return (sp->str_nstrs == 1); +} + ssize_t dt_strtab_index(dt_strtab_t *sp, const char *str) { Modified: stable/12/cddl/contrib/opensolaris/lib/libdtrace/common/dt_strtab.h ============================================================================== --- stable/12/cddl/contrib/opensolaris/lib/libdtrace/common/dt_strtab.h Thu Sep 10 12:01:35 2020 (r365565) +++ stable/12/cddl/contrib/opensolaris/lib/libdtrace/common/dt_strtab.h Thu Sep 10 12:41:01 2020 (r365566) @@ -58,6 +58,7 @@ typedef ssize_t dt_strtab_write_f(const char *, size_t extern dt_strtab_t *dt_strtab_create(size_t); extern void dt_strtab_destroy(dt_strtab_t *); +extern boolean_t dt_strtab_empty(dt_strtab_t *); extern ssize_t dt_strtab_index(dt_strtab_t *, const char *); extern ssize_t dt_strtab_insert(dt_strtab_t *, const char *); extern size_t dt_strtab_size(const dt_strtab_t *); Modified: stable/12/cddl/usr.sbin/dtrace/tests/tools/exclude.sh ============================================================================== --- stable/12/cddl/usr.sbin/dtrace/tests/tools/exclude.sh Thu Sep 10 12:01:35 2020 (r365565) +++ stable/12/cddl/usr.sbin/dtrace/tests/tools/exclude.sh Thu Sep 10 12:41:01 2020 (r365566) @@ -186,10 +186,6 @@ exclude EXFAIL common/usdt/tst.eliminate.ksh # Generated headers include , so _DTRACE_VERSION is always defined. exclude EXFAIL common/usdt/tst.nodtrace.ksh -# The second dtrace -G invocation returns an error with "no probes found," which -# makes sense to me. Not yet sure what the expected behaviour is here. -exclude EXFAIL common/usdt/tst.static2.ksh - # Uses the Solaris-specific ppriv(1). exclude EXFAIL common/usdt/tst.user.ksh From owner-svn-src-all@freebsd.org Thu Sep 10 12:49:17 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 299F73D6357; Thu, 10 Sep 2020 12:49:17 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BnJcF06rlz3y1l; Thu, 10 Sep 2020 12:49:17 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C2AE3131AB; Thu, 10 Sep 2020 12:49:16 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08ACnGc6050810; Thu, 10 Sep 2020 12:49:16 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08ACnG8g050809; Thu, 10 Sep 2020 12:49:16 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202009101249.08ACnG8g050809@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 10 Sep 2020 12:49:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365567 - stable/12/share/man/man4 X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/12/share/man/man4 X-SVN-Commit-Revision: 365567 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.33 Precedence: list List-Id: "SVN commit messages 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, 10 Sep 2020 12:49:17 -0000 Author: tuexen Date: Thu Sep 10 12:49:16 2020 New Revision: 365567 URL: https://svnweb.freebsd.org/changeset/base/365567 Log: MFC 359422: Be a bit more precisly in the description of the sysctl variable net.inet.tcp.pmtud_blackhole_detection. Also remove three entries, which are not sysctl variables but statistic counters for TCP. Thanks to 0mp@ for suggesting an improvement. Modified: stable/12/share/man/man4/tcp.4 Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man4/tcp.4 ============================================================================== --- stable/12/share/man/man4/tcp.4 Thu Sep 10 12:41:01 2020 (r365566) +++ stable/12/share/man/man4/tcp.4 Thu Sep 10 12:49:16 2020 (r365567) @@ -34,7 +34,7 @@ .\" From: @(#)tcp.4 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd December 1, 2019 +.Dd March 29, 2020 .Dt TCP 4 .Os .Sh NAME @@ -577,7 +577,12 @@ Turn on automatic path MTU blackhole detection. In case of retransmits OS will lower the MSS to check if it's MTU problem. If current MSS is greater than -configured value to try, it will be set to configured value, otherwise, +configured value to try +.Po Va net.inet.tcp.pmtud_blackhole_mss +and +.Va net.inet.tcp.v6pmtud_blackhole_mss +.Pc , +it will be set to this value, otherwise, MSS will be set to default values .Po Va net.inet.tcp.mssdflt and @@ -587,13 +592,6 @@ and MSS to try for IPv4 if PMTU blackhole detection is turned on. .It Va v6pmtud_blackhole_mss MSS to try for IPv6 if PMTU blackhole detection is turned on. -.It Va pmtud_blackhole_activated -Number of times configured values were used in an attempt to downshift. -.It Va pmtud_blackhole_activated_min_mss -Number of times default MSS was used in an attempt to downshift. -.It Va pmtud_blackhole_failed -Number of connections for which retransmits continued even after MSS -downshift. .It Va functions_available List of available TCP function blocks (TCP stacks). .It Va functions_default From owner-svn-src-all@freebsd.org Thu Sep 10 12:52:52 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1DFD63D65A5; Thu, 10 Sep 2020 12:52:52 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BnJhM72mLz3yR2; Thu, 10 Sep 2020 12:52:51 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BADF11313A; Thu, 10 Sep 2020 12:52:51 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08ACqpJ3056833; Thu, 10 Sep 2020 12:52:51 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08ACqpBK056831; Thu, 10 Sep 2020 12:52:51 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202009101252.08ACqpBK056831@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 10 Sep 2020 12:52:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365568 - in stable/12: share/man/man4 sys/netinet sys/netinet/tcp_stacks X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: in stable/12: share/man/man4 sys/netinet sys/netinet/tcp_stacks X-SVN-Commit-Revision: 365568 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.33 Precedence: list List-Id: "SVN commit messages 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, 10 Sep 2020 12:52:52 -0000 Author: tuexen Date: Thu Sep 10 12:52:50 2020 New Revision: 365568 URL: https://svnweb.freebsd.org/changeset/base/365568 Log: MFC r359487: Allow the TCP backhole detection to be disabled at all, enabled only for IPv4, enabled only for IPv6, and enabled for IPv4 and IPv6. The current blackhole detection might classify a temporary outage as an MTU issue and reduces permanently the MSS. Since the consequences of such a reduction due to a misclassification are much more drastically for IPv4 than for IPv6, allow the administrator to enable it for IPv6 only. Manually resolve conflict for BBR, which does not exist in stable/12 Modified: stable/12/share/man/man4/tcp.4 stable/12/sys/netinet/tcp_stacks/rack.c stable/12/sys/netinet/tcp_timer.c Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man4/tcp.4 ============================================================================== --- stable/12/share/man/man4/tcp.4 Thu Sep 10 12:49:16 2020 (r365567) +++ stable/12/share/man/man4/tcp.4 Thu Sep 10 12:52:50 2020 (r365568) @@ -34,7 +34,7 @@ .\" From: @(#)tcp.4 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd March 29, 2020 +.Dd March 31, 2020 .Dt TCP 4 .Os .Sh NAME @@ -573,21 +573,31 @@ specific connection. This is needed to help with connection establishment when a broken firewall is in the network path. .It Va pmtud_blackhole_detection -Turn on automatic path MTU blackhole detection. -In case of retransmits OS will -lower the MSS to check if it's MTU problem. -If current MSS is greater than -configured value to try +Enable automatic path MTU blackhole detection. +In case of retransmits of MSS sized segments, +the OS will lower the MSS to check if it's an MTU problem. +If the current MSS is greater than the configured value to try .Po Va net.inet.tcp.pmtud_blackhole_mss and .Va net.inet.tcp.v6pmtud_blackhole_mss .Pc , it will be set to this value, otherwise, -MSS will be set to default values +the MSS will be set to the default values .Po Va net.inet.tcp.mssdflt and .Va net.inet.tcp.v6mssdflt .Pc . +Settings: +.Bl -tag -compact +.It 0 +Disable path MTU blackhole detection. +.It 1 +Enable path MTU blackhole detection for IPv4 and IPv6. +.It 2 +Enable path MTU blackhole detection only for IPv4. +.It 3 +Enable path MTU blackhole detection only for IPv6. +.El .It Va pmtud_blackhole_mss MSS to try for IPv4 if PMTU blackhole detection is turned on. .It Va v6pmtud_blackhole_mss Modified: stable/12/sys/netinet/tcp_stacks/rack.c ============================================================================== --- stable/12/sys/netinet/tcp_stacks/rack.c Thu Sep 10 12:49:16 2020 (r365567) +++ stable/12/sys/netinet/tcp_stacks/rack.c Thu Sep 10 12:52:50 2020 (r365568) @@ -2934,6 +2934,7 @@ rack_timeout_rxt(struct tcpcb *tp, struct tcp_rack *ra int32_t rexmt; struct inpcb *inp; int32_t retval = 0; + bool isipv6; inp = tp->t_inpcb; if (tp->t_timers->tt_flags & TT_STOPPED) { @@ -3010,11 +3011,16 @@ rack_timeout_rxt(struct tcpcb *tp, struct tcp_rack *ra * of packets and process straight to FIN. In that case we won't * catch ESTABLISHED state. */ - if (V_tcp_pmtud_blackhole_detect && (((tp->t_state == TCPS_ESTABLISHED)) - || (tp->t_state == TCPS_FIN_WAIT_1))) { #ifdef INET6 - int32_t isipv6; + isipv6 = (tp->t_inpcb->inp_vflag & INP_IPV6) ? true : false; +#else + isipv6 = false; #endif + if (((V_tcp_pmtud_blackhole_detect == 1) || + (V_tcp_pmtud_blackhole_detect == 2 && !isipv6) || + (V_tcp_pmtud_blackhole_detect == 3 && isipv6)) && + ((tp->t_state == TCPS_ESTABLISHED) || + (tp->t_state == TCPS_FIN_WAIT_1))) { /* * Idea here is that at each stage of mtu probe (usually, @@ -3044,7 +3050,6 @@ rack_timeout_rxt(struct tcpcb *tp, struct tcp_rack *ra * default in an attempt to retransmit. */ #ifdef INET6 - isipv6 = (tp->t_inpcb->inp_vflag & INP_IPV6) ? 1 : 0; if (isipv6 && tp->t_maxseg > V_tcp_v6pmtud_blackhole_mss) { /* Use the sysctl tuneable blackhole MSS. */ Modified: stable/12/sys/netinet/tcp_timer.c ============================================================================== --- stable/12/sys/netinet/tcp_timer.c Thu Sep 10 12:49:16 2020 (r365567) +++ stable/12/sys/netinet/tcp_timer.c Thu Sep 10 12:52:50 2020 (r365568) @@ -589,6 +589,7 @@ tcp_timer_rexmt(void * xtp) int rexmt; struct inpcb *inp; struct epoch_tracker et; + bool isipv6; #ifdef TCPDEBUG int ostate; @@ -687,12 +688,16 @@ tcp_timer_rexmt(void * xtp) * packets and process straight to FIN. In that case we won't catch * ESTABLISHED state. */ - if (V_tcp_pmtud_blackhole_detect && (((tp->t_state == TCPS_ESTABLISHED)) - || (tp->t_state == TCPS_FIN_WAIT_1))) { #ifdef INET6 - int isipv6; + isipv6 = (tp->t_inpcb->inp_vflag & INP_IPV6) ? true : false; +#else + isipv6 = false; #endif - + if (((V_tcp_pmtud_blackhole_detect == 1) || + (V_tcp_pmtud_blackhole_detect == 2 && !isipv6) || + (V_tcp_pmtud_blackhole_detect == 3 && isipv6)) && + ((tp->t_state == TCPS_ESTABLISHED) || + (tp->t_state == TCPS_FIN_WAIT_1))) { /* * Idea here is that at each stage of mtu probe (usually, 1448 * -> 1188 -> 524) should be given 2 chances to recover before @@ -721,7 +726,6 @@ tcp_timer_rexmt(void * xtp) * in an attempt to retransmit. */ #ifdef INET6 - isipv6 = (tp->t_inpcb->inp_vflag & INP_IPV6) ? 1 : 0; if (isipv6 && tp->t_maxseg > V_tcp_v6pmtud_blackhole_mss) { /* Use the sysctl tuneable blackhole MSS. */ From owner-svn-src-all@freebsd.org Thu Sep 10 12:54:47 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6EDE43D65B9; Thu, 10 Sep 2020 12:54:47 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BnJkb2MTbz3yjh; Thu, 10 Sep 2020 12:54:47 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2DB291313B; Thu, 10 Sep 2020 12:54:47 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08ACslA1056977; Thu, 10 Sep 2020 12:54:47 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08ACskT1056975; Thu, 10 Sep 2020 12:54:46 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202009101254.08ACskT1056975@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 10 Sep 2020 12:54:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365569 - stable/12/sys/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/12/sys/netinet X-SVN-Commit-Revision: 365569 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.33 Precedence: list List-Id: "SVN commit messages 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, 10 Sep 2020 12:54:47 -0000 Author: tuexen Date: Thu Sep 10 12:54:46 2020 New Revision: 365569 URL: https://svnweb.freebsd.org/changeset/base/365569 Log: MFC r359926: Improve the TCP blackhole detection. The principle is to reduce the MSS in two steps and try each candidate two times. However, if two candidates are the same (which is the case in TCP/IPv6), this candidate was tested four times. This patch ensures that each candidate actually reduced the MSS and is only tested 2 times. This reduces the time window of missclassifying a temporary outage as an MTU issue. Modified: stable/12/sys/netinet/tcp_timer.c stable/12/sys/netinet/tcp_var.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/tcp_timer.c ============================================================================== --- stable/12/sys/netinet/tcp_timer.c Thu Sep 10 12:52:50 2020 (r365568) +++ stable/12/sys/netinet/tcp_timer.c Thu Sep 10 12:54:46 2020 (r365569) @@ -698,16 +698,40 @@ tcp_timer_rexmt(void * xtp) (V_tcp_pmtud_blackhole_detect == 3 && isipv6)) && ((tp->t_state == TCPS_ESTABLISHED) || (tp->t_state == TCPS_FIN_WAIT_1))) { - /* - * Idea here is that at each stage of mtu probe (usually, 1448 - * -> 1188 -> 524) should be given 2 chances to recover before - * further clamping down. 'tp->t_rxtshift % 2 == 0' should - * take care of that. - */ + if (tp->t_rxtshift == 1) { + /* + * We enter blackhole detection after the first + * unsuccessful timer based retransmission. + * Then we reduce up to two times the MSS, each + * candidate giving two tries of retransmissions. + * But we give a candidate only two tries, if it + * actually reduces the MSS. + */ + tp->t_blackhole_enter = 2; + tp->t_blackhole_exit = tp->t_blackhole_enter; + if (isipv6) { +#ifdef INET6 + if (tp->t_maxseg > V_tcp_v6pmtud_blackhole_mss) + tp->t_blackhole_exit += 2; + if (tp->t_maxseg > V_tcp_v6mssdflt && + V_tcp_v6pmtud_blackhole_mss > V_tcp_v6mssdflt) + tp->t_blackhole_exit += 2; +#endif + } else { +#ifdef INET + if (tp->t_maxseg > V_tcp_pmtud_blackhole_mss) + tp->t_blackhole_exit += 2; + if (tp->t_maxseg > V_tcp_mssdflt && + V_tcp_pmtud_blackhole_mss > V_tcp_mssdflt) + tp->t_blackhole_exit += 2; +#endif + } + } if (((tp->t_flags2 & (TF2_PLPMTU_PMTUD|TF2_PLPMTU_MAXSEGSNT)) == (TF2_PLPMTU_PMTUD|TF2_PLPMTU_MAXSEGSNT)) && - (tp->t_rxtshift >= 2 && tp->t_rxtshift < 6 && - tp->t_rxtshift % 2 == 0)) { + (tp->t_rxtshift >= tp->t_blackhole_enter && + tp->t_rxtshift < tp->t_blackhole_exit && + (tp->t_rxtshift - tp->t_blackhole_enter) % 2 == 0)) { /* * Enter Path MTU Black-hole Detection mechanism: * - Disable Path MTU Discovery (IP "DF" bit). @@ -727,7 +751,8 @@ tcp_timer_rexmt(void * xtp) */ #ifdef INET6 if (isipv6 && - tp->t_maxseg > V_tcp_v6pmtud_blackhole_mss) { + tp->t_maxseg > V_tcp_v6pmtud_blackhole_mss && + V_tcp_v6pmtud_blackhole_mss > V_tcp_v6mssdflt) { /* Use the sysctl tuneable blackhole MSS. */ tp->t_maxseg = V_tcp_v6pmtud_blackhole_mss; TCPSTAT_INC(tcps_pmtud_blackhole_activated); @@ -746,7 +771,8 @@ tcp_timer_rexmt(void * xtp) else #endif #ifdef INET - if (tp->t_maxseg > V_tcp_pmtud_blackhole_mss) { + if (tp->t_maxseg > V_tcp_pmtud_blackhole_mss && + V_tcp_pmtud_blackhole_mss > V_tcp_mssdflt) { /* Use the sysctl tuneable blackhole MSS. */ tp->t_maxseg = V_tcp_pmtud_blackhole_mss; TCPSTAT_INC(tcps_pmtud_blackhole_activated); @@ -773,11 +799,9 @@ tcp_timer_rexmt(void * xtp) * with a lowered MTU, maybe this isn't a blackhole and * we restore the previous MSS and blackhole detection * flags. - * The limit '6' is determined by giving each probe - * stage (1448, 1188, 524) 2 chances to recover. */ if ((tp->t_flags2 & TF2_PLPMTU_BLACKHOLE) && - (tp->t_rxtshift >= 6)) { + (tp->t_rxtshift >= tp->t_blackhole_exit)) { tp->t_flags2 |= TF2_PLPMTU_PMTUD; tp->t_flags2 &= ~TF2_PLPMTU_BLACKHOLE; tp->t_maxseg = tp->t_pmtud_saved_maxseg; Modified: stable/12/sys/netinet/tcp_var.h ============================================================================== --- stable/12/sys/netinet/tcp_var.h Thu Sep 10 12:52:50 2020 (r365568) +++ stable/12/sys/netinet/tcp_var.h Thu Sep 10 12:54:46 2020 (r365569) @@ -169,6 +169,8 @@ struct tcpcb { u_int t_starttime; /* time connection was established */ u_int t_pmtud_saved_maxseg; /* pre-blackhole MSS */ + int t_blackhole_enter; /* when to enter blackhole detection */ + int t_blackhole_exit; /* when to exit blackhole detection */ u_int t_rttmin; /* minimum rtt allowed */ u_int t_rttbest; /* best rtt we've seen */ From owner-svn-src-all@freebsd.org Thu Sep 10 13:15:18 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 690003D6D7D; Thu, 10 Sep 2020 13:15:18 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BnKBG2B7jz40PG; Thu, 10 Sep 2020 13:15:18 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2F62E1363C; Thu, 10 Sep 2020 13:15:18 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08ADFIWW069017; Thu, 10 Sep 2020 13:15:18 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08ADFI7t069016; Thu, 10 Sep 2020 13:15:18 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202009101315.08ADFI7t069016@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 10 Sep 2020 13:15:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365570 - stable/12/sys/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/12/sys/netinet X-SVN-Commit-Revision: 365570 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.33 Precedence: list List-Id: "SVN commit messages 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, 10 Sep 2020 13:15:18 -0000 Author: tuexen Date: Thu Sep 10 13:15:17 2020 New Revision: 365570 URL: https://svnweb.freebsd.org/changeset/base/365570 Log: MFC r358621: When using automatically generated flow labels and using TCP SYN cookies, use the same flow label for the segments sent during the handshake and after the handshake. This fixes a bug by making sure that sc_flowlabel is always stored in network byte order. Modified: stable/12/sys/netinet/tcp_syncache.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/tcp_syncache.c ============================================================================== --- stable/12/sys/netinet/tcp_syncache.c Thu Sep 10 12:54:46 2020 (r365569) +++ stable/12/sys/netinet/tcp_syncache.c Thu Sep 10 13:15:17 2020 (r365570) @@ -2161,7 +2161,8 @@ syncookie_lookup(struct in_conninfo *inc, struct synca #ifdef INET6 case INC_ISIPV6: if (sotoinpcb(lso)->inp_flags & IN6P_AUTOFLOWLABEL) - sc->sc_flowlabel = sc->sc_iss & IPV6_FLOWLABEL_MASK; + sc->sc_flowlabel = + htonl(sc->sc_iss) & IPV6_FLOWLABEL_MASK; break; #endif } From owner-svn-src-all@freebsd.org Thu Sep 10 13:17:24 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2B38F3D6FA4; Thu, 10 Sep 2020 13:17:24 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BnKDh0MWnz40mD; Thu, 10 Sep 2020 13:17:24 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E3D1E133D1; Thu, 10 Sep 2020 13:17:23 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08ADHNQf069160; Thu, 10 Sep 2020 13:17:23 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08ADHNi1069159; Thu, 10 Sep 2020 13:17:23 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202009101317.08ADHNi1069159@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 10 Sep 2020 13:17:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365571 - in stable/12/sys/netinet: . tcp_stacks X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: in stable/12/sys/netinet: . tcp_stacks X-SVN-Commit-Revision: 365571 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.33 Precedence: list List-Id: "SVN commit messages 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, 10 Sep 2020 13:17:24 -0000 Author: tuexen Date: Thu Sep 10 13:17:23 2020 New Revision: 365571 URL: https://svnweb.freebsd.org/changeset/base/365571 Log: MFC r357101: Don't delay the ACK for a TCP segment with the CWR flag set. This allows the data sender to increase the CWND faster. Modified: stable/12/sys/netinet/tcp_input.c stable/12/sys/netinet/tcp_stacks/rack.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/tcp_input.c ============================================================================== --- stable/12/sys/netinet/tcp_input.c Thu Sep 10 13:15:17 2020 (r365570) +++ stable/12/sys/netinet/tcp_input.c Thu Sep 10 13:17:23 2020 (r365571) @@ -1610,8 +1610,10 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, stru * TCP ECN processing. */ if (tp->t_flags & TF_ECN_PERMIT) { - if (thflags & TH_CWR) + if (thflags & TH_CWR) { tp->t_flags &= ~TF_ECN_SND_ECE; + tp->t_flags |= TF_ACKNOW; + } switch (iptos & IPTOS_ECN_MASK) { case IPTOS_ECN_CE: tp->t_flags |= TF_ECN_SND_ECE; Modified: stable/12/sys/netinet/tcp_stacks/rack.c ============================================================================== --- stable/12/sys/netinet/tcp_stacks/rack.c Thu Sep 10 13:15:17 2020 (r365570) +++ stable/12/sys/netinet/tcp_stacks/rack.c Thu Sep 10 13:17:23 2020 (r365571) @@ -6733,8 +6733,10 @@ rack_hpts_do_segment(struct mbuf *m, struct tcphdr *th * this to occur after we've validated the segment. */ if (tp->t_flags & TF_ECN_PERMIT) { - if (thflags & TH_CWR) + if (thflags & TH_CWR) { tp->t_flags &= ~TF_ECN_SND_ECE; + tp->t_flags |= TF_ACKNOW; + } switch (iptos & IPTOS_ECN_MASK) { case IPTOS_ECN_CE: tp->t_flags |= TF_ECN_SND_ECE; From owner-svn-src-all@freebsd.org Thu Sep 10 13:27:54 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 48EBD3D726E; Thu, 10 Sep 2020 13:27:54 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BnKSp1DwFz41D3; Thu, 10 Sep 2020 13:27:54 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0F2C01391B; Thu, 10 Sep 2020 13:27:54 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08ADRrRO075320; Thu, 10 Sep 2020 13:27:53 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08ADRr88075318; Thu, 10 Sep 2020 13:27:53 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202009101327.08ADRr88075318@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 10 Sep 2020 13:27:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365572 - in stable/12/sys/netinet: . cc X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: in stable/12/sys/netinet: . cc X-SVN-Commit-Revision: 365572 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.33 Precedence: list List-Id: "SVN commit messages 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, 10 Sep 2020 13:27:54 -0000 Author: tuexen Date: Thu Sep 10 13:27:53 2020 New Revision: 365572 URL: https://svnweb.freebsd.org/changeset/base/365572 Log: MFC r356235: Fix delayed ACK generation for DCTCP. Manually changed to use TF_ECN_SND_ECE. Modified: stable/12/sys/netinet/cc/cc_dctcp.c stable/12/sys/netinet/tcp_input.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/cc/cc_dctcp.c ============================================================================== --- stable/12/sys/netinet/cc/cc_dctcp.c Thu Sep 10 13:17:23 2020 (r365571) +++ stable/12/sys/netinet/cc/cc_dctcp.c Thu Sep 10 13:27:53 2020 (r365572) @@ -272,9 +272,9 @@ dctcp_cong_signal(struct cc_var *ccv, uint32_t type) dctcp_data->bytes_total = 0; dctcp_data->save_sndnxt = CCV(ccv, snd_nxt); } else - CCV(ccv, snd_ssthresh) = + CCV(ccv, snd_ssthresh) = max((cwin - (((uint64_t)cwin * - dctcp_data->alpha) >> (DCTCP_SHIFT+1))), + dctcp_data->alpha) >> (DCTCP_SHIFT+1))), 2 * mss); CCV(ccv, snd_cwnd) = CCV(ccv, snd_ssthresh); ENTER_CONGRECOVERY(CCV(ccv, t_flags)); @@ -316,46 +316,43 @@ dctcp_post_recovery(struct cc_var *ccv) } /* - * Execute an additional ECN processing using ECN field in IP header and the CWR - * bit in TCP header. - * - * delay_ack == 0 - Delayed ACK disabled - * delay_ack == 1 - Delayed ACK enabled + * Execute an additional ECN processing using ECN field in IP header + * and the CWR bit in TCP header. */ - static void dctcp_ecnpkt_handler(struct cc_var *ccv) { struct dctcp *dctcp_data; uint32_t ccflag; - int delay_ack; + int acknow; dctcp_data = ccv->cc_data; ccflag = ccv->flags; - delay_ack = 1; + acknow = 0; /* * DCTCP responds with an ACK immediately when the CE state * in between this segment and the last segment has changed. */ if (ccflag & CCF_IPHDR_CE) { - if (!dctcp_data->ce_prev && (ccflag & CCF_DELACK)) - delay_ack = 0; - dctcp_data->ce_prev = 1; - CCV(ccv, t_flags) |= TF_ECN_SND_ECE; + if (!dctcp_data->ce_prev) { + acknow = 1; + dctcp_data->ce_prev = 1; + CCV(ccv, t_flags2) |= TF_ECN_SND_ECE; + } } else { - if (dctcp_data->ce_prev && (ccflag & CCF_DELACK)) - delay_ack = 0; - dctcp_data->ce_prev = 0; - CCV(ccv, t_flags) &= ~TF_ECN_SND_ECE; + if (dctcp_data->ce_prev) { + acknow = 1; + dctcp_data->ce_prev = 0; + CCV(ccv, t_flags2) &= ~TF_ECN_SND_ECE; + } } - /* DCTCP sets delayed ack when this segment sets the CWR flag. */ - if ((ccflag & CCF_DELACK) && (ccflag & CCF_TCPHDR_CWR)) - delay_ack = 1; - - if (delay_ack == 0) + if ((acknow) || (ccflag & CCF_TCPHDR_CWR)) { ccv->flags |= CCF_ACKNOW; + } else { + ccv->flags &= ~CCF_ACKNOW; + } } /* Modified: stable/12/sys/netinet/tcp_input.c ============================================================================== --- stable/12/sys/netinet/tcp_input.c Thu Sep 10 13:17:23 2020 (r365571) +++ stable/12/sys/netinet/tcp_input.c Thu Sep 10 13:27:53 2020 (r365572) @@ -516,15 +516,12 @@ cc_ecnpkt_handler(struct tcpcb *tp, struct tcphdr *th, else tp->ccv->flags &= ~CCF_TCPHDR_CWR; - if (tp->t_flags & TF_DELACK) - tp->ccv->flags |= CCF_DELACK; - else - tp->ccv->flags &= ~CCF_DELACK; - CC_ALGO(tp)->ecnpkt_handler(tp->ccv); - if (tp->ccv->flags & CCF_ACKNOW) + if (tp->ccv->flags & CCF_ACKNOW) { tcp_timer_activate(tp, TT_DELACK, tcp_delacktime); + tp->t_flags |= TF_ACKNOW; + } } } From owner-svn-src-all@freebsd.org Thu Sep 10 13:44:37 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 028983D792C; Thu, 10 Sep 2020 13:44:37 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BnKr457Jfz42HR; Thu, 10 Sep 2020 13:44:36 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9264913C9B; Thu, 10 Sep 2020 13:44:36 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08ADiafu087365; Thu, 10 Sep 2020 13:44:36 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08ADiaRT087363; Thu, 10 Sep 2020 13:44:36 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202009101344.08ADiaRT087363@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 10 Sep 2020 13:44:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365573 - in stable/12/sys/netinet: . tcp_stacks X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: in stable/12/sys/netinet: . tcp_stacks X-SVN-Commit-Revision: 365573 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.33 Precedence: list List-Id: "SVN commit messages 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, 10 Sep 2020 13:44:37 -0000 Author: tuexen Date: Thu Sep 10 13:44:35 2020 New Revision: 365573 URL: https://svnweb.freebsd.org/changeset/base/365573 Log: MFC r357114: As a TCP client only enable ECN when the corresponding sysctl variable indicates that ECN should be negotiated for the client side. Modified: stable/12/sys/netinet/tcp_input.c stable/12/sys/netinet/tcp_stacks/rack.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/tcp_input.c ============================================================================== --- stable/12/sys/netinet/tcp_input.c Thu Sep 10 13:27:53 2020 (r365572) +++ stable/12/sys/netinet/tcp_input.c Thu Sep 10 13:44:35 2020 (r365573) @@ -2044,7 +2044,7 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, stru tp->t_flags |= TF_ACKNOW; if (((thflags & (TH_CWR | TH_ECE)) == TH_ECE) && - V_tcp_do_ecn) { + (V_tcp_do_ecn == 1)) { tp->t_flags |= TF_ECN_PERMIT; TCPSTAT_INC(tcps_ecn_shs); } Modified: stable/12/sys/netinet/tcp_stacks/rack.c ============================================================================== --- stable/12/sys/netinet/tcp_stacks/rack.c Thu Sep 10 13:27:53 2020 (r365572) +++ stable/12/sys/netinet/tcp_stacks/rack.c Thu Sep 10 13:44:35 2020 (r365573) @@ -5416,7 +5416,8 @@ rack_do_syn_sent(struct mbuf *m, struct tcphdr *th, st tp->t_flags |= TF_ACKNOW; } - if ((thflags & TH_ECE) && V_tcp_do_ecn) { + if (((thflags & (TH_CWR | TH_ECE)) == TH_ECE) && + (V_tcp_do_ecn == 1)) { tp->t_flags |= TF_ECN_PERMIT; TCPSTAT_INC(tcps_ecn_shs); } From owner-svn-src-all@freebsd.org Thu Sep 10 13:57:57 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DEF203D7CE4; Thu, 10 Sep 2020 13:57:57 +0000 (UTC) (envelope-from rhurlin@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BnL7T5dpgz42x8; Thu, 10 Sep 2020 13:57:57 +0000 (UTC) (envelope-from rhurlin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 A4C0C13FD3; Thu, 10 Sep 2020 13:57:57 +0000 (UTC) (envelope-from rhurlin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08ADvv7C094143; Thu, 10 Sep 2020 13:57:57 GMT (envelope-from rhurlin@FreeBSD.org) Received: (from rhurlin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08ADvvX0094142; Thu, 10 Sep 2020 13:57:57 GMT (envelope-from rhurlin@FreeBSD.org) Message-Id: <202009101357.08ADvvX0094142@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rhurlin set sender to rhurlin@FreeBSD.org using -f From: Rainer Hurling Date: Thu, 10 Sep 2020 13:57:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365574 - head/share/misc X-SVN-Group: head X-SVN-Commit-Author: rhurlin X-SVN-Commit-Paths: head/share/misc X-SVN-Commit-Revision: 365574 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.33 Precedence: list List-Id: "SVN commit messages 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, 10 Sep 2020 13:57:57 -0000 Author: rhurlin (ports committer) Date: Thu Sep 10 13:57:57 2020 New Revision: 365574 URL: https://svnweb.freebsd.org/changeset/base/365574 Log: Add author entity for rhurlin, part 2 Forgot to submit step 5 from procedure 1 in Chap. 6 of the Committers Guide: Update Mentor and Mentee Information Reviewed by: arrowd (mentor), tcberner (mentor) Approved by: arrowd (mentor), tcberner (mentor) Modified: head/share/misc/committers-ports.dot Modified: head/share/misc/committers-ports.dot ============================================================================== --- head/share/misc/committers-ports.dot Thu Sep 10 13:44:35 2020 (r365573) +++ head/share/misc/committers-ports.dot Thu Sep 10 13:57:57 2020 (r365574) @@ -229,6 +229,7 @@ rafan [label="Rong-En Fan\nrafan@FreeBSD.org\n2006/06/ rakuco [label="Raphael Kubo da Costa\nrakuco@FreeBSD.org\n2011/08/22"] rene [label="Rene Ladan\nrene@FreeBSD.org\n2010/04/11"] rezny [label="Matthew Rezny\nrezny@FreeBSD.org\n2017/01/09"] +rhurlin [label="Rainer Hurling\nrhurlin@FreeBSD.org\n2020/08/31"] riggs [label="Thomas Zander\nriggs@FreeBSD.org\n2014/01/09"] rigoletto [label="Alexandre C. Guimaraes\nrigoletto@FreeBSD.org\n2018/10/01"] rm [label="Ruslan Makhmatkhanov\nrm@FreeBSD.org\n2011/11/06"] @@ -320,6 +321,8 @@ araujo -> pclin araujo -> pgollucci araujo -> samm +arrowd -> rhurlin + arved -> markus arved -> stefan @@ -746,6 +749,7 @@ tcberner -> joneum tcberner -> kai tcberner -> lbartoletti tcberner -> pkubaj +tcberner -> rhurlin tcberner -> rigoletto tcberner -> salvadore tcberner -> yuri From owner-svn-src-all@freebsd.org Thu Sep 10 14:11:25 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 655053D8351; Thu, 10 Sep 2020 14:11:25 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BnLR126dRz43YG; Thu, 10 Sep 2020 14:11:25 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 2CC8C13BFC; Thu, 10 Sep 2020 14:11:25 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08AEBPF7002568; Thu, 10 Sep 2020 14:11:25 GMT (envelope-from arichardson@FreeBSD.org) Received: (from arichardson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08AEBPba002567; Thu, 10 Sep 2020 14:11:25 GMT (envelope-from arichardson@FreeBSD.org) Message-Id: <202009101411.08AEBPba002567@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arichardson set sender to arichardson@FreeBSD.org using -f From: Alex Richardson Date: Thu, 10 Sep 2020 14:11:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365575 - head X-SVN-Group: head X-SVN-Commit-Author: arichardson X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 365575 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.33 Precedence: list List-Id: "SVN commit messages 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, 10 Sep 2020 14:11:25 -0000 Author: arichardson Date: Thu Sep 10 14:11:24 2020 New Revision: 365575 URL: https://svnweb.freebsd.org/changeset/base/365575 Log: Use the correct config names for some .clang-format entries Those values are enum entries and should use "Never" instead of "false". clang-format currently accepts false, but it's better to use the correct syntax in case that changes in the future. Modified: head/.clang-format (contents, props changed) Modified: head/.clang-format ============================================================================== --- head/.clang-format Thu Sep 10 13:57:57 2020 (r365574) +++ head/.clang-format Thu Sep 10 14:11:24 2020 (r365575) @@ -9,10 +9,10 @@ AlignEscapedNewlines: Left AlignOperands: false AlignTrailingComments: false AllowAllParametersOfDeclarationOnNextLine: false -AllowShortBlocksOnASingleLine: false +AllowShortBlocksOnASingleLine: Never AllowShortCaseLabelsOnASingleLine: false AllowShortFunctionsOnASingleLine: InlineOnly -AllowShortIfStatementsOnASingleLine: false +AllowShortIfStatementsOnASingleLine: Never AllowShortLoopsOnASingleLine: false AlwaysBreakAfterReturnType: TopLevelDefinitions AlwaysBreakBeforeMultilineStrings: false From owner-svn-src-all@freebsd.org Thu Sep 10 14:11:32 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 41F2E3D8163; Thu, 10 Sep 2020 14:11:32 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BnLR64N3Mz43kS; Thu, 10 Sep 2020 14:11:30 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 0AF4313F67; Thu, 10 Sep 2020 14:11:29 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08AEBTcH002622; Thu, 10 Sep 2020 14:11:29 GMT (envelope-from arichardson@FreeBSD.org) Received: (from arichardson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08AEBTQI002621; Thu, 10 Sep 2020 14:11:29 GMT (envelope-from arichardson@FreeBSD.org) Message-Id: <202009101411.08AEBTQI002621@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arichardson set sender to arichardson@FreeBSD.org using -f From: Alex Richardson Date: Thu, 10 Sep 2020 14:11:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365576 - head X-SVN-Group: head X-SVN-Commit-Author: arichardson X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 365576 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.33 Precedence: list List-Id: "SVN commit messages 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, 10 Sep 2020 14:11:32 -0000 Author: arichardson Date: Thu Sep 10 14:11:29 2020 New Revision: 365576 URL: https://svnweb.freebsd.org/changeset/base/365576 Log: Set AlignTrailingComments in the clang-format config This seems to be fairly common in existing code and often looks better when adding trailing comments to e.g. enumerators or array initializers. See D26340 for more context. Reviewed By: emaste Differential Revision: https://reviews.freebsd.org/D26391 Modified: head/.clang-format (contents, props changed) Modified: head/.clang-format ============================================================================== --- head/.clang-format Thu Sep 10 14:11:24 2020 (r365575) +++ head/.clang-format Thu Sep 10 14:11:29 2020 (r365576) @@ -7,7 +7,7 @@ AlignConsecutiveAssignments: false AlignConsecutiveDeclarations: false AlignEscapedNewlines: Left AlignOperands: false -AlignTrailingComments: false +AlignTrailingComments: true AllowAllParametersOfDeclarationOnNextLine: false AllowShortBlocksOnASingleLine: Never AllowShortCaseLabelsOnASingleLine: false From owner-svn-src-all@freebsd.org Thu Sep 10 14:12:26 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 932733D8244; Thu, 10 Sep 2020 14:12:26 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BnLSB3Mf1z44CJ; Thu, 10 Sep 2020 14:12:26 +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 56E7614297; Thu, 10 Sep 2020 14:12:26 +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 08AECQHE006515; Thu, 10 Sep 2020 14:12:26 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08AECPMo006512; Thu, 10 Sep 2020 14:12:25 GMT (envelope-from br@FreeBSD.org) Message-Id: <202009101412.08AECPMo006512@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Thu, 10 Sep 2020 14:12:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365577 - in head/sys: dev/iommu x86/iommu X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: in head/sys: dev/iommu x86/iommu X-SVN-Commit-Revision: 365577 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.33 Precedence: list List-Id: "SVN commit messages 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, 10 Sep 2020 14:12:26 -0000 Author: br Date: Thu Sep 10 14:12:25 2020 New Revision: 365577 URL: https://svnweb.freebsd.org/changeset/base/365577 Log: Move the rid variable to the generic iommu context. It could be used in various IOMMU platforms, not only DMAR. Reviewed by: kib Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D26373 Modified: head/sys/dev/iommu/iommu.h head/sys/x86/iommu/intel_ctx.c head/sys/x86/iommu/intel_dmar.h Modified: head/sys/dev/iommu/iommu.h ============================================================================== --- head/sys/dev/iommu/iommu.h Thu Sep 10 14:11:29 2020 (r365576) +++ head/sys/dev/iommu/iommu.h Thu Sep 10 14:12:25 2020 (r365577) @@ -135,6 +135,7 @@ struct iommu_ctx { u_long loads; /* atomic updates, for stat only */ u_long unloads; /* same */ u_int flags; /* (u) */ + uint16_t rid; /* (c) pci RID */ }; /* struct iommu_ctx flags */ Modified: head/sys/x86/iommu/intel_ctx.c ============================================================================== --- head/sys/x86/iommu/intel_ctx.c Thu Sep 10 14:11:29 2020 (r365576) +++ head/sys/x86/iommu/intel_ctx.c Thu Sep 10 14:12:25 2020 (r365577) @@ -118,9 +118,9 @@ dmar_map_ctx_entry(struct dmar_ctx *ctx, struct sf_buf dmar = CTX2DMAR(ctx); - ctxp = dmar_map_pgtbl(dmar->ctx_obj, 1 + - PCI_RID2BUS(ctx->rid), IOMMU_PGF_NOALLOC | IOMMU_PGF_WAITOK, sfp); - ctxp += ctx->rid & 0xff; + ctxp = dmar_map_pgtbl(dmar->ctx_obj, 1 + PCI_RID2BUS(ctx->context.rid), + IOMMU_PGF_NOALLOC | IOMMU_PGF_WAITOK, sfp); + ctxp += ctx->context.rid & 0xff; return (ctxp); } @@ -386,7 +386,7 @@ dmar_ctx_alloc(struct dmar_domain *domain, uint16_t ri ctx->context.domain = DOM2IODOM(domain); ctx->context.tag = malloc(sizeof(struct bus_dma_tag_iommu), M_DMAR_CTX, M_WAITOK | M_ZERO); - ctx->rid = rid; + ctx->context.rid = rid; ctx->refs = 1; return (ctx); } @@ -643,8 +643,9 @@ dmar_move_ctx_to_domain(struct dmar_domain *domain, st error = dmar_flush_for_ctx_entry(dmar, true); /* If flush failed, rolling back would not work as well. */ printf("dmar%d rid %x domain %d->%d %s-mapped\n", - dmar->iommu.unit, ctx->rid, old_domain->domain, domain->domain, - (domain->iodom.flags & IOMMU_DOMAIN_IDMAP) != 0 ? "id" : "re"); + dmar->iommu.unit, ctx->context.rid, old_domain->domain, + domain->domain, (domain->iodom.flags & IOMMU_DOMAIN_IDMAP) != 0 ? + "id" : "re"); dmar_unref_domain_locked(dmar, old_domain); TD_PINNED_ASSERT; return (error); @@ -776,7 +777,7 @@ dmar_find_ctx_locked(struct dmar_unit *dmar, uint16_t LIST_FOREACH(domain, &dmar->domains, link) { LIST_FOREACH(ctx, &domain->contexts, link) { - if (ctx->rid == rid) + if (ctx->context.rid == rid) return (ctx); } } Modified: head/sys/x86/iommu/intel_dmar.h ============================================================================== --- head/sys/x86/iommu/intel_dmar.h Thu Sep 10 14:11:29 2020 (r365576) +++ head/sys/x86/iommu/intel_dmar.h Thu Sep 10 14:12:25 2020 (r365577) @@ -75,7 +75,6 @@ struct dmar_domain { struct dmar_ctx { struct iommu_ctx context; - uint16_t rid; /* (c) pci RID */ uint64_t last_fault_rec[2]; /* Last fault reported */ LIST_ENTRY(dmar_ctx) link; /* (u) Member in the domain list */ u_int refs; /* (u) References from tags */ From owner-svn-src-all@freebsd.org Thu Sep 10 14:13:50 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 11B943D8447; Thu, 10 Sep 2020 14:13:50 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BnLTn6hv6z44D4; Thu, 10 Sep 2020 14:13:49 +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 C954D14397; Thu, 10 Sep 2020 14:13:49 +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 08AEDnsL006617; Thu, 10 Sep 2020 14:13:49 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08AEDnUc006616; Thu, 10 Sep 2020 14:13:49 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <202009101413.08AEDnUc006616@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Thu, 10 Sep 2020 14:13:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365578 - head/stand/efi/loader/arch/arm64 X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/stand/efi/loader/arch/arm64 X-SVN-Commit-Revision: 365578 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.33 Precedence: list List-Id: "SVN commit messages 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, 10 Sep 2020 14:13:50 -0000 Author: andrew Date: Thu Sep 10 14:13:49 2020 New Revision: 365578 URL: https://svnweb.freebsd.org/changeset/base/365578 Log: Ignore the .interp section in the arm64 EFI loader When building the loader an unneeded .interp section may be added. Move this to the unused section region so offsets of used sections don't change. Obtained from: CheriBSD Sponsored by: Innovate UK Modified: head/stand/efi/loader/arch/arm64/ldscript.arm64 Modified: head/stand/efi/loader/arch/arm64/ldscript.arm64 ============================================================================== --- head/stand/efi/loader/arch/arm64/ldscript.arm64 Thu Sep 10 14:12:25 2020 (r365577) +++ head/stand/efi/loader/arch/arm64/ldscript.arm64 Thu Sep 10 14:13:49 2020 (r365578) @@ -80,6 +80,7 @@ SECTIONS _edata = .; /* Unused sections */ + .interp : { *(.interp) } .dynstr : { *(.dynstr) } .hash : { *(.hash) } } From owner-svn-src-all@freebsd.org Thu Sep 10 14:22:56 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A0E393D8A46; Thu, 10 Sep 2020 14:22:56 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BnLhJ3mwFz44k9; Thu, 10 Sep 2020 14:22:56 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from auth2-smtp.messagingengine.com (auth2-smtp.messagingengine.com [66.111.4.228]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: bdragon/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 649071A66F; Thu, 10 Sep 2020 14:22:56 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailauth.nyi.internal (Postfix) with ESMTP id CF87027C0054; Thu, 10 Sep 2020 10:22:55 -0400 (EDT) Received: from imap1 ([10.202.2.51]) by compute4.internal (MEProxy); Thu, 10 Sep 2020 10:22:55 -0400 X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduiedrudehjedgjedtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne gfrhhlucfvnfffucdluddtmdenucfjughrpefofgggkfgjfhffhffvufgtsehttdertder redtnecuhfhrohhmpedfuehrrghnughonhcuuegvrhhgrhgvnhdfuceosggurhgrghhonh eshfhrvggvuefuffdrohhrgheqnecuggftrfgrthhtvghrnhephfdvgfettdeuvedujeeu gffhkeekjeefgfelkeelvedvfeeuhfelveefleeluddtnecuffhomhgrihhnpehfrhgvvg gsshgurdhorhhgnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhf rhhomhepsggurhgrghhonhdomhgvshhmthhprghuthhhphgvrhhsohhnrghlihhthidqud dtgedvfeehkeeigedqudekuddtkeehuddqsggurhgrghhonheppefhrhgvvgeuufffrdho rhhgsehimhgrphdrtggt X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id 83BA7C200A6; Thu, 10 Sep 2020 10:22:55 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.3.0-259-g88fbbfa-fm-20200903.003-g88fbbfa3 Mime-Version: 1.0 Message-Id: <105aee92-6efe-4022-9ffb-b49a79b384b3@www.fastmail.com> In-Reply-To: <202009101413.08AEDnUc006616@repo.freebsd.org> References: <202009101413.08AEDnUc006616@repo.freebsd.org> Date: Thu, 10 Sep 2020 09:22:35 -0500 From: "Brandon Bergren" To: "Andrew Turner" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r365578 - head/stand/efi/loader/arch/arm64 Content-Type: text/plain X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 10 Sep 2020 14:22:56 -0000 You can truly get rid of it with /DISCARD/ and shave the bytes off entirely, by the way. On Thu, Sep 10, 2020, at 9:13 AM, Andrew Turner wrote: > Author: andrew > Date: Thu Sep 10 14:13:49 2020 > New Revision: 365578 > URL: https://svnweb.freebsd.org/changeset/base/365578 > > Log: > Ignore the .interp section in the arm64 EFI loader > > When building the loader an unneeded .interp section may be added. Move > this to the unused section region so offsets of used sections don't > change. > > Obtained from: CheriBSD > Sponsored by: Innovate UK > > Modified: > head/stand/efi/loader/arch/arm64/ldscript.arm64 > > Modified: head/stand/efi/loader/arch/arm64/ldscript.arm64 > ============================================================================== > --- head/stand/efi/loader/arch/arm64/ldscript.arm64 Thu Sep 10 14:12:25 > 2020 (r365577) > +++ head/stand/efi/loader/arch/arm64/ldscript.arm64 Thu Sep 10 14:13:49 > 2020 (r365578) > @@ -80,6 +80,7 @@ SECTIONS > _edata = .; > > /* Unused sections */ > + .interp : { *(.interp) } > .dynstr : { *(.dynstr) } > .hash : { *(.hash) } > } > -- Brandon Bergren bdragon@FreeBSD.org From owner-svn-src-all@freebsd.org Thu Sep 10 14:26:44 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0E5693D8CC2; Thu, 10 Sep 2020 14:26:44 +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 4BnLmg5CZZz44mr; Thu, 10 Sep 2020 14:26:43 +0000 (UTC) (envelope-from andrew@freebsd.org) Received: from [192.168.42.12] (cpc91220-cmbg18-2-0-cust60.5-4.cable.virginm.net [81.104.142.61]) by fry.fubar.geek.nz (Postfix) with ESMTPSA id 9AC6F4E70F; Thu, 10 Sep 2020 14:26:06 +0000 (UTC) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.15\)) Subject: Re: svn commit: r365578 - head/stand/efi/loader/arch/arm64 From: Andrew Turner In-Reply-To: <105aee92-6efe-4022-9ffb-b49a79b384b3@www.fastmail.com> Date: Thu, 10 Sep 2020 15:26:05 +0100 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <044B70B9-21D2-4143-8EFF-9EA716BFC108@freebsd.org> References: <202009101413.08AEDnUc006616@repo.freebsd.org> <105aee92-6efe-4022-9ffb-b49a79b384b3@www.fastmail.com> To: Brandon Bergren X-Mailer: Apple Mail (2.3445.104.15) X-Rspamd-Queue-Id: 4BnLmg5CZZz44mr X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:14061, ipnet:139.59.160.0/20, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 10 Sep 2020 14:26:44 -0000 We already discard it via objcopy when converting from elf -> EFI as we = only copy the sections needed in the final EFI file. Andrew > On 10 Sep 2020, at 15:22, Brandon Bergren wrote: >=20 > You can truly get rid of it with /DISCARD/ and shave the bytes off = entirely, by the way. >=20 > On Thu, Sep 10, 2020, at 9:13 AM, Andrew Turner wrote: >> Author: andrew >> Date: Thu Sep 10 14:13:49 2020 >> New Revision: 365578 >> URL: https://svnweb.freebsd.org/changeset/base/365578 >>=20 >> Log: >> Ignore the .interp section in the arm64 EFI loader >>=20 >> When building the loader an unneeded .interp section may be added. = Move >> this to the unused section region so offsets of used sections don't >> change. >>=20 >> Obtained from: CheriBSD >> Sponsored by: Innovate UK >>=20 >> Modified: >> head/stand/efi/loader/arch/arm64/ldscript.arm64 >>=20 >> Modified: head/stand/efi/loader/arch/arm64/ldscript.arm64 >> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >> --- head/stand/efi/loader/arch/arm64/ldscript.arm64 Thu Sep 10 = 14:12:25=20 >> 2020 (r365577) >> +++ head/stand/efi/loader/arch/arm64/ldscript.arm64 Thu Sep 10 = 14:13:49=20 >> 2020 (r365578) >> @@ -80,6 +80,7 @@ SECTIONS >> _edata =3D .; >>=20 >> /* Unused sections */ >> + .interp : { *(.interp) } >> .dynstr : { *(.dynstr) } >> .hash : { *(.hash) } >> } >>=20 >=20 > --=20 > Brandon Bergren > bdragon@FreeBSD.org >=20 From owner-svn-src-all@freebsd.org Thu Sep 10 14:58:47 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9967E3D9B1C; Thu, 10 Sep 2020 14:58:47 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BnMTg3VVbz46qp; Thu, 10 Sep 2020 14:58:47 +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 5B5E714562; Thu, 10 Sep 2020 14:58:47 +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 08AEwlpE031136; Thu, 10 Sep 2020 14:58:47 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08AEwlLT031134; Thu, 10 Sep 2020 14:58:47 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <202009101458.08AEwlLT031134@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Thu, 10 Sep 2020 14:58:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365579 - in head/sys: arm64/include dev/gpio X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: in head/sys: arm64/include dev/gpio X-SVN-Commit-Revision: 365579 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.33 Precedence: list List-Id: "SVN commit messages 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, 10 Sep 2020 14:58:47 -0000 Author: andrew Date: Thu Sep 10 14:58:46 2020 New Revision: 365579 URL: https://svnweb.freebsd.org/changeset/base/365579 Log: Move the pl061 acpi attachment earlier As the pl061 driver can be an interrupt controller attach it earlier in the boot so other drivers can use it. Use a new GPIO xref to not conflict with the existing root interrupt controller. Sponsored by: Innovate UK Modified: head/sys/arm64/include/intr.h head/sys/dev/gpio/pl061_acpi.c Modified: head/sys/arm64/include/intr.h ============================================================================== --- head/sys/arm64/include/intr.h Thu Sep 10 14:13:49 2020 (r365578) +++ head/sys/arm64/include/intr.h Thu Sep 10 14:58:46 2020 (r365579) @@ -51,6 +51,7 @@ void intr_ipi_dispatch(u_int, struct trapframe *); #ifdef DEV_ACPI #define ACPI_INTR_XREF 1 #define ACPI_MSI_XREF 2 +#define ACPI_GPIO_XREF 3 #endif #endif /* _MACHINE_INTR_H */ Modified: head/sys/dev/gpio/pl061_acpi.c ============================================================================== --- head/sys/dev/gpio/pl061_acpi.c Thu Sep 10 14:13:49 2020 (r365578) +++ head/sys/dev/gpio/pl061_acpi.c Thu Sep 10 14:58:46 2020 (r365579) @@ -76,7 +76,7 @@ pl061_acpi_attach(device_t dev) if (error != 0) return (error); - if (!intr_pic_register(dev, ACPI_INTR_XREF)) { + if (!intr_pic_register(dev, ACPI_GPIO_XREF)) { device_printf(dev, "couldn't register PIC\n"); pl061_detach(dev); error = ENXIO; @@ -98,6 +98,7 @@ DEFINE_CLASS_1(gpio, pl061_acpi_driver, pl061_acpi_met static devclass_t pl061_devclass; -DRIVER_MODULE(pl061, acpi, pl061_driver, pl061_devclass, NULL, NULL); +EARLY_DRIVER_MODULE(pl061, acpi, pl061_acpi_driver, pl061_devclass, NULL, NULL, + BUS_PASS_INTERRUPT + BUS_PASS_ORDER_LATE); MODULE_DEPEND(pl061, acpi, 1, 1, 1); MODULE_DEPEND(pl061, gpiobus, 1, 1, 1); From owner-svn-src-all@freebsd.org Thu Sep 10 15:37:10 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E68293DA369; Thu, 10 Sep 2020 15:37:10 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BnNKy5s4kz49Zq; Thu, 10 Sep 2020 15:37:10 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 AC3DC1521A; Thu, 10 Sep 2020 15:37:10 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08AFbAVX055791; Thu, 10 Sep 2020 15:37:10 GMT (envelope-from arichardson@FreeBSD.org) Received: (from arichardson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08AFb8po055779; Thu, 10 Sep 2020 15:37:08 GMT (envelope-from arichardson@FreeBSD.org) Message-Id: <202009101537.08AFb8po055779@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arichardson set sender to arichardson@FreeBSD.org using -f From: Alex Richardson Date: Thu, 10 Sep 2020 15:37:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365580 - in head: cddl/lib/drti cddl/lib/libctf cddl/lib/libdtrace cddl/usr.bin/ctfconvert cddl/usr.bin/ctfdump cddl/usr.bin/ctfmerge cddl/usr.sbin/dtrace cddl/usr.sbin/lockstat cddl/u... X-SVN-Group: head X-SVN-Commit-Author: arichardson X-SVN-Commit-Paths: in head: cddl/lib/drti cddl/lib/libctf cddl/lib/libdtrace cddl/usr.bin/ctfconvert cddl/usr.bin/ctfdump cddl/usr.bin/ctfmerge cddl/usr.sbin/dtrace cddl/usr.sbin/lockstat cddl/usr.sbin/plockstat cddl/us... X-SVN-Commit-Revision: 365580 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.33 Precedence: list List-Id: "SVN commit messages 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, 10 Sep 2020 15:37:11 -0000 Author: arichardson Date: Thu Sep 10 15:37:07 2020 New Revision: 365580 URL: https://svnweb.freebsd.org/changeset/base/365580 Log: Remove -I flag for include path that doesn't exist Found this while trying to get macOS bootstrap to work again after OpenZFS merge. Reviewed By: #zfs, freqlabs Differential Revision: https://reviews.freebsd.org/D26192 Modified: head/cddl/lib/drti/Makefile head/cddl/lib/libctf/Makefile head/cddl/lib/libdtrace/Makefile head/cddl/usr.bin/ctfconvert/Makefile head/cddl/usr.bin/ctfdump/Makefile head/cddl/usr.bin/ctfmerge/Makefile head/cddl/usr.sbin/dtrace/Makefile head/cddl/usr.sbin/lockstat/Makefile head/cddl/usr.sbin/plockstat/Makefile head/cddl/usr.sbin/zfsd/Makefile.common head/lib/libproc/Makefile Modified: head/cddl/lib/drti/Makefile ============================================================================== --- head/cddl/lib/drti/Makefile Thu Sep 10 14:58:46 2020 (r365579) +++ head/cddl/lib/drti/Makefile Thu Sep 10 15:37:07 2020 (r365580) @@ -12,7 +12,6 @@ CLEANFILES= ${FILES} # These FILES qualify as libraries for the purpose of LIBRARIES_ONLY. .undef LIBRARIES_ONLY CFLAGS+= -DIN_BASE -CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libspl/include/os/freebsd/spl CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/include CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libspl/include/ CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libspl/include/os/freebsd Modified: head/cddl/lib/libctf/Makefile ============================================================================== --- head/cddl/lib/libctf/Makefile Thu Sep 10 14:58:46 2020 (r365579) +++ head/cddl/lib/libctf/Makefile Thu Sep 10 15:37:07 2020 (r365580) @@ -22,7 +22,6 @@ WARNS?= 2 CFLAGS+= -DCTF_OLD_VERSIONS CFLAGS+= -DIN_BASE -CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libspl/include/os/freebsd/spl CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/include CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libspl/include/ CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libspl/include/os/freebsd Modified: head/cddl/lib/libdtrace/Makefile ============================================================================== --- head/cddl/lib/libdtrace/Makefile Thu Sep 10 14:58:46 2020 (r365579) +++ head/cddl/lib/libdtrace/Makefile Thu Sep 10 15:37:07 2020 (r365580) @@ -67,7 +67,6 @@ FILESMODE= ${NOBINMODE} WARNS?= 1 CFLAGS+= -DIN_BASE -CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libspl/include/os/freebsd/spl CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/include CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libspl/include/ CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libspl/include/os/freebsd Modified: head/cddl/usr.bin/ctfconvert/Makefile ============================================================================== --- head/cddl/usr.bin/ctfconvert/Makefile Thu Sep 10 14:58:46 2020 (r365579) +++ head/cddl/usr.bin/ctfconvert/Makefile Thu Sep 10 15:37:07 2020 (r365580) @@ -31,7 +31,6 @@ CFLAGS+= -DIN_BASE CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/include CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libspl/include/ CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libspl/include/os/freebsd -CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libspl/include/os/freebsd/spl CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/include CFLAGS+= -I${SRCTOP}/sys/cddl/compat/opensolaris \ -I${SRCTOP}/cddl/compat/opensolaris/include \ Modified: head/cddl/usr.bin/ctfdump/Makefile ============================================================================== --- head/cddl/usr.bin/ctfdump/Makefile Thu Sep 10 14:58:46 2020 (r365579) +++ head/cddl/usr.bin/ctfdump/Makefile Thu Sep 10 15:37:07 2020 (r365580) @@ -12,7 +12,6 @@ CFLAGS+= -DIN_BASE CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/include CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libspl/include/ CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libspl/include/os/freebsd -CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libspl/include/os/freebsd/spl CFLAGS+= -I${SRCTOP}/sys CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/include CFLAGS+= -I${OPENSOLARIS_USR_DISTDIR} \ Modified: head/cddl/usr.bin/ctfmerge/Makefile ============================================================================== --- head/cddl/usr.bin/ctfmerge/Makefile Thu Sep 10 14:58:46 2020 (r365579) +++ head/cddl/usr.bin/ctfmerge/Makefile Thu Sep 10 15:37:07 2020 (r365580) @@ -29,7 +29,6 @@ CFLAGS+= -DIN_BASE CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/include CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libspl/include/ CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libspl/include/os/freebsd -CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libspl/include/os/freebsd/spl CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/include CFLAGS+= -I${SRCTOP}/sys/cddl/compat/opensolaris \ -I${SRCTOP}/cddl/compat/opensolaris/include \ Modified: head/cddl/usr.sbin/dtrace/Makefile ============================================================================== --- head/cddl/usr.sbin/dtrace/Makefile Thu Sep 10 14:58:46 2020 (r365579) +++ head/cddl/usr.sbin/dtrace/Makefile Thu Sep 10 15:37:07 2020 (r365580) @@ -14,7 +14,6 @@ CFLAGS+= -DIN_BASE CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/include CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libspl/include/ CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libspl/include/os/freebsd -CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libspl/include/os/freebsd/spl CFLAGS+= -I${SRCTOP}/sys CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/include CFLAGS+= -I${SRCTOP}/sys/cddl/compat/opensolaris \ Modified: head/cddl/usr.sbin/lockstat/Makefile ============================================================================== --- head/cddl/usr.sbin/lockstat/Makefile Thu Sep 10 14:58:46 2020 (r365579) +++ head/cddl/usr.sbin/lockstat/Makefile Thu Sep 10 15:37:07 2020 (r365580) @@ -12,7 +12,6 @@ CFLAGS+= -DIN_BASE CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/include CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libspl/include/ CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libspl/include/os/freebsd -CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libspl/include/os/freebsd/spl CFLAGS+= -I${SRCTOP}/sys CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/include CFLAGS+= -I${SRCTOP}/sys/cddl/compat/opensolaris Modified: head/cddl/usr.sbin/plockstat/Makefile ============================================================================== --- head/cddl/usr.sbin/plockstat/Makefile Thu Sep 10 14:58:46 2020 (r365579) +++ head/cddl/usr.sbin/plockstat/Makefile Thu Sep 10 15:37:07 2020 (r365580) @@ -12,7 +12,6 @@ CFLAGS+= -DIN_BASE CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/include CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libspl/include/ CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libspl/include/os/freebsd -CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libspl/include/os/freebsd/spl CFLAGS+= -I${SRCTOP}/sys CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/include CFLAGS+= -I${SRCTOP}/sys/cddl/compat/opensolaris \ Modified: head/cddl/usr.sbin/zfsd/Makefile.common ============================================================================== --- head/cddl/usr.sbin/zfsd/Makefile.common Thu Sep 10 14:58:46 2020 (r365579) +++ head/cddl/usr.sbin/zfsd/Makefile.common Thu Sep 10 15:37:07 2020 (r365580) @@ -19,7 +19,6 @@ CFLAGS+= -DIN_BASE CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/include CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libspl/include CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libspl/include/os/freebsd -CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libspl/include/os/freebsd/spl CFLAGS+= -I${SRCTOP}/sys CFLAGS+= -include ${SRCTOP}/sys/contrib/openzfs/include/os/freebsd/spl/sys/ccompile.h CFLAGS+= -I${SRCTOP}/cddl/usr.sbin Modified: head/lib/libproc/Makefile ============================================================================== --- head/lib/libproc/Makefile Thu Sep 10 14:58:46 2020 (r365579) +++ head/lib/libproc/Makefile Thu Sep 10 15:37:07 2020 (r365580) @@ -30,7 +30,6 @@ LIBADD+= elf procstat rtld_db util LIBADD+= ctf IGNORE_PRAGMA= YES CFLAGS+= -DIN_BASE -CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libspl/include/os/freebsd/spl CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/include CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libspl/include/ CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libspl/include/os/freebsd From owner-svn-src-all@freebsd.org Thu Sep 10 15:37:17 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4B4263DA44D; Thu, 10 Sep 2020 15:37:17 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BnNL42yZ8z49dd; Thu, 10 Sep 2020 15:37:16 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 9B64A14F42; Thu, 10 Sep 2020 15:37:15 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08AFbFPm055844; Thu, 10 Sep 2020 15:37:15 GMT (envelope-from arichardson@FreeBSD.org) Received: (from arichardson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08AFbFXL055843; Thu, 10 Sep 2020 15:37:15 GMT (envelope-from arichardson@FreeBSD.org) Message-Id: <202009101537.08AFbFXL055843@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arichardson set sender to arichardson@FreeBSD.org using -f From: Alex Richardson Date: Thu, 10 Sep 2020 15:37:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365581 - head/kerberos5/include X-SVN-Group: head X-SVN-Commit-Author: arichardson X-SVN-Commit-Paths: head/kerberos5/include X-SVN-Commit-Revision: 365581 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.33 Precedence: list List-Id: "SVN commit messages 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, 10 Sep 2020 15:37:17 -0000 Author: arichardson Date: Thu Sep 10 15:37:15 2020 New Revision: 365581 URL: https://svnweb.freebsd.org/changeset/base/365581 Log: Fix a noisy -Wundef warning when bootstrapping tools Modified: head/kerberos5/include/config.h Modified: head/kerberos5/include/config.h ============================================================================== --- head/kerberos5/include/config.h Thu Sep 10 15:37:07 2020 (r365580) +++ head/kerberos5/include/config.h Thu Sep 10 15:37:15 2020 (r365581) @@ -1579,7 +1579,7 @@ static /**/const char *const rcsid[] = { (const char * /* Define to `int' if doesn't define. */ /* #undef uid_t */ -#if _AIX +#ifdef _AIX /* XXX this is gross, but kills about a gazillion warnings */ struct ether_addr; struct sockaddr; From owner-svn-src-all@freebsd.org Thu Sep 10 15:37:22 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 12A293DA80C; Thu, 10 Sep 2020 15:37:22 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BnNL92hwTz49dy; Thu, 10 Sep 2020 15:37:21 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 5F0D214ED9; Thu, 10 Sep 2020 15:37:20 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08AFbK60055898; Thu, 10 Sep 2020 15:37:20 GMT (envelope-from arichardson@FreeBSD.org) Received: (from arichardson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08AFbKrN055897; Thu, 10 Sep 2020 15:37:20 GMT (envelope-from arichardson@FreeBSD.org) Message-Id: <202009101537.08AFbKrN055897@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arichardson set sender to arichardson@FreeBSD.org using -f From: Alex Richardson Date: Thu, 10 Sep 2020 15:37:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365582 - head/usr.bin/sort X-SVN-Group: head X-SVN-Commit-Author: arichardson X-SVN-Commit-Paths: head/usr.bin/sort X-SVN-Commit-Revision: 365582 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.33 Precedence: list List-Id: "SVN commit messages 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, 10 Sep 2020 15:37:22 -0000 Author: arichardson Date: Thu Sep 10 15:37:19 2020 New Revision: 365582 URL: https://svnweb.freebsd.org/changeset/base/365582 Log: Fix -Wpointer-sign warnings in bwstring.c Modified: head/usr.bin/sort/bwstring.c Modified: head/usr.bin/sort/bwstring.c ============================================================================== --- head/usr.bin/sort/bwstring.c Thu Sep 10 15:37:15 2020 (r365581) +++ head/usr.bin/sort/bwstring.c Thu Sep 10 15:37:19 2020 (r365582) @@ -46,7 +46,7 @@ __FBSDID("$FreeBSD$"); bool byte_sort; static wchar_t **wmonths; -static unsigned char **cmonths; +static char **cmonths; /* initialise months */ @@ -56,17 +56,17 @@ initialise_months(void) const nl_item item[12] = { ABMON_1, ABMON_2, ABMON_3, ABMON_4, ABMON_5, ABMON_6, ABMON_7, ABMON_8, ABMON_9, ABMON_10, ABMON_11, ABMON_12 }; - unsigned char *tmp; + char *tmp; size_t len; if (MB_CUR_MAX == 1) { if (cmonths == NULL) { - unsigned char *m; + char *m; - cmonths = sort_malloc(sizeof(unsigned char*) * 12); + cmonths = sort_malloc(sizeof(char*) * 12); for (int i = 0; i < 12; i++) { cmonths[i] = NULL; - tmp = (unsigned char *) nl_langinfo(item[i]); + tmp = nl_langinfo(item[i]); if (debug_sort) printf("month[%d]=%s\n", i, tmp); if (*tmp == '\0') @@ -86,14 +86,14 @@ initialise_months(void) wmonths = sort_malloc(sizeof(wchar_t *) * 12); for (int i = 0; i < 12; i++) { wmonths[i] = NULL; - tmp = (unsigned char *) nl_langinfo(item[i]); + tmp = nl_langinfo(item[i]); if (debug_sort) printf("month[%d]=%s\n", i, tmp); if (*tmp == '\0') continue; len = strlen(tmp); m = sort_malloc(SIZEOF_WCHAR_STRING(len + 1)); - if (mbstowcs(m, (char*)tmp, len) == + if (mbstowcs(m, tmp, len) == ((size_t) - 1)) { sort_free(m); continue; From owner-svn-src-all@freebsd.org Thu Sep 10 15:37:27 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0C5DF3DA462; Thu, 10 Sep 2020 15:37:27 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BnNLF3Bt0z49Ph; Thu, 10 Sep 2020 15:37:25 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 2E53C14FCF; Thu, 10 Sep 2020 15:37:25 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08AFbPDT055952; Thu, 10 Sep 2020 15:37:25 GMT (envelope-from arichardson@FreeBSD.org) Received: (from arichardson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08AFbPec055951; Thu, 10 Sep 2020 15:37:25 GMT (envelope-from arichardson@FreeBSD.org) Message-Id: <202009101537.08AFbPec055951@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arichardson set sender to arichardson@FreeBSD.org using -f From: Alex Richardson Date: Thu, 10 Sep 2020 15:37:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365583 - head/tools/build/mk X-SVN-Group: head X-SVN-Commit-Author: arichardson X-SVN-Commit-Paths: head/tools/build/mk X-SVN-Commit-Revision: 365583 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.33 Precedence: list List-Id: "SVN commit messages 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, 10 Sep 2020 15:37:27 -0000 Author: arichardson Date: Thu Sep 10 15:37:24 2020 New Revision: 365583 URL: https://svnweb.freebsd.org/changeset/base/365583 Log: Silence GCC's -Wno-unused-result during bootstrap Unlike clang, GCC still warns even with (void) casts (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66425) Modified: head/tools/build/mk/Makefile.boot Modified: head/tools/build/mk/Makefile.boot ============================================================================== --- head/tools/build/mk/Makefile.boot Thu Sep 10 15:37:19 2020 (r365582) +++ head/tools/build/mk/Makefile.boot Thu Sep 10 15:37:24 2020 (r365583) @@ -96,3 +96,6 @@ UPDATE_DEPENDFILE= no Error was caused by Makefile in ${.CURDIR} .endif .endif + +# GCC doesn't allow silencing warn_unused_result calls with (void) casts. +CFLAGS.gcc+=-Wno-unused-result From owner-svn-src-all@freebsd.org Thu Sep 10 15:37:34 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C896F3DA375; Thu, 10 Sep 2020 15:37:34 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BnNLQ3xGmz49PX; Thu, 10 Sep 2020 15:37:34 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 52670153E6; Thu, 10 Sep 2020 15:37:30 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08AFbU4K056007; Thu, 10 Sep 2020 15:37:30 GMT (envelope-from arichardson@FreeBSD.org) Received: (from arichardson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08AFbTlE056005; Thu, 10 Sep 2020 15:37:29 GMT (envelope-from arichardson@FreeBSD.org) Message-Id: <202009101537.08AFbTlE056005@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arichardson set sender to arichardson@FreeBSD.org using -f From: Alex Richardson Date: Thu, 10 Sep 2020 15:37:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365584 - in head: . usr.bin/mandoc X-SVN-Group: head X-SVN-Commit-Author: arichardson X-SVN-Commit-Paths: in head: . usr.bin/mandoc X-SVN-Commit-Revision: 365584 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.33 Precedence: list List-Id: "SVN commit messages 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, 10 Sep 2020 15:37:34 -0000 Author: arichardson Date: Thu Sep 10 15:37:29 2020 New Revision: 365584 URL: https://svnweb.freebsd.org/changeset/base/365584 Log: Ensure that the makewhatis symlink is added in the bootstrap-tools stage We currently set MK_MAN=no in $BSARGS so MK_MAN_UTILS will also be false which means that the makewhatis symlink will not be created. This change fixes the build when using both -DBUILD_WITH_STRICT_TMPPATH and -DBOOTSTRAP_ALL_TOOLS. Tested by: andrew Differential Revision: https://reviews.freebsd.org/D16761 Modified: head/Makefile.inc1 head/usr.bin/mandoc/Makefile Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Thu Sep 10 15:37:24 2020 (r365583) +++ head/Makefile.inc1 Thu Sep 10 15:37:29 2020 (r365584) @@ -723,7 +723,7 @@ BSARGS= DESTDIR= \ BOOTSTRAPPING=${BOOTSTRAPPING_OSRELDATE} \ BWPHASE=${.TARGET:C,^_,,} \ SSP_CFLAGS= \ - MK_HTML=no NO_LINT=yes MK_MAN=no \ + MK_HTML=no NO_LINT=yes MK_MAN=no MK_MAN_UTILS=yes \ -DNO_PIC MK_PROFILE=no -DNO_SHARED \ -DNO_CPU_CFLAGS MK_WARNS=no MK_CTF=no \ MK_CLANG_EXTRAS=no MK_CLANG_FORMAT=no MK_CLANG_FULL=no \ Modified: head/usr.bin/mandoc/Makefile ============================================================================== --- head/usr.bin/mandoc/Makefile Thu Sep 10 15:37:24 2020 (r365583) +++ head/usr.bin/mandoc/Makefile Thu Sep 10 15:37:29 2020 (r365584) @@ -14,6 +14,8 @@ MLINKS+= apropos.1 whatis.1 LINKS= ${BINDIR}/mandoc ${BINDIR}/whatis \ ${BINDIR}/mandoc ${BINDIR}/makewhatis \ ${BINDIR}/mandoc ${BINDIR}/apropos +.elif defined(BOOTSTRAPPING) +.error "MK_MAN_UTILS should be set to yes when bootstrapping" .endif LIBMAN_SRCS= man.c \ From owner-svn-src-all@freebsd.org Thu Sep 10 15:58:38 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B49823DAEE0; Thu, 10 Sep 2020 15:58:38 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BnNpk4KWWz4D4w; Thu, 10 Sep 2020 15:58:38 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7467415248; Thu, 10 Sep 2020 15:58:38 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08AFwcux068132; Thu, 10 Sep 2020 15:58:38 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08AFwcJS068130; Thu, 10 Sep 2020 15:58:38 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202009101558.08AFwcJS068130@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 10 Sep 2020 15:58:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365585 - in stable/12/sys/netinet: . tcp_stacks X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: in stable/12/sys/netinet: . tcp_stacks X-SVN-Commit-Revision: 365585 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.33 Precedence: list List-Id: "SVN commit messages 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, 10 Sep 2020 15:58:38 -0000 Author: tuexen Date: Thu Sep 10 15:58:37 2020 New Revision: 365585 URL: https://svnweb.freebsd.org/changeset/base/365585 Log: MFC r357115: Don't set the ECT codepoint on retransmitted packets during SACK loss recovery. This is required by RFC 3168. Modified: stable/12/sys/netinet/tcp_output.c stable/12/sys/netinet/tcp_stacks/rack.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/tcp_output.c ============================================================================== --- stable/12/sys/netinet/tcp_output.c Thu Sep 10 15:37:29 2020 (r365584) +++ stable/12/sys/netinet/tcp_output.c Thu Sep 10 15:58:37 2020 (r365585) @@ -1133,6 +1133,7 @@ send: * Ignore pure ack packets, retransmissions and window probes. */ if (len > 0 && SEQ_GEQ(tp->snd_nxt, tp->snd_max) && + (sack_rxmit == 0) && !((tp->t_flags & TF_FORCEDATA) && len == 1 && SEQ_LT(tp->snd_una, tp->snd_max))) { #ifdef INET6 Modified: stable/12/sys/netinet/tcp_stacks/rack.c ============================================================================== --- stable/12/sys/netinet/tcp_stacks/rack.c Thu Sep 10 15:37:29 2020 (r365584) +++ stable/12/sys/netinet/tcp_stacks/rack.c Thu Sep 10 15:58:37 2020 (r365585) @@ -8272,6 +8272,7 @@ send: * retransmissions and window probes. */ if (len > 0 && SEQ_GEQ(tp->snd_nxt, tp->snd_max) && + (sack_rxmit == 0) && !((tp->t_flags & TF_FORCEDATA) && len == 1)) { #ifdef INET6 if (isipv6) From owner-svn-src-all@freebsd.org Thu Sep 10 16:44:31 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 26C1F3DD1C8; Thu, 10 Sep 2020 16:44:31 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BnPqf2kcDz4HVr; Thu, 10 Sep 2020 16:44:30 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C69E915EE8; Thu, 10 Sep 2020 16:44:29 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08AGiTdX098704; Thu, 10 Sep 2020 16:44:29 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08AGiTSa098701; Thu, 10 Sep 2020 16:44:29 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202009101644.08AGiTSa098701@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 10 Sep 2020 16:44:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365586 - in stable/12/sys/netinet: . cc tcp_stacks X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: in stable/12/sys/netinet: . cc tcp_stacks X-SVN-Commit-Revision: 365586 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.33 Precedence: list List-Id: "SVN commit messages 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, 10 Sep 2020 16:44:31 -0000 Author: tuexen Date: Thu Sep 10 16:44:28 2020 New Revision: 365586 URL: https://svnweb.freebsd.org/changeset/base/365586 Log: MFC r357116: Sending CWR after an RTO is according to RFC 3168 generally required and not only for the DCTCP congestion control. Modified: stable/12/sys/netinet/cc/cc_dctcp.c stable/12/sys/netinet/tcp_input.c stable/12/sys/netinet/tcp_stacks/rack.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/cc/cc_dctcp.c ============================================================================== --- stable/12/sys/netinet/cc/cc_dctcp.c Thu Sep 10 15:58:37 2020 (r365585) +++ stable/12/sys/netinet/cc/cc_dctcp.c Thu Sep 10 16:44:28 2020 (r365586) @@ -282,7 +282,6 @@ dctcp_cong_signal(struct cc_var *ccv, uint32_t type) dctcp_data->ece_curr = 1; break; case CC_RTO: - CCV(ccv, t_flags) |= TF_ECN_SND_CWR; dctcp_update_alpha(ccv); dctcp_data->save_sndnxt += CCV(ccv, t_maxseg); dctcp_data->num_cong_events++; Modified: stable/12/sys/netinet/tcp_input.c ============================================================================== --- stable/12/sys/netinet/tcp_input.c Thu Sep 10 15:58:37 2020 (r365585) +++ stable/12/sys/netinet/tcp_input.c Thu Sep 10 16:44:28 2020 (r365586) @@ -438,6 +438,8 @@ cc_cong_signal(struct tcpcb *tp, struct tcphdr *th, ui tp->snd_ssthresh = max(2, min(tp->snd_wnd, tp->snd_cwnd) / 2 / maxseg) * maxseg; tp->snd_cwnd = maxseg; + if (tp->t_flags & TF_ECN_PERMIT) + tp->t_flags |= TF_ECN_SND_CWR; break; case CC_RTO_ERR: TCPSTAT_INC(tcps_sndrexmitbad); Modified: stable/12/sys/netinet/tcp_stacks/rack.c ============================================================================== --- stable/12/sys/netinet/tcp_stacks/rack.c Thu Sep 10 15:58:37 2020 (r365585) +++ stable/12/sys/netinet/tcp_stacks/rack.c Thu Sep 10 16:44:28 2020 (r365586) @@ -1444,6 +1444,8 @@ rack_cong_signal(struct tcpcb *tp, struct tcphdr *th, tp->snd_ssthresh = max(2, min(tp->snd_wnd, tp->snd_cwnd) / 2 / tp->t_maxseg) * tp->t_maxseg; tp->snd_cwnd = tp->t_maxseg; + if (tp->t_flags & TF_ECN_PERMIT) + tp->t_flags |= TF_ECN_SND_CWR; break; case CC_RTO_ERR: TCPSTAT_INC(tcps_sndrexmitbad); From owner-svn-src-all@freebsd.org Thu Sep 10 16:47:09 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 46CB33DD682; Thu, 10 Sep 2020 16:47:09 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BnPtj1961z4J8X; Thu, 10 Sep 2020 16:47:09 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0CAF515D40; Thu, 10 Sep 2020 16:47:09 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08AGl81A098877; Thu, 10 Sep 2020 16:47:08 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08AGl8xV098876; Thu, 10 Sep 2020 16:47:08 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202009101647.08AGl8xV098876@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 10 Sep 2020 16:47:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365587 - stable/12/sys/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/12/sys/netinet X-SVN-Commit-Revision: 365587 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.33 Precedence: list List-Id: "SVN commit messages 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, 10 Sep 2020 16:47:09 -0000 Author: tuexen Date: Thu Sep 10 16:47:08 2020 New Revision: 365587 URL: https://svnweb.freebsd.org/changeset/base/365587 Log: MFC r358023: Don't use uninitialised stack memory if the sysctl variable net.inet.tcp.hostcache.enable is set to 0. The bug resulted in using possibly a too small MSS value or wrong initial retransmission timer settings. Possibly the value used for ssthresh was also wrong. Modified: stable/12/sys/netinet/tcp_hostcache.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/tcp_hostcache.c ============================================================================== --- stable/12/sys/netinet/tcp_hostcache.c Thu Sep 10 16:44:28 2020 (r365586) +++ stable/12/sys/netinet/tcp_hostcache.c Thu Sep 10 16:47:08 2020 (r365587) @@ -437,8 +437,10 @@ tcp_hc_get(struct in_conninfo *inc, struct hc_metrics_ { struct hc_metrics *hc_entry; - if (!V_tcp_use_hostcache) + if (!V_tcp_use_hostcache) { + bzero(hc_metrics_lite, sizeof(*hc_metrics_lite)); return; + } /* * Find the right bucket. From owner-svn-src-all@freebsd.org Thu Sep 10 16:47:14 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9C54C3DD701; Thu, 10 Sep 2020 16:47:14 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BnPtn537sz4J5w; Thu, 10 Sep 2020 16:47:13 +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 752D315BDA; Thu, 10 Sep 2020 16:47:13 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08AGlDdi098923; Thu, 10 Sep 2020 16:47:13 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08AGlDUd098922; Thu, 10 Sep 2020 16:47:13 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202009101647.08AGlDUd098922@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 10 Sep 2020 16:47:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365588 - head/lib/libcompiler_rt X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: head/lib/libcompiler_rt X-SVN-Commit-Revision: 365588 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.33 Precedence: list List-Id: "SVN commit messages 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, 10 Sep 2020 16:47:15 -0000 Author: dim Date: Thu Sep 10 16:47:12 2020 New Revision: 365588 URL: https://svnweb.freebsd.org/changeset/base/365588 Log: Follow-up r364753 by only using arm's stdatomic.c implementation, as it already covers the functions in compiler-rt's atomic.c, leading to conflicts when linking. PR: 230888 MFC after: 3 days X-MFC-With: r364753 Modified: head/lib/libcompiler_rt/Makefile.inc Modified: head/lib/libcompiler_rt/Makefile.inc ============================================================================== --- head/lib/libcompiler_rt/Makefile.inc Thu Sep 10 16:47:08 2020 (r365587) +++ head/lib/libcompiler_rt/Makefile.inc Thu Sep 10 16:47:12 2020 (r365588) @@ -124,7 +124,8 @@ SRCF+= umodti3 # Enable compiler-rt's atomic implementation only for clang, as it uses clang # specific builtins, and gcc packages usually come with their own libatomic. -.if "${COMPILER_TYPE}" == "clang" +# Exclude arm which has its own implementations of atomic functions, below. +.if "${COMPILER_TYPE}" == "clang" && ${MACHINE_CPUARCH} != "arm" SRCF+= atomic .endif From owner-svn-src-all@freebsd.org Thu Sep 10 16:59:55 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0C9883DE196; Thu, 10 Sep 2020 16:59:55 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BnQ9Q6JRQz4KbX; Thu, 10 Sep 2020 16:59:54 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BBA6F15FE4; Thu, 10 Sep 2020 16:59:54 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08AGxsKv005320; Thu, 10 Sep 2020 16:59:54 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08AGxs0x005318; Thu, 10 Sep 2020 16:59:54 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202009101659.08AGxs0x005318@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 10 Sep 2020 16:59:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365589 - in stable/12/sys/netinet: . tcp_stacks X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: in stable/12/sys/netinet: . tcp_stacks X-SVN-Commit-Revision: 365589 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.33 Precedence: list List-Id: "SVN commit messages 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, 10 Sep 2020 16:59:55 -0000 Author: tuexen Date: Thu Sep 10 16:59:54 2020 New Revision: 365589 URL: https://svnweb.freebsd.org/changeset/base/365589 Log: MFC r357100: The server side of TCP fast open relies on the delayed ACK timer to allow including user data in the SYN-ACK. When DSACK support was added in r347382, an immediate ACK was sent even for the received SYN with user data. This patch fixes that and allows again to send user data with the SYN-ACK. Modified: stable/12/sys/netinet/tcp_input.c stable/12/sys/netinet/tcp_stacks/rack_bbr_common.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/tcp_input.c ============================================================================== --- stable/12/sys/netinet/tcp_input.c Thu Sep 10 16:47:12 2020 (r365588) +++ stable/12/sys/netinet/tcp_input.c Thu Sep 10 16:59:54 2020 (r365589) @@ -2299,7 +2299,7 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, stru /* * DSACK - add SACK block for dropped range */ - if (tp->t_flags & TF_SACK_PERMIT) { + if ((todrop > 0) && (tp->t_flags & TF_SACK_PERMIT)) { tcp_update_sack_list(tp, th->th_seq, th->th_seq + todrop); /* Modified: stable/12/sys/netinet/tcp_stacks/rack_bbr_common.c ============================================================================== --- stable/12/sys/netinet/tcp_stacks/rack_bbr_common.c Thu Sep 10 16:47:12 2020 (r365588) +++ stable/12/sys/netinet/tcp_stacks/rack_bbr_common.c Thu Sep 10 16:59:54 2020 (r365589) @@ -495,7 +495,7 @@ ctf_drop_checks(struct tcpopt *to, struct mbuf *m, str /* * DSACK - add SACK block for dropped range */ - if (tp->t_flags & TF_SACK_PERMIT) { + if ((todrop > 0) && (tp->t_flags & TF_SACK_PERMIT)) { tcp_update_sack_list(tp, th->th_seq, th->th_seq + tlen); /* * ACK now, as the next in-sequence segment From owner-svn-src-all@freebsd.org Thu Sep 10 17:03:37 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 946F73DE155; Thu, 10 Sep 2020 17:03:37 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BnQFj3QN9z4KpT; Thu, 10 Sep 2020 17:03:37 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 58889161CD; Thu, 10 Sep 2020 17:03:37 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08AH3bbt011266; Thu, 10 Sep 2020 17:03:37 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08AH3boX011265; Thu, 10 Sep 2020 17:03:37 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202009101703.08AH3boX011265@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 10 Sep 2020 17:03:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365590 - stable/12/sys/netinet X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/12/sys/netinet X-SVN-Commit-Revision: 365590 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.33 Precedence: list List-Id: "SVN commit messages 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, 10 Sep 2020 17:03:37 -0000 Author: tuexen Date: Thu Sep 10 17:03:36 2020 New Revision: 365590 URL: https://svnweb.freebsd.org/changeset/base/365590 Log: MFC r357816 (from rrs) This small fix makes it so we properly follow the RFC and only enable ECN when both the CWR and ECT bits our set within the SYN packet. Modified: stable/12/sys/netinet/tcp_syncache.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/tcp_syncache.c ============================================================================== --- stable/12/sys/netinet/tcp_syncache.c Thu Sep 10 16:59:54 2020 (r365589) +++ stable/12/sys/netinet/tcp_syncache.c Thu Sep 10 17:03:36 2020 (r365590) @@ -1607,7 +1607,8 @@ skip_alloc: sc->sc_peer_mss = to->to_mss; /* peer mss may be zero */ if (ltflags & TF_NOOPT) sc->sc_flags |= SCF_NOOPT; - if ((th->th_flags & (TH_ECE|TH_CWR)) && V_tcp_do_ecn) + if (((th->th_flags & (TH_ECE|TH_CWR)) == (TH_ECE|TH_CWR)) && + V_tcp_do_ecn) sc->sc_flags |= SCF_ECN; if (V_tcp_syncookies) From owner-svn-src-all@freebsd.org Thu Sep 10 17:12:42 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DA6FE3DE723; Thu, 10 Sep 2020 17:12:42 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BnQSB5Tk1z4LZY; Thu, 10 Sep 2020 17:12:42 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A0D7D164B8; Thu, 10 Sep 2020 17:12:42 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08AHCgrh017308; Thu, 10 Sep 2020 17:12:42 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08AHCgso017306; Thu, 10 Sep 2020 17:12:42 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202009101712.08AHCgso017306@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 10 Sep 2020 17:12:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365591 - in stable/12/sys/netinet: . tcp_stacks X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: in stable/12/sys/netinet: . tcp_stacks X-SVN-Commit-Revision: 365591 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.33 Precedence: list List-Id: "SVN commit messages 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, 10 Sep 2020 17:12:42 -0000 Author: tuexen Date: Thu Sep 10 17:12:42 2020 New Revision: 365591 URL: https://svnweb.freebsd.org/changeset/base/365591 Log: MFC r364754: RFC 3465 defines a limit L used in TCP slow start for limiting the number of acked bytes as described in Section 2.2 of that document. This patch ensures that this limit is not also applied in congestion avoidance. Applying this limit also in congestion avoidance can result in using less bandwidth than allowed. Modified: stable/12/sys/netinet/tcp_input.c stable/12/sys/netinet/tcp_stacks/rack.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/tcp_input.c ============================================================================== --- stable/12/sys/netinet/tcp_input.c Thu Sep 10 17:03:36 2020 (r365590) +++ stable/12/sys/netinet/tcp_input.c Thu Sep 10 17:12:42 2020 (r365591) @@ -309,8 +309,7 @@ cc_ack_received(struct tcpcb *tp, struct tcphdr *th, u if (type == CC_ACK) { if (tp->snd_cwnd > tp->snd_ssthresh) { - tp->t_bytes_acked += min(tp->ccv->bytes_this_ack, - nsegs * V_tcp_abc_l_var * tcp_maxseg(tp)); + tp->t_bytes_acked += tp->ccv->bytes_this_ack; if (tp->t_bytes_acked >= tp->snd_cwnd) { tp->t_bytes_acked -= tp->snd_cwnd; tp->ccv->flags |= CCF_ABC_SENTAWND; Modified: stable/12/sys/netinet/tcp_stacks/rack.c ============================================================================== --- stable/12/sys/netinet/tcp_stacks/rack.c Thu Sep 10 17:03:36 2020 (r365590) +++ stable/12/sys/netinet/tcp_stacks/rack.c Thu Sep 10 17:12:42 2020 (r365591) @@ -1322,8 +1322,7 @@ rack_ack_received(struct tcpcb *tp, struct tcp_rack *r } #endif if (tp->snd_cwnd > tp->snd_ssthresh) { - tp->t_bytes_acked += min(tp->ccv->bytes_this_ack, - nsegs * V_tcp_abc_l_var * tp->t_maxseg); + tp->t_bytes_acked += tp->ccv->bytes_this_ack; if (tp->t_bytes_acked >= tp->snd_cwnd) { tp->t_bytes_acked -= tp->snd_cwnd; tp->ccv->flags |= CCF_ABC_SENTAWND; From owner-svn-src-all@freebsd.org Thu Sep 10 17:15:45 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7C3293DE77B; Thu, 10 Sep 2020 17:15:45 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BnQWj2kDnz4LnQ; Thu, 10 Sep 2020 17:15:45 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 4154216433; Thu, 10 Sep 2020 17:15:45 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08AHFj3o017485; Thu, 10 Sep 2020 17:15:45 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08AHFjKd017484; Thu, 10 Sep 2020 17:15:45 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <202009101715.08AHFjKd017484@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Thu, 10 Sep 2020 17:15:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365592 - head/tests/sys/kern X-SVN-Group: head X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: head/tests/sys/kern X-SVN-Commit-Revision: 365592 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.33 Precedence: list List-Id: "SVN commit messages 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, 10 Sep 2020 17:15:45 -0000 Author: lwhsu Date: Thu Sep 10 17:15:44 2020 New Revision: 365592 URL: https://svnweb.freebsd.org/changeset/base/365592 Log: Temporarily skip failing sys.kern.memfd_test.* tests in CI PR: 249236 Sponsored by: The FreeBSD Foundation Modified: head/tests/sys/kern/memfd_test.c Modified: head/tests/sys/kern/memfd_test.c ============================================================================== --- head/tests/sys/kern/memfd_test.c Thu Sep 10 17:12:42 2020 (r365591) +++ head/tests/sys/kern/memfd_test.c Thu Sep 10 17:15:44 2020 (r365592) @@ -43,6 +43,9 @@ ATF_TC_BODY(basic, tc) int fd; char buf[8]; + if (atf_tc_get_config_var_as_bool_wd(tc, "ci", false)) + atf_skip "https://bugs.freebsd.org/249236" + ATF_REQUIRE((fd = memfd_create("...", 0)) != -1); /* write(2) should grow us out automatically. */ @@ -99,6 +102,9 @@ ATF_TC_BODY(write_seal, tc) int fd; char *addr, buf[BUF_SIZE]; + if (atf_tc_get_config_var_as_bool_wd(tc, "ci", false)) + atf_skip "https://bugs.freebsd.org/249236" + ATF_REQUIRE((fd = memfd_create("...", MFD_ALLOW_SEALING)) != -1); ATF_REQUIRE(ftruncate(fd, BUF_SIZE) == 0); @@ -128,6 +134,9 @@ ATF_TC_BODY(mmap_write_seal, tc) int fd; char *addr, *paddr, *raddr; + if (atf_tc_get_config_var_as_bool_wd(tc, "ci", false)) + atf_skip "https://bugs.freebsd.org/249236" + ATF_REQUIRE((fd = memfd_create("...", MFD_ALLOW_SEALING)) != -1); ATF_REQUIRE(ftruncate(fd, BUF_SIZE) == 0); @@ -193,6 +202,9 @@ ATF_TC_WITHOUT_HEAD(truncate_seals); ATF_TC_BODY(truncate_seals, tc) { + if (atf_tc_get_config_var_as_bool_wd(tc, "ci", false)) + atf_skip "https://bugs.freebsd.org/249236" + ATF_REQUIRE(memfd_truncate_test(4, 8, F_SEAL_GROW) == EPERM); ATF_REQUIRE(memfd_truncate_test(8, 4, F_SEAL_SHRINK) == EPERM); ATF_REQUIRE(memfd_truncate_test(8, 4, F_SEAL_GROW) == 0); @@ -228,6 +240,9 @@ ATF_TC_BODY(dup_seals, tc) char buf[8]; int fd, fdx; int seals; + + if (atf_tc_get_config_var_as_bool_wd(tc, "ci", false)) + atf_skip "https://bugs.freebsd.org/249236" ATF_REQUIRE((fd = memfd_create("...", MFD_ALLOW_SEALING)) != -1); ATF_REQUIRE((fdx = dup(fd)) != -1); From owner-svn-src-all@freebsd.org Thu Sep 10 17:18:26 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0AE1B3DED09; Thu, 10 Sep 2020 17:18:26 +0000 (UTC) (envelope-from byond.lenox@gmail.com) Received: from mail-vs1-f53.google.com (mail-vs1-f53.google.com [209.85.217.53]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BnQZn58YXz4M4M; Thu, 10 Sep 2020 17:18:25 +0000 (UTC) (envelope-from byond.lenox@gmail.com) Received: by mail-vs1-f53.google.com with SMTP id j3so3846750vsm.0; Thu, 10 Sep 2020 10:18:25 -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=S2rTFpCjmAm4ikI1cY8kzx5xQ2j+BgsdwpN9E/39ch0=; b=qAfgbLVcg1hdBtRDCqg5hDTmpXljNgj0BB5R+NlgqQJd4QUuJw+XXKilVxwkjcLvQe Xf0TK8N8xpc3/1pdWXslIYrBZpHfH7Iiy3Pwjif6FFTWbfHw9Fzc8pLknACtFko453x0 TieevXd+gSWs/dHYq36xxiObaL5YTqF9a0gx7pSSeU50cDQz8pwSbX9jlnQoNFPyYiWD JGv7+S0h12YGZ4WDDh5KwoH8cHagqoyGm8XSCQw34YSce8uI2RdEvQn+zJudl5286FRd 69I8Iiuf2RKbQ8v7SmJ7eWxFn15CBMlwO3pIVt0qwnUnn4CXq8AV0qSAvqXfLucdmJLb wS0w== X-Gm-Message-State: AOAM531jKjGq9p1XutjWdzLgefp/MAXkLR6Nsrvew+pJG494dFVFT3uq UDgbUStHkainhOLzNTuoIynxCx21Xak= X-Google-Smtp-Source: ABdhPJzHXO0RBwj3fyUunxN1soJpq3WrHl06YM9nEpEWRP0zFzzKLAbRanh0/2zWwYcLsfxW6SKwFQ== X-Received: by 2002:a67:ed84:: with SMTP id d4mr5113774vsp.27.1599758304487; Thu, 10 Sep 2020 10:18:24 -0700 (PDT) Received: from mail-ua1-f41.google.com (mail-ua1-f41.google.com. [209.85.222.41]) by smtp.gmail.com with ESMTPSA id k4sm662327uak.0.2020.09.10.10.18.24 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 10 Sep 2020 10:18:24 -0700 (PDT) Received: by mail-ua1-f41.google.com with SMTP id u14so2234858uaq.1; Thu, 10 Sep 2020 10:18:24 -0700 (PDT) X-Received: by 2002:ab0:700c:: with SMTP id k12mr4677454ual.132.1599758303953; Thu, 10 Sep 2020 10:18:23 -0700 (PDT) MIME-Version: 1.0 References: <202009101715.08AHFjKd017484@repo.freebsd.org> In-Reply-To: <202009101715.08AHFjKd017484@repo.freebsd.org> From: Kyle Evans Date: Thu, 10 Sep 2020 12:18:12 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r365592 - head/tests/sys/kern To: Li-Wen Hsu Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4BnQZn58YXz4M4M X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; TAGGED_FROM(0.00)[]; REPLY(-4.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 10 Sep 2020 17:18:26 -0000 On Thu, Sep 10, 2020 at 12:16 PM Li-Wen Hsu wrote: > > Author: lwhsu > Date: Thu Sep 10 17:15:44 2020 > New Revision: 365592 > URL: https://svnweb.freebsd.org/changeset/base/365592 > > Log: > Temporarily skip failing sys.kern.memfd_test.* tests in CI > > PR: 249236 > Sponsored by: The FreeBSD Foundation > Oy, I was literally just about to hit commit on the fix for these. From owner-svn-src-all@freebsd.org Thu Sep 10 17:21:41 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id ED89B3DECC1; Thu, 10 Sep 2020 17:21:41 +0000 (UTC) (envelope-from lwhsu@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BnQfY64RKz4MVf; Thu, 10 Sep 2020 17:21:41 +0000 (UTC) (envelope-from lwhsu@freebsd.org) Received: from mail-yb1-f170.google.com (mail-yb1-f170.google.com [209.85.219.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: lwhsu/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id AFC561ADE5; Thu, 10 Sep 2020 17:21:41 +0000 (UTC) (envelope-from lwhsu@freebsd.org) Received: by mail-yb1-f170.google.com with SMTP id p81so4555936ybc.12; Thu, 10 Sep 2020 10:21:41 -0700 (PDT) X-Gm-Message-State: AOAM5321DNbB9vxy2vTS7KaHJJctDx/8FnnrG5HLHXZIGnINUHJLUb+b V7g2olDS+yjjS2KIKeQA7B5dtEasK6pvXUdqDn0= X-Google-Smtp-Source: ABdhPJwCAu0TO82O1DGx+pO2SpsH/75KeUw/3flKXDKPPmtRtz8js4Suf6DlAdzZG9tcyKoTa0xi4CEqkYY7U3oBetY= X-Received: by 2002:a25:b40a:: with SMTP id n10mr15044548ybj.497.1599758501157; Thu, 10 Sep 2020 10:21:41 -0700 (PDT) MIME-Version: 1.0 References: <202009101715.08AHFjKd017484@repo.freebsd.org> In-Reply-To: From: Li-Wen Hsu Date: Fri, 11 Sep 2020 01:21:30 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r365592 - head/tests/sys/kern To: Kyle Evans Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 10 Sep 2020 17:21:42 -0000 On Fri, Sep 11, 2020 at 1:18 AM Kyle Evans wrote: > > On Thu, Sep 10, 2020 at 12:16 PM Li-Wen Hsu wrote: > > > > Author: lwhsu > > Date: Thu Sep 10 17:15:44 2020 > > New Revision: 365592 > > URL: https://svnweb.freebsd.org/changeset/base/365592 > > > > Log: > > Temporarily skip failing sys.kern.memfd_test.* tests in CI > > > > PR: 249236 > > Sponsored by: The FreeBSD Foundation > > > > Oy, I was literally just about to hit commit on the fix for these. Oops, Although I should have marked them earlier, just don't get another report of the same issues. From owner-svn-src-all@freebsd.org Thu Sep 10 17:23:30 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DBE133DEFC9; Thu, 10 Sep 2020 17:23:30 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BnQhf5Tp6z4MNq; Thu, 10 Sep 2020 17:23:30 +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 A083E163F3; Thu, 10 Sep 2020 17:23:30 +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 08AHNURu023246; Thu, 10 Sep 2020 17:23:30 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08AHNUTY023245; Thu, 10 Sep 2020 17:23:30 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202009101723.08AHNUTY023245@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 10 Sep 2020 17:23:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365593 - head/lib/libc/sys X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/lib/libc/sys X-SVN-Commit-Revision: 365593 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.33 Precedence: list List-Id: "SVN commit messages 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, 10 Sep 2020 17:23:30 -0000 Author: kevans Date: Thu Sep 10 17:23:30 2020 New Revision: 365593 URL: https://svnweb.freebsd.org/changeset/base/365593 Log: Fix memfd_create tests after r365524 r365524 did accidentally invert this check that sets SHM_LARGEPAGE, leading non-hugetlb memfd as unconfigured largepage shm and thus test failures when we try to ftruncate or write to them. PR: 249236 Discussed with: kib Modified: head/lib/libc/sys/shm_open.c Modified: head/lib/libc/sys/shm_open.c ============================================================================== --- head/lib/libc/sys/shm_open.c Thu Sep 10 17:15:44 2020 (r365592) +++ head/lib/libc/sys/shm_open.c Thu Sep 10 17:23:30 2020 (r365593) @@ -136,7 +136,7 @@ memfd_create(const char *name, unsigned int flags) oflags |= O_CLOEXEC; if ((flags & MFD_ALLOW_SEALING) != 0) shmflags |= SHM_ALLOW_SEALING; - if ((flags & MFD_HUGETLB) == 0) + if ((flags & MFD_HUGETLB) != 0) shmflags |= SHM_LARGEPAGE; fd = __sys_shm_open2(SHM_ANON, oflags, 0, shmflags, memfd_name); if (fd == -1 || (flags & MFD_HUGETLB) == 0) From owner-svn-src-all@freebsd.org Thu Sep 10 17:26:17 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2A6313DF18C; Thu, 10 Sep 2020 17:26:17 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BnQlr6MDdz4Md4; Thu, 10 Sep 2020 17:26:16 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B658A16445; Thu, 10 Sep 2020 17:26:16 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08AHQGjL023539; Thu, 10 Sep 2020 17:26:16 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08AHQGCJ023538; Thu, 10 Sep 2020 17:26:16 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202009101726.08AHQGCJ023538@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 10 Sep 2020 17:26:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365594 - stable/12/sys/netinet/tcp_stacks X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/12/sys/netinet/tcp_stacks X-SVN-Commit-Revision: 365594 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.33 Precedence: list List-Id: "SVN commit messages 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, 10 Sep 2020 17:26:17 -0000 Author: tuexen Date: Thu Sep 10 17:26:16 2020 New Revision: 365594 URL: https://svnweb.freebsd.org/changeset/base/365594 Log: MFC r350973 (from rrs): Place back in the dependency on HPTS via module depends versus a fatal error in compiling. This was taken out by mistake when I mis-merged from the 18q22p2 sources of rack in NF. Opps. Modified: stable/12/sys/netinet/tcp_stacks/rack.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/tcp_stacks/rack.c ============================================================================== --- stable/12/sys/netinet/tcp_stacks/rack.c Thu Sep 10 17:23:30 2020 (r365593) +++ stable/12/sys/netinet/tcp_stacks/rack.c Thu Sep 10 17:26:16 2020 (r365594) @@ -127,10 +127,6 @@ uma_zone_t rack_pcb_zone; struct sysctl_ctx_list rack_sysctl_ctx; struct sysctl_oid *rack_sysctl_root; -#ifndef TCPHPTS -#error Kernel option TCPHPTS is required -#endif - #define CUM_ACKED 1 #define SACKED 2 @@ -9296,3 +9292,4 @@ static moduledata_t tcp_rack = { MODULE_VERSION(MODNAME, 1); DECLARE_MODULE(MODNAME, tcp_rack, SI_SUB_PROTO_DOMAIN, SI_ORDER_ANY); +MODULE_DEPEND(MODNAME, tcphpts, 1, 1, 1); From owner-svn-src-all@freebsd.org Thu Sep 10 17:29:21 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 232943DF1B1; Thu, 10 Sep 2020 17:29:21 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BnQqP07dJz4Myg; Thu, 10 Sep 2020 17:29:21 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DC0E216341; Thu, 10 Sep 2020 17:29:20 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08AHTKS8023741; Thu, 10 Sep 2020 17:29:20 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08AHTKPc023740; Thu, 10 Sep 2020 17:29:20 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202009101729.08AHTKPc023740@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 10 Sep 2020 17:29:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365595 - stable/12/sys/netinet/tcp_stacks X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/12/sys/netinet/tcp_stacks X-SVN-Commit-Revision: 365595 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.33 Precedence: list List-Id: "SVN commit messages 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, 10 Sep 2020 17:29:21 -0000 Author: tuexen Date: Thu Sep 10 17:29:20 2020 New Revision: 365595 URL: https://svnweb.freebsd.org/changeset/base/365595 Log: MFC r351328 (by rrs): Fix an issue when TSO and Rack play together. Basically an retransmission of the initial SYN (with data) would cause us to strip the SYN and decrement/increase offset/len which then caused us a -1 offset and a panic. Modified: stable/12/sys/netinet/tcp_stacks/rack.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/tcp_stacks/rack.c ============================================================================== --- stable/12/sys/netinet/tcp_stacks/rack.c Thu Sep 10 17:26:16 2020 (r365594) +++ stable/12/sys/netinet/tcp_stacks/rack.c Thu Sep 10 17:29:20 2020 (r365595) @@ -7467,9 +7467,6 @@ again: (tp->t_state == TCPS_SYN_RECEIVED)) flags &= ~TH_SYN; #endif - sb_offset--, len++; - if (sbavail(sb) == 0) - len = 0; } /* * Be careful not to send data and/or FIN on SYN segments. This From owner-svn-src-all@freebsd.org Thu Sep 10 17:31:35 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4A5FB3DF242; Thu, 10 Sep 2020 17:31:35 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BnQsz18rqz4NTy; Thu, 10 Sep 2020 17:31:35 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0B0C316351; Thu, 10 Sep 2020 17:31:35 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08AHVY6d024657; Thu, 10 Sep 2020 17:31:34 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08AHVYSE024656; Thu, 10 Sep 2020 17:31:34 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202009101731.08AHVYSE024656@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 10 Sep 2020 17:31:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365596 - stable/12/sys/netinet/tcp_stacks X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/12/sys/netinet/tcp_stacks X-SVN-Commit-Revision: 365596 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.33 Precedence: list List-Id: "SVN commit messages 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, 10 Sep 2020 17:31:35 -0000 Author: tuexen Date: Thu Sep 10 17:31:34 2020 New Revision: 365596 URL: https://svnweb.freebsd.org/changeset/base/365596 Log: MFC r351782: Fix two TCP RACK issues: * Convert the TCP delayed ACK timer from ms to ticks as required. This fixes the timer on platforms with hz != 1000. * Don't delay acknowledgements which report duplicate data using DSACKs. Modified: stable/12/sys/netinet/tcp_stacks/rack.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/tcp_stacks/rack.c ============================================================================== --- stable/12/sys/netinet/tcp_stacks/rack.c Thu Sep 10 17:29:20 2020 (r365595) +++ stable/12/sys/netinet/tcp_stacks/rack.c Thu Sep 10 17:31:34 2020 (r365596) @@ -1802,6 +1802,11 @@ rack_drop_checks(struct tcpopt *to, struct mbuf *m, st * will clear the DSACK block again */ tp->t_flags |= TF_ACKNOW; + /* + * ACK now, as the next in-sequence segment + * will clear the DSACK block again + */ + tp->t_flags |= TF_ACKNOW; } *drop_hdrlen += todrop; /* drop from the top afterwards */ th->th_seq += todrop; @@ -2350,7 +2355,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 Thu Sep 10 17:41:24 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6A6953DF712; Thu, 10 Sep 2020 17:41:24 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BnR5J24Tdz4NnW; Thu, 10 Sep 2020 17:41:24 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2A93116361; Thu, 10 Sep 2020 17:41:24 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08AHfOIK030127; Thu, 10 Sep 2020 17:41:24 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08AHfO8w030126; Thu, 10 Sep 2020 17:41:24 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202009101741.08AHfO8w030126@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 10 Sep 2020 17:41:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365597 - stable/12/sys/netinet/tcp_stacks X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/12/sys/netinet/tcp_stacks X-SVN-Commit-Revision: 365597 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.33 Precedence: list List-Id: "SVN commit messages 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, 10 Sep 2020 17:41:24 -0000 Author: tuexen Date: Thu Sep 10 17:41:23 2020 New Revision: 365597 URL: https://svnweb.freebsd.org/changeset/base/365597 Log: MFC r352661 (from rrs): lets put (void) in a couple of functions to keep older platforms that are stuck with gcc happy (ppc). The changes are needed in both bbr and rack. Modified: stable/12/sys/netinet/tcp_stacks/rack.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/tcp_stacks/rack.c ============================================================================== --- stable/12/sys/netinet/tcp_stacks/rack.c Thu Sep 10 17:31:34 2020 (r365596) +++ stable/12/sys/netinet/tcp_stacks/rack.c Thu Sep 10 17:41:23 2020 (r365597) @@ -479,7 +479,7 @@ sysctl_rack_clear(SYSCTL_HANDLER_ARGS) static void -rack_init_sysctls() +rack_init_sysctls(void) { SYSCTL_ADD_S32(&rack_sysctl_ctx, SYSCTL_CHILDREN(rack_sysctl_root), @@ -1130,7 +1130,7 @@ rack_log_to_processing(struct tcp_rack *rack, uint32_t } static void -rack_counter_destroy() +rack_counter_destroy(void) { counter_u64_free(rack_badfr); counter_u64_free(rack_badfr_bytes); From owner-svn-src-all@freebsd.org Thu Sep 10 17:44:28 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1E09B3DF5BF; Thu, 10 Sep 2020 17:44:28 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BnR8r000Vz4P2k; Thu, 10 Sep 2020 17:44:27 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D688616952; Thu, 10 Sep 2020 17:44:27 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08AHiRYl036199; Thu, 10 Sep 2020 17:44:27 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08AHiRRm036198; Thu, 10 Sep 2020 17:44:27 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202009101744.08AHiRRm036198@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 10 Sep 2020 17:44:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365598 - stable/12/sys/netinet/tcp_stacks X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/12/sys/netinet/tcp_stacks X-SVN-Commit-Revision: 365598 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.33 Precedence: list List-Id: "SVN commit messages 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, 10 Sep 2020 17:44:28 -0000 Author: tuexen Date: Thu Sep 10 17:44:27 2020 New Revision: 365598 URL: https://svnweb.freebsd.org/changeset/base/365598 Log: MFC r353490 (from rrs): if_hw_tsomaxsegsize needs to be initialized to zero, just like in bbr.c and tcp_output.c Modified: stable/12/sys/netinet/tcp_stacks/rack.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/tcp_stacks/rack.c ============================================================================== --- stable/12/sys/netinet/tcp_stacks/rack.c Thu Sep 10 17:41:23 2020 (r365597) +++ stable/12/sys/netinet/tcp_stacks/rack.c Thu Sep 10 17:44:27 2020 (r365598) @@ -6996,7 +6996,7 @@ rack_output(struct tcpcb *tp) struct mbuf *m; struct mbuf *mb; uint32_t if_hw_tsomaxsegcount = 0; - uint32_t if_hw_tsomaxsegsize; + uint32_t if_hw_tsomaxsegsize = 0; long tot_len_this_send = 0; struct ip *ip = NULL; #ifdef TCPDEBUG From owner-svn-src-all@freebsd.org Thu Sep 10 17:46:41 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5FC563DFA82; Thu, 10 Sep 2020 17:46:41 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BnRCP1rlVz4PQY; Thu, 10 Sep 2020 17:46:41 +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 1EB1616D85; Thu, 10 Sep 2020 17:46:41 +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 08AHkeFJ036346; Thu, 10 Sep 2020 17:46:40 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08AHkeFu036345; Thu, 10 Sep 2020 17:46:40 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202009101746.08AHkeFu036345@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 10 Sep 2020 17:46:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r365599 - vendor/NetBSD/tests/dist/lib/libexecinfo X-SVN-Group: vendor X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: vendor/NetBSD/tests/dist/lib/libexecinfo X-SVN-Commit-Revision: 365599 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.33 Precedence: list List-Id: "SVN commit messages 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, 10 Sep 2020 17:46:41 -0000 Author: kevans Date: Thu Sep 10 17:46:40 2020 New Revision: 365599 URL: https://svnweb.freebsd.org/changeset/base/365599 Log: netbsd-tests: import fix for a libexecinfo warning at higher WARNS v1.17 of this file included a fix that I just submitted upstream to fix a warning about prevent_inline with external linkage not having been previously declared. Modified: vendor/NetBSD/tests/dist/lib/libexecinfo/t_backtrace.c Modified: vendor/NetBSD/tests/dist/lib/libexecinfo/t_backtrace.c ============================================================================== --- vendor/NetBSD/tests/dist/lib/libexecinfo/t_backtrace.c Thu Sep 10 17:44:27 2020 (r365598) +++ vendor/NetBSD/tests/dist/lib/libexecinfo/t_backtrace.c Thu Sep 10 17:46:40 2020 (r365599) @@ -1,4 +1,4 @@ -/* $NetBSD: t_backtrace.c,v 1.16 2014/11/04 00:20:19 justin Exp $ */ +/* $NetBSD: t_backtrace.c,v 1.17 2020/09/09 20:04:10 christos Exp $ */ /*- * Copyright (c) 2012 The NetBSD Foundation, Inc. @@ -29,7 +29,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -__RCSID("$NetBSD: t_backtrace.c,v 1.16 2014/11/04 00:20:19 justin Exp $"); +__RCSID("$NetBSD: t_backtrace.c,v 1.17 2020/09/09 20:04:10 christos Exp $"); #include #include @@ -47,7 +47,7 @@ void myfunc2(size_t ncalls); void myfunc1(size_t origcalls, volatile size_t ncalls); void myfunc(size_t ncalls); -volatile int prevent_inline; +static volatile int prevent_inline; void myfunc3(size_t ncalls) From owner-svn-src-all@freebsd.org Thu Sep 10 17:48:28 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 31F303DFA9B; Thu, 10 Sep 2020 17:48:28 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BnRFS0f25z4PTG; Thu, 10 Sep 2020 17:48: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 EBF4016953; Thu, 10 Sep 2020 17:48:27 +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 08AHmRf4036501; Thu, 10 Sep 2020 17:48:27 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08AHmRue036500; Thu, 10 Sep 2020 17:48:27 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202009101748.08AHmRue036500@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 10 Sep 2020 17:48:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365600 - head/contrib/netbsd-tests/lib/libexecinfo X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/contrib/netbsd-tests/lib/libexecinfo X-SVN-Commit-Revision: 365600 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.33 Precedence: list List-Id: "SVN commit messages 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, 10 Sep 2020 17:48:28 -0000 Author: kevans Date: Thu Sep 10 17:48:27 2020 New Revision: 365600 URL: https://svnweb.freebsd.org/changeset/base/365600 Log: MFV r365599: import fix for a libexecinfo warning at higher WARNS v1.17 of this file included a fix that I just submitted upstream to fix a warning about prevent_inline with external linkage not having been previously declared. MFC after: 1 week Modified: head/contrib/netbsd-tests/lib/libexecinfo/t_backtrace.c Directory Properties: head/contrib/netbsd-tests/ (props changed) Modified: head/contrib/netbsd-tests/lib/libexecinfo/t_backtrace.c ============================================================================== --- head/contrib/netbsd-tests/lib/libexecinfo/t_backtrace.c Thu Sep 10 17:46:40 2020 (r365599) +++ head/contrib/netbsd-tests/lib/libexecinfo/t_backtrace.c Thu Sep 10 17:48:27 2020 (r365600) @@ -1,4 +1,4 @@ -/* $NetBSD: t_backtrace.c,v 1.16 2014/11/04 00:20:19 justin Exp $ */ +/* $NetBSD: t_backtrace.c,v 1.17 2020/09/09 20:04:10 christos Exp $ */ /*- * Copyright (c) 2012 The NetBSD Foundation, Inc. @@ -29,7 +29,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -__RCSID("$NetBSD: t_backtrace.c,v 1.16 2014/11/04 00:20:19 justin Exp $"); +__RCSID("$NetBSD: t_backtrace.c,v 1.17 2020/09/09 20:04:10 christos Exp $"); #include #include @@ -47,7 +47,7 @@ void myfunc2(size_t ncalls); void myfunc1(size_t origcalls, volatile size_t ncalls); void myfunc(size_t ncalls); -volatile int prevent_inline; +static volatile int prevent_inline; void myfunc3(size_t ncalls) From owner-svn-src-all@freebsd.org Thu Sep 10 17:49:22 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 592413DF873; Thu, 10 Sep 2020 17:49:22 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BnRGV1hh8z4PVL; Thu, 10 Sep 2020 17:49:22 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1D43616C91; Thu, 10 Sep 2020 17:49:22 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08AHnLWg036660; Thu, 10 Sep 2020 17:49:21 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08AHnL8m036658; Thu, 10 Sep 2020 17:49:21 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202009101749.08AHnL8m036658@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 10 Sep 2020 17:49:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365601 - in stable/12/sys/netinet: . tcp_stacks X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: in stable/12/sys/netinet: . tcp_stacks X-SVN-Commit-Revision: 365601 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.33 Precedence: list List-Id: "SVN commit messages 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, 10 Sep 2020 17:49:22 -0000 Author: tuexen Date: Thu Sep 10 17:49:21 2020 New Revision: 365601 URL: https://svnweb.freebsd.org/changeset/base/365601 Log: MFC r356417 (from rrs): This catches rack up in the recent changes to ECN and also commonizes the functions that both the freebsd and rack stack uses. Modified: stable/12/sys/netinet/tcp_input.c stable/12/sys/netinet/tcp_stacks/rack.c stable/12/sys/netinet/tcp_var.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/tcp_input.c ============================================================================== --- stable/12/sys/netinet/tcp_input.c Thu Sep 10 17:48:27 2020 (r365600) +++ stable/12/sys/netinet/tcp_input.c Thu Sep 10 17:49:21 2020 (r365601) @@ -493,7 +493,7 @@ cc_post_recovery(struct tcpcb *tp, struct tcphdr *th) (tlen <= tp->t_maxseg) && \ (V_tcp_delack_enabled || (tp->t_flags & TF_NEEDSYN))) -static void inline +void inline cc_ecnpkt_handler(struct tcpcb *tp, struct tcphdr *th, uint8_t iptos) { INP_WLOCK_ASSERT(tp->t_inpcb); Modified: stable/12/sys/netinet/tcp_stacks/rack.c ============================================================================== --- stable/12/sys/netinet/tcp_stacks/rack.c Thu Sep 10 17:48:27 2020 (r365600) +++ stable/12/sys/netinet/tcp_stacks/rack.c Thu Sep 10 17:49:21 2020 (r365601) @@ -6752,6 +6752,10 @@ rack_hpts_do_segment(struct mbuf *m, struct tcphdr *th TCPSTAT_INC(tcps_ecn_ect1); break; } + + /* Process a packet differently from RFC3168. */ + cc_ecnpkt_handler(tp, th, iptos); + /* Congestion experienced. */ if (thflags & TH_ECE) { rack_cong_signal(tp, th, CC_ECN); Modified: stable/12/sys/netinet/tcp_var.h ============================================================================== --- stable/12/sys/netinet/tcp_var.h Thu Sep 10 17:48:27 2020 (r365600) +++ stable/12/sys/netinet/tcp_var.h Thu Sep 10 17:49:21 2020 (r365601) @@ -868,6 +868,7 @@ void cc_ack_received(struct tcpcb *tp, struct tcphdr * uint16_t nsegs, uint16_t type); void cc_conn_init(struct tcpcb *tp); void cc_post_recovery(struct tcpcb *tp, struct tcphdr *th); +void cc_ecnpkt_handler(struct tcpcb *tp, struct tcphdr *th, uint8_t iptos); void cc_cong_signal(struct tcpcb *tp, struct tcphdr *th, uint32_t type); #ifdef TCP_HHOOK void hhook_run_tcp_est_in(struct tcpcb *tp, From owner-svn-src-all@freebsd.org Thu Sep 10 17:53:01 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 06C8E3DF977; Thu, 10 Sep 2020 17:53: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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BnRLh6MwRz4PcL; Thu, 10 Sep 2020 17:53:00 +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 BEF4B16CB1; Thu, 10 Sep 2020 17:53: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 08AHr0mR042211; Thu, 10 Sep 2020 17:53:00 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08AHr02P042210; Thu, 10 Sep 2020 17:53:00 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202009101753.08AHr02P042210@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 10 Sep 2020 17:53:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365602 - head/contrib/netbsd-tests/lib/librt X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/contrib/netbsd-tests/lib/librt X-SVN-Commit-Revision: 365602 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.33 Precedence: list List-Id: "SVN commit messages 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, 10 Sep 2020 17:53:01 -0000 Author: kevans Date: Thu Sep 10 17:53:00 2020 New Revision: 365602 URL: https://svnweb.freebsd.org/changeset/base/365602 Log: librt: tests: fix minor issues with higher WARNS got_sigalrm is a global with external linkage and must therefore have a previous extern declaration. There's no reason to maintain the status quo there, so just make it static. The result var is unused. This part of the test has not been upstreamed, presumably because it exists solely for sem_clockwait_np. We should perhaps consider moving it into its own test file outside of ^/contrib/netbsd-tests, but this can happen later. MFC after: 1 week Modified: head/contrib/netbsd-tests/lib/librt/t_sem.c Modified: head/contrib/netbsd-tests/lib/librt/t_sem.c ============================================================================== --- head/contrib/netbsd-tests/lib/librt/t_sem.c Thu Sep 10 17:49:21 2020 (r365601) +++ head/contrib/netbsd-tests/lib/librt/t_sem.c Thu Sep 10 17:53:00 2020 (r365602) @@ -190,7 +190,7 @@ timespec_add_ms(struct timespec *ts, int ms) } } -volatile sig_atomic_t got_sigalrm = 0; +static volatile sig_atomic_t got_sigalrm = 0; static void sigalrm_handler(int sig __unused) @@ -212,7 +212,6 @@ ATF_TC_BODY(timedwait, tc) { struct timespec ts; sem_t sem; - int result; SEM_REQUIRE(sem_init(&sem, 0, 0)); SEM_REQUIRE(sem_post(&sem)); From owner-svn-src-all@freebsd.org Thu Sep 10 17:58:24 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E2C863DFE4C; Thu, 10 Sep 2020 17:58: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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BnRSw5fwJz4QLK; Thu, 10 Sep 2020 17:58: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 A57F11697D; Thu, 10 Sep 2020 17:58: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 08AHwOXv042523; Thu, 10 Sep 2020 17:58:24 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08AHwO4n042522; Thu, 10 Sep 2020 17:58:24 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202009101758.08AHwO4n042522@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 10 Sep 2020 17:58:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365603 - head/tests/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/tests/sys/kern X-SVN-Commit-Revision: 365603 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.33 Precedence: list List-Id: "SVN commit messages 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, 10 Sep 2020 17:58:24 -0000 Author: kevans Date: Thu Sep 10 17:58:24 2020 New Revision: 365603 URL: https://svnweb.freebsd.org/changeset/base/365603 Log: Fix the build after r365592 r365592 accidentally mixed atf-c and atf-sh; convert atf_skip -> atf_tc_skip Modified: head/tests/sys/kern/memfd_test.c Modified: head/tests/sys/kern/memfd_test.c ============================================================================== --- head/tests/sys/kern/memfd_test.c Thu Sep 10 17:53:00 2020 (r365602) +++ head/tests/sys/kern/memfd_test.c Thu Sep 10 17:58:24 2020 (r365603) @@ -44,7 +44,7 @@ ATF_TC_BODY(basic, tc) char buf[8]; if (atf_tc_get_config_var_as_bool_wd(tc, "ci", false)) - atf_skip "https://bugs.freebsd.org/249236" + atf_tc_skip("https://bugs.freebsd.org/249236"); ATF_REQUIRE((fd = memfd_create("...", 0)) != -1); @@ -103,7 +103,7 @@ ATF_TC_BODY(write_seal, tc) char *addr, buf[BUF_SIZE]; if (atf_tc_get_config_var_as_bool_wd(tc, "ci", false)) - atf_skip "https://bugs.freebsd.org/249236" + atf_tc_skip("https://bugs.freebsd.org/249236"); ATF_REQUIRE((fd = memfd_create("...", MFD_ALLOW_SEALING)) != -1); ATF_REQUIRE(ftruncate(fd, BUF_SIZE) == 0); @@ -135,7 +135,7 @@ ATF_TC_BODY(mmap_write_seal, tc) char *addr, *paddr, *raddr; if (atf_tc_get_config_var_as_bool_wd(tc, "ci", false)) - atf_skip "https://bugs.freebsd.org/249236" + atf_tc_skip("https://bugs.freebsd.org/249236"); ATF_REQUIRE((fd = memfd_create("...", MFD_ALLOW_SEALING)) != -1); ATF_REQUIRE(ftruncate(fd, BUF_SIZE) == 0); @@ -203,7 +203,7 @@ ATF_TC_BODY(truncate_seals, tc) { if (atf_tc_get_config_var_as_bool_wd(tc, "ci", false)) - atf_skip "https://bugs.freebsd.org/249236" + atf_tc_skip("https://bugs.freebsd.org/249236"); ATF_REQUIRE(memfd_truncate_test(4, 8, F_SEAL_GROW) == EPERM); ATF_REQUIRE(memfd_truncate_test(8, 4, F_SEAL_SHRINK) == EPERM); @@ -242,7 +242,7 @@ ATF_TC_BODY(dup_seals, tc) int seals; if (atf_tc_get_config_var_as_bool_wd(tc, "ci", false)) - atf_skip "https://bugs.freebsd.org/249236" + atf_tc_skip("https://bugs.freebsd.org/249236"); ATF_REQUIRE((fd = memfd_create("...", MFD_ALLOW_SEALING)) != -1); ATF_REQUIRE((fdx = dup(fd)) != -1); From owner-svn-src-all@freebsd.org Thu Sep 10 18:04:35 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1C8063E0195; Thu, 10 Sep 2020 18:04:35 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BnRc2714qz4Qtp; Thu, 10 Sep 2020 18:04:34 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D3F4A16E2D; Thu, 10 Sep 2020 18:04:34 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08AI4YAu048484; Thu, 10 Sep 2020 18:04:34 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08AI4YOW048483; Thu, 10 Sep 2020 18:04:34 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202009101804.08AI4YOW048483@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 10 Sep 2020 18:04:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365604 - stable/12/sys/netinet/tcp_stacks X-SVN-Group: stable-12 X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: stable/12/sys/netinet/tcp_stacks X-SVN-Commit-Revision: 365604 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.33 Precedence: list List-Id: "SVN commit messages 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, 10 Sep 2020 18:04:35 -0000 Author: tuexen Date: Thu Sep 10 18:04:34 2020 New Revision: 365604 URL: https://svnweb.freebsd.org/changeset/base/365604 Log: MFC r350061: Fix compilation on platforms using gcc. When compiling RACK on platforms using gcc, a warning that tcp_outflags is defined but not used is issued and terminates compilation on PPC64, for example. So don't indicate that tcp_outflags is used. Modified: stable/12/sys/netinet/tcp_stacks/rack_bbr_common.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/tcp_stacks/rack_bbr_common.c ============================================================================== --- stable/12/sys/netinet/tcp_stacks/rack_bbr_common.c Thu Sep 10 17:58:24 2020 (r365603) +++ stable/12/sys/netinet/tcp_stacks/rack_bbr_common.c Thu Sep 10 18:04:34 2020 (r365604) @@ -85,7 +85,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#define TCPOUTFLAGS #include #include #include From owner-svn-src-all@freebsd.org Thu Sep 10 18:19:46 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0A1653E036A; Thu, 10 Sep 2020 18:19:46 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BnRxY6T2xz4RkB; Thu, 10 Sep 2020 18:19:45 +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 C161C1719D; Thu, 10 Sep 2020 18:19:45 +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 08AIJjge055493; Thu, 10 Sep 2020 18:19:45 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08AIJjQt055491; Thu, 10 Sep 2020 18:19:45 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202009101819.08AIJjQt055491@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 10 Sep 2020 18:19:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365605 - head/usr.sbin/crunch/crunchgen X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/usr.sbin/crunch/crunchgen X-SVN-Commit-Revision: 365605 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.33 Precedence: list List-Id: "SVN commit messages 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, 10 Sep 2020 18:19:46 -0000 Author: kevans Date: Thu Sep 10 18:19:45 2020 New Revision: 365605 URL: https://svnweb.freebsd.org/changeset/base/365605 Log: crunchgen(8): fix crunched application build with WARNS=6 This was revealed by the rescue build with a patch I'm working on to default WARNS=6 everywhere. The issues resolved were: - Missing prototype for _crunched_${ident}_stub in the *_stub.c generated bits - Missing prototype for crunched_main - Incomplete prototype for _crunched_${ident}_stub in the generated parts of crunched_main - Literal strings in the stub table must drop const qualifier, unless we const'ify name - f field in struct stub didn't have a proper prototype Most of these issues are minor formalities and easily addressed. I note that if my patch to eventually raise WARNS for the rescue build lands, we'll need to bump the __FreeBSD_version requirement for bootstrapping crunchgen and wipe out the rescue .OBJDIR if it's stale, which we should be able to detect pretty easily from a couple of the issues that have been fixed here. Reviewed by: arichardson MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D26363 Modified: head/usr.sbin/crunch/crunchgen/crunched_main.c head/usr.sbin/crunch/crunchgen/crunchgen.c Modified: head/usr.sbin/crunch/crunchgen/crunched_main.c ============================================================================== --- head/usr.sbin/crunch/crunchgen/crunched_main.c Thu Sep 10 18:04:34 2020 (r365604) +++ head/usr.sbin/crunch/crunchgen/crunched_main.c Thu Sep 10 18:19:45 2020 (r365605) @@ -76,15 +76,19 @@ __FBSDID("$FreeBSD$"); #include #include +typedef int crunched_stub_t(int, char **, char **); + struct stub { - char *name; - int (*f)(); + const char *name; + crunched_stub_t *f; }; extern const char *__progname; extern struct stub entry_points[]; static void crunched_usage(void); + +crunched_stub_t crunched_main; static struct stub * find_entry_point(const char *basename) Modified: head/usr.sbin/crunch/crunchgen/crunchgen.c ============================================================================== --- head/usr.sbin/crunch/crunchgen/crunchgen.c Thu Sep 10 18:04:34 2020 (r365604) +++ head/usr.sbin/crunch/crunchgen/crunchgen.c Thu Sep 10 18:19:45 2020 (r365605) @@ -934,7 +934,9 @@ gen_output_cfile(void) fprintf(outcf, "%s\n", *cp); for (p = progs; p != NULL; p = p->next) - fprintf(outcf, "extern int _crunched_%s_stub();\n", p->ident); + fprintf(outcf, + "extern crunched_stub_t _crunched_%s_stub;\n", + p->ident); fprintf(outcf, "\nstruct stub entry_points[] = {\n"); for (p = progs; p != NULL; p = p->next) { @@ -1122,9 +1124,10 @@ prog_makefile_rules(FILE *outmk, prog_t *p) fprintf(outmk, "%s_stub.c:\n", p->name); fprintf(outmk, "\techo \"" "extern int main(int argc, char **argv, char **envp); " + "int _crunched_%s_stub(int argc, char **argv, char **envp);" "int _crunched_%s_stub(int argc, char **argv, char **envp)" "{return main(argc,argv,envp);}\" >%s_stub.c\n", - p->ident, p->name); + p->ident, p->ident, p->name); fprintf(outmk, "%s.lo: %s_stub.o $(%s_OBJPATHS)", p->name, p->name, p->ident); if (p->libs) From owner-svn-src-all@freebsd.org Thu Sep 10 18:27:53 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 53EC53E0BAF; Thu, 10 Sep 2020 18:27:53 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BnS6x1XVCz4SgD; Thu, 10 Sep 2020 18:27:53 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 17B11173A8; Thu, 10 Sep 2020 18:27:53 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08AIRqf5061850; Thu, 10 Sep 2020 18:27:52 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08AIRqKr061849; Thu, 10 Sep 2020 18:27:52 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <202009101827.08AIRqKr061849@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Thu, 10 Sep 2020 18:27:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365606 - head/sys/dev/usb/net X-SVN-Group: head X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: head/sys/dev/usb/net X-SVN-Commit-Revision: 365606 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.33 Precedence: list List-Id: "SVN commit messages 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, 10 Sep 2020 18:27:53 -0000 Author: lwhsu Date: Thu Sep 10 18:27:52 2020 New Revision: 365606 URL: https://svnweb.freebsd.org/changeset/base/365606 Log: urndis(4): Add support of Inseego/Novatel Wireless MiFi 8800/8000 PR: 245152 Submitted by: rootless@gmail.com Reviewed by: hselasky MFC after: 3 days Modified: head/sys/dev/usb/net/if_urndis.c Modified: head/sys/dev/usb/net/if_urndis.c ============================================================================== --- head/sys/dev/usb/net/if_urndis.c Thu Sep 10 18:19:45 2020 (r365605) +++ head/sys/dev/usb/net/if_urndis.c Thu Sep 10 18:27:52 2020 (r365606) @@ -179,6 +179,9 @@ static const STRUCT_USB_HOST_ID urndis_host_devs[] = { /* Nokia 7 plus */ {USB_IFACE_CLASS(UICLASS_IAD), USB_IFACE_SUBCLASS(0x4), USB_IFACE_PROTOCOL(UIPROTO_ACTIVESYNC)}, + /* Novatel Wireless 8800/8000/etc */ + {USB_IFACE_CLASS(UICLASS_IAD), USB_IFACE_SUBCLASS(0xef), + USB_IFACE_PROTOCOL(UIPROTO_RNDIS)}, }; DRIVER_MODULE(urndis, uhub, urndis_driver, urndis_devclass, NULL, NULL); From owner-svn-src-all@freebsd.org Thu Sep 10 18:41:16 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 76BCD3E0FF2; Thu, 10 Sep 2020 18:41:16 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BnSQN2X56z4TVx; Thu, 10 Sep 2020 18:41:16 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 3AB4F16E7E; Thu, 10 Sep 2020 18:41:16 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08AIfGRc071818; Thu, 10 Sep 2020 18:41:16 GMT (envelope-from bdragon@FreeBSD.org) Received: (from bdragon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08AIfFEv071817; Thu, 10 Sep 2020 18:41:15 GMT (envelope-from bdragon@FreeBSD.org) Message-Id: <202009101841.08AIfFEv071817@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdragon set sender to bdragon@FreeBSD.org using -f From: Brandon Bergren Date: Thu, 10 Sep 2020 18:41:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365607 - head/sys/powerpc/include X-SVN-Group: head X-SVN-Commit-Author: bdragon X-SVN-Commit-Paths: head/sys/powerpc/include X-SVN-Commit-Revision: 365607 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.33 Precedence: list List-Id: "SVN commit messages 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, 10 Sep 2020 18:41:16 -0000 Author: bdragon Date: Thu Sep 10 18:41:15 2020 New Revision: 365607 URL: https://svnweb.freebsd.org/changeset/base/365607 Log: [PowerPC64LE] Add LOAD_LR_NIA and RETURN_TO_NATIVE_ENDIAN defines. * Add LOAD_LR_NIA define. This is preferred to "bl 1f; 1:" because it doesn't pollute the branch predictor. * Add magic sequence to return the CPU to the correct endianness after jumping to cross-endian code, similar to the sequence from Linux. Sponsored by: Tag1 Consulting, Inc. Modified: head/sys/powerpc/include/asm.h Modified: head/sys/powerpc/include/asm.h ============================================================================== --- head/sys/powerpc/include/asm.h Thu Sep 10 18:27:52 2020 (r365606) +++ head/sys/powerpc/include/asm.h Thu Sep 10 18:41:15 2020 (r365607) @@ -194,6 +194,43 @@ name: \ #define ASENTRY_NOPROF(y) _ENTRY(ASMNAME(y)) #define ENTRY_NOPROF(y) _ENTRY(CNAME(y)) +/* Load NIA without affecting branch prediction */ +#define LOAD_LR_NIA bcl 20, 31, .+4 + +/* + * Magic sequence to return to native endian. + * Overwrites r0 and r11. + * + * The encoding of the instruction "tdi 0, %r0, 0x48" in opposite endian + * happens to be "b . + 8". This is useful because we can write a sequence + * of instructions that can execute in either endian. + * + * Use a sequence of handcoded instructions that switches contexts to the + * instruction following the sequence, but with the correct PSL_LE bit. + * + * The same sequence works for both BE and LE because the xori will flip + * the bit to the other state, and the code only runs when running in the + * wrong endian. + * + * This sequence is NMI-reentrant. + */ +#define RETURN_TO_NATIVE_ENDIAN \ + tdi 0, %r0, 0x48; /* Endian swapped: b . + 8 */\ + b 1f; /* Will fall through to here if correct */\ + .long 0xa600607d; /* mfmsr %r11 */\ + .long 0x00000038; /* li %r0, 0 */\ + .long 0x6401617d; /* mtmsrd %r0, 1 (L=1 EE,RI bits only) */\ + .long 0x01006b69; /* xori %r11, %r11, 0x1 (PSL_LE) */\ + .long 0xa602087c; /* mflr %r0 */\ + .long 0x05009f42; /* LOAD_LR_NIA */\ + .long 0xa6037b7d; /* 0: mtsrr1 %r11 */\ + .long 0xa602687d; /* mflr %r11 */\ + .long 0x18006b39; /* addi %r11, %r11, (1f - 0b) */\ + .long 0xa6037a7d; /* mtsrr0 %r11 */\ + .long 0xa603087c; /* mtlr %r0 */\ + .long 0x2400004c; /* rfid */\ +1: /* RETURN_TO_NATIVE_ENDIAN */ + #define ASMSTR .asciz #define RCSID(x) .text; .asciz x From owner-svn-src-all@freebsd.org Thu Sep 10 18:49:00 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DBE173E1318; Thu, 10 Sep 2020 18:49:00 +0000 (UTC) (envelope-from agapon@gmail.com) Received: from mail-lj1-f193.google.com (mail-lj1-f193.google.com [209.85.208.193]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BnSbJ0vJwz4Tjm; Thu, 10 Sep 2020 18:48:59 +0000 (UTC) (envelope-from agapon@gmail.com) Received: by mail-lj1-f193.google.com with SMTP id n25so9556858ljj.4; Thu, 10 Sep 2020 11:48:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:openpgp:autocrypt :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=LG8mRh5AtYhdkO+fOpvOmSGnwrwY8QCrmTaFrlA76fA=; b=jE3FBq/sQF1XDkvVtkXj9I0tqEdFg/UpjtNmeIca4bA6Ls09+o0Va1UT7Tayqf2wtb UQy7/FEA68VnOP+TK/gRpHk1J9sT1pnyqvKTeWg9z0tsatWBmTvdvHYcYHglo5bFBPlO N0uyPcJateMpoZtQOVjYkVArfoiX2yuVASCok1SWrXjC+a1Wn1MRmb9vcSS+7tyRcDLP U+i7mHH1NtQIbpF4ivGlGeqkE2m5nR4Vt1tRFcX5xGoNRZ6nlxT9krtkUkGwJOsrTg3o 2qQ4NOKOkkph273D/PSLlUilCKEFFD8QEJZBMP3RbJZdXhpa0AcVslrLibaNpjBmkgt0 cVUw== X-Gm-Message-State: AOAM531N0mePk6ixL6E+ywWuyVA04lib6kBQKFgd5ffRoSBMVQVOTCYV L+etzUaGo9RXZ+2AQRWdNsfP9hQx22A= X-Google-Smtp-Source: ABdhPJyifcyIirAMMuWBcXvGQ+lh/T2+j+6XVpqOpXDQlQ3FKdIqt9OHsJc056HnuWk0zwKQ0D08pA== X-Received: by 2002:a2e:9948:: with SMTP id r8mr5017563ljj.126.1599763737667; Thu, 10 Sep 2020 11:48:57 -0700 (PDT) Received: from [192.168.0.88] (east.meadow.volia.net. [93.72.151.96]) by smtp.googlemail.com with ESMTPSA id z8sm1801749ljh.19.2020.09.10.11.48.56 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 10 Sep 2020 11:48:56 -0700 (PDT) Subject: Re: uninitialized variables [Was: svn commit: r365445 - head/sys/cam/mmc] To: Mark Johnston Cc: Michal Meloun , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202009080546.0885kAgk006783@repo.freebsd.org> <34826ee7-12a9-d309-1fee-cd2e95744603@FreeBSD.org> <67be7fa5-30dd-b7ee-1076-9c29195d83d3@gmail.com> <20200908124848.GB66031@raichu> <6b18b5ef-a743-3d5e-8dd2-24640614ec88@FreeBSD.org> <20200909134429.GA65588@raichu> From: Andriy Gapon Openpgp: preference=signencrypt Autocrypt: addr=avg@FreeBSD.org; prefer-encrypt=mutual; keydata= mDMEX1iFDhYJKwYBBAHaRw8BAQdAiu8JG/oLFkVkOAJqJc7Dx5KI/Q6C3SBI20EQm+DXnAu0 HkFuZHJpeSBHYXBvbiA8YXZnQEZyZWVCU0Qub3JnPoiWBBMWCAA+FiEEyCHHZM09l0OE3Ir/ 1A1+Gq8+L1EFAl9YhQ4CGwMFCQeEzgAFCwkIBwIGFQoJCAsCBBYCAwECHgECF4AACgkQ1A1+ Gq8+L1Fc0wD/ZjmhHfbCJywZU3aOxXIPjcz73FYEGMvqMCCLAWyLbSABALFL+1ZNrjV3BGjq 889cOYFuboA/Yn3eWezS+tfqYBsGuDgEX1iFDhIKKwYBBAGXVQEFAQEHQL6B20Xi600TrkpG P9fWjl7JtHNxqrHKhX6Kg7kgb4ILAwEIB4h+BBgWCAAmFiEEyCHHZM09l0OE3Ir/1A1+Gq8+ L1EFAl9YhQ4CGwwFCQeEzgAACgkQ1A1+Gq8+L1F3cgEAktp4h+IJUJxL1vn6zMOt//znni/J TanKfQuA8wGXcGkBAKpZJhqMkg+pKk7MGvJhgJ6nCpTZ+rMK6vZVZLUWc3QF Message-ID: Date: Thu, 10 Sep 2020 21:48:55 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Firefox/60.0 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <20200909134429.GA65588@raichu> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4BnSbJ0vJwz4Tjm X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of agapon@gmail.com designates 209.85.208.193 as permitted sender) smtp.mailfrom=agapon@gmail.com X-Spamd-Result: default: False [-2.44 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17:c]; RCPT_COUNT_FIVE(0.00)[5]; RCVD_COUNT_THREE(0.00)[3]; NEURAL_HAM_SHORT(-0.62)[-0.617]; FORGED_SENDER(0.30)[avg@FreeBSD.org,agapon@gmail.com]; RECEIVED_SPAMHAUS_PBL(0.00)[93.72.151.96:received]; MIME_TRACE(0.00)[0:+]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; MID_RHS_MATCH_FROM(0.00)[]; FROM_NEQ_ENVFROM(0.00)[avg@FreeBSD.org,agapon@gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.84)[-0.843]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-0.98)[-0.983]; TAGGED_RCPT(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[FreeBSD.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[209.85.208.193:from]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.208.193:from]; FREEMAIL_CC(0.00)[gmail.com,freebsd.org]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[svn-src-head,svn-src-all] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 10 Sep 2020 18:49:00 -0000 On 09/09/2020 16:44, Mark Johnston wrote: > On Wed, Sep 09, 2020 at 08:49:01AM +0300, Andriy Gapon wrote: >> On 08/09/2020 15:48, Mark Johnston wrote: >>> I observed the same thing recently as well: the compiler catches >>> uninitialized variables only in simple cases. In my case, any uses of >>> goto within the function seemed to silence the warning, even if they >>> appeared after the uninitialized reference. >> >> I am running a kernel build now with this addition (for clang): >> CWARNEXTRA+= -Wconditional-uninitialized -Wno-error-conditional-uninitialized >> >> It produces a ton of warnings. >> Some of them are probably false positives, but some look quite reasonable. > > It has a lot of trouble with code patterns of the form: > > for (i = 0; i < 100; i++) { > val = foo(); > } > if (val != 0) /* may be uninitialized!!1 */ > bar(); > > or > > if (foo == bar) > val = baz(); > > if (foo == bar && val == 3) > > > The second example makes some sense to me since it's hard to prove that > foo == bar will not change between the first and second evaluations. I also noted the first pattern as the most common source of false positives. So, it seems that we cannot have what we want. Without -Wconditional-uninitialized clang is too conservative, with the option it's too "loose". I seem to recall that compilers used to be better than that. But maybe it's just false memories ("there used to be more snow in the winter", etc). >> E.g.: >> sys/cam/cam_periph.c:314:19: warning: variable 'p_drv' may be uninitialized when >> used here [-Wconditional-uninitialized] >> TAILQ_REMOVE(&(*p_drv)->units, periph, unit_links); >> >> Indeed, there is a conditional 'goto failure' before a first assignment to p_drv >> and the line is after the label. So, maybe the situation is impossible, but it >> is reasonable to warn about it. >> >> But the number of false positives (and "possible but impossible" situations) is >> too overwhelming. > > Yeah. I looked at maybe 30 warnings (out of hundreds) this morning > and they were all false positives. KMSAN will provide a new tool for > finding such bugs, but they will only be detected at runtime. > -- Andriy Gapon From owner-svn-src-all@freebsd.org Thu Sep 10 19:00:22 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2D0453E180F; Thu, 10 Sep 2020 19:00:22 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BnSrQ0Zpbz4VF3; Thu, 10 Sep 2020 19:00:22 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EBF5D179BF; Thu, 10 Sep 2020 19:00:21 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08AJ0LYH082502; Thu, 10 Sep 2020 19:00:21 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08AJ0Iql082480; Thu, 10 Sep 2020 19:00:18 GMT (envelope-from bz@FreeBSD.org) Message-Id: <202009101900.08AJ0Iql082480@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Thu, 10 Sep 2020 19:00:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365608 - in stable/12: lib/lib80211 sbin/ifconfig share/man/man4 sys/contrib/dev/ath/ath_hal/ar9300 sys/dev/an sys/dev/ath sys/dev/ath/ath_dfs/null sys/dev/ath/ath_hal sys/dev/ath/ath_... X-SVN-Group: stable-12 X-SVN-Commit-Author: bz X-SVN-Commit-Paths: in stable/12: lib/lib80211 sbin/ifconfig share/man/man4 sys/contrib/dev/ath/ath_hal/ar9300 sys/dev/an sys/dev/ath sys/dev/ath/ath_dfs/null sys/dev/ath/ath_hal sys/dev/ath/ath_hal/ah_regdomain sys/dev/... X-SVN-Commit-Revision: 365608 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.33 Precedence: list List-Id: "SVN commit messages 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, 10 Sep 2020 19:00:22 -0000 Author: bz Date: Thu Sep 10 19:00:17 2020 New Revision: 365608 URL: https://svnweb.freebsd.org/changeset/base/365608 Log: MFC r344749-344750,344841-344843,345284,346405,346470,347140-347141,348331, 349593,351868,353506-353507,353809,353853,353858,353860,356852,359063, 359158,360819,360888,360950-360951,360953-360954,360998,361009,361025, 361085,361087,361098,361106-361107,361115,361118,361319-361321,361486, 361560,361566,361626,361636-361637,361687,361726,361737-361738,361768, 361778,361811-361813,361819-361822,361825-361826,361834,361863-361864, 361878,361885-361886,362016,362084-362085,362156-362157,362161-362162, 362210-362213,362216,362256-362257,362671,362815-362816,363325, 363327-363328,364011-364012,364299,364301,364303,364312,364315, 364326-364327,364551,364553,364673,365097,365116,365125-365126, 365130-365131,365198,365419 by adrian(78), bcran(1), bz(13), cem(1), gavin(1), glebius(6), landonf(1), mjg(7) Merge WiFi net80211, drivers, and management in order to support better 11n and upcoming 11ac. This includes an ath(4) update, some run(4) 11n support, 11n for otus(4), A-MPDU, A-MSDU, A-MPDU+A-MSDU and Fast frames options, scanning fixes, enahnced PRIV checks for jails, restored parent device name printing, improvements for upcoming VHT support, lots of under-the-hood infrastructure improvements, new device ID, debug tools updates, some whistespace changes (to make future MFCs easier). This does not include (nost) epoch(9) related changes as too much other infrastructure was not merged for that. Bump __FreeBSD_veresion as this changes the priv(9) names (not know to be used externally), and net80211 structures. Tested on: some ath(4) AP, run(4) STA, and rtwn(4) STA Discussed with: adrian (extremly briefly) Sponsored by: Rubicon Communications, LLC (d/b/a "Netgate") [partially] Relnotes: yes Added: stable/12/tools/tools/ath/athani/ - copied from r344842, head/tools/tools/ath/athani/ Modified: stable/12/lib/lib80211/lib80211_regdomain.c stable/12/lib/lib80211/lib80211_regdomain.h stable/12/lib/lib80211/regdomain.xml stable/12/sbin/ifconfig/ifieee80211.c stable/12/share/man/man4/ath.4 stable/12/share/man/man4/net80211.4 stable/12/share/man/man4/run.4 stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300.h stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_ani.c stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_eeprom.c stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.c stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_misc.c stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_phy.c stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_reset.c stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_stub_funcs.c stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_stub_funcs.h stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300eep.h stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_ap121.h stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_aphrodite.h stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_cus157.h stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_generic.h stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_hb112.h stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_hb116.h stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_osprey_k31.h stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_wasp_2.h stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_xb112.h stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_xb113.h stable/12/sys/dev/an/if_an.c stable/12/sys/dev/ath/ah_osdep.c stable/12/sys/dev/ath/ah_osdep_ar5210.c stable/12/sys/dev/ath/ah_osdep_ar5211.c stable/12/sys/dev/ath/ah_osdep_ar5212.c stable/12/sys/dev/ath/ah_osdep_ar5416.c stable/12/sys/dev/ath/ah_osdep_ar9300.c stable/12/sys/dev/ath/ath_dfs/null/dfs_null.c stable/12/sys/dev/ath/ath_hal/ah.c stable/12/sys/dev/ath/ath_hal/ah.h stable/12/sys/dev/ath/ath_hal/ah_eeprom_9287.c stable/12/sys/dev/ath/ath_hal/ah_eeprom_9287.h stable/12/sys/dev/ath/ath_hal/ah_eeprom_v14.c stable/12/sys/dev/ath/ath_hal/ah_eeprom_v3.c stable/12/sys/dev/ath/ath_hal/ah_eeprom_v3.h stable/12/sys/dev/ath/ath_hal/ah_eeprom_v4k.c stable/12/sys/dev/ath/ath_hal/ah_internal.h stable/12/sys/dev/ath/ath_hal/ah_regdomain.c stable/12/sys/dev/ath/ath_hal/ah_regdomain/ah_rd_domains.h stable/12/sys/dev/ath/ath_hal/ah_regdomain/ah_rd_freqbands.h stable/12/sys/dev/ath/ath_hal/ah_soc.h stable/12/sys/dev/ath/ath_hal/ar5210/ar5210.h stable/12/sys/dev/ath/ath_hal/ar5210/ar5210_recv.c stable/12/sys/dev/ath/ath_hal/ar5210/ar5210_reset.c stable/12/sys/dev/ath/ath_hal/ar5211/ar5211.h stable/12/sys/dev/ath/ath_hal/ar5211/ar5211_keycache.c stable/12/sys/dev/ath/ath_hal/ar5211/ar5211_misc.c stable/12/sys/dev/ath/ath_hal/ar5211/ar5211_phy.c stable/12/sys/dev/ath/ath_hal/ar5211/ar5211_recv.c stable/12/sys/dev/ath/ath_hal/ar5211/ar5211_xmit.c stable/12/sys/dev/ath/ath_hal/ar5211/ar5211phy.h stable/12/sys/dev/ath/ath_hal/ar5211/ar5211reg.h stable/12/sys/dev/ath/ath_hal/ar5212/ar2316.c stable/12/sys/dev/ath/ath_hal/ar5212/ar2317.c stable/12/sys/dev/ath/ath_hal/ar5212/ar2413.c stable/12/sys/dev/ath/ath_hal/ar5212/ar2425.c stable/12/sys/dev/ath/ath_hal/ar5212/ar5111.c stable/12/sys/dev/ath/ath_hal/ar5212/ar5112.c stable/12/sys/dev/ath/ath_hal/ar5212/ar5212.h stable/12/sys/dev/ath/ath_hal/ar5212/ar5212_ani.c stable/12/sys/dev/ath/ath_hal/ar5212/ar5212_interrupts.c stable/12/sys/dev/ath/ath_hal/ar5212/ar5212_keycache.c stable/12/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c stable/12/sys/dev/ath/ath_hal/ar5212/ar5212_phy.c stable/12/sys/dev/ath/ath_hal/ar5212/ar5212_recv.c stable/12/sys/dev/ath/ath_hal/ar5212/ar5212_reset.c stable/12/sys/dev/ath/ath_hal/ar5212/ar5212_xmit.c stable/12/sys/dev/ath/ath_hal/ar5212/ar5212phy.h stable/12/sys/dev/ath/ath_hal/ar5212/ar5413.c stable/12/sys/dev/ath/ath_hal/ar5312/ar5312_eeprom.c stable/12/sys/dev/ath/ath_hal/ar5312/ar5312_gpio.c stable/12/sys/dev/ath/ath_hal/ar5312/ar5312_interrupts.c stable/12/sys/dev/ath/ath_hal/ar5312/ar5312_reset.c stable/12/sys/dev/ath/ath_hal/ar5312/ar5312reg.h stable/12/sys/dev/ath/ath_hal/ar5312/ar5315_gpio.c stable/12/sys/dev/ath/ath_hal/ar5416/ar2133.c stable/12/sys/dev/ath/ath_hal/ar5416/ar5416.h stable/12/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c stable/12/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c stable/12/sys/dev/ath/ath_hal/ar5416/ar5416_beacon.c stable/12/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c stable/12/sys/dev/ath/ath_hal/ar5416/ar5416_cal.h stable/12/sys/dev/ath/ath_hal/ar5416/ar5416_gpio.c stable/12/sys/dev/ath/ath_hal/ar5416/ar5416_power.c stable/12/sys/dev/ath/ath_hal/ar5416/ar5416_recv.c stable/12/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c stable/12/sys/dev/ath/ath_hal/ar5416/ar5416_spectral.c stable/12/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c stable/12/sys/dev/ath/ath_hal/ar5416/ar5416desc.h stable/12/sys/dev/ath/ath_hal/ar5416/ar5416reg.h stable/12/sys/dev/ath/ath_hal/ar9001/ar9130_attach.c stable/12/sys/dev/ath/ath_hal/ar9001/ar9160_attach.c stable/12/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c stable/12/sys/dev/ath/ath_hal/ar9002/ar9280_olc.c stable/12/sys/dev/ath/ath_hal/ar9002/ar9285.c stable/12/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c stable/12/sys/dev/ath/ath_hal/ar9002/ar9285_btcoex.c stable/12/sys/dev/ath/ath_hal/ar9002/ar9285_diversity.c stable/12/sys/dev/ath/ath_hal/ar9002/ar9285_reset.c stable/12/sys/dev/ath/ath_hal/ar9002/ar9287_attach.c stable/12/sys/dev/ath/ath_hal/ar9002/ar9287_cal.c stable/12/sys/dev/ath/ath_hal/ar9002/ar9287_reset.c stable/12/sys/dev/ath/ath_rate/amrr/amrr.c stable/12/sys/dev/ath/ath_rate/onoe/onoe.c stable/12/sys/dev/ath/ath_rate/sample/sample.c stable/12/sys/dev/ath/ath_rate/sample/sample.h stable/12/sys/dev/ath/ath_rate/sample/tx_schedules.h stable/12/sys/dev/ath/if_ath.c stable/12/sys/dev/ath/if_ath_ahb.c stable/12/sys/dev/ath/if_ath_beacon.c stable/12/sys/dev/ath/if_ath_beacon.h stable/12/sys/dev/ath/if_ath_btcoex.c stable/12/sys/dev/ath/if_ath_dfs.c stable/12/sys/dev/ath/if_ath_drv.c stable/12/sys/dev/ath/if_ath_ioctl.c stable/12/sys/dev/ath/if_ath_led.c stable/12/sys/dev/ath/if_ath_lna_div.c stable/12/sys/dev/ath/if_ath_misc.h stable/12/sys/dev/ath/if_ath_pci.c stable/12/sys/dev/ath/if_ath_pci_devlist.h stable/12/sys/dev/ath/if_ath_rate.c stable/12/sys/dev/ath/if_ath_rx.c stable/12/sys/dev/ath/if_ath_rx_edma.c stable/12/sys/dev/ath/if_ath_spectral.c stable/12/sys/dev/ath/if_ath_sysctl.c stable/12/sys/dev/ath/if_ath_tx.c stable/12/sys/dev/ath/if_ath_tx.h stable/12/sys/dev/ath/if_ath_tx_edma.c stable/12/sys/dev/ath/if_ath_tx_ht.c stable/12/sys/dev/ath/if_athioctl.h stable/12/sys/dev/ath/if_athrate.h stable/12/sys/dev/ath/if_athvar.h stable/12/sys/dev/bwi/bwimac.c stable/12/sys/dev/bwi/bwiphy.c stable/12/sys/dev/bwi/bwirf.c stable/12/sys/dev/bwi/if_bwi.c stable/12/sys/dev/bwi/if_bwi_pci.c stable/12/sys/dev/bwi/if_bwireg.h stable/12/sys/dev/bwn/if_bwn.c stable/12/sys/dev/bwn/if_bwn_pci.c stable/12/sys/dev/bwn/if_bwn_pcivar.h stable/12/sys/dev/bwn/if_bwn_phy_g.c stable/12/sys/dev/bwn/if_bwnvar.h stable/12/sys/dev/iwm/if_iwm.c stable/12/sys/dev/iwn/if_iwn.c stable/12/sys/dev/mwl/if_mwl.c stable/12/sys/dev/mwl/if_mwl_pci.c stable/12/sys/dev/mwl/mwlreg.h stable/12/sys/dev/otus/if_otus.c stable/12/sys/dev/otus/if_otusreg.h stable/12/sys/dev/rtwn/if_rtwn.c stable/12/sys/dev/rtwn/if_rtwn_beacon.c stable/12/sys/dev/rtwn/if_rtwn_calib.c stable/12/sys/dev/rtwn/if_rtwn_cam.c stable/12/sys/dev/rtwn/if_rtwn_efuse.c stable/12/sys/dev/rtwn/if_rtwn_fw.c stable/12/sys/dev/rtwn/if_rtwn_fw.h stable/12/sys/dev/rtwn/if_rtwn_ridx.h stable/12/sys/dev/rtwn/if_rtwn_rx.c stable/12/sys/dev/rtwn/if_rtwn_rx.h stable/12/sys/dev/rtwn/if_rtwn_task.c stable/12/sys/dev/rtwn/if_rtwn_tx.c stable/12/sys/dev/rtwn/if_rtwnreg.h stable/12/sys/dev/rtwn/if_rtwnvar.h stable/12/sys/dev/rtwn/pci/rtwn_pci_attach.c stable/12/sys/dev/rtwn/pci/rtwn_pci_reg.c stable/12/sys/dev/rtwn/pci/rtwn_pci_rx.c stable/12/sys/dev/rtwn/pci/rtwn_pci_tx.c stable/12/sys/dev/rtwn/pci/rtwn_pci_var.h stable/12/sys/dev/rtwn/rtl8188e/pci/r88ee.h stable/12/sys/dev/rtwn/rtl8188e/pci/r88ee_reg.h stable/12/sys/dev/rtwn/rtl8188e/r88e.h stable/12/sys/dev/rtwn/rtl8188e/r88e_beacon.c stable/12/sys/dev/rtwn/rtl8188e/r88e_calib.c stable/12/sys/dev/rtwn/rtl8188e/r88e_chan.c stable/12/sys/dev/rtwn/rtl8188e/r88e_fw.c stable/12/sys/dev/rtwn/rtl8188e/r88e_init.c stable/12/sys/dev/rtwn/rtl8188e/r88e_led.c stable/12/sys/dev/rtwn/rtl8188e/r88e_priv.h stable/12/sys/dev/rtwn/rtl8188e/r88e_reg.h stable/12/sys/dev/rtwn/rtl8188e/r88e_rf.c stable/12/sys/dev/rtwn/rtl8188e/r88e_rom.c stable/12/sys/dev/rtwn/rtl8188e/r88e_rx.c stable/12/sys/dev/rtwn/rtl8188e/r88e_tx.c stable/12/sys/dev/rtwn/rtl8188e/usb/r88eu.h stable/12/sys/dev/rtwn/rtl8188e/usb/r88eu_attach.c stable/12/sys/dev/rtwn/rtl8188e/usb/r88eu_init.c stable/12/sys/dev/rtwn/rtl8192c/pci/r92ce.h stable/12/sys/dev/rtwn/rtl8192c/pci/r92ce_attach.c stable/12/sys/dev/rtwn/rtl8192c/pci/r92ce_calib.c stable/12/sys/dev/rtwn/rtl8192c/pci/r92ce_fw.c stable/12/sys/dev/rtwn/rtl8192c/pci/r92ce_init.c stable/12/sys/dev/rtwn/rtl8192c/pci/r92ce_priv.h stable/12/sys/dev/rtwn/rtl8192c/pci/r92ce_reg.h stable/12/sys/dev/rtwn/rtl8192c/pci/r92ce_rx.c stable/12/sys/dev/rtwn/rtl8192c/pci/r92ce_tx.c stable/12/sys/dev/rtwn/rtl8192c/r92c.h stable/12/sys/dev/rtwn/rtl8192c/r92c_attach.c stable/12/sys/dev/rtwn/rtl8192c/r92c_beacon.c stable/12/sys/dev/rtwn/rtl8192c/r92c_calib.c stable/12/sys/dev/rtwn/rtl8192c/r92c_chan.c stable/12/sys/dev/rtwn/rtl8192c/r92c_fw.c stable/12/sys/dev/rtwn/rtl8192c/r92c_init.c stable/12/sys/dev/rtwn/rtl8192c/r92c_priv.h stable/12/sys/dev/rtwn/rtl8192c/r92c_reg.h stable/12/sys/dev/rtwn/rtl8192c/r92c_rf.c stable/12/sys/dev/rtwn/rtl8192c/r92c_rom.c stable/12/sys/dev/rtwn/rtl8192c/r92c_rx.c stable/12/sys/dev/rtwn/rtl8192c/r92c_tx.c stable/12/sys/dev/rtwn/rtl8192c/r92c_tx_desc.h stable/12/sys/dev/rtwn/rtl8192c/usb/r92cu.h stable/12/sys/dev/rtwn/rtl8192c/usb/r92cu_attach.c stable/12/sys/dev/rtwn/rtl8192c/usb/r92cu_init.c stable/12/sys/dev/rtwn/rtl8192c/usb/r92cu_led.c stable/12/sys/dev/rtwn/rtl8192c/usb/r92cu_priv.h stable/12/sys/dev/rtwn/rtl8192c/usb/r92cu_reg.h stable/12/sys/dev/rtwn/rtl8192c/usb/r92cu_rx.c stable/12/sys/dev/rtwn/rtl8192c/usb/r92cu_tx.c stable/12/sys/dev/rtwn/rtl8192c/usb/r92cu_tx_desc.h stable/12/sys/dev/rtwn/rtl8192e/r92e.h stable/12/sys/dev/rtwn/rtl8192e/r92e_chan.c stable/12/sys/dev/rtwn/rtl8192e/r92e_priv.h stable/12/sys/dev/rtwn/rtl8192e/usb/r92eu.h stable/12/sys/dev/rtwn/rtl8812a/r12a.h stable/12/sys/dev/rtwn/rtl8812a/r12a_beacon.c stable/12/sys/dev/rtwn/rtl8812a/r12a_calib.c stable/12/sys/dev/rtwn/rtl8812a/r12a_caps.c stable/12/sys/dev/rtwn/rtl8812a/r12a_chan.c stable/12/sys/dev/rtwn/rtl8812a/r12a_fw.c stable/12/sys/dev/rtwn/rtl8812a/r12a_fw_cmd.h stable/12/sys/dev/rtwn/rtl8812a/r12a_init.c stable/12/sys/dev/rtwn/rtl8812a/r12a_led.c stable/12/sys/dev/rtwn/rtl8812a/r12a_priv.h stable/12/sys/dev/rtwn/rtl8812a/r12a_reg.h stable/12/sys/dev/rtwn/rtl8812a/r12a_rf.c stable/12/sys/dev/rtwn/rtl8812a/r12a_rom.c stable/12/sys/dev/rtwn/rtl8812a/r12a_rx.c stable/12/sys/dev/rtwn/rtl8812a/r12a_tx.c stable/12/sys/dev/rtwn/rtl8812a/r12a_tx_desc.h stable/12/sys/dev/rtwn/rtl8812a/usb/r12au.h stable/12/sys/dev/rtwn/rtl8812a/usb/r12au_attach.c stable/12/sys/dev/rtwn/rtl8812a/usb/r12au_init.c stable/12/sys/dev/rtwn/rtl8812a/usb/r12au_rx.c stable/12/sys/dev/rtwn/rtl8812a/usb/r12au_tx.c stable/12/sys/dev/rtwn/rtl8821a/r21a.h stable/12/sys/dev/rtwn/rtl8821a/r21a_beacon.c stable/12/sys/dev/rtwn/rtl8821a/r21a_calib.c stable/12/sys/dev/rtwn/rtl8821a/r21a_chan.c stable/12/sys/dev/rtwn/rtl8821a/r21a_fw.c stable/12/sys/dev/rtwn/rtl8821a/r21a_init.c stable/12/sys/dev/rtwn/rtl8821a/r21a_led.c stable/12/sys/dev/rtwn/rtl8821a/r21a_priv.h stable/12/sys/dev/rtwn/rtl8821a/r21a_reg.h stable/12/sys/dev/rtwn/rtl8821a/r21a_rom.c stable/12/sys/dev/rtwn/rtl8821a/r21a_rx.c stable/12/sys/dev/rtwn/rtl8821a/usb/r21au.h stable/12/sys/dev/rtwn/rtl8821a/usb/r21au_attach.c stable/12/sys/dev/rtwn/rtl8821a/usb/r21au_dfs.c stable/12/sys/dev/rtwn/rtl8821a/usb/r21au_init.c stable/12/sys/dev/rtwn/usb/rtwn_usb_attach.c stable/12/sys/dev/rtwn/usb/rtwn_usb_attach.h stable/12/sys/dev/rtwn/usb/rtwn_usb_ep.c stable/12/sys/dev/rtwn/usb/rtwn_usb_reg.c stable/12/sys/dev/rtwn/usb/rtwn_usb_tx.c stable/12/sys/dev/usb/usbdevs stable/12/sys/dev/usb/wlan/if_rsu.c stable/12/sys/dev/usb/wlan/if_run.c stable/12/sys/dev/usb/wlan/if_runreg.h stable/12/sys/dev/usb/wlan/if_runvar.h stable/12/sys/dev/usb/wlan/if_zyd.c stable/12/sys/dev/wi/if_wavelan_ieee.h stable/12/sys/dev/wi/if_wi.c stable/12/sys/dev/wi/if_wi_macio.c stable/12/sys/dev/wi/if_wi_pccard.c stable/12/sys/dev/wi/if_wi_pci.c stable/12/sys/dev/wpi/if_wpireg.h stable/12/sys/dev/wtap/if_wtap.c stable/12/sys/kern/kern_jail.c stable/12/sys/net80211/_ieee80211.h stable/12/sys/net80211/ieee80211.c stable/12/sys/net80211/ieee80211.h stable/12/sys/net80211/ieee80211_adhoc.c stable/12/sys/net80211/ieee80211_amrr.c stable/12/sys/net80211/ieee80211_ddb.c stable/12/sys/net80211/ieee80211_freebsd.c stable/12/sys/net80211/ieee80211_freebsd.h stable/12/sys/net80211/ieee80211_hostap.c stable/12/sys/net80211/ieee80211_ht.c stable/12/sys/net80211/ieee80211_ht.h stable/12/sys/net80211/ieee80211_input.h stable/12/sys/net80211/ieee80211_ioctl.c stable/12/sys/net80211/ieee80211_ioctl.h stable/12/sys/net80211/ieee80211_node.c stable/12/sys/net80211/ieee80211_node.h stable/12/sys/net80211/ieee80211_output.c stable/12/sys/net80211/ieee80211_phy.h stable/12/sys/net80211/ieee80211_power.c stable/12/sys/net80211/ieee80211_proto.c stable/12/sys/net80211/ieee80211_proto.h stable/12/sys/net80211/ieee80211_regdomain.c stable/12/sys/net80211/ieee80211_scan_sta.c stable/12/sys/net80211/ieee80211_scan_sw.c stable/12/sys/net80211/ieee80211_sta.c stable/12/sys/net80211/ieee80211_sta.h stable/12/sys/net80211/ieee80211_var.h stable/12/sys/net80211/ieee80211_vht.c stable/12/sys/net80211/ieee80211_vht.h stable/12/sys/sys/param.h stable/12/sys/sys/priv.h stable/12/tools/tools/ath/Makefile stable/12/tools/tools/ath/ath_ee_9300_print/main.c stable/12/tools/tools/ath/athratestats/main.c stable/12/tools/tools/net80211/wlanstats/main.c stable/12/tools/tools/net80211/wlanstats/wlanstats.c Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/lib80211/lib80211_regdomain.c ============================================================================== --- stable/12/lib/lib80211/lib80211_regdomain.c Thu Sep 10 18:41:15 2020 (r365607) +++ stable/12/lib/lib80211/lib80211_regdomain.c Thu Sep 10 19:00:17 2020 (r365608) @@ -192,7 +192,7 @@ decode_flag(struct mystate *mt, const char *p, int len FLAG(IEEE80211_CHAN_VHT40), FLAG(IEEE80211_CHAN_VHT80), /* - * XXX VHT80_80? This likely should be done by + * XXX VHT80P80? This likely should be done by * 80MHz chan logic in net80211 / ifconfig. */ FLAG(IEEE80211_CHAN_VHT160), Modified: stable/12/lib/lib80211/lib80211_regdomain.h ============================================================================== --- stable/12/lib/lib80211/lib80211_regdomain.h Thu Sep 10 18:41:15 2020 (r365607) +++ stable/12/lib/lib80211/lib80211_regdomain.h Thu Sep 10 19:00:17 2020 (r365608) @@ -73,10 +73,10 @@ struct regdomain { netband_head bands_11b; /* 11b operation */ netband_head bands_11g; /* 11g operation */ netband_head bands_11a; /* 11a operation */ - netband_head bands_11ng;/* 11ng operation */ - netband_head bands_11na;/* 11na operation */ - netband_head bands_11ac;/* 11ac 5GHz operation */ - netband_head bands_11acg;/* 11ac 2GHz operation */ + netband_head bands_11ng; /* 11ng operation */ + netband_head bands_11na; /* 11na operation */ + netband_head bands_11ac; /* 11ac 5GHz operation */ + netband_head bands_11acg; /* 11ac 2GHz operation */ LIST_ENTRY(regdomain) next; }; Modified: stable/12/lib/lib80211/regdomain.xml ============================================================================== --- stable/12/lib/lib80211/regdomain.xml Thu Sep 10 18:41:15 2020 (r365607) +++ stable/12/lib/lib80211/regdomain.xml Thu Sep 10 19:00:17 2020 (r365608) @@ -111,6 +111,44 @@ IEEE80211_CHAN_HT40 + + + + 17 + IEEE80211_CHAN_HT20 + IEEE80211_CHAN_VHT20 + + + + 17 + IEEE80211_CHAN_HT40 + IEEE80211_CHAN_VHT40 + + + + 17 + IEEE80211_CHAN_HT40 + IEEE80211_CHAN_VHT80 + + + + 17 + IEEE80211_CHAN_HT20 + IEEE80211_CHAN_VHT20 + + + + 17 + IEEE80211_CHAN_HT40 + IEEE80211_CHAN_VHT40 + + + + 17 + IEEE80211_CHAN_HT40 + IEEE80211_CHAN_VHT80 + + @@ -1735,6 +1773,21 @@ 20 20 IEEE80211_CHAN_A + + 5180 5240 + 20 20 + IEEE80211_CHAN_A + + + 5180 5240 + 40 20 + IEEE80211_CHAN_A + + + 5180 5240 + 80 20 + IEEE80211_CHAN_A + 5180 5240 40 20 @@ -1823,6 +1876,21 @@ 5745 5805 20 20 + IEEE80211_CHAN_A + + + 5745 5805 + 20 20 + IEEE80211_CHAN_A + + + 5745 5805 + 40 20 + IEEE80211_CHAN_A + + + 5745 5805 + 80 20 IEEE80211_CHAN_A Modified: stable/12/sbin/ifconfig/ifieee80211.c ============================================================================== --- stable/12/sbin/ifconfig/ifieee80211.c Thu Sep 10 18:41:15 2020 (r365607) +++ stable/12/sbin/ifconfig/ifieee80211.c Thu Sep 10 19:00:17 2020 (r365608) @@ -125,8 +125,19 @@ #define IEEE80211_NODE_AMSDU_RX 0x040000 /* AMSDU rx enabled */ #define IEEE80211_NODE_AMSDU_TX 0x080000 /* AMSDU tx enabled */ #define IEEE80211_NODE_VHT 0x100000 /* VHT enabled */ +#define IEEE80211_NODE_LDPC 0x200000 /* LDPC enabled */ +#define IEEE80211_NODE_UAPSD 0x400000 /* UAPSD enabled */ #endif +/* XXX should also figure out where to put these for k/u-space sharing. */ +#ifndef IEEE80211_FVHT_VHT +#define IEEE80211_FVHT_VHT 0x000000001 /* CONF: VHT supported */ +#define IEEE80211_FVHT_USEVHT40 0x000000002 /* CONF: Use VHT40 */ +#define IEEE80211_FVHT_USEVHT80 0x000000004 /* CONF: Use VHT80 */ +#define IEEE80211_FVHT_USEVHT160 0x000000008 /* CONF: Use VHT160 */ +#define IEEE80211_FVHT_USEVHT80P80 0x000000010 /* CONF: Use VHT 80+80 */ +#endif + #define MAXCHAN 1536 /* max 1.5K channels */ #define MAXCOL 78 @@ -1804,6 +1815,12 @@ set80211ldpc(const char *val, int d, int s, const stru set80211(s, IEEE80211_IOC_LDPC, ldpc, 0, NULL); } +static void +set80211uapsd(const char *val, int d, int s, const struct afswtch *rafp) +{ + set80211(s, IEEE80211_IOC_UAPSD, d, 0, NULL); +} + static DECL_CMD_FUNC(set80211ampdulimit, val, d) { @@ -2159,8 +2176,6 @@ regdomain_addchans(struct ieee80211req_chaninfo *ci, /* * VHT first - HT is a subset. - * - * XXX TODO: VHT80p80, VHT160 is not yet done. */ if (flags & IEEE80211_CHAN_VHT) { if ((chanFlags & IEEE80211_CHAN_VHT20) && @@ -2184,7 +2199,20 @@ regdomain_addchans(struct ieee80211req_chaninfo *ci, "VHT80 channel\n", freq); continue; } - + if ((chanFlags & IEEE80211_CHAN_VHT160) && + (flags & IEEE80211_CHAN_VHT160) == 0) { + if (verbose) + printf("%u: skip, not a " + "VHT160 channel\n", freq); + continue; + } + if ((chanFlags & IEEE80211_CHAN_VHT80P80) && + (flags & IEEE80211_CHAN_VHT80P80) == 0) { + if (verbose) + printf("%u: skip, not a " + "VHT80+80 channel\n", freq); + continue; + } flags &= ~IEEE80211_CHAN_VHT; flags |= chanFlags & IEEE80211_CHAN_VHT; } @@ -2370,7 +2398,7 @@ regdomain_makechannels( &dc->dc_chaninfo); } - /* XXX TODO: VHT80_80, VHT160 */ + /* XXX TODO: VHT80P80, VHT160 */ } if (!LIST_EMPTY(&rd->bands_11ng) && dc->dc_htcaps != 0) { @@ -2631,6 +2659,10 @@ getflags(int flags) *cp++ = 't'; if (flags & IEEE80211_NODE_AMSDU_RX) *cp++ = 'r'; + if (flags & IEEE80211_NODE_UAPSD) + *cp++ = 'U'; + if (flags & IEEE80211_NODE_LDPC) + *cp++ = 'L'; *cp = '\0'; return flagstring; } @@ -3840,8 +3872,8 @@ list_stations(int s) , "TXSEQ" , "RXSEQ" ); - else - printf("%-17.17s %4s %4s %4s %4s %4s %6s %6s %4s %-7s\n" + else + printf("%-17.17s %4s %4s %4s %4s %4s %6s %6s %4s %-12s\n" , "ADDR" , "AID" , "CHAN" @@ -3875,8 +3907,8 @@ list_stations(int s) , gettxseq(si) , getrxseq(si) ); - else - printf("%s %4u %4d %3dM %4.1f %4d %6d %6d %-4.4s %-7.7s" + else + printf("%s %4u %4d %3dM %4.1f %4d %6d %6d %-4.4s %-12.12s" , ether_ntoa((const struct ether_addr*) si->isi_macaddr) , IEEE80211_AID(si->isi_associd) @@ -3937,8 +3969,11 @@ get_chaninfo(const struct ieee80211_channel *c, int pr if (IEEE80211_IS_CHAN_TURBO(c)) strlcat(buf, " Turbo", bsize); if (precise) { - /* XXX should make VHT80U, VHT80D */ - if (IEEE80211_IS_CHAN_VHT80(c) && + if (IEEE80211_IS_CHAN_VHT80P80(c)) + strlcat(buf, " vht/80p80", bsize); + else if (IEEE80211_IS_CHAN_VHT160(c)) + strlcat(buf, " vht/160", bsize); + else if (IEEE80211_IS_CHAN_VHT80(c) && IEEE80211_IS_CHAN_HT40D(c)) strlcat(buf, " vht/80-", bsize); else if (IEEE80211_IS_CHAN_VHT80(c) && @@ -3992,10 +4027,11 @@ print_chaninfo(const struct ieee80211_channel *c, int static int chanpref(const struct ieee80211_channel *c) { + + if (IEEE80211_IS_CHAN_VHT80P80(c)) + return 90; if (IEEE80211_IS_CHAN_VHT160(c)) return 80; - if (IEEE80211_IS_CHAN_VHT80_80(c)) - return 75; if (IEEE80211_IS_CHAN_VHT80(c)) return 70; if (IEEE80211_IS_CHAN_VHT40(c)) @@ -4767,6 +4803,23 @@ getid(int s, int ix, void *data, size_t len, int *plen return 0; } +static int +getdevicename(int s, void *data, size_t len, int *plen) +{ + struct ieee80211req ireq; + + (void) memset(&ireq, 0, sizeof(ireq)); + (void) strlcpy(ireq.i_name, name, sizeof(ireq.i_name)); + ireq.i_type = IEEE80211_IOC_IC_NAME; + ireq.i_val = -1; + ireq.i_data = data; + ireq.i_len = len; + if (ioctl(s, SIOCG80211, &ireq) < 0) + return (-1); + *plen = ireq.i_len; + return (0); +} + static void ieee80211_status(int s) { @@ -5288,30 +5341,40 @@ end: break; } } + if (get80211val(s, IEEE80211_IOC_UAPSD, &val) != -1) { + switch (val) { + case 0: + LINE_CHECK("-uapsd"); + break; + case 1: + LINE_CHECK("uapsd"); + break; + } + } } if (IEEE80211_IS_CHAN_VHT(c) || verbose) { getvhtconf(s); - if (vhtconf & 0x1) + if (vhtconf & IEEE80211_FVHT_VHT) LINE_CHECK("vht"); else LINE_CHECK("-vht"); - if (vhtconf & 0x2) + if (vhtconf & IEEE80211_FVHT_USEVHT40) LINE_CHECK("vht40"); else LINE_CHECK("-vht40"); - if (vhtconf & 0x4) + if (vhtconf & IEEE80211_FVHT_USEVHT80) LINE_CHECK("vht80"); else LINE_CHECK("-vht80"); - if (vhtconf & 0x8) - LINE_CHECK("vht80p80"); - else - LINE_CHECK("-vht80p80"); - if (vhtconf & 0x10) + if (vhtconf & IEEE80211_FVHT_USEVHT160) LINE_CHECK("vht160"); else LINE_CHECK("-vht160"); + if (vhtconf & IEEE80211_FVHT_USEVHT80P80) + LINE_CHECK("vht80p80"); + else + LINE_CHECK("-vht80p80"); } if (get80211val(s, IEEE80211_IOC_WME, &wme) != -1) { @@ -5481,6 +5544,12 @@ end: } LINE_BREAK(); + + if (getdevicename(s, data, sizeof(data), &len) < 0) + return; + LINE_CHECK("parent interface: %s", data); + + LINE_BREAK(); } static int @@ -5872,6 +5941,8 @@ static struct cmd ieee80211_cmds[] = { DEF_CMD("-ldpctx", -1, set80211ldpc), DEF_CMD("ldpc", 3, set80211ldpc), /* NB: tx+rx */ DEF_CMD("-ldpc", -3, set80211ldpc), + DEF_CMD("uapsd", 1, set80211uapsd), + DEF_CMD("-uapsd", 0, set80211uapsd), DEF_CMD("puren", 1, set80211puren), DEF_CMD("-puren", 0, set80211puren), DEF_CMD("doth", 1, set80211doth), @@ -5904,16 +5975,16 @@ static struct cmd ieee80211_cmds[] = { DEF_CMD("-ht40", 0, set80211htconf), DEF_CMD("ht", 3, set80211htconf), /* NB: 20+40 */ DEF_CMD("-ht", 0, set80211htconf), - DEF_CMD("vht", 1, set80211vhtconf), - DEF_CMD("-vht", 0, set80211vhtconf), - DEF_CMD("vht40", 2, set80211vhtconf), - DEF_CMD("-vht40", -2, set80211vhtconf), - DEF_CMD("vht80", 4, set80211vhtconf), - DEF_CMD("-vht80", -4, set80211vhtconf), - DEF_CMD("vht80p80", 8, set80211vhtconf), - DEF_CMD("-vht80p80", -8, set80211vhtconf), - DEF_CMD("vht160", 16, set80211vhtconf), - DEF_CMD("-vht160", -16, set80211vhtconf), + DEF_CMD("vht", IEEE80211_FVHT_VHT, set80211vhtconf), + DEF_CMD("-vht", 0, set80211vhtconf), + DEF_CMD("vht40", IEEE80211_FVHT_USEVHT40, set80211vhtconf), + DEF_CMD("-vht40", -IEEE80211_FVHT_USEVHT40, set80211vhtconf), + DEF_CMD("vht80", IEEE80211_FVHT_USEVHT80, set80211vhtconf), + DEF_CMD("-vht80", -IEEE80211_FVHT_USEVHT80, set80211vhtconf), + DEF_CMD("vht160", IEEE80211_FVHT_USEVHT160, set80211vhtconf), + DEF_CMD("-vht160", -IEEE80211_FVHT_USEVHT160, set80211vhtconf), + DEF_CMD("vht80p80", IEEE80211_FVHT_USEVHT80P80, set80211vhtconf), + DEF_CMD("-vht80p80", -IEEE80211_FVHT_USEVHT80P80, set80211vhtconf), DEF_CMD("rifs", 1, set80211rifs), DEF_CMD("-rifs", 0, set80211rifs), DEF_CMD("smps", IEEE80211_HTCAP_SMPS_ENA, set80211smps), Modified: stable/12/share/man/man4/ath.4 ============================================================================== --- stable/12/share/man/man4/ath.4 Thu Sep 10 18:41:15 2020 (r365607) +++ stable/12/share/man/man4/ath.4 Thu Sep 10 19:00:17 2020 (r365608) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\"/ -.Dd April 14, 2014 +.Dd June 16, 2020 .Dt ATH 4 .Os .Sh NAME @@ -60,10 +60,10 @@ The driver provides support for wireless network adapters based on the Atheros AR5210, AR5211, AR5212, AR5416 and AR9300 programming APIs. These APIs are used by a wide variety of chips; most all chips with -a PCI and/or CardBus interface are supported. +a PCI, PCIe and/or CardBus interface are supported. .Pp Supported features include 802.11 and 802.3 frames, power management, BSS, -IBSS, MBSS, TDMA, and host-based access point operation modes. +IBSS, MBSS, WDS/DWDS TDMA, and host-based access point operation modes. All host/device interaction is via DMA. .Pp Please note that from FreeBSD-9.0, the @@ -148,12 +148,13 @@ For more information on configuring this device, see .Pp Devices supported by the .Nm -driver come in either Cardbus or mini-PCI packages. -Wireless cards in Cardbus slots may be inserted and ejected on the fly. +driver come in Cardbus, ExpressCard, Mini-PCI and Mini-PCIe packages. +Wireless cards in Cardbus and ExpressCard slots may be inserted and +ejected on the fly. .Sh HARDWARE The .Nm -driver supports all Atheros Cardbus and PCI cards, +driver supports all Atheros Cardbus, ExpressCard, PCI and PCIe cards, except those that are based on the AR5005VL chipset. .Sh EXAMPLES Join a specific BSS network with WEP encryption: @@ -293,8 +294,7 @@ device driver first appeared in Revision A1 of the D-LINK DWL-G520 and DWL-G650 are based on an Intersil PrismGT chip and are not supported by this driver. .Sh BUGS -The driver does not fully enable power-save operation of the chip -in station mode; consequently power use is suboptimal (e.g. on a laptop). +The driver does supports optional station mode power-save operation. .Pp The AR5210 can only do WEP in hardware; consequently hardware assisted WEP is disabled in order to allow software implementations of TKIP and CCMP to Modified: stable/12/share/man/man4/net80211.4 ============================================================================== --- stable/12/share/man/man4/net80211.4 Thu Sep 10 18:41:15 2020 (r365607) +++ stable/12/share/man/man4/net80211.4 Thu Sep 10 19:00:17 2020 (r365608) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 10, 2009 +.Dd August 7, 2020 .Dt NET80211 4 .Os .Sh NAME @@ -393,6 +393,16 @@ Valid values are: and .Dv IEEE80211_HWMP_ROOTMODE_RANN (send broadcast Root Announcement (RANN) frames). +.It Dv IEEE80211_IOC_IC_NAME +Return the underlying hardware +.Xr device 9 +name in the buffer pointed to by +.Va i_data +and the name length including terminating NUL character in +.Va i_len . +If the buffer length is too small to hold the full name +.Er EINVAL +will be returned. .It Dv IEEE80211_IOC_INACTIVITY Return whether or not the system handles inactivity processing in .Va i_val . Modified: stable/12/share/man/man4/run.4 ============================================================================== --- stable/12/share/man/man4/run.4 Thu Sep 10 18:41:15 2020 (r365607) +++ stable/12/share/man/man4/run.4 Thu Sep 10 19:00:17 2020 (r365608) @@ -16,7 +16,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 8, 2018 +.Dd June 16, 2020 .Dt RUN 4 .Os .Sh NAME @@ -251,5 +251,5 @@ driver was written by .Sh CAVEATS The .Nm -driver does not support any of the 802.11n capabilities offered by the +driver supports some of the 11n capabilities found in the RT2800, RT3000 and RT3900 chipsets. Modified: stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300.h ============================================================================== --- stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300.h Thu Sep 10 18:41:15 2020 (r365607) +++ stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300.h Thu Sep 10 19:00:17 2020 (r365608) @@ -19,18 +19,14 @@ #include "ar9300_freebsd_inc.h" -#define AH_BIG_ENDIAN 4321 -#define AH_LITTLE_ENDIAN 1234 - -#if _BYTE_ORDER == _BIG_ENDIAN -#define AH_BYTE_ORDER AH_BIG_ENDIAN -#else -#define AH_BYTE_ORDER AH_LITTLE_ENDIAN -#endif - /* XXX doesn't belong here */ #define AR_EEPROM_MODAL_SPURS 5 +/* Ensure that AH_BYTE_ORDER is defined */ +#ifndef AH_BYTE_ORDER +#error AH_BYTE_ORDER needs to be defined! +#endif + /* * (a) this should be N(a), * (b) FreeBSD does define nitems, @@ -43,10 +39,8 @@ #include "ah_devid.h" #include "ar9300eep.h" /* For Eeprom definitions */ - #define AR9300_MAGIC 0x19741014 - /* MAC register values */ #define INIT_CONFIG_STATUS 0x00000000 @@ -1396,7 +1390,7 @@ extern void ar9300_wowoffload_download_ns_info(struct extern HAL_BOOL ar9300_reset(struct ath_hal *ah, HAL_OPMODE opmode, struct ieee80211_channel *chan, HAL_HT_MACMODE macmode, u_int8_t txchainmask, u_int8_t rxchainmask, HAL_HT_EXTPROTSPACING extprotspacing, - HAL_BOOL b_channel_change, HAL_STATUS *status, int is_scan); + HAL_BOOL b_channel_change, HAL_STATUS *status, HAL_RESET_TYPE reset_type, int is_scan); extern HAL_BOOL ar9300_lean_channel_change(struct ath_hal *ah, HAL_OPMODE opmode, struct ieee80211_channel *chan, HAL_HT_MACMODE macmode, u_int8_t txchainmask, u_int8_t rxchainmask); extern HAL_BOOL ar9300_set_reset_reg(struct ath_hal *ah, u_int32_t type); @@ -1406,7 +1400,7 @@ extern u_int16_t ar9300_is_single_ant_power_save_poss extern void ar9300_set_operating_mode(struct ath_hal *ah, int opmode); extern HAL_BOOL ar9300_phy_disable(struct ath_hal *ah); extern HAL_BOOL ar9300_disable(struct ath_hal *ah); -extern HAL_BOOL ar9300_chip_reset(struct ath_hal *ah, struct ieee80211_channel *); +extern HAL_BOOL ar9300_chip_reset(struct ath_hal *ah, struct ieee80211_channel *, HAL_RESET_TYPE type); extern HAL_BOOL ar9300_calibration(struct ath_hal *ah, struct ieee80211_channel *chan, u_int8_t rxchainmask, HAL_BOOL longcal, HAL_BOOL *isIQdone, int is_scan, u_int32_t *sched_cals); extern void ar9300_reset_cal_valid(struct ath_hal *ah, Modified: stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_ani.c ============================================================================== --- stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_ani.c Thu Sep 10 18:41:15 2020 (r365607) +++ stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_ani.c Thu Sep 10 19:00:17 2020 (r365608) @@ -462,13 +462,55 @@ ar9300_ani_control(struct ath_hal *ah, HAL_ANI_CMD cmd u_int level = param; u_int is_on; + HALDEBUG(ah, HAL_DEBUG_ANI, "%s: cmd=%d, param=%d, chan=%p, funcmask=0x%08x\n", + __func__, + cmd, + param, + chan, + ahp->ah_ani_function); + + if (chan == NULL && cmd != HAL_ANI_MODE) { HALDEBUG(ah, HAL_DEBUG_UNMASKABLE, "%s: ignoring cmd 0x%02x - no channel\n", __func__, cmd); return AH_FALSE; } - switch (cmd & ahp->ah_ani_function) { + /* + * These two control the top-level cck/ofdm immunity levels and will + * program the rest of the values. + */ + if (cmd == HAL_ANI_NOISE_IMMUNITY_LEVEL) { + if (param > HAL_ANI_OFDM_NUM_LEVEL) + return AH_FALSE; + ar9300_ani_set_odfm_noise_immunity_level(ah, param); + return AH_TRUE; + } + + if (cmd == HAL_ANI_CCK_NOISE_IMMUNITY_LEVEL) { + if (param > HAL_ANI_CCK_NUM_LEVEL) + return AH_FALSE; + ar9300_ani_set_cck_noise_immunity_level(ah, param); + return AH_TRUE; + } + + /* + * Check to see if this command is available in the + * current operating mode. + */ + if (((1 << cmd) & ahp->ah_ani_function) == 0) { + HALDEBUG(ah, HAL_DEBUG_ANI, + "%s: early check: invalid cmd 0x%02x (allowed=0x%02x)\n", + __func__, cmd, ahp->ah_ani_function); + return AH_FALSE; + } + + /* + * The rest of these program in the requested parameter values + * into the PHY. + */ + switch (cmd) { + case HAL_ANI_OFDM_WEAK_SIGNAL_DETECTION: { int m1_thresh_low, m2_thresh_low; @@ -887,13 +929,16 @@ ar9300_ani_reset(struct ath_hal *ah, HAL_BOOL is_scann /* only allow a subset of functions in AP mode */ if (AH_PRIVATE(ah)->ah_opmode == HAL_M_HOSTAP) { if (IS_CHAN_2GHZ(ichan)) { - ahp->ah_ani_function = (HAL_ANI_SPUR_IMMUNITY_LEVEL | - HAL_ANI_FIRSTEP_LEVEL | - HAL_ANI_MRC_CCK); + ahp->ah_ani_function = (1 << HAL_ANI_SPUR_IMMUNITY_LEVEL) | + (1 << HAL_ANI_FIRSTEP_LEVEL) | + (1 << HAL_ANI_MRC_CCK); } else { ahp->ah_ani_function = 0; } + } else { + ahp->ah_ani_function = HAL_ANI_ALL; } + /* always allow mode (on/off) to be controlled */ ahp->ah_ani_function |= HAL_ANI_MODE; @@ -1172,6 +1217,7 @@ ar9300_ani_ar_poll(struct ath_hal *ah, const HAL_NODE_ cck_phy_err_cnt = OS_REG_READ(ah, AR_PHY_ERR_2); /* Populate HAL_ANISTATS */ + /* XXX TODO: are these correct? */ if (ani_stats) { ani_stats->cckphyerr_cnt = cck_phy_err_cnt - ani_state->cck_phy_err_count; @@ -1212,18 +1258,32 @@ ar9300_ani_ar_poll(struct ath_hal *ah, const HAL_NODE_ return; } + /* + * Calculate the OFDM/CCK phy error rate over the listen time interval. + * This is used in subsequent math to see if the OFDM/CCK phy error rate + * is above or below the threshold checks. + */ + ofdm_phy_err_rate = ani_state->ofdm_phy_err_count * 1000 / ani_state->listen_time; cck_phy_err_rate = ani_state->cck_phy_err_count * 1000 / ani_state->listen_time; HALDEBUG(ah, HAL_DEBUG_ANI, - "%s: listen_time=%d OFDM:%d errs=%d/s CCK:%d errs=%d/s ofdm_turn=%d\n", + "%s: listen_time=%d (total: %d) OFDM:%d errs=%d/s CCK:%d errs=%d/s ofdm_turn=%d\n", __func__, listen_time, + ani_state->listen_time, ani_state->ofdm_noise_immunity_level, ofdm_phy_err_rate, ani_state->cck_noise_immunity_level, cck_phy_err_rate, ani_state->ofdms_turn); + /* + * Check for temporary noise spurs. This is intended to be used by + * rate control to check if we should try higher packet rates or not. + * If the noise period is short enough then we shouldn't avoid trying + * higher rates but if the noise is high/sustained then it's likely + * not a great idea to try the higher MCS rates. + */ if (ani_state->listen_time >= HAL_NOISE_DETECT_PERIOD) { old_phy_noise_spur = ani_state->phy_noise_spur; if (ofdm_phy_err_rate <= ani_state->ofdm_trig_low && @@ -1236,7 +1296,7 @@ ar9300_ani_ar_poll(struct ath_hal *ah, const HAL_NODE_ } if (old_phy_noise_spur != ani_state->phy_noise_spur) { HALDEBUG(ah, HAL_DEBUG_ANI, - "%s: enviroment change from %d to %d\n", + "%s: environment change from %d to %d\n", __func__, old_phy_noise_spur, ani_state->phy_noise_spur); } } @@ -1259,6 +1319,10 @@ ar9300_ani_ar_poll(struct ath_hal *ah, const HAL_NODE_ ar9300_ani_lower_immunity(ah); ani_state->ofdms_turn = !ani_state->ofdms_turn; } + /* + * Force an ANI restart regardless of whether the lower immunity + * level was met. + */ HALDEBUG(ah, HAL_DEBUG_ANI, "%s: 1 listen_time=%d ofdm=%d/s cck=%d/s - " "calling ar9300_ani_restart\n", @@ -1292,6 +1356,13 @@ ar9300_ani_ar_poll(struct ath_hal *ah, const HAL_NODE_ ani_state->ofdms_turn = AH_TRUE; } } + + /* + * Note that currently this poll function doesn't reset the listen + * time after it accumulates a second worth of error samples. + * It will continue to accumulate samples until a counter overflows, + * or a raise threshold is met, or 5 seconds passes. + */ } /* Modified: stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_eeprom.c ============================================================================== --- stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_eeprom.c Thu Sep 10 18:41:15 2020 (r365607) +++ stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_eeprom.c Thu Sep 10 19:00:17 2020 (r365608) @@ -3040,6 +3040,33 @@ ar9300_eeprom_set_transmit_power(struct ath_hal *ah, ahp->reg_dmn = ath_hal_getctl(ah, chan); /* + * After reading FCC/OET 13TR1003 (Directional Gain of IEEE 802.11 + * MIMO devices employing cyclic delay diversity) and looking at what + * ath9k does, let's disable the CDD check until it's clearer exactly + * how the maximum cap should be applied here. + * + * Right now the CDD check is simply unconditionally reducing the + * gain of legacy and 1/2 stream rates depending upon the chainmask. + * (CDD is used when transmitting rates that don't already use up the + * full set of streams - eg OFDM or MCS0-7 on a 2 or 3 chain TX path.) + * + * It's dropping the 2-chain TX by 3dB and 3-chain by 5dB to "meet" + * power spectral density requirements but it's not currently taking + * into account how close to the regulatory limit the hardware/antenna + * system is already at. It doesn't help that the conductive testing + * limits have the array gain at 0dB for all AR9300/derivative + * configurations. + * + * It also doesn't let us do single chain transmit at the full allowed + * power for the regulatory/CTL limits as it subtracts it from what's + * programmed into the hardware. + * + * ath9k doesn't factor any of the CDD stuff into account, so I'm going + * to disable it here and in the TPC path until I get a better idea + * of what to really do here. + */ +#if 0 + /* * Always use CDD/direct per rate power table for register based approach. * For FCC, CDD calculations should factor in the array gain, hence * this adjust call. ETSI and MKK does not have this requirement. @@ -3050,6 +3077,7 @@ ar9300_eeprom_set_transmit_power(struct ath_hal *ah, __func__); ar9300_adjust_reg_txpower_cdd(ah, target_power_val_t2); } +#endif if (ar9300_eeprom_get(ahp, EEP_PAPRD_ENABLED)) { for (i = 0; i < ar9300_rate_size; i++) { Modified: stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.c ============================================================================== --- stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.c Thu Sep 10 18:41:15 2020 (r365607) +++ stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.c Thu Sep 10 19:00:17 2020 (r365608) @@ -355,7 +355,7 @@ ar9300_attach_freebsd_ops(struct ath_hal *ah) ah->ah_setRxDP = ar9300_set_rx_dp; ah->ah_enableReceive = ar9300_enable_receive; ah->ah_stopDmaReceive = ar9300_stop_dma_receive_freebsd; - ah->ah_startPcuReceive = ar9300_start_pcu_receive_freebsd; + ah->ah_startPcuReceive = ar9300_start_pcu_receive; ah->ah_stopPcuReceive = ar9300_stop_pcu_receive; ah->ah_setMulticastFilter = ar9300_set_multicast_filter; ah->ah_setMulticastFilterIndex = ar9300SetMulticastFilterIndex; @@ -543,6 +543,7 @@ ar9300_reset_freebsd(struct ath_hal *ah, HAL_OPMODE op HAL_HT_EXTPROTSPACING_20, /* always 20Mhz channel spacing */ bChannelChange, status, + resetType, AH_FALSE); /* XXX should really extend ath_hal_reset() */ return (r); @@ -678,14 +679,6 @@ ar9300_reset_cal_valid_freebsd(struct ath_hal *ah, return (is_cal_done); } - -void -ar9300_start_pcu_receive_freebsd(struct ath_hal *ah) -{ - - /* is_scanning flag == NULL */ - ar9300_start_pcu_receive(ah, AH_FALSE); -} /* * FreeBSD will just pass in the descriptor value as 'pa'. Modified: stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_misc.c ============================================================================== --- stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_misc.c Thu Sep 10 18:41:15 2020 (r365607) +++ stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_misc.c Thu Sep 10 19:00:17 2020 (r365608) @@ -1263,15 +1263,13 @@ ar9300_get_diag_state(struct ath_hal *ah, int request, if (ani == AH_NULL) return AH_FALSE; /* Convert ar9300 HAL to FreeBSD HAL ANI state */ - /* XXX TODO: add all of these to the HAL ANI state structure */ bzero(&ahp->ext_ani_state, sizeof(ahp->ext_ani_state)); - /* XXX should this be OFDM or CCK noise immunity level? */ ahp->ext_ani_state.noiseImmunityLevel = ani->ofdm_noise_immunity_level; ahp->ext_ani_state.spurImmunityLevel = ani->spur_immunity_level; ahp->ext_ani_state.firstepLevel = ani->firstep_level; ahp->ext_ani_state.ofdmWeakSigDetectOff = ani->ofdm_weak_sig_detect_off; - /* mrc_cck_off */ - /* cck_noise_immunity_level */ + ahp->ext_ani_state.mrcCck = !! ani->mrc_cck_off; + ahp->ext_ani_state.cckNoiseImmunityLevel = ani->cck_noise_immunity_level; ahp->ext_ani_state.listenTime = ani->listen_time; @@ -1289,12 +1287,18 @@ ar9300_get_diag_state(struct ath_hal *ah, int request, 0 : sizeof(HAL_ANI_STATS); return AH_TRUE; case HAL_DIAG_ANI_CMD: + { + HAL_ANI_CMD savefunc = ahp->ah_ani_function; if (argsize != 2*sizeof(u_int32_t)) { return AH_FALSE; } + /* temporarly allow all functions so we can override */ + ahp->ah_ani_function = HAL_ANI_ALL; ar9300_ani_control( ah, ((const u_int32_t *)args)[0], ((const u_int32_t *)args)[1]); + ahp->ah_ani_function = savefunc; return AH_TRUE; + } #if 0 case HAL_DIAG_TXCONT: /*AR9300_CONTTXMODE(ah, (struct ath_desc *)args, argsize );*/ Modified: stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_phy.c ============================================================================== --- stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_phy.c Thu Sep 10 18:41:15 2020 (r365607) +++ stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_phy.c Thu Sep 10 19:00:17 2020 (r365608) @@ -55,10 +55,12 @@ static inline void ar9300_init_rate_txpower_stbc(struc const HAL_RATE_TABLE *rt, HAL_BOOL is40, int rt_ss_offset, int rt_ds_offset, int rt_ts_offset, u_int8_t chainmask); +#if 0 static inline void ar9300_adjust_rate_txpower_cdd(struct ath_hal *ah, const HAL_RATE_TABLE *rt, HAL_BOOL is40, int rt_ss_offset, int rt_ds_offset, int rt_ts_offset, u_int8_t chainmask); +#endif #define AR9300_11A_RT_OFDM_OFFSET 0 HAL_RATE_TABLE ar9300_11a_table = { @@ -442,6 +444,8 @@ ar9300_adjust_reg_txpower_cdd(struct ath_hal *ah, ((int16_t)AH_MIN((ahp->twice_antenna_reduction - (ahp->twice_antenna_gain + AR9300_TXBF_2TX_ARRAY_GAIN)), 0)); cdd_power = ahp->upper_limit[1] + twice_array_gain; + + HALDEBUG(ah, HAL_DEBUG_CALIBRATE, "%s: 2 chain; cdd_power=%d", __func__, cdd_power); /* Adjust OFDM legacy rates as well */ for (i = ALL_TARGET_LEGACY_6_24; i <= ALL_TARGET_LEGACY_54; i++) { if (power_per_rate[i] > cdd_power) { @@ -471,6 +475,7 @@ ar9300_adjust_reg_txpower_cdd(struct ath_hal *ah, ((int16_t)AH_MIN((ahp->twice_antenna_reduction - (ahp->twice_antenna_gain + AR9300_TXBF_3TX_ARRAY_GAIN)), 0)); cdd_power = ahp->upper_limit[2] + twice_array_gain; + HALDEBUG(ah, HAL_DEBUG_CALIBRATE, "%s: 3 chain; cdd_power=%d", __func__, cdd_power); /* Adjust OFDM legacy rates as well */ for (i = ALL_TARGET_LEGACY_6_24; i <= ALL_TARGET_LEGACY_54; i++) { if (power_per_rate[i] > cdd_power) { @@ -531,6 +536,7 @@ ar9300_init_rate_txpower(struct ath_hal *ah, u_int mod AR9300_11NA_RT_HT_SS_OFFSET, AR9300_11NA_RT_HT_DS_OFFSET, AR9300_11NA_RT_HT_TS_OFFSET, chainmask); +#if 0 /* For FCC the array gain has to be factored for CDD mode */ if (is_reg_dmn_fcc(ath_hal_getctl(ah, chan))) { ar9300_adjust_rate_txpower_cdd(ah, rt, is40, @@ -538,6 +544,7 @@ ar9300_init_rate_txpower(struct ath_hal *ah, u_int mod AR9300_11NA_RT_HT_DS_OFFSET, AR9300_11NA_RT_HT_TS_OFFSET, chainmask); } +#endif break; case HAL_MODE_11G: ar9300_init_rate_txpower_cck(ah, rt, power_per_rate, chainmask); @@ -561,6 +568,7 @@ ar9300_init_rate_txpower(struct ath_hal *ah, u_int mod AR9300_11NG_RT_HT_SS_OFFSET, AR9300_11NG_RT_HT_DS_OFFSET, AR9300_11NG_RT_HT_TS_OFFSET, chainmask); +#if 0 /* For FCC the array gain needs to be factored for CDD mode */ if (is_reg_dmn_fcc(ath_hal_getctl(ah, chan))) { ar9300_adjust_rate_txpower_cdd(ah, rt, is40, @@ -568,6 +576,7 @@ ar9300_init_rate_txpower(struct ath_hal *ah, u_int mod AR9300_11NG_RT_HT_DS_OFFSET, AR9300_11NG_RT_HT_TS_OFFSET, chainmask); } +#endif break; default: HALDEBUG(ah, HAL_DEBUG_POWER_MGMT, "%s: invalid mode 0x%x\n", @@ -941,6 +950,10 @@ ar9300_init_rate_txpower_stbc(struct ath_hal *ah, cons return; } +/* + * To see why this is disabled, look at ar9300_eeprom.c for FCC/OET 13TR1003. + */ +#if 0 static inline void ar9300_adjust_rate_txpower_cdd(struct ath_hal *ah, const HAL_RATE_TABLE *rt, HAL_BOOL is40, @@ -1037,6 +1050,7 @@ ar9300_adjust_rate_txpower_cdd(struct ath_hal *ah, con return; } +#endif void ar9300_disp_tpc_tables(struct ath_hal *ah) { Modified: stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_reset.c ============================================================================== --- stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_reset.c Thu Sep 10 18:41:15 2020 (r365607) +++ stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_reset.c Thu Sep 10 19:00:17 2020 (r365608) @@ -2064,7 +2064,7 @@ ar9300_set_rf_mode(struct ath_hal *ah, struct ieee8021 * Places the hardware into reset and then pulls it out of reset */ HAL_BOOL -ar9300_chip_reset(struct ath_hal *ah, struct ieee80211_channel *chan) +ar9300_chip_reset(struct ath_hal *ah, struct ieee80211_channel *chan, HAL_RESET_TYPE reset_type) { struct ath_hal_9300 *ahp = AH9300(ah); int type = HAL_RESET_WARM; @@ -2080,8 +2080,13 @@ ar9300_chip_reset(struct ath_hal *ah, struct ieee80211 */ if (ahp->ah_chip_full_sleep || (ah->ah_config.ah_force_full_reset == 1) || + (reset_type == HAL_RESET_FORCE_COLD) || + (reset_type == HAL_RESET_BBPANIC) || OS_REG_READ(ah, AR_Q_TXE) || (OS_REG_READ(ah, AR_CR) & AR_CR_RXE)) { + HALDEBUG(ah, HAL_DEBUG_RESET, + "%s: full reset; reset_type=%d, full_sleep=%d\n", + __func__, reset_type, ahp->ah_chip_full_sleep); type = HAL_RESET_COLD; } @@ -4510,7 +4515,7 @@ HAL_BOOL ar9300_reset(struct ath_hal *ah, HAL_OPMODE opmode, struct ieee80211_channel *chan, HAL_HT_MACMODE macmode, u_int8_t txchainmask, u_int8_t rxchainmask, HAL_HT_EXTPROTSPACING extprotspacing, HAL_BOOL b_channel_change, - HAL_STATUS *status, int is_scan) + HAL_STATUS *status, HAL_RESET_TYPE reset_type, int is_scan) { #define FAIL(_code) do { ecode = _code; goto bad; } while (0) u_int32_t save_led_state; @@ -4864,7 +4869,7 @@ ar9300_reset(struct ath_hal *ah, HAL_OPMODE opmode, st /* Mark PHY inactive prior to reset, to be undone in ar9300_init_bb () */ ar9300_mark_phy_inactive(ah); - if (!ar9300_chip_reset(ah, chan)) { + if (!ar9300_chip_reset(ah, chan, reset_type)) { HALDEBUG(ah, HAL_DEBUG_RESET, "%s: chip reset failed\n", __func__); FAIL(HAL_EIO); } Modified: stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_stub_funcs.c ============================================================================== --- stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_stub_funcs.c Thu Sep 10 18:41:15 2020 (r365607) +++ stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_stub_funcs.c Thu Sep 10 19:00:17 2020 (r365608) @@ -691,7 +691,7 @@ ar9300_Stub_StopDmaReceive(struct ath_hal *ah) } void -ar9300_Stub_StartPcuReceive(struct ath_hal *ah) +ar9300_Stub_StartPcuReceive(struct ath_hal *ah, HAL_BOOL is_scanning) { ath_hal_printf(ah, "%s: called\n", __func__); Modified: stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_stub_funcs.h ============================================================================== --- stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_stub_funcs.h Thu Sep 10 18:41:15 2020 (r365607) +++ stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_stub_funcs.h Thu Sep 10 19:00:17 2020 (r365608) @@ -112,7 +112,7 @@ extern void ar9300_Stub_SetRxDP(struct ath_hal *ah, ui HAL_RX_QUEUE); extern void ar9300_Stub_EnableReceive(struct ath_hal *ah); extern HAL_BOOL ar9300_Stub_StopDmaReceive(struct ath_hal *ah); -extern void ar9300_Stub_StartPcuReceive(struct ath_hal *ah); +extern void ar9300_Stub_StartPcuReceive(struct ath_hal *ah, HAL_BOOL); extern void ar9300_Stub_StopPcuReceive(struct ath_hal *ah); extern void ar9300_Stub_SetMulticastFilter(struct ath_hal *ah, uint32_t filter0, uint32_t filter1); Modified: stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300eep.h ============================================================================== --- stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300eep.h Thu Sep 10 18:41:15 2020 (r365607) +++ stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300eep.h Thu Sep 10 19:00:17 2020 (r365608) @@ -18,13 +18,17 @@ #define _ATH_AR9300_EEP_H_ #include "opt_ah.h" - #include "ah.h" #if defined(WIN32) || defined(WIN64) #pragma pack (push, ar9300, 1) #endif +/* Ensure that AH_BYTE_ORDER is defined */ +#ifndef AH_BYTE_ORDER +#error AH_BYTE_ORDER needs to be defined! +#endif + /* FreeBSD extras - should be in ah_eeprom.h ? */ #define AR_EEPROM_EEPCAP_COMPRESS_DIS 0x0001 #define AR_EEPROM_EEPCAP_AES_DIS 0x0002 @@ -345,11 +349,13 @@ typedef struct CalCtlEdgePwr { u_int8_t flag :2, t_power :6; } __packed CAL_CTL_EDGE_PWR; -#else +#elif AH_BYTE_ORDER == AH_LITTLE_ENDIAN typedef struct CalCtlEdgePwr { u_int8_t t_power :6, flag :2; } __packed CAL_CTL_EDGE_PWR; +#else +#error AH_BYTE_ORDER undefined! #endif typedef struct ospCalCtlData_5G { Modified: stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_ap121.h ============================================================================== --- stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_ap121.h Thu Sep 10 18:41:15 2020 (r365607) +++ stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_ap121.h Thu Sep 10 19:00:17 2020 (r365608) @@ -25,6 +25,11 @@ #ifndef __ar9300templateAP121_h__ #define __ar9300templateAP121_h__ +/* Ensure that AH_BYTE_ORDER is defined */ +#ifndef AH_BYTE_ORDER +#error AH_BYTE_ORDER needs to be defined! +#endif + static ar9300_eeprom_t ar9300_template_ap121= { Modified: stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_aphrodite.h ============================================================================== --- stable/12/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_aphrodite.h Thu Sep 10 18:41:15 2020 (r365607) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Thu Sep 10 19:25:53 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 008223E2032; Thu, 10 Sep 2020 19:25:53 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BnTPr5X60z4XMG; Thu, 10 Sep 2020 19:25:52 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 A0E6117EDE; Thu, 10 Sep 2020 19:25:52 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08AJPq1Y001061; Thu, 10 Sep 2020 19:25:52 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08AJPpxd001057; Thu, 10 Sep 2020 19:25:51 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <202009101925.08AJPpxd001057@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Thu, 10 Sep 2020 19:25:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365609 - in head/tests/sys: netinet netinet6 X-SVN-Group: head X-SVN-Commit-Author: melifaro X-SVN-Commit-Paths: in head/tests/sys: netinet netinet6 X-SVN-Commit-Revision: 365609 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.33 Precedence: list List-Id: "SVN commit messages 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, 10 Sep 2020 19:25:53 -0000 Author: melifaro Date: Thu Sep 10 19:25:51 2020 New Revision: 365609 URL: https://svnweb.freebsd.org/changeset/base/365609 Log: Add basic test for net.fibs dynamic growth. Reviewed by: kp Differential Revision: https://reviews.freebsd.org/D26382 Added: head/tests/sys/netinet/fibs.sh (contents, props changed) head/tests/sys/netinet6/fibs6.sh (contents, props changed) Modified: head/tests/sys/netinet/Makefile head/tests/sys/netinet6/Makefile Modified: head/tests/sys/netinet/Makefile ============================================================================== --- head/tests/sys/netinet/Makefile Thu Sep 10 19:00:17 2020 (r365608) +++ head/tests/sys/netinet/Makefile Thu Sep 10 19:25:51 2020 (r365609) @@ -9,7 +9,7 @@ ATF_TESTS_C= ip_reass_test \ so_reuseport_lb_test \ socket_afinet -ATF_TESTS_SH= carp fibs_test redirect divert forward output lpm +ATF_TESTS_SH= carp fibs fibs_test redirect divert forward output lpm TEST_METADATA.output+= required_programs="python" PROGS= udp_dontroute tcp_user_cookie Added: head/tests/sys/netinet/fibs.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/netinet/fibs.sh Thu Sep 10 19:25:51 2020 (r365609) @@ -0,0 +1,73 @@ +#!/usr/bin/env atf-sh +#- +# SPDX-License-Identifier: BSD-2-Clause +# +# Copyright (c) 2020 Alexander V. Chernikov +# +# 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$ +# + +. $(atf_get_srcdir)/../common/vnet.subr + +atf_test_case "fibs_ifroutes1_success" "cleanup" +fibs_ifroutes1_success_head() +{ + + atf_set descr 'Test IPv4 routes gets populated in the correct fib' + atf_set require.user root +} + +fibs_ifroutes1_success_body() +{ + + vnet_init + + net_dst="192.168.0." + jname="v6t-fibs_ifroutes1_success" + + epair=$(vnet_mkepair) + vnet_mkjail ${jname}a ${epair}a + + jexec ${jname}a sysctl net.fibs=2 + + jexec ${jname}a ifconfig ${epair}a fib 1 + jexec ${jname}a ifconfig ${epair}a inet ${net_dst}1/24 + jexec ${jname}a ifconfig ${epair}a up + + atf_check -s exit:0 -o ignore jexec ${jname}a setfib 1 route -4n get ${net_dst}0/24 + atf_check -o match:"interface: lo0" jexec ${jname}a setfib 1 route -4n get ${net_dst}1 + atf_check -o match:"destination: ${net_dst}1" jexec ${jname}a setfib 1 route -4n get ${net_dst}1 +} + +fibs_ifroutes1_success_cleanup() +{ + vnet_cleanup +} + +atf_init_test_cases() +{ + atf_add_test_case "fibs_ifroutes1_success" +} + + Modified: head/tests/sys/netinet6/Makefile ============================================================================== --- head/tests/sys/netinet6/Makefile Thu Sep 10 19:00:17 2020 (r365608) +++ head/tests/sys/netinet6/Makefile Thu Sep 10 19:25:51 2020 (r365609) @@ -13,7 +13,8 @@ ATF_TESTS_SH= \ divert \ forward6 \ output6 \ - lpm6 + lpm6 \ + fibs6 TEST_METADATA.output6+= required_programs="python" ${PACKAGE}FILES+= exthdr.py Added: head/tests/sys/netinet6/fibs6.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/netinet6/fibs6.sh Thu Sep 10 19:25:51 2020 (r365609) @@ -0,0 +1,92 @@ +#!/usr/bin/env atf-sh +#- +# SPDX-License-Identifier: BSD-2-Clause +# +# Copyright (c) 2020 Alexander V. Chernikov +# +# 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$ +# + +. $(atf_get_srcdir)/../common/vnet.subr + +atf_test_case "fibs6_ifroutes1_success" "cleanup" +fibs6_ifroutes1_success_head() +{ + + atf_set descr 'Test IPv6 routes gets populated in the correct fib' + atf_set require.user root +} + +fibs6_ifroutes1_success_body() +{ + + vnet_init + + net_dst="2001:db8::" + jname="v6t-fibs6_ifroutes1_success" + + epair=$(vnet_mkepair) + vnet_mkjail ${jname}a ${epair}a + + jexec ${jname}a sysctl net.fibs=2 + + jexec ${jname}a ifconfig ${epair}a fib 1 + jexec ${jname}a ifconfig ${epair}a inet6 ${net_dst}1/64 + jexec ${jname}a ifconfig ${epair}a up + + + # wait for DAD to complete + while [ `jexec ${jname}a ifconfig | grep inet6 | grep -c tentative` != "0" ]; do + sleep 0.1 + done + # wait for lo0 to come up + while [ `jexec ${jname}a ifconfig -l | grep -c lo0` = "0" ]; do + sleep 0.1 + done + jexec ${jname}a setfib 1 netstat -rn + jexec ${jname}a ifconfig + + lladdr=`jexec ${jname}a ifconfig ${epair}a inet6 | awk '$1~/inet6/ && $2~/^fe80/{print$2}'` + + jexec ${jname}a setfib 1 route -6n get ${net_dst}/64 + jexec ${jname}a setfib 1 route -6n get ${net_dst}1/128 + jexec ${jname}a setfib 1 route -6n get fe80::%${epair}a/64 + jexec ${jname}a setfib 1 route -6n get ${lladdr} + + atf_check -s exit:0 -o ignore jexec ${jname}a setfib 1 route -6n get ${net_dst}/64 + atf_check -s exit:0 -o ignore jexec ${jname}a setfib 1 route -6n get ${net_dst}1/128 + atf_check -s exit:0 -o ignore jexec ${jname}a setfib 1 route -6n get fe80::%${epair}a/64 + atf_check -s exit:0 -o ignore jexec ${jname}a setfib 1 route -6n get ${lladdr} +} + +fibs6_ifroutes1_success_cleanup() +{ + vnet_cleanup +} + +atf_init_test_cases() +{ + atf_add_test_case "fibs6_ifroutes1_success" +} + From owner-svn-src-all@freebsd.org Thu Sep 10 20:28:43 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F0A9F3E3129; Thu, 10 Sep 2020 20:28:43 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BnVpM69DBz4bw6; Thu, 10 Sep 2020 20:28:43 +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 B6FED18859; Thu, 10 Sep 2020 20:28:43 +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 08AKSh25038215; Thu, 10 Sep 2020 20:28:43 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08AKShDq038214; Thu, 10 Sep 2020 20:28:43 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <202009102028.08AKShDq038214@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 10 Sep 2020 20:28:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r365610 - svnadmin/conf X-SVN-Group: svnadmin X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: svnadmin/conf X-SVN-Commit-Revision: 365610 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.33 Precedence: list List-Id: "SVN commit messages 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, 10 Sep 2020 20:28:44 -0000 Author: gjb Date: Thu Sep 10 20:28:43 2020 New Revision: 365610 URL: https://svnweb.freebsd.org/changeset/base/365610 Log: Require explicit re@ approval for the releng/12.2 branch. Approved by: re (implicit) Sponsored by: Rubicon Communications, LLC (netgate.com) Modified: svnadmin/conf/approvers Modified: svnadmin/conf/approvers ============================================================================== --- svnadmin/conf/approvers Thu Sep 10 19:25:51 2020 (r365609) +++ svnadmin/conf/approvers Thu Sep 10 20:28:43 2020 (r365610) @@ -20,6 +20,7 @@ #^stable/12/ re #^stable/11/ re ^release/ re +^releng/12.2/ re ^releng/12.[0-1]/ (security-officer|so) ^releng/11.[0-4]/ (security-officer|so) ^releng/10.[0-4]/ (security-officer|so) From owner-svn-src-all@freebsd.org Thu Sep 10 20:34:45 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BBF693E350D; Thu, 10 Sep 2020 20:34:45 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BnVxK4W6Rz4cJf; Thu, 10 Sep 2020 20:34:45 +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 7994E18A45; Thu, 10 Sep 2020 20:34:45 +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 08AKYjKq044382; Thu, 10 Sep 2020 20:34:45 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08AKYjpE044381; Thu, 10 Sep 2020 20:34:45 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202009102034.08AKYjpE044381@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 10 Sep 2020 20:34:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365611 - stable/12/sys/riscv/riscv X-SVN-Group: stable-12 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: stable/12/sys/riscv/riscv X-SVN-Commit-Revision: 365611 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.33 Precedence: list List-Id: "SVN commit messages 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, 10 Sep 2020 20:34:45 -0000 Author: jhb Date: Thu Sep 10 20:34:44 2020 New Revision: 365611 URL: https://svnweb.freebsd.org/changeset/base/365611 Log: MFC 363459: Pass the right size to memcpy() when copying the array of FP registers. The size of the containing structure was passed instead of the size of the array. This happened to be harmless as the extra word copied is one we copy in the next line anyway. Modified: stable/12/sys/riscv/riscv/machdep.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/riscv/riscv/machdep.c ============================================================================== --- stable/12/sys/riscv/riscv/machdep.c Thu Sep 10 20:28:43 2020 (r365610) +++ stable/12/sys/riscv/riscv/machdep.c Thu Sep 10 20:34:44 2020 (r365611) @@ -414,7 +414,7 @@ get_fpcontext(struct thread *td, mcontext_t *mcp) KASSERT((curpcb->pcb_fpflags & ~PCB_FP_USERMASK) == 0, ("Non-userspace FPE flags set in get_fpcontext")); memcpy(mcp->mc_fpregs.fp_x, curpcb->pcb_x, - sizeof(mcp->mc_fpregs)); + sizeof(mcp->mc_fpregs.fp_x)); mcp->mc_fpregs.fp_fcsr = curpcb->pcb_fcsr; mcp->mc_fpregs.fp_flags = curpcb->pcb_fpflags; mcp->mc_flags |= _MC_FP_VALID; @@ -441,7 +441,7 @@ set_fpcontext(struct thread *td, mcontext_t *mcp) curpcb = curthread->td_pcb; /* FPE usage is enabled, override registers. */ memcpy(curpcb->pcb_x, mcp->mc_fpregs.fp_x, - sizeof(mcp->mc_fpregs)); + sizeof(mcp->mc_fpregs.fp_x)); curpcb->pcb_fcsr = mcp->mc_fpregs.fp_fcsr; curpcb->pcb_fpflags = mcp->mc_fpregs.fp_flags & PCB_FP_USERMASK; td->td_frame->tf_sstatus |= SSTATUS_FS_CLEAN; From owner-svn-src-all@freebsd.org Thu Sep 10 20:46:18 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7A2F03E34F7; Thu, 10 Sep 2020 20:46:18 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BnWBf2b6Cz4cb5; Thu, 10 Sep 2020 20:46:18 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 225A118A5F; Thu, 10 Sep 2020 20:46:18 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08AKkIGh050447; Thu, 10 Sep 2020 20:46:18 GMT (envelope-from erj@FreeBSD.org) Received: (from erj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08AKkG3i050439; Thu, 10 Sep 2020 20:46:16 GMT (envelope-from erj@FreeBSD.org) Message-Id: <202009102046.08AKkG3i050439@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: erj set sender to erj@FreeBSD.org using -f From: Eric Joyner Date: Thu, 10 Sep 2020 20:46:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365612 - in stable/12: . sys/amd64/conf sys/conf sys/contrib/dev/ice sys/dev/ice sys/modules sys/modules/ice sys/modules/ice_ddp tools/kerneldoc/subsys X-SVN-Group: stable-12 X-SVN-Commit-Author: erj X-SVN-Commit-Paths: in stable/12: . sys/amd64/conf sys/conf sys/contrib/dev/ice sys/dev/ice sys/modules sys/modules/ice sys/modules/ice_ddp tools/kerneldoc/subsys X-SVN-Commit-Revision: 365612 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.33 Precedence: list List-Id: "SVN commit messages 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, 10 Sep 2020 20:46:18 -0000 Author: erj Date: Thu Sep 10 20:46:16 2020 New Revision: 365612 URL: https://svnweb.freebsd.org/changeset/base/365612 Log: MFC r361541, r362038, r364240 These MFCs add the ice(4) driver to the kernel for Intel 800 Series Ethernet adapters, a couple fixes for the ice_ddp module makefile, and remove some redeclarations, respectively. Relnotes: yes Sponsored by: Intel Corporation Added: stable/12/sys/contrib/dev/ice/ - copied from r361541, head/sys/contrib/dev/ice/ stable/12/sys/dev/ice/ - copied from r361541, head/sys/dev/ice/ stable/12/sys/modules/ice/ - copied from r361541, head/sys/modules/ice/ stable/12/sys/modules/ice_ddp/ - copied from r361541, head/sys/modules/ice_ddp/ stable/12/tools/kerneldoc/subsys/Doxyfile-dev_ice - copied unchanged from r361541, head/tools/kerneldoc/subsys/Doxyfile-dev_ice Modified: stable/12/MAINTAINERS stable/12/sys/amd64/conf/GENERIC stable/12/sys/amd64/conf/NOTES stable/12/sys/conf/files.amd64 stable/12/sys/conf/files.arm64 stable/12/sys/dev/ice/ice_common.h stable/12/sys/modules/Makefile stable/12/sys/modules/ice_ddp/Makefile Directory Properties: stable/12/ (props changed) Modified: stable/12/MAINTAINERS ============================================================================== --- stable/12/MAINTAINERS Thu Sep 10 20:34:44 2020 (r365611) +++ stable/12/MAINTAINERS Thu Sep 10 20:46:16 2020 (r365612) @@ -89,9 +89,11 @@ share/mk/*.test.mk freebsd-testing,ngie (same list as stand/forth dteske Pre-commit review requested. stand/lua kevans Pre-commit review requested sys/compat/linuxkpi hselasky If in doubt, ask. +sys/contrib/dev/ice erj Pre-commit phabricator review requested. sys/dev/e1000 erj Pre-commit phabricator review requested. sys/dev/ixgbe erj Pre-commit phabricator review requested. sys/dev/ixl erj Pre-commit phabricator review requested. +sys/dev/ice erj Pre-commit phabricator review requested. sys/dev/sound/usb hselasky If in doubt, ask. sys/dev/usb hselasky If in doubt, ask. sys/dev/xen royger Pre-commit review recommended. Modified: stable/12/sys/amd64/conf/GENERIC ============================================================================== --- stable/12/sys/amd64/conf/GENERIC Thu Sep 10 20:34:44 2020 (r365611) +++ stable/12/sys/amd64/conf/GENERIC Thu Sep 10 20:46:16 2020 (r365612) @@ -225,6 +225,7 @@ device ix # Intel PRO/10GbE PCIE PF Ethernet device ixv # Intel PRO/10GbE PCIE VF Ethernet device ixl # Intel 700 Series Physical Function device iavf # Intel Adaptive Virtual Function +device ice # Intel 800 Series Physical Function device vmx # VMware VMXNET3 Ethernet # PCI Ethernet NICs. Modified: stable/12/sys/amd64/conf/NOTES ============================================================================== --- stable/12/sys/amd64/conf/NOTES Thu Sep 10 20:34:44 2020 (r365611) +++ stable/12/sys/amd64/conf/NOTES Thu Sep 10 20:46:16 2020 (r365612) @@ -306,6 +306,8 @@ options DRM_DEBUG # Include debug printfs (slow) # ed: Western Digital and SMC 80xx; Novell NE1000 and NE2000; 3Com 3C503 # HP PC Lan+, various PC Card devices # (requires miibus) +# ice: Intel 800 Series Physical Function +# Requires the ice_ddp module for full functionality # ipw: Intel PRO/Wireless 2100 IEEE 802.11 adapter # Requires the ipw firmware module # iwi: Intel PRO/Wireless 2200BG/2225BG/2915ABG IEEE 802.11 adapters @@ -332,6 +334,8 @@ device iwi # Intel 2200BG/2225BG/2915ABG wireless NI device iwn # Intel 4965/1000/5000/6000 wireless NICs. device ixl # Intel 700 Series Physical Function device iavf # Intel Adaptive Virtual Function +device ice # Intel 800 Series Physical Function +device ice_ddp # Intel 800 Series DDP Package device mthca # Mellanox HCA InfiniBand device mlx4 # Shared code module between IB and Ethernet device mlx4ib # Mellanox ConnectX HCA InfiniBand Modified: stable/12/sys/conf/files.amd64 ============================================================================== --- stable/12/sys/conf/files.amd64 Thu Sep 10 20:34:44 2020 (r365611) +++ stable/12/sys/conf/files.amd64 Thu Sep 10 20:46:16 2020 (r365612) @@ -255,6 +255,52 @@ dev/imcsmb/imcsmb.c optional imcsmb dev/imcsmb/imcsmb_pci.c optional imcsmb pci dev/intel/spi.c optional intelspi dev/io/iodev.c optional io +dev/ice/if_ice_iflib.c optional ice pci \ + compile-with "${NORMAL_C} -I$S/dev/ice" +dev/ice/ice_lib.c optional ice pci \ + compile-with "${NORMAL_C} -I$S/dev/ice" +dev/ice/ice_osdep.c optional ice pci \ + compile-with "${NORMAL_C} -I$S/dev/ice" +dev/ice/ice_resmgr.c optional ice pci \ + compile-with "${NORMAL_C} -I$S/dev/ice" +dev/ice/ice_strings.c optional ice pci \ + compile-with "${NORMAL_C} -I$S/dev/ice" +dev/ice/ice_iflib_recovery_txrx.c optional ice pci \ + compile-with "${NORMAL_C} -I$S/dev/ice" +dev/ice/ice_iflib_txrx.c optional ice pci \ + compile-with "${NORMAL_C} -I$S/dev/ice" +dev/ice/ice_common.c optional ice pci \ + compile-with "${NORMAL_C} -I$S/dev/ice" +dev/ice/ice_controlq.c optional ice pci \ + compile-with "${NORMAL_C} -I$S/dev/ice" +dev/ice/ice_dcb.c optional ice pci \ + compile-with "${NORMAL_C} -I$S/dev/ice" +dev/ice/ice_flex_pipe.c optional ice pci \ + compile-with "${NORMAL_C} -I$S/dev/ice" +dev/ice/ice_flow.c optional ice pci \ + compile-with "${NORMAL_C} -I$S/dev/ice" +dev/ice/ice_nvm.c optional ice pci \ + compile-with "${NORMAL_C} -I$S/dev/ice" +dev/ice/ice_sched.c optional ice pci \ + compile-with "${NORMAL_C} -I$S/dev/ice" +dev/ice/ice_sriov.c optional ice pci \ + compile-with "${NORMAL_C} -I$S/dev/ice" +dev/ice/ice_switch.c optional ice pci \ + compile-with "${NORMAL_C} -I$S/dev/ice" +ice_ddp.c optional ice_ddp \ + compile-with "${AWK} -f $S/tools/fw_stub.awk ice_ddp.fw:ice_ddp:0x01030900 -mice_ddp -c${.TARGET}" \ + no-implicit-rule before-depend local \ + clean "ice_ddp.c" +ice_ddp.fwo optional ice_ddp \ + dependency "ice_ddp.fw" \ + compile-with "${NORMAL_FWO}" \ + no-implicit-rule \ + clean "ice_ddp.fwo" +ice_ddp.fw optional ice_ddp \ + dependency "$S/contrib/dev/ice/ice-1.3.9.0.pkg" \ + compile-with "${CP} $S/contrib/dev/ice/ice-1.3.9.0.pkg ice_ddp.fw" \ + no-obj no-implicit-rule \ + clean "ice_ddp.fw" dev/ioat/ioat.c optional ioat pci dev/ioat/ioat_test.c optional ioat pci dev/ipmi/ipmi.c optional ipmi Modified: stable/12/sys/conf/files.arm64 ============================================================================== --- stable/12/sys/conf/files.arm64 Thu Sep 10 20:34:44 2020 (r365611) +++ stable/12/sys/conf/files.arm64 Thu Sep 10 20:46:16 2020 (r365612) @@ -221,6 +221,53 @@ dev/axgbe/xgbe-dev.c optional axgbe dev/axgbe/xgbe-drv.c optional axgbe dev/axgbe/xgbe-mdio.c optional axgbe dev/cpufreq/cpufreq_dt.c optional cpufreq fdt +dev/ice/if_ice_iflib.c optional ice pci \ + compile-with "${NORMAL_C} -I$S/dev/ice" +dev/ice/ice_lib.c optional ice pci \ + compile-with "${NORMAL_C} -I$S/dev/ice" +dev/ice/ice_osdep.c optional ice pci \ + compile-with "${NORMAL_C} -I$S/dev/ice" +dev/ice/ice_resmgr.c optional ice pci \ + compile-with "${NORMAL_C} -I$S/dev/ice" +dev/ice/ice_strings.c optional ice pci \ + compile-with "${NORMAL_C} -I$S/dev/ice" +dev/ice/ice_iflib_recovery_txrx.c optional ice pci \ + compile-with "${NORMAL_C} -I$S/dev/ice" +dev/ice/ice_iflib_txrx.c optional ice pci \ + compile-with "${NORMAL_C} -I$S/dev/ice" +dev/ice/ice_common.c optional ice pci \ + compile-with "${NORMAL_C} -I$S/dev/ice" +dev/ice/ice_controlq.c optional ice pci \ + compile-with "${NORMAL_C} -I$S/dev/ice" +dev/ice/ice_dcb.c optional ice pci \ + compile-with "${NORMAL_C} -I$S/dev/ice" +dev/ice/ice_flex_pipe.c optional ice pci \ + compile-with "${NORMAL_C} -I$S/dev/ice" +dev/ice/ice_flow.c optional ice pci \ + compile-with "${NORMAL_C} -I$S/dev/ice" +dev/ice/ice_nvm.c optional ice pci \ + compile-with "${NORMAL_C} -I$S/dev/ice" +dev/ice/ice_sched.c optional ice pci \ + compile-with "${NORMAL_C} -I$S/dev/ice" +dev/ice/ice_sriov.c optional ice pci \ + compile-with "${NORMAL_C} -I$S/dev/ice" +dev/ice/ice_switch.c optional ice pci \ + compile-with "${NORMAL_C} -I$S/dev/ice" +ice_ddp.c optional ice_ddp \ + compile-with "${AWK} -f $S/tools/fw_stub.awk ice_ddp.fw:ice_ddp:0x01030900 -mice_ddp -c${.TARGET}" \ + no-implicit-rule before-depend local \ + clean "ice_ddp.c" +ice_ddp.fwo optional ice_ddp \ + dependency "ice_ddp.fw" \ + compile-with "${NORMAL_FWO}" \ + no-implicit-rule \ + clean "ice_ddp.fwo" +ice_ddp.fw optional ice_ddp \ + dependency "$S/contrib/dev/ice/ice-1.3.9.0.pkg" \ + compile-with "${CP} $S/contrib/dev/ice/ice-1.3.9.0.pkg ice_ddp.fw" \ + no-obj no-implicit-rule \ + clean "ice_ddp.fw" +dev/iicbus/sy8106a.c optional sy8106a fdt dev/iicbus/twsi/mv_twsi.c optional twsi fdt dev/iicbus/twsi/a10_twsi.c optional twsi fdt dev/iicbus/twsi/twsi.c optional twsi fdt Modified: stable/12/sys/dev/ice/ice_common.h ============================================================================== --- head/sys/dev/ice/ice_common.h Tue May 26 23:35:10 2020 (r361541) +++ stable/12/sys/dev/ice/ice_common.h Thu Sep 10 20:46:16 2020 (r365612) @@ -46,16 +46,6 @@ enum ice_fw_modes { ICE_FW_MODE_ROLLBACK }; -/* prototype for functions used for SW locks */ -void ice_free_list(struct LIST_HEAD_TYPE *list); -void ice_init_lock(struct ice_lock *lock); -void ice_acquire_lock(struct ice_lock *lock); -void ice_release_lock(struct ice_lock *lock); -void ice_destroy_lock(struct ice_lock *lock); - -void *ice_alloc_dma_mem(struct ice_hw *hw, struct ice_dma_mem *m, u64 size); -void ice_free_dma_mem(struct ice_hw *hw, struct ice_dma_mem *m); - void ice_idle_aq(struct ice_hw *hw, struct ice_ctl_q_info *cq); bool ice_sq_done(struct ice_hw *hw, struct ice_ctl_q_info *cq); @@ -77,13 +67,6 @@ ice_clean_rq_elem(struct ice_hw *hw, struct ice_ctl_q_ enum ice_status ice_get_link_status(struct ice_port_info *pi, bool *link_up); enum ice_status ice_update_link_info(struct ice_port_info *pi); -enum ice_status -ice_acquire_nvm(struct ice_hw *hw, enum ice_aq_res_access_type access); -void ice_release_nvm(struct ice_hw *hw); -enum ice_status -ice_aq_read_nvm(struct ice_hw *hw, u16 module_typeid, u32 offset, u16 length, - void *data, bool last_command, bool read_shadow_ram, - struct ice_sq_cd *cd); enum ice_status ice_acquire_res(struct ice_hw *hw, enum ice_aq_res_ids res, enum ice_aq_res_access_type access, u32 timeout); Modified: stable/12/sys/modules/Makefile ============================================================================== --- stable/12/sys/modules/Makefile Thu Sep 10 20:34:44 2020 (r365611) +++ stable/12/sys/modules/Makefile Thu Sep 10 20:46:16 2020 (r365612) @@ -160,6 +160,8 @@ SUBDIR= \ ${_ibcore} \ ${_ibcs2} \ ${_ichwd} \ + ${_ice} \ + ${_ice_ddp} \ ${_ida} \ if_bridge \ if_disc \ @@ -566,6 +568,13 @@ _rtwnfw= rtwnfw ${MACHINE_ARCH} != "powerpc" && ${MACHINE_ARCH} != "powerpcspe" && \ ${MACHINE_CPUARCH} != "riscv" _cxgbe= cxgbe +.endif + +.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "arm64" +_ice= ice +.if ${MK_SOURCELESS_UCODE} != "no" +_ice_ddp= ice_ddp +.endif .endif # These rely on 64bit atomics Modified: stable/12/sys/modules/ice_ddp/Makefile ============================================================================== --- head/sys/modules/ice_ddp/Makefile Tue May 26 23:35:10 2020 (r361541) +++ stable/12/sys/modules/ice_ddp/Makefile Thu Sep 10 20:46:16 2020 (r365612) @@ -1,24 +1,6 @@ # $FreeBSD$ -# Find the highest version DDP package file and build a .ko for it -PKG_FILE != find ${SRCTOP}/sys/contrib/dev/ice -name 'ice-*.pkg' | sort -V | tail -1 +KMOD= ice_ddp +FIRMWS= ${SRCTOP}/sys/contrib/dev/ice/ice-1.3.9.0.pkg:ice_ddp:0x01030900 -.if empty(PKG_FILE) -.error Unable to locate the DDP package binary file -.endif - -.info Found ${PKG_FILE} - -PKG_NAME != basename ${PKG_FILE} -PKG_VER_STR != basename -s .pkg ${PKG_NAME} -PKG_VER_STR := ${PKG_VER_STR:S/^ice-//} -PKG_VER_STR := ${PKG_VER_STR:S/-signed$//} -PKG_VER_MAJ != echo ${PKG_VER_STR} | cut -d. -f1 -PKG_VER_MIN != echo ${PKG_VER_STR} | cut -d. -f2 -PKG_VER_UPD != echo ${PKG_VER_STR} | cut -d. -f3 -PKG_VER_DFT != echo ${PKG_VER_STR} | cut -d. -f4 -PKG_VERSION != printf "0x%02x%02x%02x%02x" "${PKG_VER_MAJ}" "${PKG_VER_MIN}" "${PKG_VER_UPD}" "${PKG_VER_DFT}" - -KMOD := ice_ddp -FIRMWS := ${PKG_FILE}:ice_ddp:${PKG_VERSION} .include Copied: stable/12/tools/kerneldoc/subsys/Doxyfile-dev_ice (from r361541, head/tools/kerneldoc/subsys/Doxyfile-dev_ice) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/tools/kerneldoc/subsys/Doxyfile-dev_ice Thu Sep 10 20:46:16 2020 (r365612, copy of r361541, head/tools/kerneldoc/subsys/Doxyfile-dev_ice) @@ -0,0 +1,21 @@ +# Doxyfile 1.5.2 + +# $FreeBSD$ + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "FreeBSD kernel ice device code" +OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_ice/ +EXTRACT_ALL = YES # TODO: ice has @file comments.. disable this? +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = $(DOXYGEN_SRC_PATH)/dev/ice/ \ + $(NOTREVIEWED) + +GENERATE_TAGFILE = dev_ice/dev_ice.tag + +@INCLUDE_PATH = $(DOXYGEN_INCLUDE_PATH) +@INCLUDE = common-Doxyfile + From owner-svn-src-all@freebsd.org Thu Sep 10 20:54:45 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 807663E3A96; Thu, 10 Sep 2020 20:54:45 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BnWNP2dvXz4dDh; Thu, 10 Sep 2020 20:54:45 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3991818A7E; Thu, 10 Sep 2020 20:54:45 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08AKsj2G056441; Thu, 10 Sep 2020 20:54:45 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08AKsjYQ056440; Thu, 10 Sep 2020 20:54:45 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202009102054.08AKsjYQ056440@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 10 Sep 2020 20:54:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365613 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 365613 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.33 Precedence: list List-Id: "SVN commit messages 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, 10 Sep 2020 20:54:45 -0000 Author: kib Date: Thu Sep 10 20:54:44 2020 New Revision: 365613 URL: https://svnweb.freebsd.org/changeset/base/365613 Log: Fix interaction between largepages and seals/writes. On write with SHM_GROW_ON_WRITE, use proper truncate. Do not allow to grow largepage shm if F_SEAL_GROW is set. Note that shrinks are not supported at all due to unmanaged mappings. Call to vm_pager_update_writecount() is only valid for swap objects, skip it for unmanaged largepages. Largepages cannot support write sealing. Do not writecnt largepage mappings. Reported by: kevans Reviewed by: kevans, markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D26394 Modified: head/sys/kern/uipc_shm.c Modified: head/sys/kern/uipc_shm.c ============================================================================== --- head/sys/kern/uipc_shm.c Thu Sep 10 20:46:16 2020 (r365612) +++ head/sys/kern/uipc_shm.c Thu Sep 10 20:54:44 2020 (r365613) @@ -450,9 +450,7 @@ shm_write(struct file *fp, struct uio *uio, struct ucr error = 0; if ((shmfd->shm_flags & SHM_GROW_ON_WRITE) != 0 && size > shmfd->shm_size) { - VM_OBJECT_WLOCK(shmfd->shm_object); - error = shm_dotruncate_locked(shmfd, size, rl_cookie); - VM_OBJECT_WUNLOCK(shmfd->shm_object); + error = shm_dotruncate_cookie(shmfd, size, rl_cookie); } if (error == 0) error = uiomove_object(shmfd->shm_object, @@ -767,6 +765,9 @@ shm_dotruncate_largepage(struct shmfd *shmfd, off_t le #endif } + if ((shmfd->shm_seals & F_SEAL_GROW) != 0) + return (EPERM); + aflags = VM_ALLOC_NORMAL | VM_ALLOC_ZERO; if (shmfd->shm_lp_alloc_policy == SHM_LARGEPAGE_ALLOC_NOWAIT) aflags |= VM_ALLOC_WAITFAIL; @@ -1416,7 +1417,7 @@ out: static int shm_mmap_large(struct shmfd *shmfd, vm_map_t map, vm_offset_t *addr, vm_size_t size, vm_prot_t prot, vm_prot_t max_prot, int flags, - vm_ooffset_t foff, bool writecounted, struct thread *td) + vm_ooffset_t foff, struct thread *td) { struct vmspace *vms; vm_map_entry_t next_entry, prev_entry; @@ -1448,8 +1449,6 @@ shm_mmap_large(struct shmfd *shmfd, vm_map_t map, vm_o docow |= MAP_INHERIT_SHARE; if ((flags & MAP_NOCORE) != 0) docow |= MAP_DISABLE_COREDUMP; - if (writecounted) - docow |= MAP_WRITECOUNT; mask = pagesizes[shmfd->shm_lp_psind] - 1; if ((foff & mask) != 0) @@ -1594,12 +1593,15 @@ shm_mmap(struct file *fp, vm_map_t map, vm_offset_t *a mtx_unlock(&shm_timestamp_lock); vm_object_reference(shmfd->shm_object); - if (writecnt) - vm_pager_update_writecount(shmfd->shm_object, 0, objsize); if (shm_largepage(shmfd)) { + writecnt = false; error = shm_mmap_large(shmfd, map, addr, objsize, prot, - maxprot, flags, foff, writecnt, td); + maxprot, flags, foff, td); } else { + if (writecnt) { + vm_pager_update_writecount(shmfd->shm_object, 0, + objsize); + } error = vm_mmap_object(map, addr, objsize, prot, maxprot, flags, shmfd->shm_object, foff, writecnt, td); } @@ -1838,6 +1840,11 @@ shm_add_seals(struct file *fp, int seals) } nseals = seals & ~shmfd->shm_seals; if ((nseals & F_SEAL_WRITE) != 0) { + if (shm_largepage(shmfd)) { + error = ENOTSUP; + goto out; + } + /* * The rangelock above prevents writable mappings from being * added after we've started applying seals. The RLOCK here From owner-svn-src-all@freebsd.org Thu Sep 10 21:01:23 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B31FB3E3D0D; Thu, 10 Sep 2020 21:01:23 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BnWX34dgNz4dGB; Thu, 10 Sep 2020 21:01:23 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8248D1920E; Thu, 10 Sep 2020 21:01:23 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08AL1NN6060905; Thu, 10 Sep 2020 21:01:23 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08AL1MDW060901; Thu, 10 Sep 2020 21:01:22 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <202009102101.08AL1MDW060901@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Thu, 10 Sep 2020 21:01:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365614 - in stable/12: sys/dev/virtio/block usr.sbin/bhyve X-SVN-Group: stable-12 X-SVN-Commit-Author: allanjude X-SVN-Commit-Paths: in stable/12: sys/dev/virtio/block usr.sbin/bhyve X-SVN-Commit-Revision: 365614 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.33 Precedence: list List-Id: "SVN commit messages 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, 10 Sep 2020 21:01:23 -0000 Author: allanjude Date: Thu Sep 10 21:01:22 2020 New Revision: 365614 URL: https://svnweb.freebsd.org/changeset/base/365614 Log: MFC r360229, r363255 r360229: Add VIRTIO_BLK_T_DISCARD (TRIM) support to the bhyve virtio-blk backend This will advertise support for TRIM to the guest virtio-blk driver and perform the DIOCGDELETE ioctl on the backing storage if it supports it. Thanks to Jason King and others at Joyent and illumos for expanding on my original patch, adding improvements including better error handling and making sure to following the virtio spec. r363255: Add VIRTIO_BLK_T_DISCARD support to the virtio-blk driver If the hypervisor advertises support for the DISCARD command then the guest can perform TRIM commands, freeing space on the backing store. If VIRTIO_BLK_F_DISCARD is enabled, advertise DISKFLAG_CANDELETE Tested with FreeBSD guests on bhyve and KVM Relnotes: yes Sponsored by: Klara Inc. Modified: stable/12/sys/dev/virtio/block/virtio_blk.c stable/12/sys/dev/virtio/block/virtio_blk.h stable/12/usr.sbin/bhyve/block_if.c stable/12/usr.sbin/bhyve/pci_virtio_block.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/virtio/block/virtio_blk.c ============================================================================== --- stable/12/sys/dev/virtio/block/virtio_blk.c Thu Sep 10 20:54:44 2020 (r365613) +++ stable/12/sys/dev/virtio/block/virtio_blk.c Thu Sep 10 21:01:22 2020 (r365614) @@ -81,6 +81,7 @@ struct vtblk_softc { #define VTBLK_FLAG_SUSPEND 0x0008 #define VTBLK_FLAG_BARRIER 0x0010 #define VTBLK_FLAG_WC_CONFIG 0x0020 +#define VTBLK_FLAG_DISCARD 0x0040 struct virtqueue *vtblk_vq; struct sglist *vtblk_sglist; @@ -112,6 +113,7 @@ static struct virtio_feature_desc vtblk_feature_desc[] { VIRTIO_BLK_F_WCE, "WriteCache" }, { VIRTIO_BLK_F_TOPOLOGY, "Topology" }, { VIRTIO_BLK_F_CONFIG_WCE, "ConfigWCE" }, + { VIRTIO_BLK_F_DISCARD, "Discard" }, { 0, NULL } }; @@ -210,6 +212,7 @@ TUNABLE_INT("hw.vtblk.writecache_mode", &vtblk_writeca VIRTIO_BLK_F_WCE | \ VIRTIO_BLK_F_TOPOLOGY | \ VIRTIO_BLK_F_CONFIG_WCE | \ + VIRTIO_BLK_F_DISCARD | \ VIRTIO_RING_F_INDIRECT_DESC) #define VTBLK_MTX(_sc) &(_sc)->vtblk_mtx @@ -461,7 +464,7 @@ vtblk_config_change(device_t dev) vtblk_read_config(sc, &blkcfg); /* Capacity is always in 512-byte units. */ - capacity = blkcfg.capacity * 512; + capacity = blkcfg.capacity * VTBLK_BSIZE; if (sc->vtblk_disk->d_mediasize != capacity) vtblk_resize_disk(sc, capacity); @@ -546,11 +549,18 @@ vtblk_strategy(struct bio *bp) * be a better way to report our readonly'ness to GEOM above. */ if (sc->vtblk_flags & VTBLK_FLAG_READONLY && - (bp->bio_cmd == BIO_WRITE || bp->bio_cmd == BIO_FLUSH)) { + (bp->bio_cmd == BIO_WRITE || bp->bio_cmd == BIO_FLUSH || + bp->bio_cmd == BIO_DELETE)) { vtblk_bio_done(sc, bp, EROFS); return; } + if ((bp->bio_cmd != BIO_READ) && (bp->bio_cmd != BIO_WRITE) && + (bp->bio_cmd != BIO_FLUSH) && (bp->bio_cmd != BIO_DELETE)) { + vtblk_bio_done(sc, bp, EOPNOTSUPP); + return; + } + VTBLK_LOCK(sc); if (sc->vtblk_flags & VTBLK_FLAG_DETACH) { @@ -559,6 +569,13 @@ vtblk_strategy(struct bio *bp) return; } + if ((bp->bio_cmd == BIO_DELETE) && + !(sc->vtblk_flags & VTBLK_FLAG_DISCARD)) { + VTBLK_UNLOCK(sc); + vtblk_bio_done(sc, bp, EOPNOTSUPP); + return; + } + bioq_insert_tail(&sc->vtblk_bioq, bp); vtblk_startio(sc); @@ -594,6 +611,8 @@ vtblk_setup_features(struct vtblk_softc *sc) sc->vtblk_flags |= VTBLK_FLAG_BARRIER; if (virtio_with_feature(dev, VIRTIO_BLK_F_CONFIG_WCE)) sc->vtblk_flags |= VTBLK_FLAG_WC_CONFIG; + if (virtio_with_feature(dev, VIRTIO_BLK_F_DISCARD)) + sc->vtblk_flags |= VTBLK_FLAG_DISCARD; } static int @@ -683,12 +702,12 @@ vtblk_alloc_disk(struct vtblk_softc *sc, struct virtio dp->d_dump = vtblk_dump; /* Capacity is always in 512-byte units. */ - dp->d_mediasize = blkcfg->capacity * 512; + dp->d_mediasize = blkcfg->capacity * VTBLK_BSIZE; if (virtio_with_feature(dev, VIRTIO_BLK_F_BLK_SIZE)) dp->d_sectorsize = blkcfg->blk_size; else - dp->d_sectorsize = 512; + dp->d_sectorsize = VTBLK_BSIZE; /* * The VirtIO maximum I/O size is given in terms of segments. @@ -722,6 +741,11 @@ vtblk_alloc_disk(struct vtblk_softc *sc, struct virtio dp->d_stripesize; } + if (virtio_with_feature(dev, VIRTIO_BLK_F_DISCARD)) { + dp->d_flags |= DISKFLAG_CANDELETE; + dp->d_delmaxsize = blkcfg->max_discard_sectors * VTBLK_BSIZE; + } + if (vtblk_write_cache_enabled(sc, blkcfg) != 0) sc->vtblk_write_cache = VTBLK_CACHE_WRITEBACK; else @@ -872,12 +896,16 @@ vtblk_request_bio(struct vtblk_softc *sc) break; case BIO_READ: req->vbr_hdr.type = VIRTIO_BLK_T_IN; - req->vbr_hdr.sector = bp->bio_offset / 512; + req->vbr_hdr.sector = bp->bio_offset / VTBLK_BSIZE; break; case BIO_WRITE: req->vbr_hdr.type = VIRTIO_BLK_T_OUT; - req->vbr_hdr.sector = bp->bio_offset / 512; + req->vbr_hdr.sector = bp->bio_offset / VTBLK_BSIZE; break; + case BIO_DELETE: + req->vbr_hdr.type = VIRTIO_BLK_T_DISCARD; + req->vbr_hdr.sector = bp->bio_offset / VTBLK_BSIZE; + break; default: panic("%s: bio with unhandled cmd: %d", __func__, bp->bio_cmd); } @@ -931,6 +959,20 @@ vtblk_request_execute(struct vtblk_softc *sc, struct v /* BIO_READ means the host writes into our buffer. */ if (bp->bio_cmd == BIO_READ) writable = sg->sg_nseg - 1; + } else if (bp->bio_cmd == BIO_DELETE) { + struct virtio_blk_discard_write_zeroes *discard; + + discard = malloc(sizeof(*discard), M_DEVBUF, M_NOWAIT | M_ZERO); + if (discard == NULL) + return (ENOMEM); + discard->sector = bp->bio_offset / VTBLK_BSIZE; + discard->num_sectors = bp->bio_bcount / VTBLK_BSIZE; + bp->bio_driver1 = discard; + error = sglist_append(sg, discard, sizeof(*discard)); + if (error || sg->sg_nseg == sg->sg_maxseg) { + panic("%s: bio %p data buffer too big %d", + __func__, bp, error); + } } writable++; @@ -1091,6 +1133,11 @@ vtblk_bio_done(struct vtblk_softc *sc, struct bio *bp, bp->bio_flags |= BIO_ERROR; } + if (bp->bio_driver1 != NULL) { + free(bp->bio_driver1, M_DEVBUF); + bp->bio_driver1 = NULL; + } + biodone(bp); } @@ -1120,7 +1167,12 @@ vtblk_read_config(struct vtblk_softc *sc, struct virti VTBLK_GET_CONFIG(dev, VIRTIO_BLK_F_GEOMETRY, geometry, blkcfg); VTBLK_GET_CONFIG(dev, VIRTIO_BLK_F_BLK_SIZE, blk_size, blkcfg); VTBLK_GET_CONFIG(dev, VIRTIO_BLK_F_TOPOLOGY, topology, blkcfg); - VTBLK_GET_CONFIG(dev, VIRTIO_BLK_F_CONFIG_WCE, writeback, blkcfg); + VTBLK_GET_CONFIG(dev, VIRTIO_BLK_F_CONFIG_WCE, wce, blkcfg); + VTBLK_GET_CONFIG(dev, VIRTIO_BLK_F_DISCARD, max_discard_sectors, + blkcfg); + VTBLK_GET_CONFIG(dev, VIRTIO_BLK_F_DISCARD, max_discard_seg, blkcfg); + VTBLK_GET_CONFIG(dev, VIRTIO_BLK_F_DISCARD, discard_sector_alignment, + blkcfg); } #undef VTBLK_GET_CONFIG @@ -1278,7 +1330,7 @@ vtblk_dump_write(struct vtblk_softc *sc, void *virtual req->vbr_ack = -1; req->vbr_hdr.type = VIRTIO_BLK_T_OUT; req->vbr_hdr.ioprio = 1; - req->vbr_hdr.sector = offset / 512; + req->vbr_hdr.sector = offset / VTBLK_BSIZE; req->vbr_bp = &buf; g_reset_bio(&buf); @@ -1327,7 +1379,7 @@ vtblk_set_write_cache(struct vtblk_softc *sc, int wc) /* Set either writeback (1) or writethrough (0) mode. */ virtio_write_dev_config_1(sc->vtblk_dev, - offsetof(struct virtio_blk_config, writeback), wc); + offsetof(struct virtio_blk_config, wce), wc); } static int @@ -1342,7 +1394,7 @@ vtblk_write_cache_enabled(struct vtblk_softc *sc, if (wc >= 0 && wc < VTBLK_CACHE_MAX) vtblk_set_write_cache(sc, wc); else - wc = blkcfg->writeback; + wc = blkcfg->wce; } else wc = virtio_with_feature(sc->vtblk_dev, VIRTIO_BLK_F_WCE); Modified: stable/12/sys/dev/virtio/block/virtio_blk.h ============================================================================== --- stable/12/sys/dev/virtio/block/virtio_blk.h Thu Sep 10 20:54:44 2020 (r365613) +++ stable/12/sys/dev/virtio/block/virtio_blk.h Thu Sep 10 21:01:22 2020 (r365614) @@ -33,20 +33,27 @@ #ifndef _VIRTIO_BLK_H #define _VIRTIO_BLK_H +#define VTBLK_BSIZE 512 + /* Feature bits */ -#define VIRTIO_BLK_F_BARRIER 0x0001 /* Does host support barriers? */ -#define VIRTIO_BLK_F_SIZE_MAX 0x0002 /* Indicates maximum segment size */ -#define VIRTIO_BLK_F_SEG_MAX 0x0004 /* Indicates maximum # of segments */ -#define VIRTIO_BLK_F_GEOMETRY 0x0010 /* Legacy geometry available */ -#define VIRTIO_BLK_F_RO 0x0020 /* Disk is read-only */ -#define VIRTIO_BLK_F_BLK_SIZE 0x0040 /* Block size of disk is available*/ -#define VIRTIO_BLK_F_SCSI 0x0080 /* Supports scsi command passthru */ -#define VIRTIO_BLK_F_WCE 0x0200 /* Writeback mode enabled after reset */ -#define VIRTIO_BLK_F_TOPOLOGY 0x0400 /* Topology information is available */ -#define VIRTIO_BLK_F_CONFIG_WCE 0x0800 /* Writeback mode available in config */ -#define VIRTIO_BLK_ID_BYTES 20 /* ID string length */ +#define VIRTIO_BLK_F_BARRIER 0x0001 /* Does host support barriers? */ +#define VIRTIO_BLK_F_SIZE_MAX 0x0002 /* Indicates maximum segment size */ +#define VIRTIO_BLK_F_SEG_MAX 0x0004 /* Indicates maximum # of segments */ +#define VIRTIO_BLK_F_GEOMETRY 0x0010 /* Legacy geometry available */ +#define VIRTIO_BLK_F_RO 0x0020 /* Disk is read-only */ +#define VIRTIO_BLK_F_BLK_SIZE 0x0040 /* Block size of disk is available*/ +#define VIRTIO_BLK_F_SCSI 0x0080 /* Supports scsi command passthru */ +#define VIRTIO_BLK_F_FLUSH 0x0200 /* Flush command supported */ +#define VIRTIO_BLK_F_WCE 0x0200 /* Legacy alias for FLUSH */ +#define VIRTIO_BLK_F_TOPOLOGY 0x0400 /* Topology information is available */ +#define VIRTIO_BLK_F_CONFIG_WCE 0x0800 /* Writeback mode available in config */ +#define VIRTIO_BLK_F_MQ 0x1000 /* Support more than one vq */ +#define VIRTIO_BLK_F_DISCARD 0x2000 /* Trim blocks */ +#define VIRTIO_BLK_F_WRITE_ZEROES 0x4000 /* Write zeros */ +#define VIRTIO_BLK_ID_BYTES 20 /* ID string length */ + struct virtio_blk_config { /* The capacity (in 512-byte sectors). */ uint64_t capacity; @@ -66,15 +73,29 @@ struct virtio_blk_config { /* Topology of the device (if VIRTIO_BLK_F_TOPOLOGY) */ struct virtio_blk_topology { + /* Exponent for physical block per logical block. */ uint8_t physical_block_exp; + /* Alignment offset in logical blocks. */ uint8_t alignment_offset; + /* Minimum I/O size without performance penalty in logical + * blocks. */ uint16_t min_io_size; + /* Optimal sustained I/O size in logical blocks. */ uint32_t opt_io_size; } topology; /* Writeback mode (if VIRTIO_BLK_F_CONFIG_WCE) */ - uint8_t writeback; - + uint8_t wce; + uint8_t unused; + /* Number of vqs, only available when VIRTIO_BLK_F_MQ is set */ + uint16_t num_queues; + uint32_t max_discard_sectors; + uint32_t max_discard_seg; + uint32_t discard_sector_alignment; + uint32_t max_write_zeroes_sectors; + uint32_t max_write_zeroes_seg; + uint8_t write_zeroes_may_unmap; + uint8_t unused1[3]; } __packed; /* @@ -89,24 +110,35 @@ struct virtio_blk_config { */ /* These two define direction. */ -#define VIRTIO_BLK_T_IN 0 -#define VIRTIO_BLK_T_OUT 1 +#define VIRTIO_BLK_T_IN 0 +#define VIRTIO_BLK_T_OUT 1 /* This bit says it's a scsi command, not an actual read or write. */ -#define VIRTIO_BLK_T_SCSI_CMD 2 +#define VIRTIO_BLK_T_SCSI_CMD 2 +#define VIRTIO_BLK_T_SCSI_CMD_OUT 3 /* Cache flush command */ -#define VIRTIO_BLK_T_FLUSH 4 +#define VIRTIO_BLK_T_FLUSH 4 +#define VIRTIO_BLK_T_FLUSH_OUT 5 /* Get device ID command */ -#define VIRTIO_BLK_T_GET_ID 8 +#define VIRTIO_BLK_T_GET_ID 8 +/* Discard command */ +#define VIRTIO_BLK_T_DISCARD 11 + +/* Write zeros command */ +#define VIRTIO_BLK_T_WRITE_ZEROES 13 + /* Barrier before this op. */ -#define VIRTIO_BLK_T_BARRIER 0x80000000 +#define VIRTIO_BLK_T_BARRIER 0x80000000 /* ID string length */ -#define VIRTIO_BLK_ID_BYTES 20 +#define VIRTIO_BLK_ID_BYTES 20 +/* Unmap this range (only valid for write zeroes command) */ +#define VIRTIO_BLK_WRITE_ZEROES_FLAG_UNMAP 0x00000001 + /* This is the first element of the read scatter-gather list. */ struct virtio_blk_outhdr { /* VIRTIO_BLK_T* */ @@ -115,6 +147,15 @@ struct virtio_blk_outhdr { uint32_t ioprio; /* Sector (ie. 512 byte offset) */ uint64_t sector; +}; + +struct virtio_blk_discard_write_zeroes { + uint64_t sector; + uint32_t num_sectors; + struct { + uint32_t unmap:1; + uint32_t reserved:31; + } flags; }; struct virtio_scsi_inhdr { Modified: stable/12/usr.sbin/bhyve/block_if.c ============================================================================== --- stable/12/usr.sbin/bhyve/block_if.c Thu Sep 10 20:54:44 2020 (r365613) +++ stable/12/usr.sbin/bhyve/block_if.c Thu Sep 10 21:01:22 2020 (r365614) @@ -3,6 +3,7 @@ * * Copyright (c) 2013 Peter Grehan * All rights reserved. + * Copyright 2020 Joyent, Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -410,6 +411,8 @@ blockif_open(const char *optstr, const char *ident) off_t size, psectsz, psectoff; int extra, fd, i, sectsz; int nocache, sync, ro, candelete, geom, ssopt, pssopt; + int nodelete; + #ifndef WITHOUT_CAPSICUM cap_rights_t rights; cap_ioctl_t cmds[] = { DIOCGFLUSH, DIOCGDELETE }; @@ -422,6 +425,7 @@ blockif_open(const char *optstr, const char *ident) nocache = 0; sync = 0; ro = 0; + nodelete = 0; /* * The first element in the optstring is always a pathname. @@ -434,6 +438,8 @@ blockif_open(const char *optstr, const char *ident) continue; else if (!strcmp(cp, "nocache")) nocache = 1; + else if (!strcmp(cp, "nodelete")) + nodelete = 1; else if (!strcmp(cp, "sync") || !strcmp(cp, "direct")) sync = 1; else if (!strcmp(cp, "ro")) @@ -500,7 +506,7 @@ blockif_open(const char *optstr, const char *ident) ioctl(fd, DIOCGSTRIPEOFFSET, &psectoff); strlcpy(arg.name, "GEOM::candelete", sizeof(arg.name)); arg.len = sizeof(arg.value.i); - if (ioctl(fd, DIOCGATTR, &arg) == 0) + if (nodelete == 0 && ioctl(fd, DIOCGATTR, &arg) == 0) candelete = arg.value.i; if (ioctl(fd, DIOCGPROVIDERNAME, name) == 0) geom = 1; Modified: stable/12/usr.sbin/bhyve/pci_virtio_block.c ============================================================================== --- stable/12/usr.sbin/bhyve/pci_virtio_block.c Thu Sep 10 20:54:44 2020 (r365613) +++ stable/12/usr.sbin/bhyve/pci_virtio_block.c Thu Sep 10 21:01:22 2020 (r365614) @@ -3,7 +3,7 @@ * * Copyright (c) 2011 NetApp, Inc. * All rights reserved. - * Copyright (c) 2019 Joyent, Inc. + * Copyright 2020 Joyent, Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -57,26 +57,37 @@ __FBSDID("$FreeBSD$"); #include "virtio.h" #include "block_if.h" -#define VTBLK_RINGSZ 128 +#define VTBLK_BSIZE 512 +#define VTBLK_RINGSZ 128 _Static_assert(VTBLK_RINGSZ <= BLOCKIF_RING_MAX, "Each ring entry must be able to queue a request"); -#define VTBLK_S_OK 0 -#define VTBLK_S_IOERR 1 +#define VTBLK_S_OK 0 +#define VTBLK_S_IOERR 1 #define VTBLK_S_UNSUPP 2 #define VTBLK_BLK_ID_BYTES 20 + 1 /* Capability bits */ -#define VTBLK_F_SEG_MAX (1 << 2) /* Maximum request segments */ -#define VTBLK_F_BLK_SIZE (1 << 6) /* cfg block size valid */ -#define VTBLK_F_FLUSH (1 << 9) /* Cache flush support */ -#define VTBLK_F_TOPOLOGY (1 << 10) /* Optimal I/O alignment */ +#define VTBLK_F_BARRIER (1 << 0) /* Does host support barriers? */ +#define VTBLK_F_SIZE_MAX (1 << 1) /* Indicates maximum segment size */ +#define VTBLK_F_SEG_MAX (1 << 2) /* Indicates maximum # of segments */ +#define VTBLK_F_GEOMETRY (1 << 4) /* Legacy geometry available */ +#define VTBLK_F_RO (1 << 5) /* Disk is read-only */ +#define VTBLK_F_BLK_SIZE (1 << 6) /* Block size of disk is available*/ +#define VTBLK_F_SCSI (1 << 7) /* Supports scsi command passthru */ +#define VTBLK_F_FLUSH (1 << 9) /* Writeback mode enabled after reset */ +#define VTBLK_F_WCE (1 << 9) /* Legacy alias for FLUSH */ +#define VTBLK_F_TOPOLOGY (1 << 10) /* Topology information is available */ +#define VTBLK_F_CONFIG_WCE (1 << 11) /* Writeback mode available in config */ +#define VTBLK_F_MQ (1 << 12) /* Multi-Queue */ +#define VTBLK_F_DISCARD (1 << 13) /* Trim blocks */ +#define VTBLK_F_WRITE_ZEROES (1 << 14) /* Write zeros */ /* * Host capabilities */ -#define VTBLK_S_HOSTCAPS \ +#define VTBLK_S_HOSTCAPS \ ( VTBLK_F_SEG_MAX | \ VTBLK_F_BLK_SIZE | \ VTBLK_F_FLUSH | \ @@ -84,6 +95,18 @@ _Static_assert(VTBLK_RINGSZ <= BLOCKIF_RING_MAX, "Each VIRTIO_RING_F_INDIRECT_DESC ) /* indirect descriptors */ /* + * The current blockif_delete() interface only allows a single delete + * request at a time. + */ +#define VTBLK_MAX_DISCARD_SEG 1 + +/* + * An arbitrary limit to prevent excessive latency due to large + * delete requests. + */ +#define VTBLK_MAX_DISCARD_SECT ((16 << 20) / VTBLK_BSIZE) /* 16 MiB */ + +/* * Config space "registers" */ struct vtblk_config { @@ -103,6 +126,15 @@ struct vtblk_config { uint32_t opt_io_size; } vbc_topology; uint8_t vbc_writeback; + uint8_t unused0[1]; + uint16_t num_queues; + uint32_t max_discard_sectors; + uint32_t max_discard_seg; + uint32_t discard_sector_alignment; + uint32_t max_write_zeroes_sectors; + uint32_t max_write_zeroes_seg; + uint8_t write_zeroes_may_unmap; + uint8_t unused1[3]; } __packed; /* @@ -111,9 +143,14 @@ struct vtblk_config { struct virtio_blk_hdr { #define VBH_OP_READ 0 #define VBH_OP_WRITE 1 +#define VBH_OP_SCSI_CMD 2 +#define VBH_OP_SCSI_CMD_OUT 3 #define VBH_OP_FLUSH 4 #define VBH_OP_FLUSH_OUT 5 #define VBH_OP_IDENT 8 +#define VBH_OP_DISCARD 11 +#define VBH_OP_WRITE_ZEROES 13 + #define VBH_FLAG_BARRIER 0x80000000 /* OR'ed into vbh_type */ uint32_t vbh_type; uint32_t vbh_ioprio; @@ -124,8 +161,8 @@ struct virtio_blk_hdr { * Debug printf */ static int pci_vtblk_debug; -#define DPRINTF(params) if (pci_vtblk_debug) PRINTLN params -#define WPRINTF(params) PRINTLN params +#define DPRINTF(params) if (pci_vtblk_debug) PRINTLN params +#define WPRINTF(params) PRINTLN params struct pci_vtblk_ioreq { struct blockif_req io_req; @@ -134,6 +171,15 @@ struct pci_vtblk_ioreq { uint16_t io_idx; }; +struct virtio_blk_discard_write_zeroes { + uint64_t sector; + uint32_t num_sectors; + struct { + uint32_t unmap:1; + uint32_t reserved:31; + } flags; +}; + /* * Per-device softc */ @@ -142,6 +188,7 @@ struct pci_vtblk_softc { pthread_mutex_t vsc_mtx; struct vqueue_info vbsc_vq; struct vtblk_config vbsc_cfg; + struct virtio_consts vbsc_consts; struct blockif_ctxt *bc; char vbsc_ident[VTBLK_BLK_ID_BYTES]; struct pci_vtblk_ioreq vbsc_ios[VTBLK_RINGSZ]; @@ -174,9 +221,8 @@ pci_vtblk_reset(void *vsc) } static void -pci_vtblk_done(struct blockif_req *br, int err) +pci_vtblk_done_locked(struct pci_vtblk_ioreq *io, int err) { - struct pci_vtblk_ioreq *io = br->br_param; struct pci_vtblk_softc *sc = io->io_sc; /* convert errno into a virtio block error return */ @@ -191,9 +237,18 @@ pci_vtblk_done(struct blockif_req *br, int err) * Return the descriptor back to the host. * We wrote 1 byte (our status) to host. */ - pthread_mutex_lock(&sc->vsc_mtx); vq_relchain(&sc->vbsc_vq, io->io_idx, 1); vq_endchains(&sc->vbsc_vq, 0); +} + +static void +pci_vtblk_done(struct blockif_req *br, int err) +{ + struct pci_vtblk_ioreq *io = br->br_param; + struct pci_vtblk_softc *sc = io->io_sc; + + pthread_mutex_lock(&sc->vsc_mtx); + pci_vtblk_done_locked(io, err); pthread_mutex_unlock(&sc->vsc_mtx); } @@ -208,6 +263,7 @@ pci_vtblk_proc(struct pci_vtblk_softc *sc, struct vque int writeop, type; struct iovec iov[BLOCKIF_IOV_MAX + 2]; uint16_t idx, flags[BLOCKIF_IOV_MAX + 2]; + struct virtio_blk_discard_write_zeroes *discard; n = vq_getchain(vq, &idx, iov, BLOCKIF_IOV_MAX + 2, flags); @@ -224,11 +280,11 @@ pci_vtblk_proc(struct pci_vtblk_softc *sc, struct vque io = &sc->vbsc_ios[idx]; assert((flags[0] & VRING_DESC_F_WRITE) == 0); assert(iov[0].iov_len == sizeof(struct virtio_blk_hdr)); - vbh = iov[0].iov_base; + vbh = (struct virtio_blk_hdr *)iov[0].iov_base; memcpy(&io->io_req.br_iov, &iov[1], sizeof(struct iovec) * (n - 2)); io->io_req.br_iovcnt = n - 2; - io->io_req.br_offset = vbh->vbh_sector * DEV_BSIZE; - io->io_status = iov[--n].iov_base; + io->io_req.br_offset = vbh->vbh_sector * VTBLK_BSIZE; + io->io_status = (uint8_t *)iov[--n].iov_base; assert(iov[n].iov_len == 1); assert(flags[n] & VRING_DESC_F_WRITE); @@ -238,7 +294,7 @@ pci_vtblk_proc(struct pci_vtblk_softc *sc, struct vque * we don't advertise the capability. */ type = vbh->vbh_type & ~VBH_FLAG_BARRIER; - writeop = (type == VBH_OP_WRITE); + writeop = (type == VBH_OP_WRITE || type == VBH_OP_DISCARD); iolen = 0; for (i = 1; i < n; i++) { @@ -254,7 +310,7 @@ pci_vtblk_proc(struct pci_vtblk_softc *sc, struct vque io->io_req.br_resid = iolen; DPRINTF(("virtio-block: %s op, %zd bytes, %d segs, offset %ld", - writeop ? "write" : "read/ident", iolen, i - 1, + writeop ? "write/discard" : "read/ident", iolen, i - 1, io->io_req.br_offset)); switch (type) { @@ -264,6 +320,46 @@ pci_vtblk_proc(struct pci_vtblk_softc *sc, struct vque case VBH_OP_WRITE: err = blockif_write(sc->bc, &io->io_req); break; + case VBH_OP_DISCARD: + /* + * We currently only support a single request, if the guest + * has submitted a request that doesn't conform to the + * requirements, we return a error. + */ + if (iov[1].iov_len != sizeof (*discard)) { + pci_vtblk_done_locked(io, EINVAL); + return; + } + + /* The segments to discard are provided rather than data */ + discard = (struct virtio_blk_discard_write_zeroes *) + iov[1].iov_base; + + /* + * virtio v1.1 5.2.6.2: + * The device MUST set the status byte to VIRTIO_BLK_S_UNSUPP + * for discard and write zeroes commands if any unknown flag is + * set. Furthermore, the device MUST set the status byte to + * VIRTIO_BLK_S_UNSUPP for discard commands if the unmap flag + * is set. + * + * Currently there are no known flags for a DISCARD request. + */ + if (discard->flags.unmap != 0 || discard->flags.reserved != 0) { + pci_vtblk_done_locked(io, ENOTSUP); + return; + } + + /* Make sure the request doesn't exceed our size limit */ + if (discard->num_sectors > VTBLK_MAX_DISCARD_SECT) { + pci_vtblk_done_locked(io, EINVAL); + return; + } + + io->io_req.br_offset = discard->sector * VTBLK_BSIZE; + io->io_req.br_resid = discard->num_sectors * VTBLK_BSIZE; + err = blockif_delete(sc->bc, &io->io_req); + break; case VBH_OP_FLUSH: case VBH_OP_FLUSH_OUT: err = blockif_flush(sc->bc, &io->io_req); @@ -274,10 +370,10 @@ pci_vtblk_proc(struct pci_vtblk_softc *sc, struct vque memset(iov[1].iov_base, 0, iov[1].iov_len); strncpy(iov[1].iov_base, sc->vbsc_ident, MIN(iov[1].iov_len, sizeof(sc->vbsc_ident))); - pci_vtblk_done(&io->io_req, 0); + pci_vtblk_done_locked(io, 0); return; default: - pci_vtblk_done(&io->io_req, EOPNOTSUPP); + pci_vtblk_done_locked(io, EOPNOTSUPP); return; } assert(err == 0); @@ -332,10 +428,14 @@ pci_vtblk_init(struct vmctx *ctx, struct pci_devinst * io->io_idx = i; } + bcopy(&vtblk_vi_consts, &sc->vbsc_consts, sizeof (vtblk_vi_consts)); + if (blockif_candelete(sc->bc)) + sc->vbsc_consts.vc_hv_caps |= VTBLK_F_DISCARD; + pthread_mutex_init(&sc->vsc_mtx, NULL); /* init virtio softc and virtqueues */ - vi_softc_linkup(&sc->vbsc_vs, &vtblk_vi_consts, sc, pi, &sc->vbsc_vq); + vi_softc_linkup(&sc->vbsc_vs, &sc->vbsc_consts, sc, pi, &sc->vbsc_vq); sc->vbsc_vs.vs_mtx = &sc->vsc_mtx; sc->vbsc_vq.vq_qsize = VTBLK_RINGSZ; @@ -353,7 +453,7 @@ pci_vtblk_init(struct vmctx *ctx, struct pci_devinst * digest[0], digest[1], digest[2], digest[3], digest[4], digest[5]); /* setup virtio block config space */ - sc->vbsc_cfg.vbc_capacity = size / DEV_BSIZE; /* 512-byte units */ + sc->vbsc_cfg.vbc_capacity = size / VTBLK_BSIZE; /* 512-byte units */ sc->vbsc_cfg.vbc_size_max = 0; /* not negotiated */ /* @@ -375,6 +475,9 @@ pci_vtblk_init(struct vmctx *ctx, struct pci_devinst * sc->vbsc_cfg.vbc_topology.min_io_size = 0; sc->vbsc_cfg.vbc_topology.opt_io_size = 0; sc->vbsc_cfg.vbc_writeback = 0; + sc->vbsc_cfg.max_discard_sectors = VTBLK_MAX_DISCARD_SECT; + sc->vbsc_cfg.max_discard_seg = VTBLK_MAX_DISCARD_SEG; + sc->vbsc_cfg.discard_sector_alignment = sectsz / VTBLK_BSIZE; /* * Should we move some of this into virtio.c? Could From owner-svn-src-all@freebsd.org Thu Sep 10 21:25:17 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 06F1C3E449B; Thu, 10 Sep 2020 21:25:17 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BnX3c6R9jz4fpK; Thu, 10 Sep 2020 21:25:16 +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 C0019195C2; Thu, 10 Sep 2020 21:25:16 +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 08ALPG0O074685; Thu, 10 Sep 2020 21:25:16 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08ALPGbT074684; Thu, 10 Sep 2020 21:25:16 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202009102125.08ALPGbT074684@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 10 Sep 2020 21:25:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365615 - head/lib/libc/sys X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/lib/libc/sys X-SVN-Commit-Revision: 365615 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.33 Precedence: list List-Id: "SVN commit messages 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, 10 Sep 2020 21:25:17 -0000 Author: kevans Date: Thu Sep 10 21:25:16 2020 New Revision: 365615 URL: https://svnweb.freebsd.org/changeset/base/365615 Log: memfd_create: fix return values Literally returning EINVAL from a function designed to return an fd makes for interesting scenarios. I cannot assign enough pointy hats to cover this one. Modified: head/lib/libc/sys/shm_open.c Modified: head/lib/libc/sys/shm_open.c ============================================================================== --- head/lib/libc/sys/shm_open.c Thu Sep 10 21:01:22 2020 (r365614) +++ head/lib/libc/sys/shm_open.c Thu Sep 10 21:25:16 2020 (r365615) @@ -115,18 +115,26 @@ memfd_create(const char *name, unsigned int flags) struct shm_largepage_conf slc; int error, fd, i, npgs, oflags, pgidx, saved_errno, shmflags; - if (name == NULL) - return (EBADF); + if (name == NULL) { + errno = EBADF; + return (-1); + } namelen = strlen(name); - if (namelen + sizeof(MEMFD_NAME_PREFIX) - 1 > NAME_MAX) - return (EINVAL); + if (namelen + sizeof(MEMFD_NAME_PREFIX) - 1 > NAME_MAX) { + errno = EINVAL; + return (-1); + } if ((flags & ~(MFD_CLOEXEC | MFD_ALLOW_SEALING | MFD_HUGETLB | - MFD_HUGE_MASK)) != 0) - return (EINVAL); + MFD_HUGE_MASK)) != 0) { + errno = EINVAL; + return (-1); + } /* Size specified but no HUGETLB. */ if (((flags & MFD_HUGE_MASK) != 0 && (flags & MFD_HUGETLB) == 0) || - __bitcount(flags & MFD_HUGE_MASK) > 1) - return (EINVAL); + __bitcount(flags & MFD_HUGE_MASK) > 1) { + errno = EINVAL; + return (-1); + } /* We've already validated that we're sufficiently sized. */ snprintf(memfd_name, NAME_MAX + 1, "%s%s", MEMFD_NAME_PREFIX, name); From owner-svn-src-all@freebsd.org Thu Sep 10 21:31:02 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0EBC13E4730; Thu, 10 Sep 2020 21:31:02 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BnXBF6jkSz4g9l; Thu, 10 Sep 2020 21:31:01 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-qv1-f41.google.com (mail-qv1-f41.google.com [209.85.219.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id C9E361DB9E; Thu, 10 Sep 2020 21:31:01 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qv1-f41.google.com with SMTP id q10so4122519qvs.1; Thu, 10 Sep 2020 14:31:01 -0700 (PDT) X-Gm-Message-State: AOAM5304j481ti2Lm4zBXkNrSnnLAnBFxWP6uO0y2g0fx6HunU3I+Fix gyvt3LYMFeVuMnvNSBP6MEZksaI00WNsfHIptXQ= X-Google-Smtp-Source: ABdhPJz5j+GCo7FOnX43aFTvFTgj8MZQsvzVJxkdVqu8086ZhklTsgl5kC7JHv/bnf9bUmzaGxvwCBP1WJyS74OUSMs= X-Received: by 2002:ad4:4c0a:: with SMTP id bz10mr10606799qvb.14.1599773461239; Thu, 10 Sep 2020 14:31:01 -0700 (PDT) MIME-Version: 1.0 References: <202009102125.08ALPGbT074684@repo.freebsd.org> In-Reply-To: <202009102125.08ALPGbT074684@repo.freebsd.org> From: Kyle Evans Date: Thu, 10 Sep 2020 16:30:49 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r365615 - head/lib/libc/sys To: Kyle Evans Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 10 Sep 2020 21:31:02 -0000 On Thu, Sep 10, 2020 at 4:25 PM Kyle Evans wrote: > > Author: kevans > Date: Thu Sep 10 21:25:16 2020 > New Revision: 365615 > URL: https://svnweb.freebsd.org/changeset/base/365615 > > Log: > memfd_create: fix return values > > Literally returning EINVAL from a function designed to return an fd makes > for interesting scenarios. > > I cannot assign enough pointy hats to cover this one. > The word omitted is "myself" -- I cannot assign myself enough pointy hats to cover this one. Thanks, Kyle Evans From owner-svn-src-all@freebsd.org Thu Sep 10 21:44:38 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1EC603E4BAB; Thu, 10 Sep 2020 21:44:38 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-ot1-f53.google.com (mail-ot1-f53.google.com [209.85.210.53]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BnXTx5dsTz4gvP; Thu, 10 Sep 2020 21:44:37 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-ot1-f53.google.com with SMTP id g10so6646530otq.9; Thu, 10 Sep 2020 14:44:37 -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=42z1Oe2biSkBNAfsJH0xt9cSIkjMRSuPkouocb5PUNQ=; b=EPbgH3oAXQToIV1/N/xictyN4B4j2hVPrNjGFa1iZXYrzSCxdoqLny4YnMvIdlhX20 nyDlmBdKfcDq/33TLXTJkjurZc9KeKkW+A4sCqspvuMdawMgmnFCAlCGmjBxkw50wjmL 4fPp64u5QzK8WTH0FoOrQb4P0vrde5Btc7l9y8JPYZQdpfTsWPXdzfRw681KCFdmkign /CysvjzIinLxUVk+sUy1AilgsqcbotqIgGEIXV5DFmk1f8md+yVL9U+0wcB8l84YJBuX C9j5fMDiuLsQpNosfDBiC59Sy34Ovot3aWioboJ9UP4ZrHPtiIDWQm0MXXs5qzwKK72/ hWbQ== X-Gm-Message-State: AOAM530u6VSwMsi+LfdZmkuHE9gT0qpRnANEncMXKkdsuQIpMXAXctPK /cVq97Hse8jOcnHjssEE4LORdIjIuLtWgFvryEuhOyHg X-Google-Smtp-Source: ABdhPJzsINizzCpst2n9bCZHaUykhj2rxPw4T4JURAGjomrmAXnWrzO5OKKxOd2mYQHLsIveuPAiZwfy4rRKG6nMHn0= X-Received: by 2002:a05:6830:1e30:: with SMTP id t16mr5445672otr.18.1599774275601; Thu, 10 Sep 2020 14:44:35 -0700 (PDT) MIME-Version: 1.0 References: <202009102101.08AL1MDW060901@repo.freebsd.org> In-Reply-To: <202009102101.08AL1MDW060901@repo.freebsd.org> From: Alan Somers Date: Thu, 10 Sep 2020 15:44:24 -0600 Message-ID: Subject: Re: svn commit: r365614 - in stable/12: sys/dev/virtio/block usr.sbin/bhyve To: Allan Jude Cc: src-committers , svn-src-all , svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org X-Rspamd-Queue-Id: 4BnXTx5dsTz4gvP X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.33 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 10 Sep 2020 21:44:38 -0000 On Thu, Sep 10, 2020 at 3:01 PM Allan Jude wrote: > Author: allanjude > Date: Thu Sep 10 21:01:22 2020 > New Revision: 365614 > URL: https://svnweb.freebsd.org/changeset/base/365614 > > Log: > MFC r360229, r363255 > > r360229: > Add VIRTIO_BLK_T_DISCARD (TRIM) support to the bhyve virtio-blk backend > > This will advertise support for TRIM to the guest virtio-blk driver and > perform the DIOCGDELETE ioctl on the backing storage if it supports it. > > Thanks to Jason King and others at Joyent and illumos for expanding on > my original patch, adding improvements including better error handling > and making sure to following the virtio spec. > > r363255: > Add VIRTIO_BLK_T_DISCARD support to the virtio-blk driver > > If the hypervisor advertises support for the DISCARD command then the > guest can perform TRIM commands, freeing space on the backing store. > > If VIRTIO_BLK_F_DISCARD is enabled, advertise DISKFLAG_CANDELETE > > Tested with FreeBSD guests on bhyve and KVM > > Relnotes: yes > Sponsored by: Klara Inc. > > Modified: > stable/12/sys/dev/virtio/block/virtio_blk.c > stable/12/sys/dev/virtio/block/virtio_blk.h > stable/12/usr.sbin/bhyve/block_if.c > stable/12/usr.sbin/bhyve/pci_virtio_block.c > Directory Properties: > stable/12/ (props changed) > Yay! From owner-svn-src-all@freebsd.org Thu Sep 10 22:22:23 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D9CED3E5F96; Thu, 10 Sep 2020 22:22:23 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BnYKW5TsPz4kM4; Thu, 10 Sep 2020 22:22:23 +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 A0A9B19F2C; Thu, 10 Sep 2020 22:22:23 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08AMMNsa011473; Thu, 10 Sep 2020 22:22:23 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08AMMNAN011472; Thu, 10 Sep 2020 22:22:23 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202009102222.08AMMNAN011472@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 10 Sep 2020 22:22:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365616 - head/sys/amd64/vmm/amd X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/amd64/vmm/amd X-SVN-Commit-Revision: 365616 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.33 Precedence: list List-Id: "SVN commit messages 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, 10 Sep 2020 22:22:23 -0000 Author: jhb Date: Thu Sep 10 22:22:23 2020 New Revision: 365616 URL: https://svnweb.freebsd.org/changeset/base/365616 Log: Use vmcb_read/write for the vmcb snapshot functions. This avoids some unnecessary layers of indirection. Modified: head/sys/amd64/vmm/amd/vmcb.c Modified: head/sys/amd64/vmm/amd/vmcb.c ============================================================================== --- head/sys/amd64/vmm/amd/vmcb.c Thu Sep 10 21:25:16 2020 (r365615) +++ head/sys/amd64/vmm/amd/vmcb.c Thu Sep 10 22:22:23 2020 (r365616) @@ -472,7 +472,7 @@ vmcb_getany(struct svm_softc *sc, int vcpu, int ident, goto err; } - error = vm_get_register(sc->vm, vcpu, ident, val); + error = vmcb_read(sc, vcpu, ident, val); err: return (error); @@ -493,7 +493,7 @@ vmcb_setany(struct svm_softc *sc, int vcpu, int ident, goto err; } - error = vm_set_register(sc->vm, vcpu, ident, val); + error = vmcb_write(sc, vcpu, ident, val); err: return (error); From owner-svn-src-all@freebsd.org Thu Sep 10 23:46:14 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5FA463E7068; Thu, 10 Sep 2020 23:46:14 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BnbBG21Qzz4nWq; Thu, 10 Sep 2020 23:46:14 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 296071B017; Thu, 10 Sep 2020 23:46:14 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08ANkEqG060054; Thu, 10 Sep 2020 23:46:14 GMT (envelope-from erj@FreeBSD.org) Received: (from erj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08ANkDbw060050; Thu, 10 Sep 2020 23:46:13 GMT (envelope-from erj@FreeBSD.org) Message-Id: <202009102346.08ANkDbw060050@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: erj set sender to erj@FreeBSD.org using -f From: Eric Joyner Date: Thu, 10 Sep 2020 23:46:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365617 - head/sys/dev/ice X-SVN-Group: head X-SVN-Commit-Author: erj X-SVN-Commit-Paths: head/sys/dev/ice X-SVN-Commit-Revision: 365617 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.33 Precedence: list List-Id: "SVN commit messages 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, 10 Sep 2020 23:46:14 -0000 Author: erj Date: Thu Sep 10 23:46:13 2020 New Revision: 365617 URL: https://svnweb.freebsd.org/changeset/base/365617 Log: ice(4): Update to 0.26.16 Summary of changes: - Assorted bug fixes - Support for newer versions of the device firmware - Suspend/resume support - Support for Lenient Link Mode for E82X devices (e.g. can try to link with SFP/QSFP modules with bad EEPROMs) - Adds port-level rx_discards sysctl, similar to ixl(4)'s This version of the driver is intended to be used with DDP package 1.3.16.0, which has already been updated in a previous commit. Tested by: Jeffrey Pieper MFC after: 3 days MFC with: r365332, r365550 Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D26322 Modified: head/sys/dev/ice/ice_adminq_cmd.h head/sys/dev/ice/ice_bitops.h head/sys/dev/ice/ice_common.c head/sys/dev/ice/ice_common.h head/sys/dev/ice/ice_controlq.c head/sys/dev/ice/ice_controlq.h head/sys/dev/ice/ice_dcb.c head/sys/dev/ice/ice_dcb.h head/sys/dev/ice/ice_drv_info.h head/sys/dev/ice/ice_flex_pipe.c head/sys/dev/ice/ice_flex_pipe.h head/sys/dev/ice/ice_flex_type.h head/sys/dev/ice/ice_flow.c head/sys/dev/ice/ice_flow.h head/sys/dev/ice/ice_hw_autogen.h head/sys/dev/ice/ice_lan_tx_rx.h head/sys/dev/ice/ice_lib.c head/sys/dev/ice/ice_lib.h head/sys/dev/ice/ice_nvm.c head/sys/dev/ice/ice_nvm.h head/sys/dev/ice/ice_protocol_type.h head/sys/dev/ice/ice_sched.c head/sys/dev/ice/ice_sched.h head/sys/dev/ice/ice_status.h head/sys/dev/ice/ice_strings.c head/sys/dev/ice/ice_switch.c head/sys/dev/ice/ice_switch.h head/sys/dev/ice/ice_type.h head/sys/dev/ice/if_ice_iflib.c head/sys/dev/ice/virtchnl.h head/sys/dev/ice/virtchnl_inline_ipsec.h Modified: head/sys/dev/ice/ice_adminq_cmd.h ============================================================================== --- head/sys/dev/ice/ice_adminq_cmd.h Thu Sep 10 22:22:23 2020 (r365616) +++ head/sys/dev/ice/ice_adminq_cmd.h Thu Sep 10 23:46:13 2020 (r365617) @@ -156,12 +156,13 @@ struct ice_aqc_list_caps_elem { #define ICE_AQC_CAPS_MSIX 0x0043 #define ICE_AQC_CAPS_MAX_MTU 0x0047 #define ICE_AQC_CAPS_NVM_VER 0x0048 +#define ICE_AQC_CAPS_OROM_VER 0x004A +#define ICE_AQC_CAPS_NET_VER 0x004C #define ICE_AQC_CAPS_CEM 0x00F2 #define ICE_AQC_CAPS_IWARP 0x0051 #define ICE_AQC_CAPS_LED 0x0061 #define ICE_AQC_CAPS_SDP 0x0062 #define ICE_AQC_CAPS_WR_CSR_PROT 0x0064 -#define ICE_AQC_CAPS_NO_DROP_POLICY 0x0065 #define ICE_AQC_CAPS_LOGI_TO_PHYSI_PORT_MAP 0x0073 #define ICE_AQC_CAPS_SKU 0x0074 #define ICE_AQC_CAPS_PORT_MAP 0x0075 @@ -281,13 +282,6 @@ struct ice_aqc_get_sw_cfg_resp_elem { #define ICE_AQC_GET_SW_CONF_RESP_IS_VF BIT(15) }; -/* The response buffer is as follows. Note that the length of the - * elements array varies with the length of the command response. - */ -struct ice_aqc_get_sw_cfg_resp { - struct ice_aqc_get_sw_cfg_resp_elem elements[1]; -}; - /* Set Port parameters, (direct, 0x0203) */ struct ice_aqc_set_port_params { __le16 cmd_flags; @@ -338,8 +332,6 @@ struct ice_aqc_set_port_params { #define ICE_AQC_RES_TYPE_SWITCH_PROF_BLDR_TCAM 0x49 #define ICE_AQC_RES_TYPE_ACL_PROF_BLDR_PROFID 0x50 #define ICE_AQC_RES_TYPE_ACL_PROF_BLDR_TCAM 0x51 -#define ICE_AQC_RES_TYPE_FD_PROF_BLDR_PROFID 0x58 -#define ICE_AQC_RES_TYPE_FD_PROF_BLDR_TCAM 0x59 #define ICE_AQC_RES_TYPE_HASH_PROF_BLDR_PROFID 0x60 #define ICE_AQC_RES_TYPE_HASH_PROF_BLDR_TCAM 0x61 /* Resource types 0x62-67 are reserved for Hash profile builder */ @@ -372,15 +364,6 @@ struct ice_aqc_get_res_resp_elem { __le16 total_free; /* Resources un-allocated/not reserved by any PF */ }; -/* Buffer for Get Resource command */ -struct ice_aqc_get_res_resp { - /* Number of resource entries to be calculated using - * datalen/sizeof(struct ice_aqc_cmd_resp)). - * Value of 'datalen' gets updated as part of response. - */ - struct ice_aqc_get_res_resp_elem elem[1]; -}; - /* Allocate Resources command (indirect 0x0208) * Free Resources command (indirect 0x0209) */ @@ -406,7 +389,7 @@ struct ice_aqc_alloc_free_res_elem { #define ICE_AQC_RES_TYPE_VSI_PRUNE_LIST_M \ (0xF << ICE_AQC_RES_TYPE_VSI_PRUNE_LIST_S) __le16 num_elems; - struct ice_aqc_res_elem elem[1]; + struct ice_aqc_res_elem elem[STRUCT_HACK_VAR_LEN]; }; /* Get Allocated Resource Descriptors Command (indirect 0x020A) */ @@ -428,10 +411,6 @@ struct ice_aqc_get_allocd_res_desc { __le32 addr_low; }; -struct ice_aqc_get_allocd_res_desc_resp { - struct ice_aqc_res_elem elem[1]; -}; - /* Add VSI (indirect 0x0210) * Update VSI (indirect 0x0211) * Get VSI (indirect 0x0212) @@ -758,7 +737,6 @@ struct ice_aqc_sw_rules { __le32 addr_low; }; -#pragma pack(1) /* Add/Update/Get/Remove lookup Rx/Tx command/response entry * This structures describes the lookup rules and associated actions. "index" * is returned as part of a response to a successful Add command, and can be @@ -841,9 +819,8 @@ struct ice_sw_rule_lkup_rx_tx { * lookup-type */ __le16 hdr_len; - u8 hdr[1]; + u8 hdr[STRUCT_HACK_VAR_LEN]; }; -#pragma pack() /* Add/Update/Remove large action command/response entry * "index" is returned as part of a response to a successful Add command, and @@ -852,7 +829,6 @@ struct ice_sw_rule_lkup_rx_tx { struct ice_sw_rule_lg_act { __le16 index; /* Index in large action table */ __le16 size; - __le32 act[1]; /* array of size for actions */ /* Max number of large actions */ #define ICE_MAX_LG_ACT 4 /* Bit 0:1 - Action type */ @@ -903,6 +879,7 @@ struct ice_sw_rule_lg_act { #define ICE_LG_ACT_STAT_COUNT 0x7 #define ICE_LG_ACT_STAT_COUNT_S 3 #define ICE_LG_ACT_STAT_COUNT_M (0x7F << ICE_LG_ACT_STAT_COUNT_S) + __le32 act[STRUCT_HACK_VAR_LEN]; /* array of size for actions */ }; /* Add/Update/Remove VSI list command/response entry @@ -912,7 +889,7 @@ struct ice_sw_rule_lg_act { struct ice_sw_rule_vsi_list { __le16 index; /* Index of VSI/Prune list */ __le16 number_vsi; - __le16 vsi[1]; /* Array of number_vsi VSI numbers */ + __le16 vsi[STRUCT_HACK_VAR_LEN]; /* Array of number_vsi VSI numbers */ }; #pragma pack(1) @@ -977,8 +954,10 @@ struct ice_aqc_set_query_pfc_mode { struct ice_aqc_set_dcb_params { u8 cmd_flags; /* unused in response */ #define ICE_AQC_LINK_UP_DCB_CFG BIT(0) +#define ICE_AQC_PERSIST_DCB_CFG BIT(1) u8 valid_flags; /* unused in response */ #define ICE_AQC_LINK_UP_DCB_CFG_VALID BIT(0) +#define ICE_AQC_PERSIST_DCB_CFG_VALID BIT(1) u8 rsvd[14]; }; @@ -1008,14 +987,6 @@ struct ice_aqc_sched_elem_cmd { __le32 addr_low; }; -/* This is the buffer for: - * Suspend Nodes (indirect 0x0409) - * Resume Nodes (indirect 0x040A) - */ -struct ice_aqc_suspend_resume_elem { - __le32 teid[1]; -}; - struct ice_aqc_txsched_move_grp_info_hdr { __le32 src_parent_teid; __le32 dest_parent_teid; @@ -1025,7 +996,7 @@ struct ice_aqc_txsched_move_grp_info_hdr { struct ice_aqc_move_elem { struct ice_aqc_txsched_move_grp_info_hdr hdr; - __le32 teid[1]; + __le32 teid[STRUCT_HACK_VAR_LEN]; }; struct ice_aqc_elem_info_bw { @@ -1078,17 +1049,9 @@ struct ice_aqc_txsched_topo_grp_info_hdr { struct ice_aqc_add_elem { struct ice_aqc_txsched_topo_grp_info_hdr hdr; - struct ice_aqc_txsched_elem_data generic[1]; + struct ice_aqc_txsched_elem_data generic[STRUCT_HACK_VAR_LEN]; }; -struct ice_aqc_conf_elem { - struct ice_aqc_txsched_elem_data generic[1]; -}; - -struct ice_aqc_get_elem { - struct ice_aqc_txsched_elem_data generic[1]; -}; - struct ice_aqc_get_topo_elem { struct ice_aqc_txsched_topo_grp_info_hdr hdr; struct ice_aqc_txsched_elem_data @@ -1097,7 +1060,7 @@ struct ice_aqc_get_topo_elem { struct ice_aqc_delete_elem { struct ice_aqc_txsched_topo_grp_info_hdr hdr; - __le32 teid[1]; + __le32 teid[STRUCT_HACK_VAR_LEN]; }; /* Query Port ETS (indirect 0x040E) @@ -1160,10 +1123,6 @@ struct ice_aqc_rl_profile_elem { __le16 rl_encode; }; -struct ice_aqc_rl_profile_generic_elem { - struct ice_aqc_rl_profile_elem generic[1]; -}; - /* Configure L2 Node CGD (indirect 0x0414) * This indirect command allows configuring a congestion domain for given L2 * node TEIDs in the scheduler topology. @@ -1181,10 +1140,6 @@ struct ice_aqc_cfg_l2_node_cgd_elem { u8 reserved[3]; }; -struct ice_aqc_cfg_l2_node_cgd_data { - struct ice_aqc_cfg_l2_node_cgd_elem elem[1]; -}; - /* Query Scheduler Resource Allocation (indirect 0x0412) * This indirect command retrieves the scheduler resources allocated by * EMP Firmware to the given PF. @@ -1330,7 +1285,7 @@ struct ice_aqc_get_phy_caps { #define ICE_PHY_TYPE_HIGH_100G_CAUI2 BIT_ULL(2) #define ICE_PHY_TYPE_HIGH_100G_AUI2_AOC_ACC BIT_ULL(3) #define ICE_PHY_TYPE_HIGH_100G_AUI2 BIT_ULL(4) -#define ICE_PHY_TYPE_HIGH_MAX_INDEX 19 +#define ICE_PHY_TYPE_HIGH_MAX_INDEX 5 struct ice_aqc_get_phy_caps_data { __le64 phy_type_low; /* Use values from ICE_PHY_TYPE_LOW_* */ @@ -1381,6 +1336,7 @@ struct ice_aqc_get_phy_caps_data { u8 module_type[ICE_MODULE_TYPE_TOTAL_BYTE]; #define ICE_AQC_MOD_TYPE_BYTE0_SFP_PLUS 0xA0 #define ICE_AQC_MOD_TYPE_BYTE0_QSFP_PLUS 0x80 +#define ICE_AQC_MOD_TYPE_IDENT 1 #define ICE_AQC_MOD_TYPE_BYTE1_SFP_PLUS_CU_PASSIVE BIT(0) #define ICE_AQC_MOD_TYPE_BYTE1_SFP_PLUS_CU_ACTIVE BIT(1) #define ICE_AQC_MOD_TYPE_BYTE1_10G_BASE_SR BIT(4) @@ -1490,6 +1446,9 @@ struct ice_aqc_get_link_status_data { #define ICE_AQ_LINK_TOPO_UNSUPP_MEDIA BIT(7) u8 link_cfg_err; #define ICE_AQ_LINK_CFG_ERR BIT(0) +#define ICE_AQ_LINK_ACT_PORT_OPT_INVAL BIT(2) +#define ICE_AQ_LINK_FEAT_ID_OR_CONFIG_ID_INVAL BIT(3) +#define ICE_AQ_LINK_TOPO_CRITICAL_SDP_ERR BIT(4) u8 link_info; #define ICE_AQ_LINK_UP BIT(0) /* Link Status */ #define ICE_AQ_LINK_FAULT BIT(1) @@ -1607,7 +1566,7 @@ struct ice_aqc_set_mac_lb { u8 reserved[15]; }; -/* DNL Get Status command (indirect 0x680) +/* DNL Get Status command (indirect 0x0680) * Structure used for the response, the command uses the generic * ice_aqc_generic struct to pass a buffer address to the FW. */ @@ -1667,7 +1626,7 @@ struct ice_aqc_dnl_get_status_data { u32 sb_iosf_clk_cntr; }; -/* DNL run command (direct 0x681) */ +/* DNL run command (direct 0x0681) */ struct ice_aqc_dnl_run_command { u8 reserved0; u8 command; @@ -1686,7 +1645,7 @@ struct ice_aqc_dnl_run_command { u8 reserved1[12]; }; -/* DNL call command (indirect 0x682) +/* DNL call command (indirect 0x0682) * Struct is used for both command and response */ struct ice_aqc_dnl_call_command { @@ -1698,14 +1657,14 @@ struct ice_aqc_dnl_call_command { __le32 addr_low; }; -/* DNL call command/response buffer (indirect 0x682) */ +/* DNL call command/response buffer (indirect 0x0682) */ struct ice_aqc_dnl_call { __le32 stores[4]; }; /* Used for both commands: - * DNL read sto command (indirect 0x683) - * DNL write sto command (indirect 0x684) + * DNL read sto command (indirect 0x0683) + * DNL write sto command (indirect 0x0684) */ struct ice_aqc_dnl_read_write_command { u8 ctx; @@ -1720,8 +1679,8 @@ struct ice_aqc_dnl_read_write_command { }; /* Used for both command responses: - * DNL read sto response (indirect 0x683) - * DNL write sto response (indirect 0x684) + * DNL read sto response (indirect 0x0683) + * DNL write sto response (indirect 0x0684) */ struct ice_aqc_dnl_read_write_response { u8 reserved; @@ -1732,14 +1691,14 @@ struct ice_aqc_dnl_read_write_response { __le32 addr_low; /* Reserved for write command */ }; -/* DNL set breakpoints command (indirect 0x686) */ +/* DNL set breakpoints command (indirect 0x0686) */ struct ice_aqc_dnl_set_breakpoints_command { __le32 reserved[2]; __le32 addr_high; __le32 addr_low; }; -/* DNL set breakpoints data buffer structure (indirect 0x686) */ +/* DNL set breakpoints data buffer structure (indirect 0x0686) */ struct ice_aqc_dnl_set_breakpoints { u8 ctx; u8 ena; /* 0- disabled, 1- enabled */ @@ -1747,7 +1706,7 @@ struct ice_aqc_dnl_set_breakpoints { __le16 activity_id; }; -/* DNL read log data command(indirect 0x687) */ +/* DNL read log data command(indirect 0x0687) */ struct ice_aqc_dnl_read_log_command { __le16 reserved0; __le16 offset; @@ -1757,7 +1716,7 @@ struct ice_aqc_dnl_read_log_command { }; -/* DNL read log data response(indirect 0x687) */ +/* DNL read log data response(indirect 0x0687) */ struct ice_aqc_dnl_read_log_response { __le16 reserved; __le16 size; @@ -1976,6 +1935,7 @@ struct ice_aqc_get_port_options { struct ice_aqc_get_port_options_elem { u8 pmd; +#define ICE_AQC_PORT_INV_PORT_OPT 4 #define ICE_AQC_PORT_OPT_PMD_COUNT_S 0 #define ICE_AQC_PORT_OPT_PMD_COUNT_M (0xF << ICE_AQC_PORT_OPT_PMD_COUNT_S) #define ICE_AQC_PORT_OPT_PMD_WIDTH_S 4 @@ -1995,13 +1955,6 @@ struct ice_aqc_get_port_options_elem { u8 phy_scid[2]; }; -/* The buffer for command 0x06EA contains port_options_count of options - * in the option array. - */ -struct ice_aqc_get_port_options_data { - struct ice_aqc_get_port_options_elem option[1]; -}; - /* Set Port Option (direct, 0x06EB) */ struct ice_aqc_set_port_option { u8 lport_num; @@ -2114,6 +2067,7 @@ struct ice_aqc_nvm { #define ICE_AQC_NVM_LINK_TOPO_NETLIST_LEN 2 /* In bytes */ #define ICE_AQC_NVM_NETLIST_NODE_COUNT_OFFSET 2 #define ICE_AQC_NVM_NETLIST_NODE_COUNT_LEN 2 /* In bytes */ +#define ICE_AQC_NVM_NETLIST_NODE_COUNT_M MAKEMASK(0x3FF, 0) #define ICE_AQC_NVM_NETLIST_ID_BLK_START_OFFSET 5 #define ICE_AQC_NVM_NETLIST_ID_BLK_LEN 0x30 /* In words */ @@ -2353,6 +2307,18 @@ struct ice_aqc_lldp_stop_start_specific_agent { u8 reserved[15]; }; +/* LLDP Filter Control (direct 0x0A0A) */ +struct ice_aqc_lldp_filter_ctrl { + u8 cmd_flags; +#define ICE_AQC_LLDP_FILTER_ACTION_M MAKEMASK(3, 0) +#define ICE_AQC_LLDP_FILTER_ACTION_ADD 0x0 +#define ICE_AQC_LLDP_FILTER_ACTION_DELETE 0x1 +#define ICE_AQC_LLDP_FILTER_ACTION_UPDATE 0x2 + u8 reserved1; + __le16 vsi_num; + u8 reserved2[12]; +}; + /* Get/Set RSS key (indirect 0x0B04/0x0B02) */ struct ice_aqc_get_set_rss_key { #define ICE_AQC_GSET_RSS_KEY_VSI_VALID BIT(15) @@ -2389,7 +2355,7 @@ struct ice_aqc_get_set_rss_keys { struct ice_aqc_get_set_rss_lut { #define ICE_AQC_GSET_RSS_LUT_VSI_VALID BIT(15) #define ICE_AQC_GSET_RSS_LUT_VSI_ID_S 0 -#define ICE_AQC_GSET_RSS_LUT_VSI_ID_M (0x1FF << ICE_AQC_GSET_RSS_LUT_VSI_ID_S) +#define ICE_AQC_GSET_RSS_LUT_VSI_ID_M (0x3FF << ICE_AQC_GSET_RSS_LUT_VSI_ID_S) __le16 vsi_id; #define ICE_AQC_GSET_RSS_LUT_TABLE_TYPE_S 0 #define ICE_AQC_GSET_RSS_LUT_TABLE_TYPE_M \ @@ -2450,7 +2416,7 @@ struct ice_aqc_add_tx_qgrp { __le32 parent_teid; u8 num_txqs; u8 rsvd[3]; - struct ice_aqc_add_txqs_perq txqs[1]; + struct ice_aqc_add_txqs_perq txqs[STRUCT_HACK_VAR_LEN]; }; /* Disable Tx LAN Queues (indirect 0x0C31) */ @@ -2483,24 +2449,21 @@ struct ice_aqc_dis_txqs { * added before the start of the next group, to allow correct * alignment of the parent_teid field. */ +#pragma pack(1) struct ice_aqc_dis_txq_item { __le32 parent_teid; u8 num_qs; u8 rsvd; /* The length of the q_id array varies according to num_qs */ - __le16 q_id[1]; - /* This only applies from F8 onward */ #define ICE_AQC_Q_DIS_BUF_ELEM_TYPE_S 15 #define ICE_AQC_Q_DIS_BUF_ELEM_TYPE_LAN_Q \ (0 << ICE_AQC_Q_DIS_BUF_ELEM_TYPE_S) #define ICE_AQC_Q_DIS_BUF_ELEM_TYPE_RDMA_QSET \ (1 << ICE_AQC_Q_DIS_BUF_ELEM_TYPE_S) + __le16 q_id[STRUCT_HACK_VAR_LEN]; }; +#pragma pack() -struct ice_aqc_dis_txq { - struct ice_aqc_dis_txq_item qgrps[1]; -}; - /* Tx LAN Queues Cleanup Event (0x0C31) */ struct ice_aqc_txqs_cleanup { __le16 caller_opc; @@ -2540,11 +2503,11 @@ struct ice_aqc_move_txqs_elem { struct ice_aqc_move_txqs_data { __le32 src_teid; __le32 dest_teid; - struct ice_aqc_move_txqs_elem txqs[1]; + struct ice_aqc_move_txqs_elem txqs[STRUCT_HACK_VAR_LEN]; }; /* Download Package (indirect 0x0C40) */ -/* Also used for Update Package (indirect 0x0C42) */ +/* Also used for Update Package (indirect 0x0C42 and 0x0C41) */ struct ice_aqc_download_pkg { u8 flags; #define ICE_AQC_DOWNLOAD_PKG_LAST_BUF 0x01 @@ -2593,7 +2556,7 @@ struct ice_aqc_get_pkg_info { /* Get Package Info List response buffer format (0x0C43) */ struct ice_aqc_get_pkg_info_resp { __le32 count; - struct ice_aqc_get_pkg_info pkg_info[1]; + struct ice_aqc_get_pkg_info pkg_info[STRUCT_HACK_VAR_LEN]; }; /* Driver Shared Parameters (direct, 0x0C90) */ @@ -2617,6 +2580,50 @@ struct ice_aqc_event_lan_overflow { u8 reserved[8]; }; +/* Set Health Status (direct 0xFF20) */ +struct ice_aqc_set_health_status_config { + u8 event_source; +#define ICE_AQC_HEALTH_STATUS_SET_PF_SPECIFIC_MASK BIT(0) +#define ICE_AQC_HEALTH_STATUS_SET_ALL_PF_MASK BIT(1) +#define ICE_AQC_HEALTH_STATUS_SET_GLOBAL_MASK BIT(2) + u8 reserved[15]; +}; + +/* Get Health Status codes (indirect 0xFF21) */ +struct ice_aqc_get_supported_health_status_codes { + __le16 health_code_count; + u8 reserved[6]; + __le32 addr_high; + __le32 addr_low; +}; + +/* Get Health Status (indirect 0xFF22) */ +struct ice_aqc_get_health_status { + __le16 health_status_count; + u8 reserved[6]; + __le32 addr_high; + __le32 addr_low; +}; + +/* Get Health Status event buffer entry, (0xFF22) + * repeated per reported health status + */ +struct ice_aqc_health_status_elem { + __le16 health_status_code; + __le16 event_source; +#define ICE_AQC_HEALTH_STATUS_PF (0x1) +#define ICE_AQC_HEALTH_STATUS_PORT (0x2) +#define ICE_AQC_HEALTH_STATUS_GLOBAL (0x3) + __le32 internal_data1; +#define ICE_AQC_HEALTH_STATUS_UNDEFINED_DATA (0xDEADBEEF) + __le32 internal_data2; +}; + +/* Clear Health Status (direct 0xFF23) */ +struct ice_aqc_clear_health_status { + __le32 reserved[4]; +}; + /** * struct ice_aq_desc - Admin Queue (AQ) descriptor * @flags: ICE_AQ_FLAG_* flags @@ -2706,6 +2713,7 @@ struct ice_aq_desc { struct ice_aqc_lldp_start lldp_start; struct ice_aqc_lldp_set_local_mib lldp_set_mib; struct ice_aqc_lldp_stop_start_specific_agent lldp_agent_ctrl; + struct ice_aqc_lldp_filter_ctrl lldp_filter_ctrl; struct ice_aqc_get_set_rss_lut get_set_rss_lut; struct ice_aqc_get_set_rss_key get_set_rss_key; struct ice_aqc_add_txqs add_txqs; @@ -2727,6 +2735,12 @@ struct ice_aq_desc { struct ice_aqc_get_link_status get_link_status; struct ice_aqc_event_lan_overflow lan_overflow; struct ice_aqc_get_link_topo get_link_topo; + struct ice_aqc_set_health_status_config + set_health_status_config; + struct ice_aqc_get_supported_health_status_codes + get_supported_health_status_codes; + struct ice_aqc_get_health_status get_health_status; + struct ice_aqc_clear_health_status clear_health_status; } params; }; @@ -2918,6 +2932,8 @@ enum ice_adminq_opc { ice_aqc_opc_nvm_sr_dump = 0x0707, ice_aqc_opc_nvm_save_factory_settings = 0x0708, ice_aqc_opc_nvm_update_empr = 0x0709, + ice_aqc_opc_nvm_pkg_data = 0x070A, + ice_aqc_opc_nvm_pass_component_tbl = 0x070B, /* PF/VF mailbox commands */ ice_mbx_opc_send_msg_to_pf = 0x0801, @@ -2940,6 +2956,7 @@ enum ice_adminq_opc { ice_aqc_opc_get_cee_dcb_cfg = 0x0A07, ice_aqc_opc_lldp_set_local_mib = 0x0A08, ice_aqc_opc_lldp_stop_start_specific_agent = 0x0A09, + ice_aqc_opc_lldp_filter_ctrl = 0x0A0A, /* RSS commands */ ice_aqc_opc_set_rss_key = 0x0B02, @@ -2963,6 +2980,12 @@ enum ice_adminq_opc { /* Standalone Commands/Events */ ice_aqc_opc_event_lan_overflow = 0x1001, + + /* SystemDiagnostic commands */ + ice_aqc_opc_set_health_status_config = 0xFF20, + ice_aqc_opc_get_supported_health_status_codes = 0xFF21, + ice_aqc_opc_get_health_status = 0xFF22, + ice_aqc_opc_clear_health_status = 0xFF23 }; #endif /* _ICE_ADMINQ_CMD_H_ */ Modified: head/sys/dev/ice/ice_bitops.h ============================================================================== --- head/sys/dev/ice/ice_bitops.h Thu Sep 10 22:22:23 2020 (r365616) +++ head/sys/dev/ice/ice_bitops.h Thu Sep 10 23:46:13 2020 (r365617) @@ -242,7 +242,7 @@ ice_or_bitmap(ice_bitmap_t *dst, const ice_bitmap_t *b ice_bitmap_t mask; u16 i; - /* Handle all but last chunk*/ + /* Handle all but last chunk */ for (i = 0; i < BITS_TO_CHUNKS(size) - 1; i++) dst[i] = bmp1[i] | bmp2[i]; @@ -273,7 +273,7 @@ ice_xor_bitmap(ice_bitmap_t *dst, const ice_bitmap_t * ice_bitmap_t mask; u16 i; - /* Handle all but last chunk*/ + /* Handle all but last chunk */ for (i = 0; i < BITS_TO_CHUNKS(size) - 1; i++) dst[i] = bmp1[i] ^ bmp2[i]; @@ -287,6 +287,37 @@ ice_xor_bitmap(ice_bitmap_t *dst, const ice_bitmap_t * } /** + * ice_andnot_bitmap - bitwise ANDNOT 2 bitmaps and result in dst bitmap + * @dst: Destination bitmap that receive the result of the operation + * @bmp1: The first bitmap of ANDNOT operation + * @bmp2: The second bitmap to ANDNOT operation + * @size: Size of the bitmaps in bits + * + * This function performs a bitwise ANDNOT on two "source" bitmaps of the same + * size, and stores the result to "dst" bitmap. The "dst" bitmap must be of the + * same size as the "source" bitmaps to avoid buffer overflows. + */ +static inline void +ice_andnot_bitmap(ice_bitmap_t *dst, const ice_bitmap_t *bmp1, + const ice_bitmap_t *bmp2, u16 size) +{ + ice_bitmap_t mask; + u16 i; + + /* Handle all but last chunk */ + for (i = 0; i < BITS_TO_CHUNKS(size) - 1; i++) + dst[i] = bmp1[i] & ~bmp2[i]; + + /* We want to only clear bits within the size. Furthermore, we also do + * not want to modify destination bits which are beyond the specified + * size. Use a bitmask to ensure that we only modify the bits that are + * within the specified size. + */ + mask = LAST_CHUNK_MASK(size); + dst[i] = (dst[i] & ~mask) | ((bmp1[i] & ~bmp2[i]) & mask); +} + +/** * ice_find_next_bit - Find the index of the next set bit of a bitmap * @bitmap: the bitmap to scan * @size: the size in bits of the bitmap @@ -343,6 +374,11 @@ static inline u16 ice_find_first_bit(const ice_bitmap_ return ice_find_next_bit(bitmap, size, 0); } +#define ice_for_each_set_bit(_bitpos, _addr, _maxlen) \ + for ((_bitpos) = ice_find_first_bit((_addr), (_maxlen)); \ + (_bitpos) < (_maxlen); \ + (_bitpos) = ice_find_next_bit((_addr), (_maxlen), (_bitpos) + 1)) + /** * ice_is_any_bit_set - Return true of any bit in the bitmap is set * @bitmap: the bitmap to check @@ -373,6 +409,48 @@ static inline void ice_cp_bitmap(ice_bitmap_t *dst, ic } /** + * ice_bitmap_set - set a number of bits in bitmap from a starting position + * @dst: bitmap destination + * @pos: first bit position to set + * @num_bits: number of bits to set + * + * This function sets bits in a bitmap from pos to (pos + num_bits) - 1. + * Note that this function assumes it is operating on a bitmap declared using + * ice_declare_bitmap. + */ +static inline void +ice_bitmap_set(ice_bitmap_t *dst, u16 pos, u16 num_bits) +{ + u16 i; + + for (i = pos; i < num_bits; i++) + ice_set_bit(i, dst); +} + +/** + * ice_bitmap_hweight - hamming weight of bitmap + * @bm: bitmap pointer + * @size: size of bitmap (in bits) + * + * This function determines the number of set bits in a bitmap. + * Note that this function assumes it is operating on a bitmap declared using + * ice_declare_bitmap. + */ +static inline int +ice_bitmap_hweight(ice_bitmap_t *bm, u16 size) +{ + int count = 0; + u16 bit = 0; + + while (size > (bit = ice_find_next_bit(bm, size, bit))) { + count++; + bit++; + } + + return count; +} + +/** * ice_cmp_bitmaps - compares two bitmaps. * @bmp1: the bitmap to compare * @bmp2: the bitmap to compare with bmp1 @@ -386,12 +464,12 @@ ice_cmp_bitmap(ice_bitmap_t *bmp1, ice_bitmap_t *bmp2, ice_bitmap_t mask; u16 i; - /* Handle all but last chunk*/ + /* Handle all but last chunk */ for (i = 0; i < BITS_TO_CHUNKS(size) - 1; i++) if (bmp1[i] != bmp2[i]) return false; - /* We want to only compare bits within the size.*/ + /* We want to only compare bits within the size */ mask = LAST_CHUNK_MASK(size); if ((bmp1[i] & mask) != (bmp2[i] & mask)) return false; Modified: head/sys/dev/ice/ice_common.c ============================================================================== --- head/sys/dev/ice/ice_common.c Thu Sep 10 22:22:23 2020 (r365616) +++ head/sys/dev/ice/ice_common.c Thu Sep 10 23:46:13 2020 (r365617) @@ -115,7 +115,8 @@ enum ice_status ice_clear_pf_cfg(struct ice_hw *hw) * is returned in user specified buffer. Please interpret user specified * buffer as "manage_mac_read" response. * Response such as various MAC addresses are stored in HW struct (port.mac) - * ice_aq_discover_caps is expected to be called before this function is called. + * ice_discover_dev_caps is expected to be called before this function is + * called. */ enum ice_status ice_aq_manage_mac_read(struct ice_hw *hw, void *buf, u16 buf_size, @@ -180,11 +181,13 @@ ice_aq_get_phy_caps(struct ice_port_info *pi, bool qua u16 pcaps_size = sizeof(*pcaps); struct ice_aq_desc desc; enum ice_status status; + struct ice_hw *hw; cmd = &desc.params.get_phy; if (!pcaps || (report_mode & ~ICE_AQC_REPORT_MODE_M) || !pi) return ICE_ERR_PARAM; + hw = pi->hw; ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_get_phy_caps); @@ -192,11 +195,39 @@ ice_aq_get_phy_caps(struct ice_port_info *pi, bool qua cmd->param0 |= CPU_TO_LE16(ICE_AQC_GET_PHY_RQM); cmd->param0 |= CPU_TO_LE16(report_mode); - status = ice_aq_send_cmd(pi->hw, &desc, pcaps, pcaps_size, cd); + status = ice_aq_send_cmd(hw, &desc, pcaps, pcaps_size, cd); + ice_debug(hw, ICE_DBG_LINK, "get phy caps - report_mode = 0x%x\n", + report_mode); + ice_debug(hw, ICE_DBG_LINK, " phy_type_low = 0x%llx\n", + (unsigned long long)LE64_TO_CPU(pcaps->phy_type_low)); + ice_debug(hw, ICE_DBG_LINK, " phy_type_high = 0x%llx\n", + (unsigned long long)LE64_TO_CPU(pcaps->phy_type_high)); + ice_debug(hw, ICE_DBG_LINK, " caps = 0x%x\n", pcaps->caps); + ice_debug(hw, ICE_DBG_LINK, " low_power_ctrl_an = 0x%x\n", + pcaps->low_power_ctrl_an); + ice_debug(hw, ICE_DBG_LINK, " eee_cap = 0x%x\n", pcaps->eee_cap); + ice_debug(hw, ICE_DBG_LINK, " eeer_value = 0x%x\n", + pcaps->eeer_value); + ice_debug(hw, ICE_DBG_LINK, " link_fec_options = 0x%x\n", + pcaps->link_fec_options); + ice_debug(hw, ICE_DBG_LINK, " module_compliance_enforcement = 0x%x\n", + pcaps->module_compliance_enforcement); + ice_debug(hw, ICE_DBG_LINK, " extended_compliance_code = 0x%x\n", + pcaps->extended_compliance_code); + ice_debug(hw, ICE_DBG_LINK, " module_type[0] = 0x%x\n", + pcaps->module_type[0]); + ice_debug(hw, ICE_DBG_LINK, " module_type[1] = 0x%x\n", + pcaps->module_type[1]); + ice_debug(hw, ICE_DBG_LINK, " module_type[2] = 0x%x\n", + pcaps->module_type[2]); + if (status == ICE_SUCCESS && report_mode == ICE_AQC_REPORT_TOPO_CAP) { pi->phy.phy_type_low = LE64_TO_CPU(pcaps->phy_type_low); pi->phy.phy_type_high = LE64_TO_CPU(pcaps->phy_type_high); + ice_memcpy(pi->phy.link_info.module_type, &pcaps->module_type, + sizeof(pi->phy.link_info.module_type), + ICE_NONDMA_TO_NONDMA); } return status; @@ -269,6 +300,18 @@ static enum ice_media_type ice_get_media_type(struct i return ICE_MEDIA_UNKNOWN; if (hw_link_info->phy_type_low) { + /* 1G SGMII is a special case where some DA cable PHYs + * may show this as an option when it really shouldn't + * be since SGMII is meant to be between a MAC and a PHY + * in a backplane. Try to detect this case and handle it + */ + if (hw_link_info->phy_type_low == ICE_PHY_TYPE_LOW_1G_SGMII && + (hw_link_info->module_type[ICE_AQC_MOD_TYPE_IDENT] == + ICE_AQC_MOD_TYPE_BYTE1_SFP_PLUS_CU_ACTIVE || + hw_link_info->module_type[ICE_AQC_MOD_TYPE_IDENT] == + ICE_AQC_MOD_TYPE_BYTE1_SFP_PLUS_CU_PASSIVE)) + return ICE_MEDIA_DA; + switch (hw_link_info->phy_type_low) { case ICE_PHY_TYPE_LOW_1000BASE_SX: case ICE_PHY_TYPE_LOW_1000BASE_LX: @@ -289,6 +332,15 @@ static enum ice_media_type ice_get_media_type(struct i case ICE_PHY_TYPE_LOW_100GBASE_SR2: case ICE_PHY_TYPE_LOW_100GBASE_DR: return ICE_MEDIA_FIBER; + case ICE_PHY_TYPE_LOW_10G_SFI_AOC_ACC: + case ICE_PHY_TYPE_LOW_25G_AUI_AOC_ACC: + case ICE_PHY_TYPE_LOW_40G_XLAUI_AOC_ACC: + case ICE_PHY_TYPE_LOW_50G_LAUI2_AOC_ACC: + case ICE_PHY_TYPE_LOW_50G_AUI2_AOC_ACC: + case ICE_PHY_TYPE_LOW_50G_AUI1_AOC_ACC: + case ICE_PHY_TYPE_LOW_100G_CAUI4_AOC_ACC: + case ICE_PHY_TYPE_LOW_100G_AUI4_AOC_ACC: + return ICE_MEDIA_FIBER; case ICE_PHY_TYPE_LOW_100BASE_TX: case ICE_PHY_TYPE_LOW_1000BASE_T: case ICE_PHY_TYPE_LOW_2500BASE_T: @@ -315,7 +367,7 @@ static enum ice_media_type ice_get_media_type(struct i case ICE_PHY_TYPE_LOW_100G_AUI4: case ICE_PHY_TYPE_LOW_100G_CAUI4: if (ice_is_media_cage_present(pi)) - return ICE_MEDIA_DA; + return ICE_MEDIA_AUI; /* fall-through */ case ICE_PHY_TYPE_LOW_1000BASE_KX: case ICE_PHY_TYPE_LOW_2500BASE_KX: @@ -335,11 +387,15 @@ static enum ice_media_type ice_get_media_type(struct i } else { switch (hw_link_info->phy_type_high) { case ICE_PHY_TYPE_HIGH_100G_AUI2: + case ICE_PHY_TYPE_HIGH_100G_CAUI2: if (ice_is_media_cage_present(pi)) - return ICE_MEDIA_DA; + return ICE_MEDIA_AUI; /* fall-through */ case ICE_PHY_TYPE_HIGH_100GBASE_KR2_PAM4: return ICE_MEDIA_BACKPLANE; + case ICE_PHY_TYPE_HIGH_100G_CAUI2_AOC_ACC: + case ICE_PHY_TYPE_HIGH_100G_AUI2_AOC_ACC: + return ICE_MEDIA_FIBER; } } return ICE_MEDIA_UNKNOWN; @@ -420,18 +476,21 @@ ice_aq_get_link_info(struct ice_port_info *pi, bool en li->lse_ena = !!(resp->cmd_flags & CPU_TO_LE16(ICE_AQ_LSE_IS_ENABLED)); - ice_debug(hw, ICE_DBG_LINK, "link_speed = 0x%x\n", li->link_speed); - ice_debug(hw, ICE_DBG_LINK, "phy_type_low = 0x%llx\n", + ice_debug(hw, ICE_DBG_LINK, "get link info\n"); + ice_debug(hw, ICE_DBG_LINK, " link_speed = 0x%x\n", li->link_speed); + ice_debug(hw, ICE_DBG_LINK, " phy_type_low = 0x%llx\n", (unsigned long long)li->phy_type_low); - ice_debug(hw, ICE_DBG_LINK, "phy_type_high = 0x%llx\n", + ice_debug(hw, ICE_DBG_LINK, " phy_type_high = 0x%llx\n", (unsigned long long)li->phy_type_high); - ice_debug(hw, ICE_DBG_LINK, "media_type = 0x%x\n", *hw_media_type); - ice_debug(hw, ICE_DBG_LINK, "link_info = 0x%x\n", li->link_info); - ice_debug(hw, ICE_DBG_LINK, "an_info = 0x%x\n", li->an_info); - ice_debug(hw, ICE_DBG_LINK, "ext_info = 0x%x\n", li->ext_info); - ice_debug(hw, ICE_DBG_LINK, "lse_ena = 0x%x\n", li->lse_ena); - ice_debug(hw, ICE_DBG_LINK, "max_frame = 0x%x\n", li->max_frame_size); - ice_debug(hw, ICE_DBG_LINK, "pacing = 0x%x\n", li->pacing); + ice_debug(hw, ICE_DBG_LINK, " media_type = 0x%x\n", *hw_media_type); + ice_debug(hw, ICE_DBG_LINK, " link_info = 0x%x\n", li->link_info); + ice_debug(hw, ICE_DBG_LINK, " an_info = 0x%x\n", li->an_info); + ice_debug(hw, ICE_DBG_LINK, " ext_info = 0x%x\n", li->ext_info); + ice_debug(hw, ICE_DBG_LINK, " fec_info = 0x%x\n", li->fec_info); + ice_debug(hw, ICE_DBG_LINK, " lse_ena = 0x%x\n", li->lse_ena); + ice_debug(hw, ICE_DBG_LINK, " max_frame = 0x%x\n", + li->max_frame_size); + ice_debug(hw, ICE_DBG_LINK, " pacing = 0x%x\n", li->pacing); /* save link status information */ if (link) @@ -444,6 +503,43 @@ ice_aq_get_link_info(struct ice_port_info *pi, bool en } /** + * ice_fill_tx_timer_and_fc_thresh + * @hw: pointer to the HW struct + * @cmd: pointer to MAC cfg structure + * + * Add Tx timer and FC refresh threshold info to Set MAC Config AQ command + * descriptor + */ +static void +ice_fill_tx_timer_and_fc_thresh(struct ice_hw *hw, + struct ice_aqc_set_mac_cfg *cmd) +{ + u16 fc_thres_val, tx_timer_val; + u32 val; + + /* We read back the transmit timer and fc threshold value of + * LFC. Thus, we will use index = + * PRTMAC_HSEC_CTL_TX_PAUSE_QUANTA_MAX_INDEX. + * + * Also, because we are opearating on transmit timer and fc + * threshold of LFC, we don't turn on any bit in tx_tmr_priority + */ +#define IDX_OF_LFC PRTMAC_HSEC_CTL_TX_PAUSE_QUANTA_MAX_INDEX + + /* Retrieve the transmit timer */ + val = rd32(hw, PRTMAC_HSEC_CTL_TX_PAUSE_QUANTA(IDX_OF_LFC)); + tx_timer_val = val & + PRTMAC_HSEC_CTL_TX_PAUSE_QUANTA_HSEC_CTL_TX_PAUSE_QUANTA_M; + cmd->tx_tmr_value = CPU_TO_LE16(tx_timer_val); + + /* Retrieve the fc threshold */ + val = rd32(hw, PRTMAC_HSEC_CTL_TX_PAUSE_REFRESH_TIMER(IDX_OF_LFC)); + fc_thres_val = val & PRTMAC_HSEC_CTL_TX_PAUSE_REFRESH_TIMER_M; + + cmd->fc_refresh_threshold = CPU_TO_LE16(fc_thres_val); +} + +/** * ice_aq_set_mac_cfg * @hw: pointer to the HW struct * @max_frame_size: Maximum Frame Size to be supported @@ -454,10 +550,8 @@ ice_aq_get_link_info(struct ice_port_info *pi, bool en enum ice_status ice_aq_set_mac_cfg(struct ice_hw *hw, u16 max_frame_size, struct ice_sq_cd *cd) { - u16 fc_threshold_val, tx_timer_val; struct ice_aqc_set_mac_cfg *cmd; struct ice_aq_desc desc; - u32 reg_val; cmd = &desc.params.set_mac_cfg; @@ -468,28 +562,8 @@ ice_aq_set_mac_cfg(struct ice_hw *hw, u16 max_frame_si cmd->max_frame_size = CPU_TO_LE16(max_frame_size); - /* We read back the transmit timer and fc threshold value of - * LFC. Thus, we will use index = - * PRTMAC_HSEC_CTL_TX_PAUSE_QUANTA_MAX_INDEX. - * - * Also, because we are opearating on transmit timer and fc - * threshold of LFC, we don't turn on any bit in tx_tmr_priority - */ -#define IDX_OF_LFC PRTMAC_HSEC_CTL_TX_PAUSE_QUANTA_MAX_INDEX + ice_fill_tx_timer_and_fc_thresh(hw, cmd); - /* Retrieve the transmit timer */ - reg_val = rd32(hw, - PRTMAC_HSEC_CTL_TX_PAUSE_QUANTA(IDX_OF_LFC)); - tx_timer_val = reg_val & - PRTMAC_HSEC_CTL_TX_PAUSE_QUANTA_HSEC_CTL_TX_PAUSE_QUANTA_M; - cmd->tx_tmr_value = CPU_TO_LE16(tx_timer_val); - - /* Retrieve the fc threshold */ - reg_val = rd32(hw, - PRTMAC_HSEC_CTL_TX_PAUSE_REFRESH_TIMER(IDX_OF_LFC)); - fc_threshold_val = reg_val & MAKEMASK(0xFFFF, 0); - cmd->fc_refresh_threshold = CPU_TO_LE16(fc_threshold_val); - return ice_aq_send_cmd(hw, &desc, NULL, 0, cd); } @@ -500,6 +574,7 @@ ice_aq_set_mac_cfg(struct ice_hw *hw, u16 max_frame_si static enum ice_status ice_init_fltr_mgmt_struct(struct ice_hw *hw) { struct ice_switch_info *sw; + enum ice_status status; hw->switch_info = (struct ice_switch_info *) ice_malloc(hw, sizeof(*hw->switch_info)); @@ -510,28 +585,38 @@ static enum ice_status ice_init_fltr_mgmt_struct(struc return ICE_ERR_NO_MEMORY; INIT_LIST_HEAD(&sw->vsi_list_map_head); + sw->prof_res_bm_init = 0; - return ice_init_def_sw_recp(hw, &hw->switch_info->recp_list); + status = ice_init_def_sw_recp(hw, &hw->switch_info->recp_list); + if (status) { + ice_free(hw, hw->switch_info); + return status; + } + return ICE_SUCCESS; } /** - * ice_cleanup_fltr_mgmt_struct - cleanup filter management list and locks + * ice_cleanup_fltr_mgmt_single - clears single filter mngt struct * @hw: pointer to the HW struct + * @sw: pointer to switch info struct for which function clears filters */ -static void ice_cleanup_fltr_mgmt_struct(struct ice_hw *hw) +static void +ice_cleanup_fltr_mgmt_single(struct ice_hw *hw, struct ice_switch_info *sw) { - struct ice_switch_info *sw = hw->switch_info; struct ice_vsi_list_map_info *v_pos_map; struct ice_vsi_list_map_info *v_tmp_map; struct ice_sw_recipe *recps; u8 i; + if (!sw) + return; + LIST_FOR_EACH_ENTRY_SAFE(v_pos_map, v_tmp_map, &sw->vsi_list_map_head, ice_vsi_list_map_info, list_entry) { LIST_DEL(&v_pos_map->list_entry); ice_free(hw, v_pos_map); } - recps = hw->switch_info->recp_list; + recps = sw->recp_list; for (i = 0; i < ICE_MAX_NUM_RECIPES; i++) { struct ice_recp_grp_entry *rg_entry, *tmprg_entry; @@ -571,12 +656,21 @@ static void ice_cleanup_fltr_mgmt_struct(struct ice_hw if (recps[i].root_buf) ice_free(hw, recps[i].root_buf); } - ice_rm_all_sw_replay_rule_info(hw); + ice_rm_sw_replay_rule_info(hw, sw); ice_free(hw, sw->recp_list); ice_free(hw, sw); } /** + * ice_cleanup_all_fltr_mgmt - cleanup filter management list and locks + * @hw: pointer to the HW struct + */ +static void ice_cleanup_fltr_mgmt_struct(struct ice_hw *hw) +{ + ice_cleanup_fltr_mgmt_single(hw, hw->switch_info); +} + +/** * ice_get_itr_intrl_gran * @hw: pointer to the HW struct * @@ -648,7 +742,6 @@ enum ice_status ice_init_hw(struct ice_hw *hw) status = ice_reset(hw, ICE_RESET_PFR); if (status) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Thu Sep 10 23:57:00 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BD60D3E73DD; Thu, 10 Sep 2020 23:57:00 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BnbQh4c1Tz4p8p; Thu, 10 Sep 2020 23:57:00 +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 81BF61B388; Thu, 10 Sep 2020 23:57:00 +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 08ANv0k6066508; Thu, 10 Sep 2020 23:57:00 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08ANv084066503; Thu, 10 Sep 2020 23:57:00 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <202009102357.08ANv084066503@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 10 Sep 2020 23:57:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r365618 - in releng/12.2: release/pkg_repos sys/conf sys/sys X-SVN-Group: releng X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: in releng/12.2: release/pkg_repos sys/conf sys/sys X-SVN-Commit-Revision: 365618 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.33 Precedence: list List-Id: "SVN commit messages 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, 10 Sep 2020 23:57:00 -0000 Author: gjb Date: Thu Sep 10 23:56:59 2020 New Revision: 365618 URL: https://svnweb.freebsd.org/changeset/base/365618 Log: - Copy stable/12@r365545 to releng/12.2 as part of the 12.2-RELEASE cycle. - Update from PRERELEASE to BETA1. - Set the default pkg(7) repository to 'quarterly'. - Bump __FreeBSD_version. - Prune svn:mergeinfo from the new branch. Approved by: re (implicit) Sponsored by: Rubicon Communications, LLC (netgate.com) Added: - copied from r365545, stable/12/ Directory Properties: releng/12.2/ (props changed) Modified: releng/12.2/release/pkg_repos/release-dvd.conf releng/12.2/sys/conf/newvers.sh releng/12.2/sys/sys/param.h Modified: releng/12.2/release/pkg_repos/release-dvd.conf ============================================================================== --- stable/12/release/pkg_repos/release-dvd.conf Wed Sep 9 23:11:55 2020 (r365545) +++ releng/12.2/release/pkg_repos/release-dvd.conf Thu Sep 10 23:56:59 2020 (r365618) @@ -1,6 +1,6 @@ # $FreeBSD$ release: { - url: "pkg+http://pkg.FreeBSD.org/${ABI}/latest", + url: "pkg+http://pkg.FreeBSD.org/${ABI}/quarterly", mirror_type: "srv", signature_type: "fingerprints", fingerprints: "/usr/share/keys/pkg", Modified: releng/12.2/sys/conf/newvers.sh ============================================================================== --- stable/12/sys/conf/newvers.sh Wed Sep 9 23:11:55 2020 (r365545) +++ releng/12.2/sys/conf/newvers.sh Thu Sep 10 23:56:59 2020 (r365618) @@ -49,7 +49,7 @@ TYPE="FreeBSD" REVISION="12.2" -BRANCH=${BRANCH_OVERRIDE:-PRERELEASE} +BRANCH=${BRANCH_OVERRIDE:-BETA1} RELEASE="${REVISION}-${BRANCH}" VERSION="${TYPE} ${RELEASE}" Modified: releng/12.2/sys/sys/param.h ============================================================================== --- stable/12/sys/sys/param.h Wed Sep 9 23:11:55 2020 (r365545) +++ releng/12.2/sys/sys/param.h Thu Sep 10 23:56:59 2020 (r365618) @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1201525 /* Master, propagated to newvers */ +#define __FreeBSD_version 1202000 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-all@freebsd.org Fri Sep 11 00:04:23 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D88393E7B41; Fri, 11 Sep 2020 00:04:23 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BnbbC5QC5z4pfH; Fri, 11 Sep 2020 00:04:23 +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 9D2901B4A5; Fri, 11 Sep 2020 00:04:23 +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 08B04Nsn072375; Fri, 11 Sep 2020 00:04:23 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08B04NNO072373; Fri, 11 Sep 2020 00:04:23 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <202009110004.08B04NNO072373@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Fri, 11 Sep 2020 00:04:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365619 - in stable/12/sys: conf sys X-SVN-Group: stable-12 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: in stable/12/sys: conf sys X-SVN-Commit-Revision: 365619 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.33 Precedence: list List-Id: "SVN commit messages 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, 11 Sep 2020 00:04:23 -0000 Author: gjb Date: Fri Sep 11 00:04:23 2020 New Revision: 365619 URL: https://svnweb.freebsd.org/changeset/base/365619 Log: Rename stable/12 to -STABLE, and bump __FreeBSD_version after releng/12.2 had been created. Approved by: re (implicit) Sponsored by: Rubicon Communications, LLC (netgate.com) Modified: stable/12/sys/conf/newvers.sh stable/12/sys/sys/param.h Modified: stable/12/sys/conf/newvers.sh ============================================================================== --- stable/12/sys/conf/newvers.sh Thu Sep 10 23:56:59 2020 (r365618) +++ stable/12/sys/conf/newvers.sh Fri Sep 11 00:04:23 2020 (r365619) @@ -49,7 +49,7 @@ TYPE="FreeBSD" REVISION="12.2" -BRANCH=${BRANCH_OVERRIDE:-PRERELEASE} +BRANCH=${BRANCH_OVERRIDE:-STABLE} RELEASE="${REVISION}-${BRANCH}" VERSION="${TYPE} ${RELEASE}" Modified: stable/12/sys/sys/param.h ============================================================================== --- stable/12/sys/sys/param.h Thu Sep 10 23:56:59 2020 (r365618) +++ stable/12/sys/sys/param.h Fri Sep 11 00:04:23 2020 (r365619) @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1201526 /* Master, propagated to newvers */ +#define __FreeBSD_version 1202500 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-all@freebsd.org Fri Sep 11 00:06:17 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F41A73E7A6D; Fri, 11 Sep 2020 00:06:16 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BnbdN6F6jz4pqQ; Fri, 11 Sep 2020 00:06:16 +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 B97A91B2F2; Fri, 11 Sep 2020 00:06:16 +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 08B06GYE072518; Fri, 11 Sep 2020 00:06:16 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08B06Gxe072517; Fri, 11 Sep 2020 00:06:16 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202009110006.08B06Gxe072517@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 11 Sep 2020 00:06:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365620 - head/sys/riscv/conf X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/riscv/conf X-SVN-Commit-Revision: 365620 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.33 Precedence: list List-Id: "SVN commit messages 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, 11 Sep 2020 00:06:17 -0000 Author: jhb Date: Fri Sep 11 00:06:16 2020 New Revision: 365620 URL: https://svnweb.freebsd.org/changeset/base/365620 Log: Disable WITNESS for spin locks by default. This matches all other architectures and removes substantial overhead. Reported by: arichardson (indirectly) Reviewed by: imp, arichardson Obtained from: CheriBSD Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D26403 Modified: head/sys/riscv/conf/GENERIC Modified: head/sys/riscv/conf/GENERIC ============================================================================== --- head/sys/riscv/conf/GENERIC Fri Sep 11 00:04:23 2020 (r365619) +++ head/sys/riscv/conf/GENERIC Fri Sep 11 00:06:16 2020 (r365620) @@ -140,7 +140,7 @@ options DEADLKRES # Enable the deadlock resolver options INVARIANTS # Enable calls of extra sanity checking options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS options WITNESS # Enable checks to detect deadlocks and cycles -# options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed +options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed options MALLOC_DEBUG_MAXZONES=8 # Separate malloc(9) zones # options EARLY_PRINTF options VERBOSE_SYSINIT=0 # Support debug.verbose_sysinit, off by default From owner-svn-src-all@freebsd.org Fri Sep 11 00:10:24 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F16D43E7D56; Fri, 11 Sep 2020 00:10:24 +0000 (UTC) (envelope-from jceel@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bnbk866L5z4q8R; Fri, 11 Sep 2020 00:10:24 +0000 (UTC) (envelope-from jceel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 B56231B4A7; Fri, 11 Sep 2020 00:10:24 +0000 (UTC) (envelope-from jceel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08B0AOvL072864; Fri, 11 Sep 2020 00:10:24 GMT (envelope-from jceel@FreeBSD.org) Received: (from jceel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08B0AO3K072863; Fri, 11 Sep 2020 00:10:24 GMT (envelope-from jceel@FreeBSD.org) Message-Id: <202009110010.08B0AO3K072863@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jceel set sender to jceel@FreeBSD.org using -f From: Jakub Wojciech Klama Date: Fri, 11 Sep 2020 00:10:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r365621 - vendor/lib9p/dist/transport X-SVN-Group: vendor X-SVN-Commit-Author: jceel X-SVN-Commit-Paths: vendor/lib9p/dist/transport X-SVN-Commit-Revision: 365621 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.33 Precedence: list List-Id: "SVN commit messages 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, 11 Sep 2020 00:10:25 -0000 Author: jceel Date: Fri Sep 11 00:10:24 2020 New Revision: 365621 URL: https://svnweb.freebsd.org/changeset/base/365621 Log: Import lib9p 9d5aee77bcc1bf0e79b0a3bfefff5fdf2146283c. Approved by: trasz (mentor) MFC after: 1 month Sponsored by: Conclusive Engineering Modified: vendor/lib9p/dist/transport/socket.c Modified: vendor/lib9p/dist/transport/socket.c ============================================================================== --- vendor/lib9p/dist/transport/socket.c Fri Sep 11 00:06:16 2020 (r365620) +++ vendor/lib9p/dist/transport/socket.c Fri Sep 11 00:10:24 2020 (r365621) @@ -307,7 +307,7 @@ l9p_socket_send_response(struct l9p_request *req __unu static void l9p_socket_drop_response(struct l9p_request *req __unused, - const struct iovec *iov, size_t niov __unused, void *arg) + const struct iovec *iov, size_t niov __unused, void *arg __unused) { L9P_LOG(L9P_DEBUG, "%p: drop buf=%p", arg, iov[0].iov_base); From owner-svn-src-all@freebsd.org Fri Sep 11 00:12:06 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6DD443E8013; Fri, 11 Sep 2020 00:12:06 +0000 (UTC) (envelope-from jceel@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bnbm62DPrz4qCY; Fri, 11 Sep 2020 00:12:06 +0000 (UTC) (envelope-from jceel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 312DA1B68A; Fri, 11 Sep 2020 00:12:06 +0000 (UTC) (envelope-from jceel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08B0C655077790; Fri, 11 Sep 2020 00:12:06 GMT (envelope-from jceel@FreeBSD.org) Received: (from jceel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08B0C6m1077789; Fri, 11 Sep 2020 00:12:06 GMT (envelope-from jceel@FreeBSD.org) Message-Id: <202009110012.08B0C6m1077789@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jceel set sender to jceel@FreeBSD.org using -f From: Jakub Wojciech Klama Date: Fri, 11 Sep 2020 00:12:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r365622 - vendor/lib9p/9d5aee77bcc1bf0e79b0a3bfefff5fdf2146283c X-SVN-Group: vendor X-SVN-Commit-Author: jceel X-SVN-Commit-Paths: vendor/lib9p/9d5aee77bcc1bf0e79b0a3bfefff5fdf2146283c X-SVN-Commit-Revision: 365622 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.33 Precedence: list List-Id: "SVN commit messages 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, 11 Sep 2020 00:12:06 -0000 Author: jceel Date: Fri Sep 11 00:12:05 2020 New Revision: 365622 URL: https://svnweb.freebsd.org/changeset/base/365622 Log: Tag import of lib9p 9d5aee77bcc1bf0e79b0a3bfefff5fdf2146283c. Approved by: trasz (mentor) MFC after: 1 month Sponsored by: Conclusive Engineering Added: vendor/lib9p/9d5aee77bcc1bf0e79b0a3bfefff5fdf2146283c/ - copied from r365621, vendor/lib9p/dist/ From owner-svn-src-all@freebsd.org Fri Sep 11 02:02:13 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D19E43E9D6D; Fri, 11 Sep 2020 02:02:13 +0000 (UTC) (envelope-from jmg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BnfC95Cqfz4vGq; Fri, 11 Sep 2020 02:02:13 +0000 (UTC) (envelope-from jmg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 97D541C7D5; Fri, 11 Sep 2020 02:02:13 +0000 (UTC) (envelope-from jmg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08B22DAP045187; Fri, 11 Sep 2020 02:02:13 GMT (envelope-from jmg@FreeBSD.org) Received: (from jmg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08B22DxY045186; Fri, 11 Sep 2020 02:02:13 GMT (envelope-from jmg@FreeBSD.org) Message-Id: <202009110202.08B22DxY045186@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jmg set sender to jmg@FreeBSD.org using -f From: John-Mark Gurney Date: Fri, 11 Sep 2020 02:02:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365623 - head/sys/dev/usb/net X-SVN-Group: head X-SVN-Commit-Author: jmg X-SVN-Commit-Paths: head/sys/dev/usb/net X-SVN-Commit-Revision: 365623 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.33 Precedence: list List-Id: "SVN commit messages 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, 11 Sep 2020 02:02:13 -0000 Author: jmg Date: Fri Sep 11 02:02:13 2020 New Revision: 365623 URL: https://svnweb.freebsd.org/changeset/base/365623 Log: Don't clear reserved bits per RealTek MFC after: 3 days Modified: head/sys/dev/usb/net/if_ure.c Modified: head/sys/dev/usb/net/if_ure.c ============================================================================== --- head/sys/dev/usb/net/if_ure.c Fri Sep 11 00:12:05 2020 (r365622) +++ head/sys/dev/usb/net/if_ure.c Fri Sep 11 02:02:13 2020 (r365623) @@ -816,9 +816,10 @@ ure_rxfilter(struct usb_ether *ue) URE_LOCK_ASSERT(sc, MA_OWNED); - rxmode = URE_RCR_APM; - if (ifp->if_flags & IFF_BROADCAST) - rxmode |= URE_RCR_AB; + rxmode = ure_read_4(sc, URE_PLA_RCR, URE_MCU_TYPE_PLA); + rxmode &= ~(URE_RCR_AAP | URE_RCR_AM); + rxmode |= URE_RCR_APM; /* accept physical match packets */ + rxmode |= URE_RCR_AB; /* always accept broadcasts */ if (ifp->if_flags & (IFF_ALLMULTI | IFF_PROMISC)) { if (ifp->if_flags & IFF_PROMISC) rxmode |= URE_RCR_AAP; From owner-svn-src-all@freebsd.org Fri Sep 11 02:02:17 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 334313E9AA9; Fri, 11 Sep 2020 02:02:17 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BnfCD6vHvz4vY6; Fri, 11 Sep 2020 02:02:16 +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 690291CA11; Fri, 11 Sep 2020 02:02:16 +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 08B22GmF045239; Fri, 11 Sep 2020 02:02:16 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08B22Go6045238; Fri, 11 Sep 2020 02:02:16 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202009110202.08B22Go6045238@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 11 Sep 2020 02:02:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365624 - head/lib/libc/sys X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/lib/libc/sys X-SVN-Commit-Revision: 365624 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.33 Precedence: list List-Id: "SVN commit messages 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, 11 Sep 2020 02:02:17 -0000 Author: kevans Date: Fri Sep 11 02:02:15 2020 New Revision: 365624 URL: https://svnweb.freebsd.org/changeset/base/365624 Log: memfd_create: simplify HUGETLB support a little bit This also fixes a minor issue that was missed in the initial review; the layout of the MFD_HUGE_* flags is actually not 1:1 bit:flag -- it instead borrowed the Linux convention of how this is laid out since it was originally implemented on Linux, the top 6 bits represent the shift required for the requested page size. This allows us to remove the flag <-> pgsize mapping table and simplify the logic just prior to validation of the requested page size. While we're here, fix two small nits: - HUGETLB memfd shouldn't exhibit the SHM_GROW_ON_WRITE behavior. We can only grow largepage shm by appropriately aligned (i.e. requested pagesize) sizes, so it can't work in the typical/sane fashion. Furthermore, Linux does the same, so let's be compatible. - We don't allow MFD_HUGETLB without specifying a pagesize, so no need to check for that later. Reviewed by: kib (slightly earlier version) Modified: head/lib/libc/sys/shm_open.c Modified: head/lib/libc/sys/shm_open.c ============================================================================== --- head/lib/libc/sys/shm_open.c Fri Sep 11 02:02:13 2020 (r365623) +++ head/lib/libc/sys/shm_open.c Fri Sep 11 02:02:15 2020 (r365624) @@ -81,27 +81,6 @@ shm_create_largepage(const char *path, int flags, int return (fd); } -#define K(x) ((size_t)(x) * 1024) -#define M(x) (K(x) * 1024) -#define G(x) (M(x) * 1024) -static const struct { - int mask; - size_t pgsize; -} mfd_huge_sizes[] = { - { .mask = MFD_HUGE_64KB, .pgsize = K(64) }, - { .mask = MFD_HUGE_512KB, .pgsize = K(512) }, - { .mask = MFD_HUGE_1MB, .pgsize = M(1) }, - { .mask = MFD_HUGE_2MB, .pgsize = M(2) }, - { .mask = MFD_HUGE_8MB, .pgsize = M(8) }, - { .mask = MFD_HUGE_16MB, .pgsize = M(16) }, - { .mask = MFD_HUGE_32MB, .pgsize = M(32) }, - { .mask = MFD_HUGE_256MB, .pgsize = M(256) }, - { .mask = MFD_HUGE_512MB, .pgsize = M(512) }, - { .mask = MFD_HUGE_1GB, .pgsize = G(1) }, - { .mask = MFD_HUGE_2GB, .pgsize = G(2) }, - { .mask = MFD_HUGE_16GB, .pgsize = G(16) }, -}; - /* * The path argument is passed to the kernel, but the kernel doesn't currently * do anything with it. Linux exposes it in linprocfs for debugging purposes @@ -111,9 +90,9 @@ int memfd_create(const char *name, unsigned int flags) { char memfd_name[NAME_MAX + 1]; - size_t namelen, *pgs; + size_t namelen, *pgs, pgsize; struct shm_largepage_conf slc; - int error, fd, i, npgs, oflags, pgidx, saved_errno, shmflags; + int error, fd, npgs, oflags, pgidx, saved_errno, shmflags; if (name == NULL) { errno = EBADF; @@ -130,8 +109,7 @@ memfd_create(const char *name, unsigned int flags) return (-1); } /* Size specified but no HUGETLB. */ - if (((flags & MFD_HUGE_MASK) != 0 && (flags & MFD_HUGETLB) == 0) || - __bitcount(flags & MFD_HUGE_MASK) > 1) { + if ((flags & MFD_HUGE_MASK) != 0 && (flags & MFD_HUGETLB) == 0) { errno = EINVAL; return (-1); } @@ -139,13 +117,15 @@ memfd_create(const char *name, unsigned int flags) /* We've already validated that we're sufficiently sized. */ snprintf(memfd_name, NAME_MAX + 1, "%s%s", MEMFD_NAME_PREFIX, name); oflags = O_RDWR; - shmflags = SHM_GROW_ON_WRITE; + shmflags = 0; if ((flags & MFD_CLOEXEC) != 0) oflags |= O_CLOEXEC; if ((flags & MFD_ALLOW_SEALING) != 0) shmflags |= SHM_ALLOW_SEALING; if ((flags & MFD_HUGETLB) != 0) shmflags |= SHM_LARGEPAGE; + else + shmflags |= SHM_GROW_ON_WRITE; fd = __sys_shm_open2(SHM_ANON, oflags, 0, shmflags, memfd_name); if (fd == -1 || (flags & MFD_HUGETLB) == 0) return (fd); @@ -160,25 +140,14 @@ memfd_create(const char *name, unsigned int flags) error = getpagesizes(pgs, npgs); if (error == -1) goto clean; - if ((flags & MFD_HUGE_MASK) == 0) { - if (npgs == 1) { - errno = EOPNOTSUPP; - goto clean; - } - pgidx = 1; - } else { - for (i = 0; i < nitems(mfd_huge_sizes); i++) { - if (mfd_huge_sizes[i].mask == (flags & MFD_HUGE_MASK)) - break; - } - for (pgidx = 0; pgidx < npgs; pgidx++) { - if (mfd_huge_sizes[i].pgsize == pgs[pgidx]) - break; - } - if (pgidx == npgs) { - errno = EOPNOTSUPP; - goto clean; - } + pgsize = (size_t)1 << ((flags & MFD_HUGE_MASK) >> MFD_HUGE_SHIFT); + for (pgidx = 0; pgidx < npgs; pgidx++) { + if (pgsize == pgs[pgidx]) + break; + } + if (pgidx == npgs) { + errno = EOPNOTSUPP; + goto clean; } free(pgs); pgs = NULL; From owner-svn-src-all@freebsd.org Fri Sep 11 05:45:28 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9844E3EE72C; Fri, 11 Sep 2020 05:45:28 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bnl8m3Vsjz3c3Y; Fri, 11 Sep 2020 05:45:28 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 5C7F01F4F8; Fri, 11 Sep 2020 05:45:28 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08B5jSqp080375; Fri, 11 Sep 2020 05:45:28 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08B5jSV3080374; Fri, 11 Sep 2020 05:45:28 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <202009110545.08B5jSV3080374@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Fri, 11 Sep 2020 05:45:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365625 - head/tests/sys/kern X-SVN-Group: head X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: head/tests/sys/kern X-SVN-Commit-Revision: 365625 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.33 Precedence: list List-Id: "SVN commit messages 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, 11 Sep 2020 05:45:28 -0000 Author: lwhsu Date: Fri Sep 11 05:45:27 2020 New Revision: 365625 URL: https://svnweb.freebsd.org/changeset/base/365625 Log: Revert r365592 and r365603 as the tests are fixed by r365593 PR: 249236 Sponsored by: The FreeBSD Foundation Modified: head/tests/sys/kern/memfd_test.c Modified: head/tests/sys/kern/memfd_test.c ============================================================================== --- head/tests/sys/kern/memfd_test.c Fri Sep 11 02:02:15 2020 (r365624) +++ head/tests/sys/kern/memfd_test.c Fri Sep 11 05:45:27 2020 (r365625) @@ -43,9 +43,6 @@ ATF_TC_BODY(basic, tc) int fd; char buf[8]; - if (atf_tc_get_config_var_as_bool_wd(tc, "ci", false)) - atf_tc_skip("https://bugs.freebsd.org/249236"); - ATF_REQUIRE((fd = memfd_create("...", 0)) != -1); /* write(2) should grow us out automatically. */ @@ -102,9 +99,6 @@ ATF_TC_BODY(write_seal, tc) int fd; char *addr, buf[BUF_SIZE]; - if (atf_tc_get_config_var_as_bool_wd(tc, "ci", false)) - atf_tc_skip("https://bugs.freebsd.org/249236"); - ATF_REQUIRE((fd = memfd_create("...", MFD_ALLOW_SEALING)) != -1); ATF_REQUIRE(ftruncate(fd, BUF_SIZE) == 0); @@ -134,9 +128,6 @@ ATF_TC_BODY(mmap_write_seal, tc) int fd; char *addr, *paddr, *raddr; - if (atf_tc_get_config_var_as_bool_wd(tc, "ci", false)) - atf_tc_skip("https://bugs.freebsd.org/249236"); - ATF_REQUIRE((fd = memfd_create("...", MFD_ALLOW_SEALING)) != -1); ATF_REQUIRE(ftruncate(fd, BUF_SIZE) == 0); @@ -202,9 +193,6 @@ ATF_TC_WITHOUT_HEAD(truncate_seals); ATF_TC_BODY(truncate_seals, tc) { - if (atf_tc_get_config_var_as_bool_wd(tc, "ci", false)) - atf_tc_skip("https://bugs.freebsd.org/249236"); - ATF_REQUIRE(memfd_truncate_test(4, 8, F_SEAL_GROW) == EPERM); ATF_REQUIRE(memfd_truncate_test(8, 4, F_SEAL_SHRINK) == EPERM); ATF_REQUIRE(memfd_truncate_test(8, 4, F_SEAL_GROW) == 0); @@ -240,9 +228,6 @@ ATF_TC_BODY(dup_seals, tc) char buf[8]; int fd, fdx; int seals; - - if (atf_tc_get_config_var_as_bool_wd(tc, "ci", false)) - atf_tc_skip("https://bugs.freebsd.org/249236"); ATF_REQUIRE((fd = memfd_create("...", MFD_ALLOW_SEALING)) != -1); ATF_REQUIRE((fdx = dup(fd)) != -1); From owner-svn-src-all@freebsd.org Fri Sep 11 09:13:46 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E942A3D323F; Fri, 11 Sep 2020 09:13:46 +0000 (UTC) (envelope-from ruslanngaripov@gmail.com) Received: from mail-lf1-x142.google.com (mail-lf1-x142.google.com [IPv6:2a00:1450:4864:20::142]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bnqn55w8xz43q9; Fri, 11 Sep 2020 09:13:45 +0000 (UTC) (envelope-from ruslanngaripov@gmail.com) Received: by mail-lf1-x142.google.com with SMTP id q8so5132325lfb.6; Fri, 11 Sep 2020 02:13:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:date:message-id:in-reply-to:references:user-agent :subject:mime-version:content-transfer-encoding; bh=9fX0eqYI3fXmmw0aVTIoKXYKA6vVlWJaD70CYuvR2ls=; b=WjZZQIYP79wfbOHKz6YKO4DrUXjWrwjufIRTijN82ku9AX7Bn6Xk4nZVXvQ5q+qLUF VAUHAg9my8adDUccDWZPJxBe6G1vNX+ljQs6GGR2AnMqFx7zDJrSWWC1PBhdfFpaixZm K6KawWhVofNzLyVuFBFz0yE5wwX84O2cY76yvavOnZsr6C2BF/qT1/Paj5OsTEV/FhMZ H6ox/DlxCEFjd3ddB231gBftYBi2ER7zsQFDUMfg3nSmhwPVTqBmOpFNC6pvEGTX/6AT SyWGX1wzGcH05YPoW7ji8pfQkLS7XtNSa3QLPafO42qEg0/cNGNcwtoENavTcrZ5CuDT 6YUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:date:message-id:in-reply-to :references:user-agent:subject:mime-version :content-transfer-encoding; bh=9fX0eqYI3fXmmw0aVTIoKXYKA6vVlWJaD70CYuvR2ls=; b=foOmkbtBVAujP2Zm4IbUp02tBkX2eEmpucJfnYX5dNnM/V1wviGnXpZgRV+bxZucnm pp4cvGu0ObdY292ZovNbsXySDk3IL0yLvGWueBpCSaxKU+XJvgooXa3FKS66JD735N3m Gz73jyPYIvfJByiiD3FadJxs2aiVmZmDdlMNuPCQu7hif6Epq3bqXMCbWMRai2qOPlj+ VNjKdJ4IP6sMQbp1oLEIH45LTwPwUwNLwkW6JcEuPmPA8DYshS6zcYC7TJnGzP8TnzeB 19ohpRjtQlOqA2ot4Hgg51MGv5b5wHjhA6vXBqXQGWs0Z8pswFqpihIjkusJsjxh8gBc AU1A== X-Gm-Message-State: AOAM530couhb5zt5BJPAJSTHB8CzBMwQ4LWpLijX84AQtC/eItl721Hj pFt1yWDQRCbHVCPz6Tsxk+MKKy9vrg6zlA== X-Google-Smtp-Source: ABdhPJyXqnXciq+uvpDI927XSTpkAn9qtZkLTnPdtLunusV4xmB7Rgjsn2oyrxq2O4Wz1okdLJ971A== X-Received: by 2002:a19:b4b:: with SMTP id 72mr3581lfl.590.1599815623701; Fri, 11 Sep 2020 02:13:43 -0700 (PDT) Received: from [192.168.0.15] (ip-18-154.tagiltelecom.ru. [217.114.18.154]) by smtp.gmail.com with ESMTPSA id i17sm433940lja.45.2020.09.11.02.13.42 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 11 Sep 2020 02:13:43 -0700 (PDT) From: Ruslan Garipov To: Glen Barber CC: , , Date: Fri, 11 Sep 2020 14:13:41 +0500 Message-ID: <1747c711988.27b9.e2363f32305322128423a5fd7014e4c4@gmail.com> In-Reply-To: <20200909135114.GC61041@FreeBSD.org> References: <202008272119.07RLJGgb043888@repo.freebsd.org> <174719d0148.27b9.e2363f32305322128423a5fd7014e4c4@gmail.com> <20200909135114.GC61041@FreeBSD.org> User-Agent: AquaMail/1.26.0-1689 (build: 102600004) Subject: Re: svn commit: r364891 - in head: . release release/scripts MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="us-ascii" Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4Bnqn55w8xz43q9 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=WjZZQIYP; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of ruslanngaripov@gmail.com designates 2a00:1450:4864:20::142 as permitted sender) smtp.mailfrom=ruslanngaripov@gmail.com X-Spamd-Result: default: False [-2.94 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36:c]; FREEMAIL_FROM(0.00)[gmail.com]; MIME_GOOD(-0.10)[text/plain]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-0.995]; TO_DN_SOME(0.00)[]; NEURAL_SPAM_SHORT(0.04)[0.035]; RCVD_COUNT_THREE(0.00)[3]; NEURAL_HAM_MEDIUM(-0.98)[-0.977]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::142:from]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[svn-src-all,svn-src-head]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 11 Sep 2020 09:13:47 -0000 On September 9, 2020 6:51:18 PM Glen Barber wrote: > On Wed, Sep 09, 2020 at 11:45:49AM +0500, Ruslan Garipov wrote: >> On August 28, 2020 2:19:33 AM Glen Barber wrote: >> >> > Author: gjb >> > Date: Thu Aug 27 21:19:16 2020 >> > New Revision: 364891 >> > URL: https://svnweb.freebsd.org/changeset/base/364891 >> > >> > Log: >> > Merge the projects/release-git branch to head. >> > This allows building 13.x from Git instead of Subversion. >> I'm sorry for the late response (and for the bad first one I made on this >> commit recently via Gmail web client). >> >> My build machine is completely offline. I provide it with fresh snapshots >> of the source and ports tree manually -- via tarballs which I'm pulling on >> a FreeBSD machine having Internet connection. Therefore, neither >> "/scratch", nor the chrooted environment for me don't require Internet >> access (I fetch distfiles for offline usage too). >> >> Can we somehow remove that requirement for the devel/git port? For >> example, if one has set all three {SRC,PORTS,DOC}_UPDATE_SKIP variables, >> then release/release.sh doesn't require devel/git to exist on the host. >> >> I really don't need git on my build machine (and don't need it for >> building). >> > > Can you verify if the attached patch works for your use case? You will > need to set NOGIT=1 in your release.conf. Partially. It doesn't require devel/git to create the initial build environment, but it does before beginning cross-build in the extra_chroot_setup(). You check there does the NOGIT have zero length. If NOGIT isn't empty, then release.sh will ($(which git) returns nothing for me) try to install devel/git port or package again. And NOGIT isn't empty because in this function my release.conf was already sourced. So I had removed "not" (``!'') on line #278, ignoring NOGIT checking, and cross-build started. It failed eventually on modifications made by r365398, but that's another story. Thanks again, Glen! > > Glen > From owner-svn-src-all@freebsd.org Fri Sep 11 09:15:50 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 059A93D2EE1; Fri, 11 Sep 2020 09:15:50 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BnqqT6PRsz4451; Fri, 11 Sep 2020 09:15:49 +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 C02E62183B; Fri, 11 Sep 2020 09:15:49 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08B9FnYN008498; Fri, 11 Sep 2020 09:15:49 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08B9FnnD008496; Fri, 11 Sep 2020 09:15:49 GMT (envelope-from kp@FreeBSD.org) Message-Id: <202009110915.08B9FnnD008496@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Fri, 11 Sep 2020 09:15:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365626 - in head/sys/cddl/dev: dtrace/riscv fbt/riscv X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: in head/sys/cddl/dev: dtrace/riscv fbt/riscv X-SVN-Commit-Revision: 365626 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.33 Precedence: list List-Id: "SVN commit messages 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, 11 Sep 2020 09:15:50 -0000 Author: kp Date: Fri Sep 11 09:15:49 2020 New Revision: 365626 URL: https://svnweb.freebsd.org/changeset/base/365626 Log: dtrace: fix fbt return probes on RISC-V Return values are passed in a0, so read it from there. We also pass a1 through to userspace, as the ABI allows small structs to be returned in registers a0/a1. While here read the register values directly from the trapframe rather than rtval, and remove the now unneeded argument from dtrace_invop(). Set fbtp_roffset so that we get the correct return location in arg0. Reviewed by: markj Sponsored by: Axiado Differential Revision: https://reviews.freebsd.org/D26389 Modified: head/sys/cddl/dev/dtrace/riscv/dtrace_subr.c head/sys/cddl/dev/fbt/riscv/fbt_isa.c Modified: head/sys/cddl/dev/dtrace/riscv/dtrace_subr.c ============================================================================== --- head/sys/cddl/dev/dtrace/riscv/dtrace_subr.c Fri Sep 11 05:45:27 2020 (r365625) +++ head/sys/cddl/dev/dtrace/riscv/dtrace_subr.c Fri Sep 11 09:15:49 2020 (r365626) @@ -53,7 +53,7 @@ extern dtrace_id_t dtrace_probeid_error; extern int (*dtrace_invop_jump_addr)(struct trapframe *); extern void dtrace_getnanotime(struct timespec *tsp); -int dtrace_invop(uintptr_t, struct trapframe *, uintptr_t); +int dtrace_invop(uintptr_t, struct trapframe *); void dtrace_invop_init(void); void dtrace_invop_uninit(void); @@ -65,13 +65,13 @@ typedef struct dtrace_invop_hdlr { dtrace_invop_hdlr_t *dtrace_invop_hdlr; int -dtrace_invop(uintptr_t addr, struct trapframe *frame, uintptr_t eax) +dtrace_invop(uintptr_t addr, struct trapframe *frame) { dtrace_invop_hdlr_t *hdlr; int rval; for (hdlr = dtrace_invop_hdlr; hdlr != NULL; hdlr = hdlr->dtih_next) - if ((rval = hdlr->dtih_func(addr, frame, eax)) != 0) + if ((rval = hdlr->dtih_func(addr, frame, 0)) != 0) return (rval); return (0); @@ -254,7 +254,7 @@ dtrace_invop_start(struct trapframe *frame) uint32_t imm; int invop; - invop = dtrace_invop(frame->tf_sepc, frame, frame->tf_sepc); + invop = dtrace_invop(frame->tf_sepc, frame); if (invop == 0) return (-1); Modified: head/sys/cddl/dev/fbt/riscv/fbt_isa.c ============================================================================== --- head/sys/cddl/dev/fbt/riscv/fbt_isa.c Fri Sep 11 05:45:27 2020 (r365625) +++ head/sys/cddl/dev/fbt/riscv/fbt_isa.c Fri Sep 11 09:15:49 2020 (r365626) @@ -59,9 +59,14 @@ fbt_invop(uintptr_t addr, struct trapframe *frame, uin if ((uintptr_t)fbt->fbtp_patchpoint == addr) { cpu->cpu_dtrace_caller = addr; - dtrace_probe(fbt->fbtp_id, frame->tf_a[0], - frame->tf_a[1], frame->tf_a[2], - frame->tf_a[3], frame->tf_a[4]); + if (fbt->fbtp_roffset == 0) { + dtrace_probe(fbt->fbtp_id, frame->tf_a[0], + frame->tf_a[1], frame->tf_a[2], + frame->tf_a[3], frame->tf_a[4]); + } else { + dtrace_probe(fbt->fbtp_id, fbt->fbtp_roffset, + frame->tf_a[0], frame->tf_a[1], 0, 0); + } cpu->cpu_dtrace_caller = 0; return (fbt->fbtp_savedval); @@ -233,6 +238,7 @@ again: fbt->fbtp_loadcnt = lf->loadcnt; fbt->fbtp_symindx = symindx; fbt->fbtp_rval = rval; + fbt->fbtp_roffset = (uintptr_t)instr - (uintptr_t)symval->value; fbt->fbtp_savedval = *instr; fbt->fbtp_patchval = patchval; fbt->fbtp_hashnext = fbt_probetab[FBT_ADDR2NDX(instr)]; From owner-svn-src-all@freebsd.org Fri Sep 11 10:05:45 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 04B973D48CF; Fri, 11 Sep 2020 10:05:45 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bnrx465SZz467k; Fri, 11 Sep 2020 10:05:44 +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 B4F672250E; Fri, 11 Sep 2020 10:05:44 +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 08BA5iph038562; Fri, 11 Sep 2020 10:05:44 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08BA5iGY038561; Fri, 11 Sep 2020 10:05:44 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202009111005.08BA5iGY038561@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 11 Sep 2020 10:05:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365627 - stable/12/libexec/rtld-elf X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/libexec/rtld-elf X-SVN-Commit-Revision: 365627 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.33 Precedence: list List-Id: "SVN commit messages 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, 11 Sep 2020 10:05:45 -0000 Author: kib Date: Fri Sep 11 10:05:44 2020 New Revision: 365627 URL: https://svnweb.freebsd.org/changeset/base/365627 Log: MFC r365360, r365370: rtld: Handle ELF dso with program headers outside the first page. PR: 229708 Modified: stable/12/libexec/rtld-elf/map_object.c Directory Properties: stable/12/ (props changed) Modified: stable/12/libexec/rtld-elf/map_object.c ============================================================================== --- stable/12/libexec/rtld-elf/map_object.c Fri Sep 11 09:15:49 2020 (r365626) +++ stable/12/libexec/rtld-elf/map_object.c Fri Sep 11 10:05:44 2020 (r365627) @@ -40,11 +40,19 @@ #include "debug.h" #include "rtld.h" -static Elf_Ehdr *get_elf_header(int, const char *, const struct stat *); +static Elf_Ehdr *get_elf_header(int, const char *, const struct stat *, + Elf_Phdr **phdr); static int convert_flags(int); /* Elf flags -> mmap flags */ int __getosreldate(void); +static bool +phdr_in_zero_page(const Elf_Ehdr *hdr) +{ + return (hdr->e_phoff + hdr->e_phnum * sizeof(Elf_Phdr) <= + (size_t)PAGE_SIZE); +} + /* * Map a shared object into memory. The "fd" argument is a file descriptor, * which must be open on the object and positioned at its beginning. @@ -94,17 +102,15 @@ map_object(int fd, const char *path, const struct stat char *note_map; size_t note_map_len; - hdr = get_elf_header(fd, path, sb); + hdr = get_elf_header(fd, path, sb, &phdr); if (hdr == NULL) return (NULL); /* * Scan the program header entries, and save key information. - * * We expect that the loadable segments are ordered by load address. */ - phdr = (Elf_Phdr *)((char *)hdr + hdr->e_phoff); - phsize = hdr->e_phnum * sizeof (phdr[0]); + phsize = hdr->e_phnum * sizeof(phdr[0]); phlimit = phdr + hdr->e_phnum; nsegs = -1; phdyn = phinterp = phtls = NULL; @@ -327,14 +333,18 @@ error1: error: if (note_map != NULL && note_map != MAP_FAILED) munmap(note_map, note_map_len); + if (!phdr_in_zero_page(hdr)) + munmap(phdr, hdr->e_phnum * sizeof(phdr[0])); munmap(hdr, PAGE_SIZE); return (NULL); } static Elf_Ehdr * -get_elf_header(int fd, const char *path, const struct stat *sbp) +get_elf_header(int fd, const char *path, const struct stat *sbp, + Elf_Phdr **phdr_p) { Elf_Ehdr *hdr; + Elf_Phdr *phdr; /* Make sure file has enough data for the ELF header */ if (sbp != NULL && sbp->st_size < (off_t)sizeof(Elf_Ehdr)) { @@ -383,11 +393,19 @@ get_elf_header(int fd, const char *path, const struct "%s: invalid shared object: e_phentsize != sizeof(Elf_Phdr)", path); goto error; } - if (hdr->e_phoff + hdr->e_phnum * sizeof(Elf_Phdr) > - (size_t)PAGE_SIZE) { - _rtld_error("%s: program header too large", path); - goto error; + if (phdr_in_zero_page(hdr)) { + phdr = (Elf_Phdr *)((char *)hdr + hdr->e_phoff); + } else { + phdr = mmap(NULL, hdr->e_phnum * sizeof(phdr[0]), + PROT_READ, MAP_PRIVATE | MAP_PREFAULT_READ, fd, + hdr->e_phoff); + if (phdr == MAP_FAILED) { + _rtld_error("%s: error mapping phdr: %s", path, + rtld_strerror(errno)); + goto error; + } } + *phdr_p = phdr; return (hdr); error: From owner-svn-src-all@freebsd.org Fri Sep 11 10:07:10 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7FD763D499D; Fri, 11 Sep 2020 10:07:10 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bnryk2rtXz46Nk; Fri, 11 Sep 2020 10:07:10 +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 4614922154; Fri, 11 Sep 2020 10:07:10 +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 08BA7AUx038703; Fri, 11 Sep 2020 10:07:10 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08BA7AbB038702; Fri, 11 Sep 2020 10:07:10 GMT (envelope-from ae@FreeBSD.org) Message-Id: <202009111007.08BA7AbB038702@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Fri, 11 Sep 2020 10:07:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365628 - head/sbin/ipfw X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: head/sbin/ipfw X-SVN-Commit-Revision: 365628 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.33 Precedence: list List-Id: "SVN commit messages 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, 11 Sep 2020 10:07:10 -0000 Author: ae Date: Fri Sep 11 10:07:09 2020 New Revision: 365628 URL: https://svnweb.freebsd.org/changeset/base/365628 Log: Fix compatibility regression after r364117. Properly handle the case, when some opcode keywords follow after the `frag` opcode without additional options. Reported by: Evgeniy Khramtsov Modified: head/sbin/ipfw/ipfw2.c Modified: head/sbin/ipfw/ipfw2.c ============================================================================== --- head/sbin/ipfw/ipfw2.c Fri Sep 11 10:05:44 2020 (r365627) +++ head/sbin/ipfw/ipfw2.c Fri Sep 11 10:07:09 2020 (r365628) @@ -4560,17 +4560,24 @@ read_options: fill_cmd(cmd, O_DIVERTED, 0, 2); break; - case TOK_FRAG: - fill_flags_cmd(cmd, O_FRAG, f_ipoff, *av); - /* - * Compatibility: no argument after "frag" - * keyword equals to "frag offset". - */ - if (cmd->arg1 == 0) - cmd->arg1 = 0x1; - else + case TOK_FRAG: { + uint32_t set = 0, clear = 0; + + if (*av != NULL && fill_flags(f_ipoff, *av, NULL, + &set, &clear) == 0) av++; + else { + /* + * Compatibility: no argument after "frag" + * keyword equals to "frag offset". + */ + set = 0x01; + clear = 0; + } + fill_cmd(cmd, O_FRAG, 0, + (set & 0xff) | ( (clear & 0xff) << 8)); break; + } case TOK_LAYER2: fill_cmd(cmd, O_LAYER2, 0, 0); From owner-svn-src-all@freebsd.org Fri Sep 11 10:11:05 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 455FD3D4933; Fri, 11 Sep 2020 10: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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bns3F19JLz46mK; Fri, 11 Sep 2020 10: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 0C89D2232D; Fri, 11 Sep 2020 10:11:05 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08BAB4df039844; Fri, 11 Sep 2020 10:11:04 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08BAB4HJ039843; Fri, 11 Sep 2020 10:11:04 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202009111011.08BAB4HJ039843@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 11 Sep 2020 10: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: r365629 - stable/11/libexec/rtld-elf X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/libexec/rtld-elf X-SVN-Commit-Revision: 365629 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.33 Precedence: list List-Id: "SVN commit messages 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, 11 Sep 2020 10:11:05 -0000 Author: kib Date: Fri Sep 11 10:11:04 2020 New Revision: 365629 URL: https://svnweb.freebsd.org/changeset/base/365629 Log: MFC r365360, r365370: rtld: Handle ELF dso with program headers outside the first page. PR: 229708 Modified: stable/11/libexec/rtld-elf/map_object.c Directory Properties: stable/11/ (props changed) Modified: stable/11/libexec/rtld-elf/map_object.c ============================================================================== --- stable/11/libexec/rtld-elf/map_object.c Fri Sep 11 10:07:09 2020 (r365628) +++ stable/11/libexec/rtld-elf/map_object.c Fri Sep 11 10:11:04 2020 (r365629) @@ -38,11 +38,19 @@ #include "debug.h" #include "rtld.h" -static Elf_Ehdr *get_elf_header(int, const char *, const struct stat *); +static Elf_Ehdr *get_elf_header(int, const char *, const struct stat *, + Elf_Phdr **phdr); static int convert_flags(int); /* Elf flags -> mmap flags */ int __getosreldate(void); +static bool +phdr_in_zero_page(const Elf_Ehdr *hdr) +{ + return (hdr->e_phoff + hdr->e_phnum * sizeof(Elf_Phdr) <= + (size_t)PAGE_SIZE); +} + /* * Map a shared object into memory. The "fd" argument is a file descriptor, * which must be open on the object and positioned at its beginning. @@ -92,17 +100,15 @@ map_object(int fd, const char *path, const struct stat char *note_map; size_t note_map_len; - hdr = get_elf_header(fd, path, sb); + hdr = get_elf_header(fd, path, sb, &phdr); if (hdr == NULL) return (NULL); /* * Scan the program header entries, and save key information. - * * We expect that the loadable segments are ordered by load address. */ - phdr = (Elf_Phdr *) ((char *)hdr + hdr->e_phoff); - phsize = hdr->e_phnum * sizeof (phdr[0]); + phsize = hdr->e_phnum * sizeof(phdr[0]); phlimit = phdr + hdr->e_phnum; nsegs = -1; phdyn = phinterp = phtls = NULL; @@ -324,14 +330,18 @@ error1: error: if (note_map != NULL && note_map != MAP_FAILED) munmap(note_map, note_map_len); + if (!phdr_in_zero_page(hdr)) + munmap(phdr, hdr->e_phnum * sizeof(phdr[0])); munmap(hdr, PAGE_SIZE); return (NULL); } static Elf_Ehdr * -get_elf_header(int fd, const char *path, const struct stat *sbp) +get_elf_header(int fd, const char *path, const struct stat *sbp, + Elf_Phdr **phdr_p) { Elf_Ehdr *hdr; + Elf_Phdr *phdr; /* Make sure file has enough data for the ELF header */ if (sbp != NULL && sbp->st_size < sizeof(Elf_Ehdr)) { @@ -380,11 +390,19 @@ get_elf_header(int fd, const char *path, const struct "%s: invalid shared object: e_phentsize != sizeof(Elf_Phdr)", path); goto error; } - if (hdr->e_phoff + hdr->e_phnum * sizeof(Elf_Phdr) > - (size_t)PAGE_SIZE) { - _rtld_error("%s: program header too large", path); - goto error; + if (phdr_in_zero_page(hdr)) { + phdr = (Elf_Phdr *)((char *)hdr + hdr->e_phoff); + } else { + phdr = mmap(NULL, hdr->e_phnum * sizeof(phdr[0]), + PROT_READ, MAP_PRIVATE | MAP_PREFAULT_READ, fd, + hdr->e_phoff); + if (phdr == MAP_FAILED) { + _rtld_error("%s: error mapping phdr: %s", path, + rtld_strerror(errno)); + goto error; + } } + *phdr_p = phdr; return (hdr); error: From owner-svn-src-all@freebsd.org Fri Sep 11 12:36:08 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 463D93D920B; Fri, 11 Sep 2020 12:36:08 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BnwGc1S8Gz4Hx7; Fri, 11 Sep 2020 12:36:08 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0F78623F33; Fri, 11 Sep 2020 12:36:08 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08BCa8u1030729; Fri, 11 Sep 2020 12:36:08 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08BCa6VP030719; Fri, 11 Sep 2020 12:36:06 GMT (envelope-from bz@FreeBSD.org) Message-Id: <202009111236.08BCa6VP030719@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Fri, 11 Sep 2020 12:36:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365630 - in stable/12: sbin/rtsol usr.sbin/rtsold X-SVN-Group: stable-12 X-SVN-Commit-Author: bz X-SVN-Commit-Paths: in stable/12: sbin/rtsol usr.sbin/rtsold X-SVN-Commit-Revision: 365630 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.33 Precedence: list List-Id: "SVN commit messages 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, 11 Sep 2020 12:36:08 -0000 Author: bz Date: Fri Sep 11 12:36:05 2020 New Revision: 365630 URL: https://svnweb.freebsd.org/changeset/base/365630 Log: MFC r342788,354926,364771 (markj, bz) - Capsicumize rtsol(8) and rtsold(8). - Avoid relying on pollution from libcasper.h. - Add script for "M bit". Added: stable/12/usr.sbin/rtsold/cap_llflags.c - copied, changed from r342788, head/usr.sbin/rtsold/cap_llflags.c stable/12/usr.sbin/rtsold/cap_script.c - copied unchanged from r342788, head/usr.sbin/rtsold/cap_script.c stable/12/usr.sbin/rtsold/cap_sendmsg.c - copied unchanged from r342788, head/usr.sbin/rtsold/cap_sendmsg.c Deleted: stable/12/usr.sbin/rtsold/probe.c Modified: stable/12/sbin/rtsol/Makefile stable/12/usr.sbin/rtsold/Makefile stable/12/usr.sbin/rtsold/dump.c stable/12/usr.sbin/rtsold/if.c stable/12/usr.sbin/rtsold/rtsock.c stable/12/usr.sbin/rtsold/rtsol.c stable/12/usr.sbin/rtsold/rtsold.8 stable/12/usr.sbin/rtsold/rtsold.c stable/12/usr.sbin/rtsold/rtsold.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/rtsol/Makefile ============================================================================== --- stable/12/sbin/rtsol/Makefile Fri Sep 11 10:11:04 2020 (r365629) +++ stable/12/sbin/rtsol/Makefile Fri Sep 11 12:36:05 2020 (r365630) @@ -18,10 +18,24 @@ PACKAGE=runtime PROG= rtsol -SRCS= rtsold.c rtsol.c if.c probe.c dump.c rtsock.c +SRCS= cap_llflags.c \ + cap_script.c \ + cap_sendmsg.c \ + dump.c \ + if.c \ + rtsol.c \ + rtsold.c \ + rtsock.c MAN= +LIBADD= util -WARNS?= 3 -CFLAGS+= -DSMALL +.include + +.if ${MK_DYNAMICROOT} == "no" +.warning ${PROG} built without libcasper support +.elif ${MK_CASPER} != "no" && !defined(RESCUE) +CFLAGS+= -DWITH_CASPER +LIBADD+= cap_syslog casper nv +.endif .include Modified: stable/12/usr.sbin/rtsold/Makefile ============================================================================== --- stable/12/usr.sbin/rtsold/Makefile Fri Sep 11 10:11:04 2020 (r365629) +++ stable/12/usr.sbin/rtsold/Makefile Fri Sep 11 12:36:05 2020 (r365630) @@ -17,8 +17,22 @@ PROG= rtsold MAN= rtsold.8 MLINKS= rtsold.8 rtsol.8 -SRCS= rtsold.c rtsol.c if.c probe.c dump.c rtsock.c +SRCS= cap_llflags.c \ + cap_script.c \ + cap_sendmsg.c \ + dump.c \ + if.c \ + rtsock.c \ + rtsol.c \ + rtsold.c -WARNS?= 3 +LIBADD= util + +.include + +.if ${MK_CASPER} != "no" +CFLAGS+= -DWITH_CASPER +LIBADD+= casper cap_syslog nv +.endif .include Copied and modified: stable/12/usr.sbin/rtsold/cap_llflags.c (from r342788, head/usr.sbin/rtsold/cap_llflags.c) ============================================================================== --- head/usr.sbin/rtsold/cap_llflags.c Sat Jan 5 16:05:39 2019 (r342788, copy source) +++ stable/12/usr.sbin/rtsold/cap_llflags.c Fri Sep 11 12:36:05 2020 (r365630) @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include Copied: stable/12/usr.sbin/rtsold/cap_script.c (from r342788, head/usr.sbin/rtsold/cap_script.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/usr.sbin/rtsold/cap_script.c Fri Sep 11 12:36:05 2020 (r365630, copy of r342788, head/usr.sbin/rtsold/cap_script.c) @@ -0,0 +1,236 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2018 The FreeBSD Foundation + * + * This software was developed by Mark Johnston 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 AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include +#include + +#include +#include + +#include "rtsold.h" + +/* + * Run the script and return the write end of a pipe to the main process. + * Return -1 and set errno on error. + */ +static int +script_run(char **argv) +{ + pid_t pid; + int fd[2], null; + + if (pipe(fd) != 0) + return (-1); + if ((pid = fork()) < 0) + return (-1); + if (pid == 0) { + (void)close(fd[1]); + null = open("/dev/null", O_RDWR); + if (null < 0) + _exit(1); + if (dup2(fd[0], STDIN_FILENO) != STDIN_FILENO) + _exit(1); + + closefrom(3); + (void)execve(argv[0], argv, NULL); + _exit(1); + } else + (void)close(fd[0]); + + return (fd[1]); +} + +int +cap_script_run(cap_channel_t *cap, const char *const *argv) +{ +#ifdef WITH_CASPER + nvlist_t *nvl; + size_t argc; + int error, wfd; + + for (argc = 0; argv[argc] != NULL; argc++) + ; + + nvl = nvlist_create(0); + nvlist_add_string(nvl, "cmd", "script_run"); + nvlist_add_string_array(nvl, "argv", argv, argc); + nvl = cap_xfer_nvlist(cap, nvl); + if (nvl == NULL) + return (-1); + + error = (int)dnvlist_get_number(nvl, "error", 0); + if (error == 0) + wfd = nvlist_take_descriptor(nvl, "fd"); + nvlist_destroy(nvl); + if (error != 0) + errno = error; + return (error == 0 ? wfd : -1); +#else + (void)cap; + return (script_run(__DECONST(char **, argv))); +#endif +} + +/* + * Wait for a child process to exit, and return its status. + * Return -1 and set errno upon error. + */ +static int +script_wait(int *statusp) +{ + int error; + + error = wait(statusp); + return (error >= 0 ? 0 : -1); +} + +int +cap_script_wait(cap_channel_t *cap, int *statusp) +{ +#ifdef WITH_CASPER + nvlist_t *nvl; + int error; + + nvl = nvlist_create(0); + nvlist_add_string(nvl, "cmd", "script_wait"); + nvl = cap_xfer_nvlist(cap, nvl); + if (nvl == NULL) + return (-1); + + error = (int)dnvlist_get_number(nvl, "error", 0); + if (error == 0) + *statusp = (int)nvlist_get_number(nvl, "status"); + nvlist_destroy(nvl); + if (error != 0) + errno = error; + return (error == 0 ? 0 : -1); +#else + (void)cap; + return (script_wait(statusp)); +#endif +} + +#ifdef WITH_CASPER +static int +script_command(const char *cmd, const nvlist_t *limits, nvlist_t *nvlin, + nvlist_t *nvlout) +{ + cap_rights_t rights; + const char *const *iargv, *const *scripts; + char **argv; + size_t argc, i, nscripts; + int fd, status; + + if (strcmp(cmd, "script_wait") == 0) { + /* Wait for the result of a previous "script_run" command. */ + if (script_wait(&status) == -1) + return (errno); + nvlist_add_number(nvlout, "status", status); + return (0); + } + if (strcmp(cmd, "script_run") != 0) + return (EINVAL); + + /* + * Validate the argv against the limits specified at initialization + * time. + */ + iargv = nvlist_get_string_array(nvlin, "argv", &argc); + if (argc == 0) + return (EINVAL); + scripts = nvlist_get_string_array(limits, "scripts", &nscripts); + for (i = 0; i < nscripts; i++) + if (strcmp(iargv[0], scripts[i]) == 0) + break; + if (i == nscripts) + return (EINVAL); + + /* + * The nvlist API does not permit NULL pointers in an array, so we have + * to add the nul terminator ourselves. Yuck. + */ + argv = calloc(argc + 1, sizeof(*argv)); + if (argv == NULL) + return (errno); + memcpy(argv, iargv, sizeof(*argv) * argc); + + fd = script_run(argv); + if (fd < 0) + return (errno); + + (void)caph_rights_limit(fd, cap_rights_init(&rights, CAP_WRITE)); + nvlist_move_descriptor(nvlout, "fd", fd); + return (0); +} + +static int +script_limit(const nvlist_t *oldlimits, const nvlist_t *newlimits __unused) +{ + const char *name; + void *cookie; + int nvtype; + bool hasscripts; + + /* Limits may only be set once. */ + if (oldlimits != NULL) + return (ENOTCAPABLE); + + cookie = NULL; + hasscripts = false; + while ((name = nvlist_next(newlimits, &nvtype, &cookie)) != NULL) { + if (nvtype == NV_TYPE_STRING_ARRAY && + strcmp(name, "scripts") == 0) + hasscripts = true; + else + return (EINVAL); + } + if (!hasscripts) + return (EINVAL); + return (0); +} + +CREATE_SERVICE("rtsold.script", script_limit, script_command, 0); +#endif /* WITH_CASPER */ Copied: stable/12/usr.sbin/rtsold/cap_sendmsg.c (from r342788, head/usr.sbin/rtsold/cap_sendmsg.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/usr.sbin/rtsold/cap_sendmsg.c Fri Sep 11 12:36:05 2020 (r365630, copy of r342788, head/usr.sbin/rtsold/cap_sendmsg.c) @@ -0,0 +1,282 @@ +/* $KAME: probe.c,v 1.17 2003/10/05 00:09:36 itojun Exp $ */ + +/*- + * SPDX-License-Identifier: BSD-3-Clause + * + * Copyright (C) 1998 WIDE Project. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the project nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE PROJECT 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 PROJECT 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$ + */ + +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include +#include + +#include +#include + +#include "rtsold.h" + +static int +getsocket(int *sockp, int proto) +{ + cap_rights_t rights; + int sock; + + if (*sockp >= 0) + return (0); + + if ((sock = socket(AF_INET6, SOCK_RAW, proto)) < 0) + return (-1); + cap_rights_init(&rights, CAP_CONNECT, CAP_SEND); + if (caph_rights_limit(sock, &rights) != 0) + return (-1); + *sockp = sock; + + return (0); +} + +static ssize_t +sendpacket(int sock, struct sockaddr_in6 *dst, uint32_t ifindex, int hoplimit, + const void *data, size_t len) +{ + uint8_t cmsg[CMSG_SPACE(sizeof(struct in6_pktinfo)) + + CMSG_SPACE(sizeof(int))]; + struct msghdr hdr; + struct iovec iov; + struct in6_pktinfo *pi; + struct cmsghdr *cm; + + memset(&hdr, 0, sizeof(hdr)); + hdr.msg_name = dst; + hdr.msg_namelen = sizeof(*dst); + hdr.msg_iov = &iov; + hdr.msg_iovlen = 1; + hdr.msg_control = cmsg; + hdr.msg_controllen = sizeof(cmsg); + + iov.iov_base = __DECONST(void *, data); + iov.iov_len = len; + + /* Specify the outbound interface. */ + cm = CMSG_FIRSTHDR(&hdr); + cm->cmsg_level = IPPROTO_IPV6; + cm->cmsg_type = IPV6_PKTINFO; + cm->cmsg_len = CMSG_LEN(sizeof(struct in6_pktinfo)); + pi = (struct in6_pktinfo *)(void *)CMSG_DATA(cm); + memset(&pi->ipi6_addr, 0, sizeof(pi->ipi6_addr)); /*XXX*/ + pi->ipi6_ifindex = ifindex; + + /* Specify the hop limit of the packet for safety. */ + cm = CMSG_NXTHDR(&hdr, cm); + cm->cmsg_level = IPPROTO_IPV6; + cm->cmsg_type = IPV6_HOPLIMIT; + cm->cmsg_len = CMSG_LEN(sizeof(int)); + memcpy(CMSG_DATA(cm), &hoplimit, sizeof(int)); + + return (sendmsg(sock, &hdr, 0)); +} + +static int +probe_defrouters(uint32_t ifindex, uint32_t linkid) +{ + static int probesock = -1; + struct sockaddr_in6 dst; + struct in6_defrouter *p, *ep; + char *buf; + size_t len; + int mib[4]; + + if (ifindex == 0) + return (0); + if (getsocket(&probesock, IPPROTO_NONE) != 0) + return (-1); + + mib[0] = CTL_NET; + mib[1] = PF_INET6; + mib[2] = IPPROTO_ICMPV6; + mib[3] = ICMPV6CTL_ND6_DRLIST; + if (sysctl(mib, nitems(mib), NULL, &len, NULL, 0) < 0) + return (-1); + if (len == 0) + return (0); + + memset(&dst, 0, sizeof(dst)); + dst.sin6_family = AF_INET6; + dst.sin6_len = sizeof(dst); + + buf = malloc(len); + if (buf == NULL) + return (-1); + if (sysctl(mib, nitems(mib), buf, &len, NULL, 0) < 0) + return (-1); + ep = (struct in6_defrouter *)(void *)(buf + len); + for (p = (struct in6_defrouter *)(void *)buf; p < ep; p++) { + if (ifindex != p->if_index) + continue; + if (!IN6_IS_ADDR_LINKLOCAL(&p->rtaddr.sin6_addr)) + continue; + dst.sin6_addr = p->rtaddr.sin6_addr; + dst.sin6_scope_id = linkid; + (void)sendpacket(probesock, &dst, ifindex, 1, NULL, 0); + } + free(buf); + + return (0); +} + +static int +rssend(uint32_t ifindex, uint32_t linkid, const void *data, size_t len) +{ + static int rssock = -1; + struct sockaddr_in6 dst; + ssize_t n; + + if (getsocket(&rssock, IPPROTO_ICMPV6) != 0) + return (-1); + + memset(&dst, 0, sizeof(dst)); + dst.sin6_family = AF_INET6; + dst.sin6_len = sizeof(dst); + dst.sin6_addr = (struct in6_addr)IN6ADDR_LINKLOCAL_ALLROUTERS_INIT; + dst.sin6_scope_id = linkid; + + n = sendpacket(rssock, &dst, ifindex, 255, data, len); + if (n < 0 || (size_t)n != len) + return (-1); + return (0); +} + +int +cap_probe_defrouters(cap_channel_t *cap, struct ifinfo *ifinfo) +{ +#ifdef WITH_CASPER + nvlist_t *nvl; + int error; + + nvl = nvlist_create(0); + nvlist_add_string(nvl, "cmd", "probe_defrouters"); + nvlist_add_number(nvl, "ifindex", ifinfo->sdl->sdl_index); + nvlist_add_number(nvl, "linkid", ifinfo->linkid); + + nvl = cap_xfer_nvlist(cap, nvl); + if (nvl == NULL) + return (errno); + error = (int)dnvlist_get_number(nvl, "error", 0); + nvlist_destroy(nvl); + errno = error; + return (error == 0 ? 0 : -1); +#else + (void)cap; + return (probe_defrouters(ifinfo->sdl->sdl_index, ifinfo->linkid)); +#endif +} + +int +cap_rssend(cap_channel_t *cap, struct ifinfo *ifinfo) +{ + int error; + +#ifdef WITH_CASPER + nvlist_t *nvl = nvlist_create(0); + nvlist_add_string(nvl, "cmd", "rssend"); + nvlist_add_number(nvl, "ifindex", ifinfo->sdl->sdl_index); + nvlist_add_number(nvl, "linkid", ifinfo->linkid); + nvlist_add_binary(nvl, "data", ifinfo->rs_data, ifinfo->rs_datalen); + + nvl = cap_xfer_nvlist(cap, nvl); + if (nvl == NULL) + return (errno); + error = (int)dnvlist_get_number(nvl, "error", 0); + nvlist_destroy(nvl); + errno = error; +#else + (void)cap; + error = rssend(ifinfo->sdl->sdl_index, ifinfo->linkid, ifinfo->rs_data, + ifinfo->rs_datalen); +#endif + + ifinfo->probes++; + if (error != 0 && (errno != ENETDOWN || dflag > 0)) { + error = errno; + warnmsg(LOG_ERR, __func__, "sendmsg on %s: %s", + ifinfo->ifname, strerror(errno)); + errno = error; + } + return (error == 0 ? 0 : -1); +} + +#ifdef WITH_CASPER +static int +sendmsg_command(const char *cmd, const nvlist_t *limits __unused, nvlist_t *nvlin, + nvlist_t *nvlout __unused) +{ + const void *data; + size_t len; + uint32_t ifindex, linkid; + int error; + + if (strcmp(cmd, "probe_defrouters") != 0 && + strcmp(cmd, "rssend") != 0) + return (EINVAL); + + ifindex = (uint32_t)nvlist_get_number(nvlin, "ifindex"); + linkid = (uint32_t)nvlist_get_number(nvlin, "linkid"); + if (strcmp(cmd, "probe_defrouters") == 0) { + error = probe_defrouters(ifindex, linkid); + } else { + data = nvlist_get_binary(nvlin, "data", &len); + error = rssend(ifindex, linkid, data, len); + } + if (error != 0) + return (errno); + return (0); +} + +CREATE_SERVICE("rtsold.sendmsg", NULL, sendmsg_command, 0); +#endif /* WITH_CASPER */ Modified: stable/12/usr.sbin/rtsold/dump.c ============================================================================== --- stable/12/usr.sbin/rtsold/dump.c Fri Sep 11 10:11:04 2020 (r365629) +++ stable/12/usr.sbin/rtsold/dump.c Fri Sep 11 12:36:05 2020 (r365630) @@ -34,6 +34,7 @@ */ #include +#include #include #include @@ -42,21 +43,20 @@ #include #include -#include -#include +#include +#include #include #include -#include +#include +#include #include "rtsold.h" -static FILE *fp; +static const char * const ifstatstr[] = + { "IDLE", "DELAY", "PROBE", "DOWN", "TENTATIVE" }; -static void dump_interface_status(void); -static const char * const ifstatstr[] = {"IDLE", "DELAY", "PROBE", "DOWN", "TENTATIVE"}; - -static void -dump_interface_status(void) +void +rtsold_dump(FILE *fp) { struct ifinfo *ifi; struct rainfo *rai; @@ -64,8 +64,14 @@ dump_interface_status(void) struct timespec now; char ntopbuf[INET6_ADDRSTRLEN]; - clock_gettime(CLOCK_MONOTONIC_FAST, &now); + if (fseek(fp, 0, SEEK_SET) != 0) { + warnmsg(LOG_ERR, __func__, "fseek(): %s", strerror(errno)); + return; + } + (void)ftruncate(fileno(fp), 0); + (void)clock_gettime(CLOCK_MONOTONIC_FAST, &now); + TAILQ_FOREACH(ifi, &ifinfo_head, ifi_next) { fprintf(fp, "Interface %s\n", ifi->ifname); fprintf(fp, " probe interval: "); @@ -78,6 +84,8 @@ dump_interface_status(void) } fprintf(fp, " interface status: %s\n", ifi->active > 0 ? "active" : "inactive"); + fprintf(fp, " managed config: %s\n", + ifi->managedconfig ? "on" : "off"); fprintf(fp, " other config: %s\n", ifi->otherconfig ? "on" : "off"); fprintf(fp, " rtsold status: %s\n", ifstatstr[ifi->state]); @@ -121,18 +129,28 @@ dump_interface_status(void) fprintf(fp, "\n"); } } + fflush(fp); } -void -rtsold_dump_file(const char *dumpfile) +FILE * +rtsold_init_dumpfile(const char *dumpfile) { + cap_rights_t rights; + FILE *fp; + if ((fp = fopen(dumpfile, "w")) == NULL) { - warnmsg(LOG_WARNING, __func__, "open a dump file(%s): %s", + warnmsg(LOG_WARNING, __func__, "opening a dump file(%s): %s", dumpfile, strerror(errno)); - return; + return (NULL); } - dump_interface_status(); - fclose(fp); + + cap_rights_init(&rights, CAP_FSTAT, CAP_FTRUNCATE, CAP_SEEK, CAP_WRITE); + if (caph_rights_limit(fileno(fp), &rights) != 0) { + warnmsg(LOG_WARNING, __func__, "caph_rights_limit(%s): %s", + dumpfile, strerror(errno)); + return (NULL); + } + return (fp); } const char * Modified: stable/12/usr.sbin/rtsold/if.c ============================================================================== --- stable/12/usr.sbin/rtsold/if.c Fri Sep 11 10:11:04 2020 (r365629) +++ stable/12/usr.sbin/rtsold/if.c Fri Sep 11 12:36:05 2020 (r365630) @@ -34,10 +34,11 @@ */ #include -#include -#include +#include #include #include +#include +#include #include #include @@ -51,6 +52,7 @@ #include #include +#include #include #include #include @@ -63,16 +65,28 @@ #include "rtsold.h" static int ifsock; - -static int get_llflag(const char *); static void get_rtaddrs(int, struct sockaddr *, struct sockaddr **); int ifinit(void) { - ifsock = rssock; + cap_rights_t rights; + int sock; - return(0); + sock = socket(AF_INET6, SOCK_RAW, IPPROTO_ICMPV6); + if (sock < 0) { + warnmsg(LOG_ERR, __func__, "socket(): %s", + strerror(errno)); + return (-1); + } + if (caph_rights_limit(sock, cap_rights_init(&rights, CAP_IOCTL)) < 0) { + warnmsg(LOG_ERR, __func__, "caph_rights_limit(): %s", + strerror(errno)); + (void)close(sock); + return (-1); + } + ifsock = sock; + return (0); } int @@ -150,10 +164,9 @@ interface_up(char *name) } close(s); - llflag = get_llflag(name); - if (llflag < 0) { + if (cap_llflags_get(capllflags, name, &llflag) != 0) { warnmsg(LOG_WARNING, __func__, - "get_llflag() failed, anyway I'll try"); + "cap_llflags_get() failed, anyway I'll try"); return (0); } @@ -273,8 +286,6 @@ lladdropt_fill(struct sockaddr_dl *sdl, struct nd_opt_ "unsupported link type(%d)", sdl->sdl_type); exit(1); } - - return; } struct sockaddr_dl * @@ -331,58 +342,6 @@ if_nametosdl(char *name) free(buf); return (ret_sdl); } - -/*------------------------------------------------------------*/ - -/* get ia6_flags for link-local addr on if. returns -1 on error. */ -static int -get_llflag(const char *name) -{ - struct ifaddrs *ifap, *ifa; - struct in6_ifreq ifr6; - struct sockaddr_in6 *sin6; - int s; - - if ((s = socket(PF_INET6, SOCK_DGRAM, 0)) < 0) { - warnmsg(LOG_ERR, __func__, "socket(SOCK_DGRAM): %s", - strerror(errno)); - exit(1); - } - if (getifaddrs(&ifap) != 0) { - warnmsg(LOG_ERR, __func__, "getifaddrs: %s", - strerror(errno)); - exit(1); - } - - for (ifa = ifap; ifa; ifa = ifa->ifa_next) { - if (strlen(ifa->ifa_name) != strlen(name) || - strncmp(ifa->ifa_name, name, strlen(name)) != 0) - continue; - if (ifa->ifa_addr->sa_family != AF_INET6) - continue; - sin6 = (struct sockaddr_in6 *)(void *)ifa->ifa_addr; - if (!IN6_IS_ADDR_LINKLOCAL(&sin6->sin6_addr)) - continue; - - memset(&ifr6, 0, sizeof(ifr6)); - strlcpy(ifr6.ifr_name, name, sizeof(ifr6.ifr_name)); - memcpy(&ifr6.ifr_ifru.ifru_addr, sin6, sin6->sin6_len); - if (ioctl(s, SIOCGIFAFLAG_IN6, &ifr6) < 0) { - warnmsg(LOG_ERR, __func__, - "ioctl(SIOCGIFAFLAG_IN6): %s", strerror(errno)); - exit(1); - } - - freeifaddrs(ifap); - close(s); - return (ifr6.ifr_ifru.ifru_flags6); - } - - freeifaddrs(ifap); - close(s); - return (-1); -} - static void get_rtaddrs(int addrs, struct sockaddr *sa, struct sockaddr **rti_info) Modified: stable/12/usr.sbin/rtsold/rtsock.c ============================================================================== --- stable/12/usr.sbin/rtsold/rtsock.c Fri Sep 11 10:11:04 2020 (r365629) +++ stable/12/usr.sbin/rtsold/rtsock.c Fri Sep 11 12:36:05 2020 (r365630) @@ -33,10 +33,11 @@ */ #include +#include +#include #include -#include #include -#include +#include #include #include @@ -46,6 +47,7 @@ #include #include +#include #include #include #include @@ -72,8 +74,20 @@ static struct { int rtsock_open(void) { + cap_rights_t rights; + int error, s; - return (socket(PF_ROUTE, SOCK_RAW, 0)); + s = socket(PF_ROUTE, SOCK_RAW, 0); + if (s < 0) + return (s); + cap_rights_init(&rights, CAP_EVENT, CAP_READ); + if (caph_rights_limit(s, &rights) != 0) { + error = errno; + (void)close(s); + errno = errno; + return (-1); + } + return (s); } int Modified: stable/12/usr.sbin/rtsold/rtsol.c ============================================================================== --- stable/12/usr.sbin/rtsold/rtsol.c Fri Sep 11 10:11:04 2020 (r365629) +++ stable/12/usr.sbin/rtsold/rtsol.c Fri Sep 11 12:36:05 2020 (r365630) @@ -35,11 +35,12 @@ */ #include +#include +#include #include +#include #include -#include #include -#include #include #include @@ -54,6 +55,7 @@ #include +#include #include #include #include @@ -67,40 +69,24 @@ #include #include "rtsold.h" -static struct msghdr rcvmhdr; -static struct msghdr sndmhdr; -static struct iovec rcviov[2]; -static struct iovec sndiov[2]; -static struct sockaddr_in6 from; -static int rcvcmsglen; - -int rssock; static char rsid[IFNAMSIZ + 1 + sizeof(DNSINFO_ORIGIN_LABEL) + 1 + NI_MAXHOST]; -struct ifinfo_head_t ifinfo_head = - TAILQ_HEAD_INITIALIZER(ifinfo_head); +struct ifinfo_head_t ifinfo_head = TAILQ_HEAD_INITIALIZER(ifinfo_head); -static const struct sockaddr_in6 sin6_allrouters = { - .sin6_len = sizeof(sin6_allrouters), - .sin6_family = AF_INET6, - .sin6_addr = IN6ADDR_LINKLOCAL_ALLROUTERS_INIT, -}; - -static void call_script(const int, const char *const *, - struct script_msg_head_t *); +static void call_script(const char *const *, struct script_msg_head_t *); static size_t dname_labeldec(char *, size_t, const char *); -static int safefile(const char *); static struct ra_opt *find_raopt(struct rainfo *, int, void *, size_t); static int ra_opt_rdnss_dispatch(struct ifinfo *, struct rainfo *, struct script_msg_head_t *, struct script_msg_head_t *); static char *make_rsid(const char *, const char *, struct rainfo *); +#define _ARGS_MANAGED managedconf_script, ifi->ifname #define _ARGS_OTHER otherconf_script, ifi->ifname #define _ARGS_RESADD resolvconf_script, "-a", rsid #define _ARGS_RESDEL resolvconf_script, "-d", rsid #define CALL_SCRIPT(name, sm_head) do { \ const char *const sarg[] = { _ARGS_##name, NULL }; \ - call_script(sizeof(sarg), sarg, sm_head); \ + call_script(sarg, sm_head); \ } while (0) #define ELM_MALLOC(p, error_action) do { \ @@ -114,130 +100,69 @@ static char *make_rsid(const char *, const char *, str } while (0) int -sockopen(void) +recvsockopen(void) { - static u_char *rcvcmsgbuf = NULL, *sndcmsgbuf = NULL; - int sndcmsglen, on; - static u_char answer[1500]; struct icmp6_filter filt; + cap_rights_t rights; + int on, sock; - sndcmsglen = rcvcmsglen = CMSG_SPACE(sizeof(struct in6_pktinfo)) + - CMSG_SPACE(sizeof(int)); - if (rcvcmsgbuf == NULL && (rcvcmsgbuf = malloc(rcvcmsglen)) == NULL) { - warnmsg(LOG_ERR, __func__, - "malloc for receive msghdr failed"); - return (-1); - } - if (sndcmsgbuf == NULL && (sndcmsgbuf = malloc(sndcmsglen)) == NULL) { - warnmsg(LOG_ERR, __func__, - "malloc for send msghdr failed"); - return (-1); - } - if ((rssock = socket(AF_INET6, SOCK_RAW, IPPROTO_ICMPV6)) < 0) { + if ((sock = socket(AF_INET6, SOCK_RAW, IPPROTO_ICMPV6)) < 0) { warnmsg(LOG_ERR, __func__, "socket: %s", strerror(errno)); - return (-1); + goto fail; } - /* specify to tell receiving interface */ + /* Provide info about the receiving interface. */ on = 1; - if (setsockopt(rssock, IPPROTO_IPV6, IPV6_RECVPKTINFO, &on, + if (setsockopt(sock, IPPROTO_IPV6, IPV6_RECVPKTINFO, &on, sizeof(on)) < 0) { - warnmsg(LOG_ERR, __func__, "IPV6_RECVPKTINFO: %s", + warnmsg(LOG_ERR, __func__, "setsockopt(IPV6_RECVPKTINFO): %s", strerror(errno)); - exit(1); + goto fail; } - /* specify to tell value of hoplimit field of received IP6 hdr */ + /* Include the hop limit from the received header. */ on = 1; - if (setsockopt(rssock, IPPROTO_IPV6, IPV6_RECVHOPLIMIT, &on, + if (setsockopt(sock, IPPROTO_IPV6, IPV6_RECVHOPLIMIT, &on, sizeof(on)) < 0) { - warnmsg(LOG_ERR, __func__, "IPV6_RECVHOPLIMIT: %s", + warnmsg(LOG_ERR, __func__, "setsockopt(IPV6_RECVHOPLIMIT): %s", strerror(errno)); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri Sep 11 12:55:28 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 859C13D92D2; Fri, 11 Sep 2020 12:55:28 +0000 (UTC) (envelope-from gjb@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bnwhw2qKwz4Jh3; Fri, 11 Sep 2020 12:55:28 +0000 (UTC) (envelope-from gjb@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1599828928; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Tyk3xeaGusj6BLKkfeqYoA1ZlzVsHsxq0WNjfnX7Rn8=; b=LA7KGu9Z9ImY/GILfJh2I2ydOcpa5AQaJoU2DZ2UVu1G+eZm40x/BDJHG0vA65AA0jJT1o /sy5a3202lThe/DO+jA48p5Q6j/dVtIDcXrzYFl3K2HCKFX4m1Ln/vjuLaxyKUsihebVFO bqPI1FnlVk93qSQFDo4OJJFZDuKLbWu9aTwhn7ljBAbYqCYxWjMibOr/pdnzN1056MeNjc vQNyT61bPrsYUnaaLJsse+dCopcCvNoEIN7+65tI2nzGiBtu4gEFsUIxd/2YqvhY15lTUc rzynjza/sGMFMM2w7el3jAFmQKMU+S5Jn+gOOEoxa+y9enfryRnoBKzSbhrHdA== Received: from FreeBSD.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by freefall.freebsd.org (Postfix) with ESMTPS id D622D1EA94; Fri, 11 Sep 2020 12:55:27 +0000 (UTC) (envelope-from gjb@freebsd.org) Date: Fri, 11 Sep 2020 12:55:25 +0000 From: Glen Barber To: Ruslan Garipov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r364891 - in head: . release release/scripts Message-ID: <20200911125525.GC61041@FreeBSD.org> References: <202008272119.07RLJGgb043888@repo.freebsd.org> <174719d0148.27b9.e2363f32305322128423a5fd7014e4c4@gmail.com> <20200909135114.GC61041@FreeBSD.org> <1747c711988.27b9.e2363f32305322128423a5fd7014e4c4@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="xVJ7dC7LImzyqkjg" Content-Disposition: inline In-Reply-To: <1747c711988.27b9.e2363f32305322128423a5fd7014e4c4@gmail.com> ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1599828928; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Tyk3xeaGusj6BLKkfeqYoA1ZlzVsHsxq0WNjfnX7Rn8=; b=JYgZPInvmpEpgbuQtP8Cr3Qf1xM2snfBVS4+n6B4Jw8QfVH7CMT0cMFkpzzGBVtlAUz550 JkdlzI6xFPXgohX6wsQ0euyXHRIS4Xy/EVHyhcwlfdXJHCwLGcMQQIWCfMbCROGp1lRc7p FvL8+wyJ5o6V8Y8YIcZSPwHoarI83QTXZkjIww8SpbH59rvbiI8T5q6Y4+lqBdm2a6Usz/ Ogum/wFLOp8zHsyOhFMu6sJtq8rMf3wJz3HhQ+bIxY2mxzVsz6f4ZVSyWcN4EjjennVu8j QD0zHi9fSe3bPFJG4obE9aKIguWQkABhNKSaQMUJu63zSdb3Fp21dBCg1RUpeg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1599828928; a=rsa-sha256; cv=none; b=jKtWArdoD4ET4YuwGrjzPQxT86uwxmlnnRZmdDgf/hxAJU8A5sigSfsquGniE53RI3dB72 SBB1i78yAFyi5qVlZQxHvqpMlIJIfucde4tjRrmNJYdTi4opau+ygSFKSb7vpd1iEe5QPf zFnK3oMPs06Z/E1AZgUxiNK6aDhJjoBz8hB3BG/4wcmNbE+kjvWkR8uukFW22AvhhyecCJ CBIxLItSPexbanw8MfnPzGtyuTxQXAFNlFsk0eOWrzUKNkzD/61s1pss2hNCuv1C0DW84/ jB5Aw9mTJnVzC+GWRV64vuVMnry1M06uxojGyrCUs6yErCMp9a8UOJr6cCWW7g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 11 Sep 2020 12:55:28 -0000 --xVJ7dC7LImzyqkjg Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Sep 11, 2020 at 02:13:41PM +0500, Ruslan Garipov wrote: > On September 9, 2020 6:51:18 PM Glen Barber wrote: >=20 > > On Wed, Sep 09, 2020 at 11:45:49AM +0500, Ruslan Garipov wrote: > > > On August 28, 2020 2:19:33 AM Glen Barber wrote: > > >=20 > > > > Author: gjb > > > > Date: Thu Aug 27 21:19:16 2020 > > > > New Revision: 364891 > > > > URL: https://svnweb.freebsd.org/changeset/base/364891 > > > > > > > > Log: > > > > Merge the projects/release-git branch to head. > > > > This allows building 13.x from Git instead of Subversion. > > > I'm sorry for the late response (and for the bad first one I made on = this > > > commit recently via Gmail web client). > > >=20 > > > My build machine is completely offline. I provide it with fresh snap= shots > > > of the source and ports tree manually -- via tarballs which I'm pulli= ng on > > > a FreeBSD machine having Internet connection. Therefore, neither > > > "/scratch", nor the chrooted environment for me don't require Internet > > > access (I fetch distfiles for offline usage too). > > >=20 > > > Can we somehow remove that requirement for the devel/git port? For > > > example, if one has set all three {SRC,PORTS,DOC}_UPDATE_SKIP variabl= es, > > > then release/release.sh doesn't require devel/git to exist on the hos= t. > > >=20 > > > I really don't need git on my build machine (and don't need it for > > > building). > > >=20 > >=20 > > Can you verify if the attached patch works for your use case? You will > > need to set NOGIT=3D1 in your release.conf. > Partially. It doesn't require devel/git to create the initial build > environment, but it does before beginning cross-build in the > extra_chroot_setup(). >=20 > You check there does the NOGIT have zero length. If NOGIT isn't empty, t= hen > release.sh will ($(which git) returns nothing for me) try to install > devel/git port or package again. And NOGIT isn't empty because in this > function my release.conf was already sourced. So I had removed "not" > (``!'') on line #278, ignoring NOGIT checking, and cross-build started. >=20 Doh! Yeah, that was a mistake - sorry about that. So as far as you are concerned, with the addition of removing the '!', it works as you expect? > It failed eventually on modifications made by r365398, but that's another > story. >=20 > Thanks again, Glen! >=20 Thank you for testing (and finding a silly bug)! Glen --xVJ7dC7LImzyqkjg Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEjRJAPC5sqwhs9k2jAxRYpUeP4pMFAl9bc70ACgkQAxRYpUeP 4pNevQ//VaPtQ0h+OCaA1yOXPpWqQ8SLdMyuyO1wE/cXpOQpz9v3o/XP22q/MA7h NVDPxvAgWOP8q3hophjadO2PnzRLVRFcP1k91rVgSscbLqL0nBG0YQF5SBH9Wk48 5Y2G/PSlTwh5KHbWBTfbYUXYeIURWyPTTvfViKzVa7PD88t3ewgLMdaGjagUGr2O 6FwRDpQYtUB9Htgt7jLe+fyEQxNdlJx38tg3GkBoBG+BRdPL7lg0+QF6/WcHQvni wlTigsRlY7r0lKdmA7fxiuNFkhBjQzmP5TtNi6iA9fZNBjdG7CxBJr7salcgrR0G 6UZt+F530n49rWGzRm1gh3zSy59dsBaPIUWTlq+Rigq9hnx9jP/lxdImBz7Bi8SF EfbcckaL/W+spL0sUJihNwyyGNuJJ2EV1UivQzMZxZdEhF6/sFMRAcNr7O0CAAlj qvrFbQdzY0YyVv7A6I+LYNSqxEWvNnmcGVYmtsn4/0W0a4KsqO3upfyeKCMJmndC Qe5dxBjXkbMJMae9htmhI1Iwim8nMM2B0yIJPLAx19lw/DNEA+XSHld4EvVqyoOj ZcI95MhiEud0zUfCfR3EuHaI6DvjlLSqBIpQutiJCG6r0jU7DkehfDiMFzCr/dIG 8KHOHDomOmayxrHkfHphKmv4IX9L9ctVaYR638Z4wr0oLCt4ddM= =qzpp -----END PGP SIGNATURE----- --xVJ7dC7LImzyqkjg-- From owner-svn-src-all@freebsd.org Fri Sep 11 13:28:42 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 818CE3DA258; Fri, 11 Sep 2020 13:28:42 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BnxRG2ppgz4LWq; Fri, 11 Sep 2020 13:28:42 +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 44F5024968; Fri, 11 Sep 2020 13:28:42 +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 08BDSgH6061212; Fri, 11 Sep 2020 13:28:42 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08BDScrP061194; Fri, 11 Sep 2020 13:28:38 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202009111328.08BDScrP061194@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 11 Sep 2020 13:28:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365631 - in head: lib/libc++ lib/libcxxrt lib/libopenbsd lib/libsqlite3 lib/libucl lib/libzstd libexec/dma/dma-mbox-create libexec/dma/dmagent sbin/gvinum sbin/tunefs stand/efi/boot1 s... X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head: lib/libc++ lib/libcxxrt lib/libopenbsd lib/libsqlite3 lib/libucl lib/libzstd libexec/dma/dma-mbox-create libexec/dma/dmagent sbin/gvinum sbin/tunefs stand/efi/boot1 stand/efi/gptboot stand/li... X-SVN-Commit-Revision: 365631 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.33 Precedence: list List-Id: "SVN commit messages 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, 11 Sep 2020 13:28:42 -0000 Author: kevans Date: Fri Sep 11 13:28:37 2020 New Revision: 365631 URL: https://svnweb.freebsd.org/changeset/base/365631 Log: Only set WARNS if not defined This would allow interested parties to do experimental runs with an environment set appropriately to raise all the warnings throughout the build; e.g. env WARNS=6 NO_WERROR=yes buildworld. Not currently touching the numerous instances in ^/tools. MFC after: 1 week Modified: head/lib/libc++/Makefile head/lib/libcxxrt/Makefile head/lib/libopenbsd/Makefile head/lib/libsqlite3/Makefile head/lib/libucl/Makefile head/lib/libzstd/Makefile head/libexec/dma/dma-mbox-create/Makefile head/libexec/dma/dmagent/Makefile head/sbin/gvinum/Makefile head/sbin/tunefs/Makefile head/stand/efi/boot1/Makefile head/stand/efi/gptboot/Makefile head/stand/liblua/Makefile head/usr.bin/bmake/Makefile.inc head/usr.bin/localedef/Makefile head/usr.bin/m4/Makefile head/usr.bin/users/Makefile head/usr.bin/zstd/Makefile head/usr.sbin/ypldap/Makefile Modified: head/lib/libc++/Makefile ============================================================================== --- head/lib/libc++/Makefile Fri Sep 11 12:36:05 2020 (r365630) +++ head/lib/libc++/Makefile Fri Sep 11 13:28:37 2020 (r365631) @@ -71,7 +71,7 @@ cxxrt_${_S}: ${_LIBCXXRTDIR}/${_S} .NOMETA ln -sf ${.ALLSRC} ${.TARGET} .endfor -WARNS= 0 +WARNS?= 0 CFLAGS+= -isystem ${HDRDIR} CFLAGS+= -isystem ${_LIBCXXRTDIR} CFLAGS+= -nostdinc++ Modified: head/lib/libcxxrt/Makefile ============================================================================== --- head/lib/libcxxrt/Makefile Fri Sep 11 12:36:05 2020 (r365630) +++ head/lib/libcxxrt/Makefile Fri Sep 11 13:28:37 2020 (r365631) @@ -20,7 +20,7 @@ SRCS+= libelftc_dem_gnu3.c\ typeinfo.cc\ guard.cc -WARNS= 0 +WARNS?= 0 CFLAGS+= -isystem ${SRCDIR} -nostdinc++ CXXSTD?= c++14 VERSION_MAP= ${.CURDIR}/Version.map Modified: head/lib/libopenbsd/Makefile ============================================================================== --- head/lib/libopenbsd/Makefile Fri Sep 11 12:36:05 2020 (r365630) +++ head/lib/libopenbsd/Makefile Fri Sep 11 13:28:37 2020 (r365631) @@ -15,6 +15,6 @@ INTERNALLIB= CFLAGS+= -I${.CURDIR} -WARNS= 3 +WARNS?= 3 .include Modified: head/lib/libsqlite3/Makefile ============================================================================== --- head/lib/libsqlite3/Makefile Fri Sep 11 12:36:05 2020 (r365630) +++ head/lib/libsqlite3/Makefile Fri Sep 11 13:28:37 2020 (r365631) @@ -12,7 +12,7 @@ INCS= sqlite3.h sqlite3ext.h SQLITE= ${SRCTOP}/contrib/sqlite3 .PATH: ${SQLITE} -WARNS= 3 +WARNS?= 3 CFLAGS+= -I${SQLITE} \ -DUSE_PREAD=1 \ -DSTDC_HEADERS=1 \ Modified: head/lib/libucl/Makefile ============================================================================== --- head/lib/libucl/Makefile Fri Sep 11 12:36:05 2020 (r365630) +++ head/lib/libucl/Makefile Fri Sep 11 13:28:37 2020 (r365631) @@ -23,7 +23,7 @@ SRCS= ucl_emitter_streamline.c \ INCS= ucl.h LIBADD= m -WARNS= 1 +WARNS?= 1 CFLAGS+= -I${LIBUCL_DIR}/include \ -I${LIBUCL_DIR}/src \ -I${LIBUCL_DIR}/uthash \ Modified: head/lib/libzstd/Makefile ============================================================================== --- head/lib/libzstd/Makefile Fri Sep 11 12:36:05 2020 (r365630) +++ head/lib/libzstd/Makefile Fri Sep 11 13:28:37 2020 (r365631) @@ -33,7 +33,7 @@ SRCS= entropy_common.c \ debug.c \ hist.c \ fastcover.c -WARNS= 2 +WARNS?= 2 INCS= zstd.h CFLAGS+= -I${ZSTDDIR}/lib -I${ZSTDDIR}/lib/common -DXXH_NAMESPACE=ZSTD_ \ -DZSTD_MULTITHREAD=1 Modified: head/libexec/dma/dma-mbox-create/Makefile ============================================================================== --- head/libexec/dma/dma-mbox-create/Makefile Fri Sep 11 12:36:05 2020 (r365630) +++ head/libexec/dma/dma-mbox-create/Makefile Fri Sep 11 13:28:37 2020 (r365631) @@ -2,7 +2,7 @@ MAN= -WARNS= 2 +WARNS?= 2 PROG= dma-mbox-create BINMODE= 4554 Modified: head/libexec/dma/dmagent/Makefile ============================================================================== --- head/libexec/dma/dmagent/Makefile Fri Sep 11 12:36:05 2020 (r365630) +++ head/libexec/dma/dmagent/Makefile Fri Sep 11 13:28:37 2020 (r365631) @@ -35,7 +35,7 @@ BINMODE= 2555 .include .if ${COMPILER_TYPE} == gcc -WARNS= 5 +WARNS?= 5 .endif .include Modified: head/sbin/gvinum/Makefile ============================================================================== --- head/sbin/gvinum/Makefile Fri Sep 11 12:36:05 2020 (r365630) +++ head/sbin/gvinum/Makefile Fri Sep 11 13:28:37 2020 (r365631) @@ -5,7 +5,7 @@ PROG= gvinum SRCS= gvinum.c gvinum.h geom_vinum_share.c MAN= gvinum.8 -WARNS= 2 +WARNS?= 2 CFLAGS+= -I${SRCTOP}/sys -I${SYSROOT:U${DESTDIR}}/${INCLUDEDIR}/edit LIBADD= edit geom Modified: head/sbin/tunefs/Makefile ============================================================================== --- head/sbin/tunefs/Makefile Fri Sep 11 12:36:05 2020 (r365630) +++ head/sbin/tunefs/Makefile Fri Sep 11 13:28:37 2020 (r365631) @@ -11,6 +11,6 @@ MOUNT= ${SRCTOP}/sbin/mount CFLAGS+= -I${MOUNT} .PATH: ${MOUNT} -WARNS= 3 +WARNS?= 3 .include Modified: head/stand/efi/boot1/Makefile ============================================================================== --- head/stand/efi/boot1/Makefile Fri Sep 11 12:36:05 2020 (r365630) +++ head/stand/efi/boot1/Makefile Fri Sep 11 13:28:37 2020 (r365631) @@ -5,7 +5,7 @@ BOOT1?= boot1 PROG= ${BOOT1}.sym INTERNALPROG= -WARNS= 6 +WARNS?= 6 CFLAGS+= -DEFI_BOOT1 # We implement a slightly non-standard %S in that it always takes a Modified: head/stand/efi/gptboot/Makefile ============================================================================== --- head/stand/efi/gptboot/Makefile Fri Sep 11 12:36:05 2020 (r365630) +++ head/stand/efi/gptboot/Makefile Fri Sep 11 13:28:37 2020 (r365631) @@ -13,5 +13,5 @@ CFLAGS+= -DBOOTPROG=\"gptboot.efi\" CFLAGS+= -DHAVE_MEMCPY -I${SRCTOP}/sys/contrib/zlib SRCS+= gpt.c CWARNFLAGS.gpt.c+= -Wno-sign-compare -Wno-cast-align -WARNS=6 +WARNS?=6 .include "${.CURDIR}/../boot1/Makefile" Modified: head/stand/liblua/Makefile ============================================================================== --- head/stand/liblua/Makefile Fri Sep 11 12:36:05 2020 (r365630) +++ head/stand/liblua/Makefile Fri Sep 11 13:28:37 2020 (r365631) @@ -28,7 +28,7 @@ SRCS+= lerrno.c lstd.c lutils.c .PATH: ${FLUASRC}/modules SRCS+= lfs.c -WARNS= 3 +WARNS?= 3 CFLAGS+= -DLUA_PATH=\"${LUAPATH}\" -DLUA_PATH_DEFAULT=\"${LUAPATH}/\?.lua\" CFLAGS+= -ffreestanding -nostdlib -DLUA_USE_POSIX Modified: head/usr.bin/bmake/Makefile.inc ============================================================================== --- head/usr.bin/bmake/Makefile.inc Fri Sep 11 12:36:05 2020 (r365630) +++ head/usr.bin/bmake/Makefile.inc Fri Sep 11 13:28:37 2020 (r365631) @@ -22,7 +22,7 @@ NO_SHARED?= YES SUBDIR+= tests .endif -WARNS=3 +WARNS?=3 CFLAGS+= -DNO_PWD_OVERRIDE .if make(after-import) Modified: head/usr.bin/localedef/Makefile ============================================================================== --- head/usr.bin/localedef/Makefile Fri Sep 11 12:36:05 2020 (r365630) +++ head/usr.bin/localedef/Makefile Fri Sep 11 13:28:37 2020 (r365631) @@ -13,7 +13,7 @@ SRCS= charmap.c \ time.c \ wide.c -WARNS= 3 +WARNS?= 3 ${SRCS:M*.c}: parser.h parser.h: parser.y Modified: head/usr.bin/m4/Makefile ============================================================================== --- head/usr.bin/m4/Makefile Fri Sep 11 12:36:05 2020 (r365630) +++ head/usr.bin/m4/Makefile Fri Sep 11 13:28:37 2020 (r365631) @@ -22,7 +22,7 @@ SRCS+= tokenizer.l .endif GENFILES= tokenizer.c parser.c parser.h -WARNS= 3 +WARNS?= 3 tokenizer.o: parser.h Modified: head/usr.bin/users/Makefile ============================================================================== --- head/usr.bin/users/Makefile Fri Sep 11 12:36:05 2020 (r365630) +++ head/usr.bin/users/Makefile Fri Sep 11 13:28:37 2020 (r365631) @@ -1,7 +1,7 @@ # @(#)Makefile 8.1 (Berkeley) 6/6/93 # $FreeBSD$ -WARNS= 3 +WARNS?= 3 PROG_CXX= users CXXFLAGS+= -fno-rtti Modified: head/usr.bin/zstd/Makefile ============================================================================== --- head/usr.bin/zstd/Makefile Fri Sep 11 12:36:05 2020 (r365630) +++ head/usr.bin/zstd/Makefile Fri Sep 11 13:28:37 2020 (r365631) @@ -26,7 +26,7 @@ MLINKS= zstd.1 unzstd.1 \ zstd.1 zstdcat.1 \ zstd.1 zstdmt.1 -WARNS= 2 +WARNS?= 2 LIBADD= zstd .PATH: ${SRCTOP}/sys/contrib/zstd/programs Modified: head/usr.sbin/ypldap/Makefile ============================================================================== --- head/usr.sbin/ypldap/Makefile Fri Sep 11 12:36:05 2020 (r365630) +++ head/usr.sbin/ypldap/Makefile Fri Sep 11 13:28:37 2020 (r365631) @@ -15,6 +15,6 @@ CFLAGS+=-I${.CURDIR} CFLAGS+=-I${SRCTOP}/contrib/pf/libevent CFLAGS+=-I${SRCTOP}/lib/libopenbsd -WARNS= 2 +WARNS?= 2 .include From owner-svn-src-all@freebsd.org Fri Sep 11 14:00:12 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A0DA23DB617; Fri, 11 Sep 2020 14:00:12 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bny7c3pqCz4NMG; Fri, 11 Sep 2020 14:00:12 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 672B624AC2; Fri, 11 Sep 2020 14:00:12 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08BE0Cwi079802; Fri, 11 Sep 2020 14:00:12 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08BE0BTK079796; Fri, 11 Sep 2020 14:00:11 GMT (envelope-from mav@FreeBSD.org) Message-Id: <202009111400.08BE0BTK079796@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 11 Sep 2020 14:00:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365632 - in stable/12/sys/powerpc: include powernv powerpc ps3 pseries X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: in stable/12/sys/powerpc: include powernv powerpc ps3 pseries X-SVN-Commit-Revision: 365632 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.33 Precedence: list List-Id: "SVN commit messages 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, 11 Sep 2020 14:00:12 -0000 Author: mav Date: Fri Sep 11 14:00:10 2020 New Revision: 365632 URL: https://svnweb.freebsd.org/changeset/base/365632 Log: MFC r342852 (by cem): powerpc: Fix regression introduced in r342771 In r342771, I introduced a regression in Power by abusing the platform smp_topo() method as a shortcut for providing the MI information needed for the stated sysctls. The smp_topo() method was already called later by sched_ule (under the name cpu_topo()), and initializes a static array of scheduler topology information. I had skimmed the smp_topo_foo() functions and assumed they were idempotent; empirically, they are not (or at least, detect re-initialization and panic). Do the cleaner thing I should have done in the first place and add a platform method specifically for core- and thread-count probing. PR: 249250 Modified: stable/12/sys/powerpc/include/platform.h stable/12/sys/powerpc/powernv/platform_powernv.c stable/12/sys/powerpc/powerpc/mp_machdep.c stable/12/sys/powerpc/powerpc/platform.c stable/12/sys/powerpc/powerpc/platform_if.m stable/12/sys/powerpc/ps3/platform_ps3.c stable/12/sys/powerpc/pseries/platform_chrp.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/powerpc/include/platform.h ============================================================================== --- stable/12/sys/powerpc/include/platform.h Fri Sep 11 13:28:37 2020 (r365631) +++ stable/12/sys/powerpc/include/platform.h Fri Sep 11 14:00:10 2020 (r365632) @@ -58,6 +58,7 @@ int platform_smp_get_bsp(struct cpuref *); int platform_smp_start_cpu(struct pcpu *); void platform_smp_timebase_sync(u_long tb, int ap); void platform_smp_ap_init(void); +void platform_smp_probe_threads(void); const char *installed_platform(void); void platform_probe_and_attach(void); Modified: stable/12/sys/powerpc/powernv/platform_powernv.c ============================================================================== --- stable/12/sys/powerpc/powernv/platform_powernv.c Fri Sep 11 13:28:37 2020 (r365631) +++ stable/12/sys/powerpc/powernv/platform_powernv.c Fri Sep 11 14:00:10 2020 (r365632) @@ -71,6 +71,7 @@ static int powernv_smp_get_bsp(platform_t, struct cpur static void powernv_smp_ap_init(platform_t); #ifdef SMP static int powernv_smp_start_cpu(platform_t, struct pcpu *cpu); +static void powernv_smp_probe_threads(platform_t); static struct cpu_group *powernv_smp_topo(platform_t plat); #endif static void powernv_reset(platform_t); @@ -89,6 +90,7 @@ static platform_method_t powernv_methods[] = { PLATFORMMETHOD(platform_smp_get_bsp, powernv_smp_get_bsp), #ifdef SMP PLATFORMMETHOD(platform_smp_start_cpu, powernv_smp_start_cpu), + PLATFORMMETHOD(platform_smp_probe_threads, powernv_smp_probe_threads), PLATFORMMETHOD(platform_smp_topo, powernv_smp_topo), #endif @@ -403,8 +405,8 @@ powernv_smp_start_cpu(platform_t plat, struct pcpu *pc return (0); } -static struct cpu_group * -powernv_smp_topo(platform_t plat) +static void +powernv_smp_probe_threads(platform_t plat) { char buf[8]; phandle_t cpu, dev, root; @@ -436,21 +438,26 @@ powernv_smp_topo(platform_t plat) } smp_threads_per_core = nthreads; + if (mp_ncpus % nthreads == 0) + mp_ncores = mp_ncpus / nthreads; +} - if (mp_ncpus % nthreads != 0) { +static struct cpu_group * +powernv_smp_topo(platform_t plat) +{ + if (mp_ncpus % smp_threads_per_core != 0) { printf("WARNING: Irregular SMP topology. Performance may be " "suboptimal (%d threads, %d on first core)\n", - mp_ncpus, nthreads); + mp_ncpus, smp_threads_per_core); return (smp_topo_none()); } - mp_ncores = mp_ncpus / nthreads; - /* Don't do anything fancier for non-threaded SMP */ - if (nthreads == 1) + if (smp_threads_per_core == 1) return (smp_topo_none()); - return (smp_topo_1level(CG_SHARE_L1, nthreads, CG_FLAG_SMT)); + return (smp_topo_1level(CG_SHARE_L1, smp_threads_per_core, + CG_FLAG_SMT)); } #endif Modified: stable/12/sys/powerpc/powerpc/mp_machdep.c ============================================================================== --- stable/12/sys/powerpc/powerpc/mp_machdep.c Fri Sep 11 13:28:37 2020 (r365631) +++ stable/12/sys/powerpc/powerpc/mp_machdep.c Fri Sep 11 14:00:10 2020 (r365632) @@ -182,8 +182,7 @@ next: } #ifdef SMP - /* Probe mp_ncores and smp_threads_per_core as a side effect. */ - (void)cpu_topo(); + platform_smp_probe_threads(); #endif } Modified: stable/12/sys/powerpc/powerpc/platform.c ============================================================================== --- stable/12/sys/powerpc/powerpc/platform.c Fri Sep 11 13:28:37 2020 (r365631) +++ stable/12/sys/powerpc/powerpc/platform.c Fri Sep 11 14:00:10 2020 (r365632) @@ -242,6 +242,12 @@ platform_smp_ap_init() PLATFORM_SMP_AP_INIT(plat_obj); } +void +platform_smp_probe_threads(void) +{ + PLATFORM_SMP_PROBE_THREADS(plat_obj); +} + #ifdef SMP struct cpu_group * cpu_topo(void) Modified: stable/12/sys/powerpc/powerpc/platform_if.m ============================================================================== --- stable/12/sys/powerpc/powerpc/platform_if.m Fri Sep 11 13:28:37 2020 (r365631) +++ stable/12/sys/powerpc/powerpc/platform_if.m Fri Sep 11 14:00:10 2020 (r365632) @@ -84,6 +84,10 @@ CODE { { return; } + static void platform_null_smp_probe_threads(void) + { + return; + } }; /** @@ -195,6 +199,13 @@ METHOD int smp_start_cpu { METHOD void smp_ap_init { platform_t _plat; } DEFAULT platform_null_smp_ap_init; + +/** + * @brief Probe mp_ncores and smp_threads_per_core for early MI code + */ +METHOD void smp_probe_threads { + platform_t _plat; +} DEFAULT platform_null_smp_probe_threads; /** * @brief Return SMP topology Modified: stable/12/sys/powerpc/ps3/platform_ps3.c ============================================================================== --- stable/12/sys/powerpc/ps3/platform_ps3.c Fri Sep 11 13:28:37 2020 (r365631) +++ stable/12/sys/powerpc/ps3/platform_ps3.c Fri Sep 11 14:00:10 2020 (r365632) @@ -70,6 +70,7 @@ static int ps3_smp_first_cpu(platform_t, struct cpuref static int ps3_smp_next_cpu(platform_t, struct cpuref *cpuref); static int ps3_smp_get_bsp(platform_t, struct cpuref *cpuref); static int ps3_smp_start_cpu(platform_t, struct pcpu *cpu); +static void ps3_smp_probe_threads(platform_t); static struct cpu_group *ps3_smp_topo(platform_t); #endif static void ps3_reset(platform_t); @@ -87,6 +88,7 @@ static platform_method_t ps3_methods[] = { PLATFORMMETHOD(platform_smp_next_cpu, ps3_smp_next_cpu), PLATFORMMETHOD(platform_smp_get_bsp, ps3_smp_get_bsp), PLATFORMMETHOD(platform_smp_start_cpu, ps3_smp_start_cpu), + PLATFORMMETHOD(platform_smp_probe_threads, ps3_smp_probe_threads), PLATFORMMETHOD(platform_smp_topo, ps3_smp_topo), #endif @@ -243,11 +245,16 @@ ps3_smp_start_cpu(platform_t plat, struct pcpu *pc) return ((pc->pc_awake) ? 0 : EBUSY); } -static struct cpu_group * -ps3_smp_topo(platform_t plat) +static void +ps3_smp_probe_threads(platform_t plat) { mp_ncores = 1; smp_threads_per_core = 2; +} + +static struct cpu_group * +ps3_smp_topo(platform_t plat) +{ return (smp_topo_1level(CG_SHARE_L1, 2, CG_FLAG_SMT)); } #endif Modified: stable/12/sys/powerpc/pseries/platform_chrp.c ============================================================================== --- stable/12/sys/powerpc/pseries/platform_chrp.c Fri Sep 11 13:28:37 2020 (r365631) +++ stable/12/sys/powerpc/pseries/platform_chrp.c Fri Sep 11 14:00:10 2020 (r365632) @@ -78,6 +78,7 @@ static void chrp_smp_ap_init(platform_t); static int chrp_cpuref_init(void); #ifdef SMP static int chrp_smp_start_cpu(platform_t, struct pcpu *cpu); +static void chrp_smp_probe_threads(platform_t plat); static struct cpu_group *chrp_smp_topo(platform_t plat); #endif static void chrp_reset(platform_t); @@ -103,6 +104,7 @@ static platform_method_t chrp_methods[] = { PLATFORMMETHOD(platform_smp_get_bsp, chrp_smp_get_bsp), #ifdef SMP PLATFORMMETHOD(platform_smp_start_cpu, chrp_smp_start_cpu), + PLATFORMMETHOD(platform_smp_probe_threads, chrp_smp_probe_threads), PLATFORMMETHOD(platform_smp_topo, chrp_smp_topo), #endif @@ -499,13 +501,13 @@ chrp_smp_start_cpu(platform_t plat, struct pcpu *pc) return ((pc->pc_awake) ? 0 : EBUSY); } -static struct cpu_group * -chrp_smp_topo(platform_t plat) +static void +chrp_smp_probe_threads(platform_t plat) { struct pcpu *pc, *last_pc; - int i, ncores, ncpus; + int i, ncores; - ncores = ncpus = 0; + ncores = 0; last_pc = NULL; for (i = 0; i <= mp_maxid; i++) { pc = pcpu_find(i); @@ -514,23 +516,29 @@ chrp_smp_topo(platform_t plat) if (last_pc == NULL || pc->pc_hwref != last_pc->pc_hwref) ncores++; last_pc = pc; - ncpus++; } mp_ncores = ncores; + if (mp_ncpus % ncores == 0) + smp_threads_per_core = mp_ncpus / ncores; +} - if (ncpus % ncores != 0) { +static struct cpu_group * +chrp_smp_topo(platform_t plat) +{ + + if (mp_ncpus % mp_ncores != 0) { printf("WARNING: Irregular SMP topology. Performance may be " - "suboptimal (%d CPUS, %d cores)\n", ncpus, ncores); + "suboptimal (%d CPUS, %d cores)\n", mp_ncpus, mp_ncores); return (smp_topo_none()); } /* Don't do anything fancier for non-threaded SMP */ - if (ncpus == ncores) + if (mp_ncpus == mp_ncores) return (smp_topo_none()); - smp_threads_per_core = ncpus / ncores; - return (smp_topo_1level(CG_SHARE_L1, ncpus / ncores, CG_FLAG_SMT)); + return (smp_topo_1level(CG_SHARE_L1, smp_threads_per_core, + CG_FLAG_SMT)); } #endif From owner-svn-src-all@freebsd.org Fri Sep 11 14:18:48 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2EE283DBCF9; Fri, 11 Sep 2020 14:18:48 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BnyY40SH5z4PWL; Fri, 11 Sep 2020 14:18:48 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E86FB25222; Fri, 11 Sep 2020 14:18:47 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08BEIl6e091849; Fri, 11 Sep 2020 14:18:47 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08BEIlRR091848; Fri, 11 Sep 2020 14:18:47 GMT (envelope-from bz@FreeBSD.org) Message-Id: <202009111418.08BEIlRR091848@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Fri, 11 Sep 2020 14:18:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365633 - head/sys/dev/iwm X-SVN-Group: head X-SVN-Commit-Author: bz X-SVN-Commit-Paths: head/sys/dev/iwm X-SVN-Commit-Revision: 365633 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.33 Precedence: list List-Id: "SVN commit messages 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, 11 Sep 2020 14:18:48 -0000 Author: bz Date: Fri Sep 11 14:18:47 2020 New Revision: 365633 URL: https://svnweb.freebsd.org/changeset/base/365633 Log: iwm: fix regression from r365419 (ieee80211_media_change()) In r365419 ieee80211_media_change() callers were updated to not longer act on the obselete ENETRESET return code. While in the old days iwm has done a stop/init cycle in these cases, this was not executed since r193340. As a consequence simplify iwm code as well by passing ieee80211_media_change() right to ieee80211_vap_attach() as there is no more need for a local implementation. Reported by: Tomoaki AOKI (junchoon dec.sakura.ne.jp) Tested by: Tomoaki AOKI (junchoon dec.sakura.ne.jp) MFC after: 3 days X-MFC: fix is already in stable/12 PR: 248955 Modified: head/sys/dev/iwm/if_iwm.c Modified: head/sys/dev/iwm/if_iwm.c ============================================================================== --- head/sys/dev/iwm/if_iwm.c Fri Sep 11 14:00:10 2020 (r365632) +++ head/sys/dev/iwm/if_iwm.c Fri Sep 11 14:18:47 2020 (r365633) @@ -354,7 +354,6 @@ static struct ieee80211_node * static uint8_t iwm_rate_from_ucode_rate(uint32_t); static int iwm_rate2ridx(struct iwm_softc *, uint8_t); static void iwm_setrates(struct iwm_softc *, struct iwm_node *, int); -static int iwm_media_change(struct ifnet *); static int iwm_newstate(struct ieee80211vap *, enum ieee80211_state, int); static void iwm_endscan_cb(void *, int); static int iwm_send_bt_init_conf(struct iwm_softc *); @@ -4417,27 +4416,6 @@ iwm_setrates(struct iwm_softc *sc, struct iwm_node *in } } -static int -iwm_media_change(struct ifnet *ifp) -{ - struct ieee80211vap *vap = ifp->if_softc; - struct ieee80211com *ic = vap->iv_ic; - struct iwm_softc *sc = ic->ic_softc; - int error; - - error = ieee80211_media_change(ifp); - if (error != 0) - return (error); - - IWM_LOCK(sc); - if (ic->ic_nrunning > 0) { - iwm_stop(sc); - iwm_init(sc); - } - IWM_UNLOCK(sc); - return (0); -} - static void iwm_bring_down_firmware(struct iwm_softc *sc, struct ieee80211vap *vap) { @@ -6432,8 +6410,8 @@ iwm_vap_create(struct ieee80211com *ic, const char nam ieee80211_ratectl_init(vap); /* Complete setup. */ - ieee80211_vap_attach(vap, iwm_media_change, ieee80211_media_status, - mac); + ieee80211_vap_attach(vap, ieee80211_media_change, + ieee80211_media_status, mac); ic->ic_opmode = opmode; return vap; From owner-svn-src-all@freebsd.org Fri Sep 11 15:30:49 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 20FF23DE3AD; Fri, 11 Sep 2020 15:30:49 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bp08905dlz4V1p; Fri, 11 Sep 2020 15:30:49 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DAE93260FF; Fri, 11 Sep 2020 15:30:48 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08BFUmYq035913; Fri, 11 Sep 2020 15:30:48 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08BFUliP035907; Fri, 11 Sep 2020 15:30:47 GMT (envelope-from mav@FreeBSD.org) Message-Id: <202009111530.08BFUliP035907@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 11 Sep 2020 15:30:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r365634 - in releng/12.2/sys/powerpc: include powernv powerpc ps3 pseries X-SVN-Group: releng X-SVN-Commit-Author: mav X-SVN-Commit-Paths: in releng/12.2/sys/powerpc: include powernv powerpc ps3 pseries X-SVN-Commit-Revision: 365634 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.33 Precedence: list List-Id: "SVN commit messages 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, 11 Sep 2020 15:30:49 -0000 Author: mav Date: Fri Sep 11 15:30:47 2020 New Revision: 365634 URL: https://svnweb.freebsd.org/changeset/base/365634 Log: MFC r342852 (by cem): powerpc: Fix regression introduced in r342771 In r342771, I introduced a regression in Power by abusing the platform smp_topo() method as a shortcut for providing the MI information needed for the stated sysctls. The smp_topo() method was already called later by sched_ule (under the name cpu_topo()), and initializes a static array of scheduler topology information. I had skimmed the smp_topo_foo() functions and assumed they were idempotent; empirically, they are not (or at least, detect re-initialization and panic). Do the cleaner thing I should have done in the first place and add a platform method specifically for core- and thread-count probing. PR: 249250 Approved by: re (gjb) Modified: releng/12.2/sys/powerpc/include/platform.h releng/12.2/sys/powerpc/powernv/platform_powernv.c releng/12.2/sys/powerpc/powerpc/mp_machdep.c releng/12.2/sys/powerpc/powerpc/platform.c releng/12.2/sys/powerpc/powerpc/platform_if.m releng/12.2/sys/powerpc/ps3/platform_ps3.c releng/12.2/sys/powerpc/pseries/platform_chrp.c Directory Properties: releng/12.2/ (props changed) Modified: releng/12.2/sys/powerpc/include/platform.h ============================================================================== --- releng/12.2/sys/powerpc/include/platform.h Fri Sep 11 14:18:47 2020 (r365633) +++ releng/12.2/sys/powerpc/include/platform.h Fri Sep 11 15:30:47 2020 (r365634) @@ -58,6 +58,7 @@ int platform_smp_get_bsp(struct cpuref *); int platform_smp_start_cpu(struct pcpu *); void platform_smp_timebase_sync(u_long tb, int ap); void platform_smp_ap_init(void); +void platform_smp_probe_threads(void); const char *installed_platform(void); void platform_probe_and_attach(void); Modified: releng/12.2/sys/powerpc/powernv/platform_powernv.c ============================================================================== --- releng/12.2/sys/powerpc/powernv/platform_powernv.c Fri Sep 11 14:18:47 2020 (r365633) +++ releng/12.2/sys/powerpc/powernv/platform_powernv.c Fri Sep 11 15:30:47 2020 (r365634) @@ -71,6 +71,7 @@ static int powernv_smp_get_bsp(platform_t, struct cpur static void powernv_smp_ap_init(platform_t); #ifdef SMP static int powernv_smp_start_cpu(platform_t, struct pcpu *cpu); +static void powernv_smp_probe_threads(platform_t); static struct cpu_group *powernv_smp_topo(platform_t plat); #endif static void powernv_reset(platform_t); @@ -89,6 +90,7 @@ static platform_method_t powernv_methods[] = { PLATFORMMETHOD(platform_smp_get_bsp, powernv_smp_get_bsp), #ifdef SMP PLATFORMMETHOD(platform_smp_start_cpu, powernv_smp_start_cpu), + PLATFORMMETHOD(platform_smp_probe_threads, powernv_smp_probe_threads), PLATFORMMETHOD(platform_smp_topo, powernv_smp_topo), #endif @@ -403,8 +405,8 @@ powernv_smp_start_cpu(platform_t plat, struct pcpu *pc return (0); } -static struct cpu_group * -powernv_smp_topo(platform_t plat) +static void +powernv_smp_probe_threads(platform_t plat) { char buf[8]; phandle_t cpu, dev, root; @@ -436,21 +438,26 @@ powernv_smp_topo(platform_t plat) } smp_threads_per_core = nthreads; + if (mp_ncpus % nthreads == 0) + mp_ncores = mp_ncpus / nthreads; +} - if (mp_ncpus % nthreads != 0) { +static struct cpu_group * +powernv_smp_topo(platform_t plat) +{ + if (mp_ncpus % smp_threads_per_core != 0) { printf("WARNING: Irregular SMP topology. Performance may be " "suboptimal (%d threads, %d on first core)\n", - mp_ncpus, nthreads); + mp_ncpus, smp_threads_per_core); return (smp_topo_none()); } - mp_ncores = mp_ncpus / nthreads; - /* Don't do anything fancier for non-threaded SMP */ - if (nthreads == 1) + if (smp_threads_per_core == 1) return (smp_topo_none()); - return (smp_topo_1level(CG_SHARE_L1, nthreads, CG_FLAG_SMT)); + return (smp_topo_1level(CG_SHARE_L1, smp_threads_per_core, + CG_FLAG_SMT)); } #endif Modified: releng/12.2/sys/powerpc/powerpc/mp_machdep.c ============================================================================== --- releng/12.2/sys/powerpc/powerpc/mp_machdep.c Fri Sep 11 14:18:47 2020 (r365633) +++ releng/12.2/sys/powerpc/powerpc/mp_machdep.c Fri Sep 11 15:30:47 2020 (r365634) @@ -182,8 +182,7 @@ next: } #ifdef SMP - /* Probe mp_ncores and smp_threads_per_core as a side effect. */ - (void)cpu_topo(); + platform_smp_probe_threads(); #endif } Modified: releng/12.2/sys/powerpc/powerpc/platform.c ============================================================================== --- releng/12.2/sys/powerpc/powerpc/platform.c Fri Sep 11 14:18:47 2020 (r365633) +++ releng/12.2/sys/powerpc/powerpc/platform.c Fri Sep 11 15:30:47 2020 (r365634) @@ -242,6 +242,12 @@ platform_smp_ap_init() PLATFORM_SMP_AP_INIT(plat_obj); } +void +platform_smp_probe_threads(void) +{ + PLATFORM_SMP_PROBE_THREADS(plat_obj); +} + #ifdef SMP struct cpu_group * cpu_topo(void) Modified: releng/12.2/sys/powerpc/powerpc/platform_if.m ============================================================================== --- releng/12.2/sys/powerpc/powerpc/platform_if.m Fri Sep 11 14:18:47 2020 (r365633) +++ releng/12.2/sys/powerpc/powerpc/platform_if.m Fri Sep 11 15:30:47 2020 (r365634) @@ -84,6 +84,10 @@ CODE { { return; } + static void platform_null_smp_probe_threads(void) + { + return; + } }; /** @@ -195,6 +199,13 @@ METHOD int smp_start_cpu { METHOD void smp_ap_init { platform_t _plat; } DEFAULT platform_null_smp_ap_init; + +/** + * @brief Probe mp_ncores and smp_threads_per_core for early MI code + */ +METHOD void smp_probe_threads { + platform_t _plat; +} DEFAULT platform_null_smp_probe_threads; /** * @brief Return SMP topology Modified: releng/12.2/sys/powerpc/ps3/platform_ps3.c ============================================================================== --- releng/12.2/sys/powerpc/ps3/platform_ps3.c Fri Sep 11 14:18:47 2020 (r365633) +++ releng/12.2/sys/powerpc/ps3/platform_ps3.c Fri Sep 11 15:30:47 2020 (r365634) @@ -70,6 +70,7 @@ static int ps3_smp_first_cpu(platform_t, struct cpuref static int ps3_smp_next_cpu(platform_t, struct cpuref *cpuref); static int ps3_smp_get_bsp(platform_t, struct cpuref *cpuref); static int ps3_smp_start_cpu(platform_t, struct pcpu *cpu); +static void ps3_smp_probe_threads(platform_t); static struct cpu_group *ps3_smp_topo(platform_t); #endif static void ps3_reset(platform_t); @@ -87,6 +88,7 @@ static platform_method_t ps3_methods[] = { PLATFORMMETHOD(platform_smp_next_cpu, ps3_smp_next_cpu), PLATFORMMETHOD(platform_smp_get_bsp, ps3_smp_get_bsp), PLATFORMMETHOD(platform_smp_start_cpu, ps3_smp_start_cpu), + PLATFORMMETHOD(platform_smp_probe_threads, ps3_smp_probe_threads), PLATFORMMETHOD(platform_smp_topo, ps3_smp_topo), #endif @@ -243,11 +245,16 @@ ps3_smp_start_cpu(platform_t plat, struct pcpu *pc) return ((pc->pc_awake) ? 0 : EBUSY); } -static struct cpu_group * -ps3_smp_topo(platform_t plat) +static void +ps3_smp_probe_threads(platform_t plat) { mp_ncores = 1; smp_threads_per_core = 2; +} + +static struct cpu_group * +ps3_smp_topo(platform_t plat) +{ return (smp_topo_1level(CG_SHARE_L1, 2, CG_FLAG_SMT)); } #endif Modified: releng/12.2/sys/powerpc/pseries/platform_chrp.c ============================================================================== --- releng/12.2/sys/powerpc/pseries/platform_chrp.c Fri Sep 11 14:18:47 2020 (r365633) +++ releng/12.2/sys/powerpc/pseries/platform_chrp.c Fri Sep 11 15:30:47 2020 (r365634) @@ -78,6 +78,7 @@ static void chrp_smp_ap_init(platform_t); static int chrp_cpuref_init(void); #ifdef SMP static int chrp_smp_start_cpu(platform_t, struct pcpu *cpu); +static void chrp_smp_probe_threads(platform_t plat); static struct cpu_group *chrp_smp_topo(platform_t plat); #endif static void chrp_reset(platform_t); @@ -103,6 +104,7 @@ static platform_method_t chrp_methods[] = { PLATFORMMETHOD(platform_smp_get_bsp, chrp_smp_get_bsp), #ifdef SMP PLATFORMMETHOD(platform_smp_start_cpu, chrp_smp_start_cpu), + PLATFORMMETHOD(platform_smp_probe_threads, chrp_smp_probe_threads), PLATFORMMETHOD(platform_smp_topo, chrp_smp_topo), #endif @@ -499,13 +501,13 @@ chrp_smp_start_cpu(platform_t plat, struct pcpu *pc) return ((pc->pc_awake) ? 0 : EBUSY); } -static struct cpu_group * -chrp_smp_topo(platform_t plat) +static void +chrp_smp_probe_threads(platform_t plat) { struct pcpu *pc, *last_pc; - int i, ncores, ncpus; + int i, ncores; - ncores = ncpus = 0; + ncores = 0; last_pc = NULL; for (i = 0; i <= mp_maxid; i++) { pc = pcpu_find(i); @@ -514,23 +516,29 @@ chrp_smp_topo(platform_t plat) if (last_pc == NULL || pc->pc_hwref != last_pc->pc_hwref) ncores++; last_pc = pc; - ncpus++; } mp_ncores = ncores; + if (mp_ncpus % ncores == 0) + smp_threads_per_core = mp_ncpus / ncores; +} - if (ncpus % ncores != 0) { +static struct cpu_group * +chrp_smp_topo(platform_t plat) +{ + + if (mp_ncpus % mp_ncores != 0) { printf("WARNING: Irregular SMP topology. Performance may be " - "suboptimal (%d CPUS, %d cores)\n", ncpus, ncores); + "suboptimal (%d CPUS, %d cores)\n", mp_ncpus, mp_ncores); return (smp_topo_none()); } /* Don't do anything fancier for non-threaded SMP */ - if (ncpus == ncores) + if (mp_ncpus == mp_ncores) return (smp_topo_none()); - smp_threads_per_core = ncpus / ncores; - return (smp_topo_1level(CG_SHARE_L1, ncpus / ncores, CG_FLAG_SMT)); + return (smp_topo_1level(CG_SHARE_L1, smp_threads_per_core, + CG_FLAG_SMT)); } #endif From owner-svn-src-all@freebsd.org Fri Sep 11 16:12:49 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 155EA3DF3C2; Fri, 11 Sep 2020 16:12:49 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bp14c6sDkz4XNk; Fri, 11 Sep 2020 16:12: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 CE982266B5; Fri, 11 Sep 2020 16:12: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 08BGCm7t066302; Fri, 11 Sep 2020 16:12:48 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08BGCm3j066301; Fri, 11 Sep 2020 16:12:48 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202009111612.08BGCm3j066301@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 11 Sep 2020 16:12:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r365636 - vendor/libarchive/dist/test_utils X-SVN-Group: vendor X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: vendor/libarchive/dist/test_utils X-SVN-Commit-Revision: 365636 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.33 Precedence: list List-Id: "SVN commit messages 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, 11 Sep 2020 16:12:49 -0000 Author: kevans Date: Fri Sep 11 16:12:48 2020 New Revision: 365636 URL: https://svnweb.freebsd.org/changeset/base/365636 Log: libarchive: import fix for WARNS=6 builds in testing bits Two more cases of explicitly marking globals for internal linkage where they need not be shared. Committed upstream as of a38e62314a1f. Modified: vendor/libarchive/dist/test_utils/test_main.c Modified: vendor/libarchive/dist/test_utils/test_main.c ============================================================================== --- vendor/libarchive/dist/test_utils/test_main.c Fri Sep 11 16:03:09 2020 (r365635) +++ vendor/libarchive/dist/test_utils/test_main.c Fri Sep 11 16:12:48 2020 (r365636) @@ -475,7 +475,7 @@ static struct line { int count; int skip; } failed_lines[10000]; -const char *failed_filename; +static const char *failed_filename; /* Count this failure, setup up log destination and handle initial report. */ static void __LA_PRINTFLIKE(3, 4) @@ -3458,7 +3458,7 @@ assertion_entry_compare_acls(const char *file, int lin /* Use "list.h" to create a list of all tests (functions and names). */ #undef DEFINE_TEST #define DEFINE_TEST(n) { n, #n, 0 }, -struct test_list_t tests[] = { +static struct test_list_t tests[] = { #include "list.h" }; From owner-svn-src-all@freebsd.org Fri Sep 11 16:13:46 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8178D3DF76F; Fri, 11 Sep 2020 16:13:46 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bp15k2s69z4Xk2; Fri, 11 Sep 2020 16:13:46 +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 4562226A8E; Fri, 11 Sep 2020 16:13:46 +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 08BGDk1I066397; Fri, 11 Sep 2020 16:13:46 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08BGDk0a066396; Fri, 11 Sep 2020 16:13:46 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202009111613.08BGDk0a066396@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 11 Sep 2020 16:13:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365637 - head/contrib/libarchive/test_utils X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/contrib/libarchive/test_utils X-SVN-Commit-Revision: 365637 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.33 Precedence: list List-Id: "SVN commit messages 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, 11 Sep 2020 16:13:46 -0000 Author: kevans Date: Fri Sep 11 16:13:45 2020 New Revision: 365637 URL: https://svnweb.freebsd.org/changeset/base/365637 Log: MFV r365636: libarchive: import fix for WARNS=6 builds in testing bits Two more cases of explicitly marking globals for internal linkage where they need not be shared. Committed upstream as of a38e62314a1f. MFC after: 1 week Modified: head/contrib/libarchive/test_utils/test_main.c Directory Properties: head/contrib/libarchive/ (props changed) Modified: head/contrib/libarchive/test_utils/test_main.c ============================================================================== --- head/contrib/libarchive/test_utils/test_main.c Fri Sep 11 16:12:48 2020 (r365636) +++ head/contrib/libarchive/test_utils/test_main.c Fri Sep 11 16:13:45 2020 (r365637) @@ -475,7 +475,7 @@ static struct line { int count; int skip; } failed_lines[10000]; -const char *failed_filename; +static const char *failed_filename; /* Count this failure, setup up log destination and handle initial report. */ static void __LA_PRINTFLIKE(3, 4) @@ -3458,7 +3458,7 @@ assertion_entry_compare_acls(const char *file, int lin /* Use "list.h" to create a list of all tests (functions and names). */ #undef DEFINE_TEST #define DEFINE_TEST(n) { n, #n, 0 }, -struct test_list_t tests[] = { +static struct test_list_t tests[] = { #include "list.h" }; From owner-svn-src-all@freebsd.org Fri Sep 11 16:56:38 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 637293E03F8; Fri, 11 Sep 2020 16:56:38 +0000 (UTC) (envelope-from ruslanngaripov@gmail.com) Received: from mail-lj1-x243.google.com (mail-lj1-x243.google.com [IPv6:2a00:1450:4864:20::243]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bp2394b2Sz4ZQc; Fri, 11 Sep 2020 16:56:37 +0000 (UTC) (envelope-from ruslanngaripov@gmail.com) Received: by mail-lj1-x243.google.com with SMTP id k25so13033144ljk.0; Fri, 11 Sep 2020 09:56:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=dr3Q30YDq5H5NwV/bsrqUIuQ7lkkcnsEeXgTZyCKYx4=; b=EsyK9WCKJqt2IeucgaLVQjr1SO/v7K+1uzwOfouNr7puiJfC8DPggTccpPEfYnItZT mkiqaCaaScfETrkIvOe9GzdpXrg6aAg4tm1VPa9vD4hdKZ//U+gOvuZ/xx5nbRLH1do2 GrmkLo2ygbqv9pQAJQbvbDL9aHvmwex3zpY4nuND5mFE2ImahUK/Pm2dGngwM+xFWxyD enrz4mLQTOA03REi0adjieULEdV/H9VPuWVLe8FmUdd07GhX7OcfrBF/YuD05SmrGLYD CSBBA0qTh8RlgdNn7fimpdpIROwZhOIfz4XkPSuPpVrfmTe+dKnAIC5Tw0jcdUvqvH+c gXdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=dr3Q30YDq5H5NwV/bsrqUIuQ7lkkcnsEeXgTZyCKYx4=; b=Kc/XF6mHp0vY9OXsuwVgBoALbKuQY93cEKSCV9WF+QfIsxXPU/GICxtu6FZxCZwjj5 IgtSAKY96XyegV3kby3QA+jZzPxOLLGNyPeaMld/b0nMvtZNutCMnlQb6OkAJrgYT392 HijvMeoNzMmR/2BbJC4bAIqyzzVAed5/hAnZTfQOGNVCgz4JlNoay5ZxkvSNCYTYE8aj IUiWMdGTlv7rvve4rcb1NqQDZhmgoLR7cl84RU7R1m4OkUvX1b2WlYglkqjUXzsBESLn qRMgGkxF76DZqvsyZ9OV/OsJfk5ptYavGyvuorgSbfHWtYie0cv3zsGygbbdqLOqVqYb RcgQ== X-Gm-Message-State: AOAM53066MF+TWAnRSjHNqPnUKYksD8hBg5zhJarMipKic8NJRolYFof L49RndqPy5/vZWCWDsM8DwDtFt0D3Yo= X-Google-Smtp-Source: ABdhPJwAZNRJvh3ymEIxHNmYaynzdv3ex1M5GysiIcjP611mtNxT3Qgr6v+8TqdxxVwd18saRvfnXQ== X-Received: by 2002:a2e:8146:: with SMTP id t6mr1015014ljg.259.1599843395527; Fri, 11 Sep 2020 09:56:35 -0700 (PDT) Received: from [192.168.1.6] ([188.226.57.142]) by smtp.gmail.com with ESMTPSA id q7sm508208lfr.16.2020.09.11.09.56.34 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 11 Sep 2020 09:56:35 -0700 (PDT) Subject: Re: svn commit: r364891 - in head: . release release/scripts To: Glen Barber Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202008272119.07RLJGgb043888@repo.freebsd.org> <174719d0148.27b9.e2363f32305322128423a5fd7014e4c4@gmail.com> <20200909135114.GC61041@FreeBSD.org> <1747c711988.27b9.e2363f32305322128423a5fd7014e4c4@gmail.com> <20200911125525.GC61041@FreeBSD.org> From: Ruslan Garipov Message-ID: <6d1dd875-c0d6-0006-d829-905534728589@gmail.com> Date: Fri, 11 Sep 2020 21:56:31 +0500 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.2.1 MIME-Version: 1.0 In-Reply-To: <20200911125525.GC61041@FreeBSD.org> Content-Type: text/plain; charset=windows-1252 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4Bp2394b2Sz4ZQc X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=EsyK9WCK; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of ruslanngaripov@gmail.com designates 2a00:1450:4864:20::243 as permitted sender) smtp.mailfrom=ruslanngaripov@gmail.com X-Spamd-Result: default: False [-3.36 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36:c]; FREEMAIL_FROM(0.00)[gmail.com]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; NEURAL_HAM_SHORT(-0.42)[-0.417]; RECEIVED_SPAMHAUS_PBL(0.00)[188.226.57.142:received]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; MID_RHS_MATCH_FROM(0.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.95)[-0.955]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-0.99)[-0.992]; MIME_GOOD(-0.10)[text/plain]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::243:from]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[svn-src-head,svn-src-all] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 11 Sep 2020 16:56:38 -0000 On 9/11/2020 5:55 PM, Glen Barber wrote: > On Fri, Sep 11, 2020 at 02:13:41PM +0500, Ruslan Garipov wrote: >> On September 9, 2020 6:51:18 PM Glen Barber wrote: >> >>> On Wed, Sep 09, 2020 at 11:45:49AM +0500, Ruslan Garipov wrote: >>>> On August 28, 2020 2:19:33 AM Glen Barber wrote: >>>> >>>>> Author: gjb >>>>> Date: Thu Aug 27 21:19:16 2020 >>>>> New Revision: 364891 >>>>> URL: https://svnweb.freebsd.org/changeset/base/364891 >>>>> >>>>> Log: >>>>> Merge the projects/release-git branch to head. >>>>> This allows building 13.x from Git instead of Subversion. >>>> I'm sorry for the late response (and for the bad first one I made on this >>>> commit recently via Gmail web client). >>>> >>>> My build machine is completely offline. I provide it with fresh snapshots >>>> of the source and ports tree manually -- via tarballs which I'm pulling on >>>> a FreeBSD machine having Internet connection. Therefore, neither >>>> "/scratch", nor the chrooted environment for me don't require Internet >>>> access (I fetch distfiles for offline usage too). >>>> >>>> Can we somehow remove that requirement for the devel/git port? For >>>> example, if one has set all three {SRC,PORTS,DOC}_UPDATE_SKIP variables, >>>> then release/release.sh doesn't require devel/git to exist on the host. >>>> >>>> I really don't need git on my build machine (and don't need it for >>>> building). >>>> >>> >>> Can you verify if the attached patch works for your use case? You will >>> need to set NOGIT=1 in your release.conf. >> Partially. It doesn't require devel/git to create the initial build >> environment, but it does before beginning cross-build in the >> extra_chroot_setup(). >> >> You check there does the NOGIT have zero length. If NOGIT isn't empty, then >> release.sh will ($(which git) returns nothing for me) try to install >> devel/git port or package again. And NOGIT isn't empty because in this >> function my release.conf was already sourced. So I had removed "not" >> (``!'') on line #278, ignoring NOGIT checking, and cross-build started. >> > > Doh! Yeah, that was a mistake - sorry about that. > > So as far as you are concerned, with the addition of removing the '!', > it works as you expect? Yes, it does. Should we also "fix" env_setup()? Which also checks NOGIT for zero length. What if one set NOGIT up outside release.conf as NOGIT=1 (I don't do that). Does he/she end up with "The devel/git is required"? > >> It failed eventually on modifications made by r365398, but that's another >> story. >> >> Thanks again, Glen! >> > > Thank you for testing (and finding a silly bug)! > > Glen > From owner-svn-src-all@freebsd.org Fri Sep 11 17:00:39 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B19D33E0644; Fri, 11 Sep 2020 17:00:39 +0000 (UTC) (envelope-from gjb@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bp27q4JYdz4ZnF; Fri, 11 Sep 2020 17:00:39 +0000 (UTC) (envelope-from gjb@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1599843639; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=eLoQyO41kaKk3+NdXQ1MOCkYeTyfolhFPhHqmXg2nYo=; b=dZtxVBy4ZAXczKIXj/7DRwSX5JHlWUckG925yHIgCdBGmTUnSpHr3rqCZEfVNwo7hL5Wfh jsuaBcINC8lz3GPz5CH3yXv+LcecSjwj6ZhARexVtmBhRaXe2S+q1PjiEMNHjuCQIiq8XF A8Udfc0FpsaAZyTwCYmmjst3EhARI7QxeFVTHI3CPX4OkWnsCVgJAzYXU8f2D2j+Eb0ABo 4oSpm+1KbNsqVtG/1ibMtG3hOzLqp+S0FysM+AxFKl2fFTkKIoGAz+TcDP+0HG4oQigC0E aTGa/08+t83wH5CYQRgO/xCJdivnEMJl8BY6HNAsAo3+DDsCtJhchTQkAbCi1g== Received: from FreeBSD.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by freefall.freebsd.org (Postfix) with ESMTPS id 266C92115; Fri, 11 Sep 2020 17:00:39 +0000 (UTC) (envelope-from gjb@freebsd.org) Date: Fri, 11 Sep 2020 17:00:36 +0000 From: Glen Barber To: Ruslan Garipov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r364891 - in head: . release release/scripts Message-ID: <20200911170036.GD61041@FreeBSD.org> References: <202008272119.07RLJGgb043888@repo.freebsd.org> <174719d0148.27b9.e2363f32305322128423a5fd7014e4c4@gmail.com> <20200909135114.GC61041@FreeBSD.org> <1747c711988.27b9.e2363f32305322128423a5fd7014e4c4@gmail.com> <20200911125525.GC61041@FreeBSD.org> <6d1dd875-c0d6-0006-d829-905534728589@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="JMkwMgK6e0iG7uLb" Content-Disposition: inline In-Reply-To: <6d1dd875-c0d6-0006-d829-905534728589@gmail.com> ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1599843639; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=eLoQyO41kaKk3+NdXQ1MOCkYeTyfolhFPhHqmXg2nYo=; b=wQrV/bkAGdePNM5c30ZQJDkA8sUYVYeo/othR+1JnD5MlY71a6cvu6QP+qQKzegcfwXEIs 38Ka7iF88SAFzI06rOLnNQKUy0/z7Fj/CweKDXal37+qY1RzmWgqkttRC216+oI6Qk+amC hckoED+ihWmD9rMrnFhcZBmBB7GagO0G9p6e5dPKcJ0BJMHaN7fH0ocL72u0w6ai+4I1UF JakIhjW9vBJ7K/6KUZNmt2/dbv/AoHdQfKy1ZUKytcBpmoWmyOs2EoCsUZQhNd2vAiw8hM TyEgy/CZ0C8475mkjR9MRKHjboCB03Eqqe3hiTOe049Fd60g0+6Hd3PapiHLwg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1599843639; a=rsa-sha256; cv=none; b=cvZ1FDTzrhLanm1VyV0staXY5emiAG0CDMmhejGRCdDJlESfSPQcffs7xrhVaBW7t2Nz4F DkUU0ZdaFMkIOlLyzKWYtWYUXNa89gMwxEMPxaGt06DngKsK2NEBxRBJSHrNeI1oxq3FUa 5hv3/nNmdagiZKw88xRdGY3cfJlfC6GocePFI8vjysTwy0fF5e16kanDZQ4HmZ4LnKTKJS 5sSDWWe3Hkoq3AVVgHj8W/ZMd0OwwQeWjTIvgfTC9rLtmsRcZR4kbu7yUa/Jy4Iv6/oh2a u+IOAmCXxqSiybQu2O4xd03qVQp0dF8bDvkIl3QlRC1KEiUIciEKCa1SzLnF+A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 11 Sep 2020 17:00:39 -0000 --JMkwMgK6e0iG7uLb Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Sep 11, 2020 at 09:56:31PM +0500, Ruslan Garipov wrote: > On 9/11/2020 5:55 PM, Glen Barber wrote: > > So as far as you are concerned, with the addition of removing the '!', > > it works as you expect? > Yes, it does. >=20 > Should we also "fix" env_setup()? Which also checks NOGIT for zero > length. What if one set NOGIT up outside release.conf as NOGIT=3D1 (I > don't do that). Does he/she end up with "The devel/git is required"? Yes, you are correct. I made the same mistake twice... I will commit it shortly with both things fixed. Glen --JMkwMgK6e0iG7uLb Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEjRJAPC5sqwhs9k2jAxRYpUeP4pMFAl9brTQACgkQAxRYpUeP 4pPz6g/8CaJZI/60eoQPBMbcDca5lPTIXUz7DC1LzC7XOvRz3wD7kthur49cvBUP oOq6Qg4ziFo45hRVus5Ckrocqrn6Oj6HP51W9+Yp8QKWjeK8IofMTduOY8KzzzkU AkdXQ7VZhig9b8Yr2v9PtHU1L09QpDKBkIgfXYU2Wn/8ZWhblN77b0fzWHwTPg25 m4kE19odRrgxp5WS4qfaIzNLbE04N5l0Iof87xefpX+M17BiGlk0CEV9z+ZzK9oL Ta3nsNRfXpHW1bt85x6XEIS+mDmomZGJkYQo2NlVJTnp1HbaDs+LFOt6SDpJ3erN J2I5KZQ/7xfO62au1hWsZ8DfpVXwKcWPbKwqENXC9WD5Rm+WNS+/wrHzl+A3viQu iKE9kXFoExqVsHNwlo4J1ckfDc1OqjPokB0Uc5PbO8KcDdyQrQHkkT/9+xlO1oxE 12CykEl2KzxaRPy6EFyh2mC/SJ+k2h58BmnzMpqN3WnxS1Bv/TTfoLr5fFzyOx8f VFRzyuFzhanFh7N1WUWpPLxr8wh9K7F3x7A4RB576ZYr3SR9cjH92SEzq9xGi5et DGnj/AowFC0/U7KQ5QbEqyhvKShkSj0wVdhPXJHH0zWjW3QDY22OCCPu1gLwFD7+ g1Em6Ga1dqTJLm26Tgu0Wdg0TU3zzI/f7C3hclEsvu7QDCUlBGE= =/NnJ -----END PGP SIGNATURE----- --JMkwMgK6e0iG7uLb-- From owner-svn-src-all@freebsd.org Fri Sep 11 17:04:10 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 77F343E0BA2; Fri, 11 Sep 2020 17:04:10 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bp2Ct2fN0z4bT7; Fri, 11 Sep 2020 17:04:10 +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 3FC9A2712C; Fri, 11 Sep 2020 17:04: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 08BH4AYc096685; Fri, 11 Sep 2020 17:04:10 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08BH499K096684; Fri, 11 Sep 2020 17:04:09 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <202009111704.08BH499K096684@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Fri, 11 Sep 2020 17:04:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365638 - head/release X-SVN-Group: head X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: head/release X-SVN-Commit-Revision: 365638 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.33 Precedence: list List-Id: "SVN commit messages 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, 11 Sep 2020 17:04:10 -0000 Author: gjb Date: Fri Sep 11 17:04:09 2020 New Revision: 365638 URL: https://svnweb.freebsd.org/changeset/base/365638 Log: Add a NOGIT option to avoid explicitly requiring devel/git if the sources are obtained through a different mechanism. Reported and tested by: Ruslan Garipov Sponsored by: Rubicon Communications, LLC (netgate.com) Modified: head/release/release.conf.sample head/release/release.sh Modified: head/release/release.conf.sample ============================================================================== --- head/release/release.conf.sample Fri Sep 11 16:13:45 2020 (r365637) +++ head/release/release.conf.sample Fri Sep 11 17:04:09 2020 (r365638) @@ -12,6 +12,8 @@ ## Set the directory within which the release will be built. CHROOTDIR="/scratch" +## Do not explicitly require the devel/git port to be installed. +#NOGIT=1 ## Set the version control system host. GITROOT="https://cgit-beta.freebsd.org/" GITSRC="src.git" Modified: head/release/release.sh ============================================================================== --- head/release/release.sh Fri Sep 11 16:13:45 2020 (r365637) +++ head/release/release.sh Fri Sep 11 17:04:09 2020 (r365638) @@ -65,7 +65,7 @@ env_setup() { [ ! -z "${VCSCMD}" ] && break 2 done - if [ -z "${VCSCMD}" ]; then + if [ -z "${VCSCMD}" -a -z "${NOGIT}" ]; then echo "*** The devel/git port/package is required." exit 1 fi @@ -275,6 +275,7 @@ extra_chroot_setup() { cp ${SRC_CONF} ${CHROOTDIR}/${SRC_CONF} fi + if [ -z "${NOGIT}" ]; then # Install git from ports or packages if the ports tree is # available and VCSCMD is unset. _gitcmd="$(which git)" @@ -299,6 +300,7 @@ extra_chroot_setup() { pkg install -y devel/git eval chroot ${CHROOTDIR} env ASSUME_ALWAYS_YES=yes \ pkg clean -y + fi fi if [ -d ${CHROOTDIR}/usr/ports ]; then # Trick the ports 'run-autotools-fixup' target to do the right From owner-svn-src-all@freebsd.org Fri Sep 11 17:05:09 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E6D8D3E0872; Fri, 11 Sep 2020 17:05:09 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bp2F15mnjz4bSB; Fri, 11 Sep 2020 17:05:09 +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 8F6FB26B7B; Fri, 11 Sep 2020 17:05:09 +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 08BH59ft096785; Fri, 11 Sep 2020 17:05:09 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08BH5951096784; Fri, 11 Sep 2020 17:05:09 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <202009111705.08BH5951096784@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Fri, 11 Sep 2020 17:05:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365639 - head/release X-SVN-Group: head X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: head/release X-SVN-Commit-Revision: 365639 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.33 Precedence: list List-Id: "SVN commit messages 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, 11 Sep 2020 17:05:10 -0000 Author: gjb Date: Fri Sep 11 17:05:09 2020 New Revision: 365639 URL: https://svnweb.freebsd.org/changeset/base/365639 Log: Fix indentation following r365638. No functional changes. Sponsored by: Rubicon Communications, LLC (netgate.com) Modified: head/release/release.sh Modified: head/release/release.sh ============================================================================== --- head/release/release.sh Fri Sep 11 17:04:09 2020 (r365638) +++ head/release/release.sh Fri Sep 11 17:05:09 2020 (r365639) @@ -276,31 +276,31 @@ extra_chroot_setup() { fi if [ -z "${NOGIT}" ]; then - # Install git from ports or packages if the ports tree is - # available and VCSCMD is unset. - _gitcmd="$(which git)" - if [ -d ${CHROOTDIR}/usr/ports -a -z "${_gitcmd}" ]; then - # Trick the ports 'run-autotools-fixup' target to do the right - # thing. - _OSVERSION=$(chroot ${CHROOTDIR} /usr/bin/uname -U) - REVISION=$(chroot ${CHROOTDIR} make -C /usr/src/release -V REVISION) - BRANCH=$(chroot ${CHROOTDIR} make -C /usr/src/release -V BRANCH) - UNAME_r=${REVISION}-${BRANCH} - GITUNSETOPTS="CONTRIB CURL CVS GITWEB GUI HTMLDOCS" - GITUNSETOPTS="${GITUNSETOPTS} ICONV NLS P4 PERL" - GITUNSETOPTS="${GITUNSETOPTS} SEND_EMAIL SUBTREE SVN" - GITUNSETOPTS="${GITUNSETOPTS} PCRE PCRE2" - eval chroot ${CHROOTDIR} env OPTIONS_UNSET=\"${GITUNSETOPTS}\" \ - make -C /usr/ports/devel/git FORCE_PKG_REGISTER=1 \ - WRKDIRPREFIX=/tmp/ports \ - DISTDIR=/tmp/distfiles \ - install clean distclean - else - eval chroot ${CHROOTDIR} env ASSUME_ALWAYS_YES=yes \ - pkg install -y devel/git - eval chroot ${CHROOTDIR} env ASSUME_ALWAYS_YES=yes \ - pkg clean -y - fi + # Install git from ports or packages if the ports tree is + # available and VCSCMD is unset. + _gitcmd="$(which git)" + if [ -d ${CHROOTDIR}/usr/ports -a -z "${_gitcmd}" ]; then + # Trick the ports 'run-autotools-fixup' target to do the right + # thing. + _OSVERSION=$(chroot ${CHROOTDIR} /usr/bin/uname -U) + REVISION=$(chroot ${CHROOTDIR} make -C /usr/src/release -V REVISION) + BRANCH=$(chroot ${CHROOTDIR} make -C /usr/src/release -V BRANCH) + UNAME_r=${REVISION}-${BRANCH} + GITUNSETOPTS="CONTRIB CURL CVS GITWEB GUI HTMLDOCS" + GITUNSETOPTS="${GITUNSETOPTS} ICONV NLS P4 PERL" + GITUNSETOPTS="${GITUNSETOPTS} SEND_EMAIL SUBTREE SVN" + GITUNSETOPTS="${GITUNSETOPTS} PCRE PCRE2" + eval chroot ${CHROOTDIR} env OPTIONS_UNSET=\"${GITUNSETOPTS}\" \ + make -C /usr/ports/devel/git FORCE_PKG_REGISTER=1 \ + WRKDIRPREFIX=/tmp/ports \ + DISTDIR=/tmp/distfiles \ + install clean distclean + else + eval chroot ${CHROOTDIR} env ASSUME_ALWAYS_YES=yes \ + pkg install -y devel/git + eval chroot ${CHROOTDIR} env ASSUME_ALWAYS_YES=yes \ + pkg clean -y + fi fi if [ -d ${CHROOTDIR}/usr/ports ]; then # Trick the ports 'run-autotools-fixup' target to do the right From owner-svn-src-all@freebsd.org Fri Sep 11 18:09:50 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 33CA33E18C0; Fri, 11 Sep 2020 18:09:50 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bp3gf0dCLz4dxt; Fri, 11 Sep 2020 18:09:50 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 ECCFB27F84; Fri, 11 Sep 2020 18:09:49 +0000 (UTC) (envelope-from gbe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08BI9nQx034087; Fri, 11 Sep 2020 18:09:49 GMT (envelope-from gbe@FreeBSD.org) Received: (from gbe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08BI9nR9034084; Fri, 11 Sep 2020 18:09:49 GMT (envelope-from gbe@FreeBSD.org) Message-Id: <202009111809.08BI9nR9034084@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gbe set sender to gbe@FreeBSD.org using -f From: Gordon Bergling Date: Fri, 11 Sep 2020 18:09:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365640 - in head: share/man/man5 share/man/man7 tools/build/options X-SVN-Group: head X-SVN-Commit-Author: gbe X-SVN-Commit-Paths: in head: share/man/man5 share/man/man7 tools/build/options X-SVN-Commit-Revision: 365640 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.33 Precedence: list List-Id: "SVN commit messages 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, 11 Sep 2020 18:09:50 -0000 Author: gbe (doc committer) Date: Fri Sep 11 18:09:49 2020 New Revision: 365640 URL: https://svnweb.freebsd.org/changeset/base/365640 Log: Improvements for the src.conf(5) and build(7) man pages PR: 203863 (based on) Submitted by: Russell Haley Reviewed by: bcr, imp Approved by: imp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D26343 Modified: head/share/man/man5/src.conf.5 head/share/man/man7/build.7 head/tools/build/options/makeman Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Fri Sep 11 17:05:09 2020 (r365639) +++ head/share/man/man5/src.conf.5 Fri Sep 11 18:09:49 2020 (r365640) @@ -1,6 +1,6 @@ .\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman. .\" $FreeBSD$ -.Dd September 8, 2020 +.Dd September 11, 2020 .Dt SRC.CONF 5 .Os .Sh NAME @@ -9,7 +9,8 @@ .Sh DESCRIPTION The .Nm -file contains settings that will apply to every build involving the +file contains variables that control what components will be generated during +the build process of the .Fx source tree; see .Xr build 7 . Modified: head/share/man/man7/build.7 ============================================================================== --- head/share/man/man7/build.7 Fri Sep 11 17:05:09 2020 (r365639) +++ head/share/man/man7/build.7 Fri Sep 11 18:09:49 2020 (r365640) @@ -24,12 +24,12 @@ .\" .\" $FreeBSD$ .\" -.Dd August 5, 2020 +.Dd September 11, 2020 .Dt BUILD 7 .Os .Sh NAME .Nm build -.Nd information on how to build the system +.Nd General instructions on how to build the system .Sh DESCRIPTION The sources for the .Fx @@ -66,10 +66,11 @@ command is used in each of these directories to build things in that directory. Issuing the .Xr make 1 -command in any directory or -subdirectory of those directories has the same effect as issuing the -same command in all subdirectories of that directory. -With no target specified, the things in that directory are just built. +command in any directory issues the +.Xr make 1 +command recursively in all subdirectories. +With no target specified, the items in the directories are built +and no further action is taken. .Pp A source tree is allowed to be read-only. As described in @@ -93,6 +94,14 @@ variables described in the section below, and by the variables documented in .Xr make.conf 5 . .Pp +The default components included in the build are specified in the file +.Pa /etc/src.conf +in the source tree. +To override the default file, include the SRCCONF option in the make steps, +pointing to a custom src.conf file. +For more information see +.Xr src.conf 5 . +.Pp The following list provides the names and actions for the targets supported by the build system: .Bl -tag -width ".Cm cleandepend" @@ -583,6 +592,12 @@ process. .Bd -literal -offset indent make PORTS_MODULES=emulators/kqemu-kmod kernel .Ed +.It Va SRCCONF +Specify a file to override the default +.Pa /etc/src.conf . +The src.conf file controls the components to build. +See +.Xr src.conf 5 .It Va STRIPBIN Command to use at install time when stripping binaries. Be sure to add any additional tools required to run Modified: head/tools/build/options/makeman ============================================================================== --- head/tools/build/options/makeman Fri Sep 11 17:05:09 2020 (r365639) +++ head/tools/build/options/makeman Fri Sep 11 18:09:49 2020 (r365640) @@ -154,7 +154,8 @@ main() .Sh DESCRIPTION The .Nm -file contains settings that will apply to every build involving the +file contains variables that control what components will be generated during +the build process of the .Fx source tree; see .Xr build 7 . From owner-svn-src-all@freebsd.org Fri Sep 11 19:45:27 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 71F473E4615; Fri, 11 Sep 2020 19:45:27 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bp5nz2RQzz3X07; Fri, 11 Sep 2020 19:45:27 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 36FBE8EF1; Fri, 11 Sep 2020 19:45:27 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08BJjRvJ094627; Fri, 11 Sep 2020 19:45:27 GMT (envelope-from scottl@FreeBSD.org) Received: (from scottl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08BJjRXC094626; Fri, 11 Sep 2020 19:45:27 GMT (envelope-from scottl@FreeBSD.org) Message-Id: <202009111945.08BJjRXC094626@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: scottl set sender to scottl@FreeBSD.org using -f From: Scott Long Date: Fri, 11 Sep 2020 19:45:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365641 - head/share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: scottl X-SVN-Commit-Paths: head/share/man/man9 X-SVN-Commit-Revision: 365641 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.33 Precedence: list List-Id: "SVN commit messages 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, 11 Sep 2020 19:45:27 -0000 Author: scottl Date: Fri Sep 11 19:45:26 2020 New Revision: 365641 URL: https://svnweb.freebsd.org/changeset/base/365641 Log: Improve the documenation for bus_dma templates. Also add notes to make it clear that filters may not work correctly and that their use is deprecated. MFC after: 3 days Modified: head/share/man/man9/bus_dma.9 Modified: head/share/man/man9/bus_dma.9 ============================================================================== --- head/share/man/man9/bus_dma.9 Fri Sep 11 18:09:49 2020 (r365640) +++ head/share/man/man9/bus_dma.9 Fri Sep 11 19:45:26 2020 (r365641) @@ -311,13 +311,13 @@ tag inheriting the restrictions of its parent. This allows all devices along the path of DMA transactions to contribute to the constraints of those transactions. .It Vt bus_dma_template_t -A template structure for creating a +A template is a structure for creating a .Fa bus_dma_tag_t from a set of defaults. Once initialized with .Fn bus_dma_template_init , a driver can over-ride individual fields to suit its needs. -The following fields have the indicated values: +The following fields start with the indicated default values: .Bd -literal alignment 1 boundary 0 @@ -362,6 +362,8 @@ to inclusive. The filter function should return zero if any mapping in this range can be accommodated by the device and non-zero otherwise. +.Pp +.Em Note: The use of filters is deprecated. Proper operation is not guaranteed. .It Vt bus_dma_segment_t A machine-dependent type that describes individual DMA segments. @@ -614,6 +616,8 @@ and cannot adequately describe the constraints of the device. The filter function will be called for every machine page that overlaps the exclusion window. +.Pp +.Em Note: The use of filters is deprecated. Proper operation is not guaranteed. .It Fa filtfuncarg Argument passed to all calls to the filter function for this tag. May be @@ -691,22 +695,23 @@ on success. .It Fn bus_dma_template_init "*template" "parent" Initializes a .Fa bus_dma_template_t -structure and associates it with an optional -.Fa parent . -The -.Fa parent -argument may be NULL. +structure. If the +.Fa parent +argument is non-NULL, values from this tag will be copied into the template, +replacing any defaults. .It Fn bus_dma_template_tag "*template" "*dmat" Unpacks a template into a tag, and returns the tag via the .Fa dmat . All return values are identical to .Fn bus_dma_tag_create . +The template is not modified by this function, and can be reused and/or +freed upon return. .It Fn bus_dma_template_clone "*template" "dmat" -Clones the fields from a tag to a template. -This is useful for cloning tags when paired with -.Fn bus_dma_template_tag . -A template that is filled in as a clone does not need to be initialized -first. +Copies the fields from an existing tag to a template. +The template does not need to be initialized first. All of its fields will +be overwritten by the values contained in the tag. When paired with +.Fn bus_dma_template_tag , +this function is useful for creating copies of tags. .It Fn bus_dmamap_create "dmat" "flags" "*mapp" Allocates and initializes a DMA map. Arguments are as follows: From owner-svn-src-all@freebsd.org Fri Sep 11 20:32:41 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 914113E5D0C; Fri, 11 Sep 2020 20:32:41 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bp6rT3J2tz3Zxd; Fri, 11 Sep 2020 20:32:41 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 554B499AA; Fri, 11 Sep 2020 20:32:41 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08BKWfOG025518; Fri, 11 Sep 2020 20:32:41 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08BKWf6V025517; Fri, 11 Sep 2020 20:32:41 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202009112032.08BKWf6V025517@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 11 Sep 2020 20:32:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365642 - in head/sys: amd64/amd64 x86/include X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head/sys: amd64/amd64 x86/include X-SVN-Commit-Revision: 365642 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.33 Precedence: list List-Id: "SVN commit messages 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, 11 Sep 2020 20:32:41 -0000 Author: jhb Date: Fri Sep 11 20:32:40 2020 New Revision: 365642 URL: https://svnweb.freebsd.org/changeset/base/365642 Log: Add constant for the DE_CFG MSR on AMD CPUs. Reported by: Patrick Mooney MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D25885 Modified: head/sys/amd64/amd64/initcpu.c head/sys/x86/include/specialreg.h Modified: head/sys/amd64/amd64/initcpu.c ============================================================================== --- head/sys/amd64/amd64/initcpu.c Fri Sep 11 19:45:26 2020 (r365641) +++ head/sys/amd64/amd64/initcpu.c Fri Sep 11 20:32:40 2020 (r365642) @@ -86,7 +86,7 @@ init_amd(void) case 0x10: case 0x12: if ((cpu_feature2 & CPUID2_HV) == 0) - wrmsr(0xc0011029, rdmsr(0xc0011029) | 1); + wrmsr(MSR_DE_CFG, rdmsr(MSR_DE_CFG) | 1); break; } @@ -135,9 +135,9 @@ init_amd(void) if (CPUID_TO_FAMILY(cpu_id) == 0x17 && CPUID_TO_MODEL(cpu_id) == 0x1 && (cpu_feature2 & CPUID2_HV) == 0) { /* 1021 */ - msr = rdmsr(0xc0011029); + msr = rdmsr(MSR_DE_CFG); msr |= 0x2000; - wrmsr(0xc0011029, msr); + wrmsr(MSR_DE_CFG, msr); /* 1033 */ msr = rdmsr(MSR_LS_CFG); Modified: head/sys/x86/include/specialreg.h ============================================================================== --- head/sys/x86/include/specialreg.h Fri Sep 11 19:45:26 2020 (r365641) +++ head/sys/x86/include/specialreg.h Fri Sep 11 20:32:40 2020 (r365642) @@ -1138,6 +1138,7 @@ #define MSR_EXTFEATURES 0xc0011005 /* Extended CPUID Features override */ #define MSR_LS_CFG 0xc0011020 #define MSR_IC_CFG 0xc0011021 /* Instruction Cache Configuration */ +#define MSR_DE_CFG 0xc0011029 /* Decode Configuration */ /* MSR_VM_CR related */ #define VM_CR_SVMDIS 0x10 /* SVM: disabled by BIOS */ From owner-svn-src-all@freebsd.org Fri Sep 11 20:49:37 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 54AE43E5EDD; Fri, 11 Sep 2020 20:49:37 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bp7D11bgfz3bB4; Fri, 11 Sep 2020 20:49:37 +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 01A919F18; Fri, 11 Sep 2020 20:49:37 +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 08BKnaoh032213; Fri, 11 Sep 2020 20:49:36 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08BKnavL032212; Fri, 11 Sep 2020 20:49:36 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <202009112049.08BKnavL032212@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Fri, 11 Sep 2020 20:49:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365643 - head/bin/cp X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/bin/cp X-SVN-Commit-Revision: 365643 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.33 Precedence: list List-Id: "SVN commit messages 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, 11 Sep 2020 20:49:37 -0000 Author: asomers Date: Fri Sep 11 20:49:36 2020 New Revision: 365643 URL: https://svnweb.freebsd.org/changeset/base/365643 Log: cp: fall back to read/write if copy_file_range fails Even though copy_file_range has a file-system agnostic version, it still fails on devfs (perhaps because the file descriptor is non-seekable?) In that case, fallback to old-fashioned read/write. Fixes "cp /dev/null /tmp/null" PR: 249248 Reported by: Michael Butler Reviewed by: mjg MFC-With: 365549 Differential Revision: https://reviews.freebsd.org/D26395 Modified: head/bin/cp/utils.c Modified: head/bin/cp/utils.c ============================================================================== --- head/bin/cp/utils.c Fri Sep 11 20:32:40 2020 (r365642) +++ head/bin/cp/utils.c Fri Sep 11 20:49:36 2020 (r365643) @@ -74,6 +74,26 @@ __FBSDID("$FreeBSD$"); */ #define BUFSIZE_SMALL (MAXPHYS) +static int +copy_fallback(int from_fd, int to_fd, char *buf, size_t bufsize) +{ + int rcount; + ssize_t wresid, wcount = 0; + char *bufp; + + rcount = read(from_fd, buf, bufsize); + if (rcount <= 0) + return (rcount); + for (bufp = buf, wresid = rcount; ; bufp += wcount, wresid -= wcount) { + wcount = write(to_fd, bufp, wresid); + if (wcount <= 0) + break; + if (wcount >= (ssize_t)wresid) + break; + } + return (wcount < 0 ? wcount : rcount); +} + int copy_file(const FTSENT *entp, int dne) { @@ -88,6 +108,7 @@ copy_file(const FTSENT *entp, int dne) #ifdef VM_AND_BUFFER_CACHE_SYNCHRONIZED char *p; #endif + int use_copy_file_range = 1; from_fd = to_fd = -1; if (!lflag && !sflag && @@ -212,9 +233,19 @@ copy_file(const FTSENT *entp, int dne) err(1, "Not enough memory"); } wtotal = 0; - while ((rcount = copy_file_range(from_fd, NULL, - to_fd, NULL, bufsize, 0)) > 0) - { + do { + if (use_copy_file_range) { + rcount = copy_file_range(from_fd, NULL, + to_fd, NULL, bufsize, 0); + if (rcount < 0 && errno == EINVAL) { + /* Prob a non-seekable FD */ + use_copy_file_range = 0; + } + } + if (!use_copy_file_range) { + rcount = copy_fallback(from_fd, to_fd, + buf, bufsize); + } wtotal += rcount; if (info) { info = 0; @@ -223,7 +254,7 @@ copy_file(const FTSENT *entp, int dne) entp->fts_path, to.p_path, cp_pct(wtotal, fs->st_size)); } - } + } while (rcount > 0); if (rcount < 0) { warn("%s", entp->fts_path); rval = 1; From owner-svn-src-all@freebsd.org Fri Sep 11 21:43:35 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2D41A3E7024; Fri, 11 Sep 2020 21:43:35 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bp8QG6LgDz3f6b; Fri, 11 Sep 2020 21:43:34 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.16.1/8.16.1) with ESMTPS id 08BLhRxw075567 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Sat, 12 Sep 2020 00:43:30 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 08BLhRxw075567 Received: (from kostik@localhost) by tom.home (8.16.1/8.16.1/Submit) id 08BLhR5Z075566; Sat, 12 Sep 2020 00:43:27 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 12 Sep 2020 00:43:27 +0300 From: Konstantin Belousov To: Alan Somers Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r365643 - head/bin/cp Message-ID: <20200911214327.GY94807@kib.kiev.ua> References: <202009112049.08BKnavL032212@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202009112049.08BKnavL032212@repo.freebsd.org> X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on tom.home X-Rspamd-Queue-Id: 4Bp8QG6LgDz3f6b X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 11 Sep 2020 21:43:35 -0000 On Fri, Sep 11, 2020 at 08:49:36PM +0000, Alan Somers wrote: > Author: asomers > Date: Fri Sep 11 20:49:36 2020 > New Revision: 365643 > URL: https://svnweb.freebsd.org/changeset/base/365643 > > Log: > cp: fall back to read/write if copy_file_range fails > > Even though copy_file_range has a file-system agnostic version, it still > fails on devfs (perhaps because the file descriptor is non-seekable?) In > that case, fallback to old-fashioned read/write. Fixes > "cp /dev/null /tmp/null" Devices are seekable. The reason for EINVAL is that vn_copy_file_range() checks that both in and out vnodes are VREG. For devfs, they are VCHR. From owner-svn-src-all@freebsd.org Fri Sep 11 21:52:21 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0FB323E7ABE; Fri, 11 Sep 2020 21:52:21 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from CAN01-QB1-obe.outbound.protection.outlook.com (mail-eopbgr660075.outbound.protection.outlook.com [40.107.66.75]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "GlobalSign Organization Validation CA - SHA256 - G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bp8cM6m9Jz3fcV; Fri, 11 Sep 2020 21:52:19 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dLaj8gYptk1WZd2mdX8LJbRqZTeIMOcXVjlNL2KkL5nyGR/g6ymSSPh/WPNDmbkdIrW9BkvR+q7kZOt0f8igGudsjCszF1BMdUqss9kEFhbVKcMtnKkyBFY0M47vAxfOzkpyZ6LlXUOHzmbZ6ZU6c2FGC+46FmMTeBvbx4SHj7DlbfoF9RWGDtik3NB0PQVCorxGZyxUKyZM4wOirWCpZoeWdCBBTD9sytYcKllYvmNrs8JEvKSXqhJ/UWmCvRVfb1heYZIlx5ZDmzvDGtGIxt/72j2L2kFTSq1pGDop37rzfNiWmAxg/6lD0wymXIpqd1JuLfgiJEFKd1WgCUF/Jw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+V0PibtQLsVFa+UKQSuKO0EFDo/1+luYjAEamADgPlo=; b=GYFKFG6eiFGacjvEht6DErVesqmjYaViqsXVK7UABsIB6n4JJzrfoKBohTa+BEyllLztlT4KR+zpZbdyetlTiA32d+o84ys6w3EaQYgARabdgZzfnMptgVooryVE5VwuoHlWaf+HpHCy0egDpNSW9EoSIfiOA+1SF+xD/M2zFKewKvMr1OjI0SEipS4MRtKRNSXJRyq9cOCUgog5obwfO70e/PxWSASVPAQAYTTRUbOPs3e+gXuNrH38K+5KSmWAGIyTlh1YlKLGibxSmsImmx9r5doIBgoVdQ1e8023/5qLrCGYloOJFK6QHd1zW9XS0ipC9d2dFzsqJn/1R7Jg/Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=uoguelph.ca; dmarc=pass action=none header.from=uoguelph.ca; dkim=pass header.d=uoguelph.ca; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=uoguelph.ca; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+V0PibtQLsVFa+UKQSuKO0EFDo/1+luYjAEamADgPlo=; b=eYUXJ2rdhfea0XqvX9rUlyELZ+4HvnlQKsO0YRJFPgHu3h3DFRPglBOpYB3LRaGn+0XfrDSWtuESAer6lUQ5fM9P0r1x7xzDgfp4fduuzIklN4ubcJHr5cKH1WGuLZy60uF6lDIBl8drUHbSANF++Fi2FSTUSHzzsUkMANL4xmJixEKdoPVYS7oSMuRLiTGJlYnvV8wNG+X5M62SdA/hHAjbdRrcV1wDRls0+mUdZKEadppeEEGQ7WFa7NffPvL4LC21nfzGydCSEWp2UE5af/Lc+YZuHNUaAiAUUPpB5SMGIVxxs9hJbzxTY/+IdFJS6mZAW5kTOfZCOors1xm8Rg== Received: from YTBPR01MB3966.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:24::27) by YTBPR01MB3165.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:1c::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3370.16; Fri, 11 Sep 2020 21:52:18 +0000 Received: from YTBPR01MB3966.CANPRD01.PROD.OUTLOOK.COM ([fe80::687f:d85a:a0a3:bd20]) by YTBPR01MB3966.CANPRD01.PROD.OUTLOOK.COM ([fe80::687f:d85a:a0a3:bd20%6]) with mapi id 15.20.3370.017; Fri, 11 Sep 2020 21:52:17 +0000 From: Rick Macklem To: Konstantin Belousov , Alan Somers CC: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r365643 - head/bin/cp Thread-Topic: svn commit: r365643 - head/bin/cp Thread-Index: AQHWiH0X8pBOJ1Dd2EKX5zw9++b1Talj+C+AgAABEqg= Date: Fri, 11 Sep 2020 21:52:17 +0000 Message-ID: References: <202009112049.08BKnavL032212@repo.freebsd.org>, <20200911214327.GY94807@kib.kiev.ua> In-Reply-To: <20200911214327.GY94807@kib.kiev.ua> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: bbe03bed-dd42-41b3-66b8-08d8569cf3e9 x-ms-traffictypediagnostic: YTBPR01MB3165: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8882; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: llKLmYUvutFOxZ1JrxcsT1HmNRqpk4c365WeHGXZ4HvUqHH7Ri73R5UCe7CceC3UenT/LuQV4YofJSozLFqL0vdYNAEcoLMa6+LqZHOrwNkCWizEqqpWNpDjjX1ijd6Vv2d/BtZHmYqQGcfTF3iAY8OIYr6wTh3XGh/3zpR2hRRQ+7ddMq4Rr9AkiXiV6CUMZ9qX0LS2wCwT9LvYsj+wfkOKhc8ZAiiu05EAw8VAjlA6lafBVwi1XSYmanKKVkmqpp4JUIFOfhrdsVe0C6jo+S1rbc6927sOGdz3whEZoQfMhMJOThHP5/GOuhEtkmFDJUwbD5suRqZ2DpTQMNbIeHDUwDld95xE17TJtQv48C7mWQz7m138ljjcIrRu1FT7ZTX29n+mJPBAEvoQLDJYtA== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:YTBPR01MB3966.CANPRD01.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFS:(396003)(366004)(346002)(39860400002)(376002)(136003)(33656002)(966005)(71200400001)(8676002)(786003)(5660300002)(26005)(4326008)(478600001)(316002)(86362001)(91956017)(76116006)(2906002)(54906003)(8936002)(9686003)(66946007)(52536014)(7696005)(55016002)(64756008)(6506007)(66556008)(66476007)(66446008)(186003)(110136005); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: /TrAi6t0s4aQBNJzBnAUopWeiFnrRosZXxaSn9BoTN/eNHoXJj9kWB1AQHuEnVXCdStCB7eWps76JVXFH1+QZaiRoqPvRtfKi/X1isW4qzEpAeIyno+Bn3HLpHQAQaCx33ITu0/C5W9j7tHnG8Lr/QtWmGEHMZwJU29qF87T70aKrSPlDCA2SSrOjXX2hlE/cTALTm42KxqU2b2rSlr5L9kgo/uRuLOA69O17EzUq4fADbcVIcfmaNn8gda9TXnxuQOcnKpK/IbglPTvUmts0AYGjycy+QNvxu7VtW2Sxz9E6gVjVXlEtCnAhzZOpqNxz4NdT8598wFfDfew0F7oqsC1OOqjGW9nRZ7mbXVB3TLhSeHEMypXgrBShmF5Klut7AcuzQc+9MpO5zIaTd/rrG8pEuIKszsXwqELs3hAmyf95mfI0ltS4SxozR+x46oWTIi5V+bfSU1xSWpKqFhmhNaZuCr4xUFMJqaAZ+H62ZzCCAtZCYI0U2xW83B7VF4Ccmt+TtxYqXjVg3/mSVkeI29qoAXYGW2x3QLeSsuTd2KIJejcOnVz9UfSiqtMe5hajx5XfRVlau7O2BgOU8Wp7gR9UHOJvD6CNGKkZYtImU/o8abRPGbxyniR7dddt+Q43LOv3E8WtDLAUlc+fvgssg== x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: uoguelph.ca X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: YTBPR01MB3966.CANPRD01.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-Network-Message-Id: bbe03bed-dd42-41b3-66b8-08d8569cf3e9 X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Sep 2020 21:52:17.9581 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: be62a12b-2cad-49a1-a5fa-85f4f3156a7d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: TiM/kzd/b9hErm1qw9/n8tUXlQhK/KlsOl7Qyo5fW84Jf0x8Zu1bErXqpDinADXkCPB0NmwJ3JsUbAcOc9F1iw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: YTBPR01MB3165 X-Rspamd-Queue-Id: 4Bp8cM6m9Jz3fcV X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org; dkim=pass header.d=uoguelph.ca header.s=selector1 header.b=eYUXJ2rd; dmarc=pass (policy=none) header.from=uoguelph.ca; spf=pass (mx1.freebsd.org: domain of rmacklem@uoguelph.ca designates 40.107.66.75 as permitted sender) smtp.mailfrom=rmacklem@uoguelph.ca X-Spamd-Result: default: False [-6.25 / 15.00]; TO_DN_EQ_ADDR_SOME(0.00)[]; NEURAL_HAM_MEDIUM(-0.93)[-0.926]; R_DKIM_ALLOW(-0.20)[uoguelph.ca:s=selector1]; FREEFALL_USER(0.00)[rmacklem]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:40.107.0.0/16]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; RCPT_COUNT_FIVE(0.00)[5]; DWL_DNSWL_LOW(-1.00)[uoguelph.ca:dkim]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[uoguelph.ca:+]; DMARC_POLICY_ALLOW(-0.50)[uoguelph.ca,none]; RCVD_IN_DNSWL_NONE(0.00)[40.107.66.75:from]; NEURAL_HAM_SHORT(-1.32)[-1.321]; FREEMAIL_TO(0.00)[gmail.com,FreeBSD.org]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:8075, ipnet:40.104.0.0/14, country:US]; ARC_ALLOW(-1.00)[microsoft.com:s=arcselector9901:i=1]; MAILMAN_DEST(0.00)[svn-src-all,svn-src-head]; RWL_MAILSPIKE_POSSIBLE(0.00)[40.107.66.75:from] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 11 Sep 2020 21:52:21 -0000 Konstantin Belousov wrote:=0A= >On Fri, Sep 11, 2020 at 08:49:36PM +0000, Alan Somers wrote:=0A= >> Author: asomers=0A= >> Date: Fri Sep 11 20:49:36 2020=0A= >> New Revision: 365643=0A= >> URL: https://svnweb.freebsd.org/changeset/base/365643=0A= >>=0A= >> Log:=0A= >> cp: fall back to read/write if copy_file_range fails=0A= >>=0A= >> Even though copy_file_range has a file-system agnostic version, it sti= ll=0A= >> fails on devfs (perhaps because the file descriptor is non-seekable?) = In=0A= >> that case, fallback to old-fashioned read/write. Fixes=0A= >> "cp /dev/null /tmp/null"=0A= >=0A= >Devices are seekable.=0A= >=0A= >The reason for EINVAL is that vn_copy_file_range() checks that both in and= out=0A= >vnodes are VREG. For devfs, they are VCHR.=0A= =0A= I coded the syscall to the Linux man page, which states that EINVAL is retu= rned=0A= if either fd does not refer to a regular file.=0A= Having said that, I do not recall testing the VCHR case under Linux. (ie. I= t might=0A= actually work and the man page turns out to be incorrect?)=0A= =0A= I will test this case under Linux when I get home next week, rick=0A= =0A= From owner-svn-src-all@freebsd.org Fri Sep 11 22:27:36 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E5BDF3E85AB; Fri, 11 Sep 2020 22:27:36 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bp9P45Z2Cz3gxY; Fri, 11 Sep 2020 22:27:36 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 9E206AE3A; Fri, 11 Sep 2020 22:27:36 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08BMRa71092940; Fri, 11 Sep 2020 22:27:36 GMT (envelope-from scottl@FreeBSD.org) Received: (from scottl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08BMRaRn092938; Fri, 11 Sep 2020 22:27:36 GMT (envelope-from scottl@FreeBSD.org) Message-Id: <202009112227.08BMRaRn092938@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: scottl set sender to scottl@FreeBSD.org using -f From: Scott Long Date: Fri, 11 Sep 2020 22:27:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365644 - head/sys/dev/mps X-SVN-Group: head X-SVN-Commit-Author: scottl X-SVN-Commit-Paths: head/sys/dev/mps X-SVN-Commit-Revision: 365644 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.33 Precedence: list List-Id: "SVN commit messages 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, 11 Sep 2020 22:27:37 -0000 Author: scottl Date: Fri Sep 11 22:27:35 2020 New Revision: 365644 URL: https://svnweb.freebsd.org/changeset/base/365644 Log: Convert the mps driver to use busdma templates Modified: head/sys/dev/mps/mps.c head/sys/dev/mps/mps_pci.c head/sys/dev/mps/mps_user.c Modified: head/sys/dev/mps/mps.c ============================================================================== --- head/sys/dev/mps/mps.c Fri Sep 11 20:49:36 2020 (r365643) +++ head/sys/dev/mps/mps.c Fri Sep 11 22:27:35 2020 (r365644) @@ -1278,6 +1278,7 @@ mps_alloc_queues(struct mps_softc *sc) static int mps_alloc_hw_queues(struct mps_softc *sc) { + bus_dma_tag_template_t t; bus_addr_t queues_busaddr; uint8_t *queues; int qsize, fqsize, pqsize; @@ -1299,17 +1300,12 @@ mps_alloc_hw_queues(struct mps_softc *sc) pqsize = sc->pqdepth * 8; qsize = fqsize + pqsize; - if (bus_dma_tag_create( sc->mps_parent_dmat, /* parent */ - 16, 0, /* algnmnt, boundary */ - BUS_SPACE_MAXADDR_32BIT,/* lowaddr */ - BUS_SPACE_MAXADDR, /* highaddr */ - NULL, NULL, /* filter, filterarg */ - qsize, /* maxsize */ - 1, /* nsegments */ - qsize, /* maxsegsize */ - 0, /* flags */ - NULL, NULL, /* lockfunc, lockarg */ - &sc->queues_dmat)) { + bus_dma_template_init(&t, sc->mps_parent_dmat); + t.alignment = 16; + t.lowaddr = BUS_SPACE_MAXADDR_32BIT; + t.maxsize = t.maxsegsize = qsize; + t.nsegments = 1; + if (bus_dma_template_tag(&t, &sc->queues_dmat)) { mps_dprint(sc, MPS_ERROR, "Cannot allocate queues DMA tag\n"); return (ENOMEM); } @@ -1337,6 +1333,7 @@ mps_alloc_hw_queues(struct mps_softc *sc) static int mps_alloc_replies(struct mps_softc *sc) { + bus_dma_tag_template_t t; int rsize, num_replies; /* Store the reply frame size in bytes rather than as 32bit words */ @@ -1350,17 +1347,12 @@ mps_alloc_replies(struct mps_softc *sc) num_replies = max(sc->fqdepth, sc->num_replies); rsize = sc->replyframesz * num_replies; - if (bus_dma_tag_create( sc->mps_parent_dmat, /* parent */ - 4, 0, /* algnmnt, boundary */ - BUS_SPACE_MAXADDR_32BIT,/* lowaddr */ - BUS_SPACE_MAXADDR, /* highaddr */ - NULL, NULL, /* filter, filterarg */ - rsize, /* maxsize */ - 1, /* nsegments */ - rsize, /* maxsegsize */ - 0, /* flags */ - NULL, NULL, /* lockfunc, lockarg */ - &sc->reply_dmat)) { + bus_dma_template_init(&t, sc->mps_parent_dmat); + t.alignment = 4; + t.lowaddr = BUS_SPACE_MAXADDR_32BIT; + t.maxsize = t.maxsegsize = rsize; + t.nsegments = 1; + if (bus_dma_template_tag(&t, &sc->reply_dmat)) { mps_dprint(sc, MPS_ERROR, "Cannot allocate replies DMA tag\n"); return (ENOMEM); } @@ -1408,21 +1400,17 @@ mps_load_chains_cb(void *arg, bus_dma_segment_t *segs, static int mps_alloc_requests(struct mps_softc *sc) { + bus_dma_tag_template_t t; struct mps_command *cm; int i, rsize, nsegs; rsize = sc->reqframesz * sc->num_reqs; - if (bus_dma_tag_create( sc->mps_parent_dmat, /* parent */ - 16, 0, /* algnmnt, boundary */ - BUS_SPACE_MAXADDR_32BIT,/* lowaddr */ - BUS_SPACE_MAXADDR, /* highaddr */ - NULL, NULL, /* filter, filterarg */ - rsize, /* maxsize */ - 1, /* nsegments */ - rsize, /* maxsegsize */ - 0, /* flags */ - NULL, NULL, /* lockfunc, lockarg */ - &sc->req_dmat)) { + bus_dma_template_init(&t, sc->mps_parent_dmat); + t.alignment = 16; + t.lowaddr = BUS_SPACE_MAXADDR_32BIT; + t.maxsize = t.maxsegsize = rsize; + t.nsegments = 1; + if (bus_dma_template_tag(&t, &sc->req_dmat)) { mps_dprint(sc, MPS_ERROR, "Cannot allocate request DMA tag\n"); return (ENOMEM); } @@ -1444,17 +1432,10 @@ mps_alloc_requests(struct mps_softc *sc) return (ENOMEM); } rsize = sc->reqframesz * sc->num_chains; - if (bus_dma_tag_create( sc->mps_parent_dmat, /* parent */ - 16, 0, /* algnmnt, boundary */ - BUS_SPACE_MAXADDR_32BIT,/* lowaddr */ - BUS_SPACE_MAXADDR, /* highaddr */ - NULL, NULL, /* filter, filterarg */ - rsize, /* maxsize */ - howmany(rsize, PAGE_SIZE), /* nsegments */ - rsize, /* maxsegsize */ - 0, /* flags */ - NULL, NULL, /* lockfunc, lockarg */ - &sc->chain_dmat)) { + bus_dma_template_clone(&t, sc->req_dmat); + t.maxsize = t.maxsegsize = rsize; + t.nsegments = howmany(rsize, PAGE_SIZE); + if (bus_dma_template_tag(&t, &sc->chain_dmat)) { mps_dprint(sc, MPS_ERROR, "Cannot allocate chain DMA tag\n"); return (ENOMEM); } @@ -1472,17 +1453,10 @@ mps_alloc_requests(struct mps_softc *sc) } rsize = MPS_SENSE_LEN * sc->num_reqs; - if (bus_dma_tag_create( sc->mps_parent_dmat, /* parent */ - 1, 0, /* algnmnt, boundary */ - BUS_SPACE_MAXADDR_32BIT,/* lowaddr */ - BUS_SPACE_MAXADDR, /* highaddr */ - NULL, NULL, /* filter, filterarg */ - rsize, /* maxsize */ - 1, /* nsegments */ - rsize, /* maxsegsize */ - 0, /* flags */ - NULL, NULL, /* lockfunc, lockarg */ - &sc->sense_dmat)) { + bus_dma_template_clone(&t, sc->req_dmat); + t.maxsize = t.maxsegsize = rsize; + t.alignment = 1; + if (bus_dma_template_tag(&t, &sc->sense_dmat)) { mps_dprint(sc, MPS_ERROR, "Cannot allocate sense DMA tag\n"); return (ENOMEM); } @@ -1498,18 +1472,14 @@ mps_alloc_requests(struct mps_softc *sc) (uintmax_t)sc->sense_busaddr, rsize); nsegs = (sc->maxio / PAGE_SIZE) + 1; - if (bus_dma_tag_create( sc->mps_parent_dmat, /* parent */ - 1, 0, /* algnmnt, boundary */ - BUS_SPACE_MAXADDR, /* lowaddr */ - BUS_SPACE_MAXADDR, /* highaddr */ - NULL, NULL, /* filter, filterarg */ - BUS_SPACE_MAXSIZE_32BIT,/* maxsize */ - nsegs, /* nsegments */ - BUS_SPACE_MAXSIZE_24BIT,/* maxsegsize */ - BUS_DMA_ALLOCNOW, /* flags */ - busdma_lock_mutex, /* lockfunc */ - &sc->mps_mtx, /* lockarg */ - &sc->buffer_dmat)) { + bus_dma_template_init(&t, sc->mps_parent_dmat); + t.maxsize = BUS_SPACE_MAXSIZE_32BIT; + t.nsegments = nsegs; + t.maxsegsize = BUS_SPACE_MAXSIZE_24BIT; + t.flags = BUS_DMA_ALLOCNOW; + t.lockfunc = busdma_lock_mutex; + t.lockfuncarg = &sc->mps_mtx; + if (bus_dma_template_tag(&t, &sc->buffer_dmat)) { mps_dprint(sc, MPS_ERROR, "Cannot allocate buffer DMA tag\n"); return (ENOMEM); } Modified: head/sys/dev/mps/mps_pci.c ============================================================================== --- head/sys/dev/mps/mps_pci.c Fri Sep 11 20:49:36 2020 (r365643) +++ head/sys/dev/mps/mps_pci.c Fri Sep 11 22:27:35 2020 (r365644) @@ -185,6 +185,7 @@ mps_pci_probe(device_t dev) static int mps_pci_attach(device_t dev) { + bus_dma_tag_template_t t; struct mps_softc *sc; struct mps_ident *m; int error; @@ -211,17 +212,8 @@ mps_pci_attach(device_t dev) sc->mps_bhandle = rman_get_bushandle(sc->mps_regs_resource); /* Allocate the parent DMA tag */ - if (bus_dma_tag_create( bus_get_dma_tag(dev), /* parent */ - 1, 0, /* algnmnt, boundary */ - BUS_SPACE_MAXADDR, /* lowaddr */ - BUS_SPACE_MAXADDR, /* highaddr */ - NULL, NULL, /* filter, filterarg */ - BUS_SPACE_MAXSIZE_32BIT,/* maxsize */ - BUS_SPACE_UNRESTRICTED, /* nsegments */ - BUS_SPACE_MAXSIZE_32BIT,/* maxsegsize */ - 0, /* flags */ - NULL, NULL, /* lockfunc, lockarg */ - &sc->mps_parent_dmat)) { + bus_dma_template_init(&t, bus_get_dma_tag(dev)); + if (bus_dma_template_tag(&t, &sc->mps_parent_dmat)) { mps_printf(sc, "Cannot allocate parent DMA tag\n"); mps_pci_free(sc); return (ENOMEM); Modified: head/sys/dev/mps/mps_user.c ============================================================================== --- head/sys/dev/mps/mps_user.c Fri Sep 11 20:49:36 2020 (r365643) +++ head/sys/dev/mps/mps_user.c Fri Sep 11 22:27:35 2020 (r365644) @@ -1346,6 +1346,7 @@ static int mps_diag_register(struct mps_softc *sc, mps_fw_diag_register_t *diag_register, uint32_t *return_code) { + bus_dma_tag_template_t t; mps_fw_diagnostic_buffer_t *pBuffer; struct mps_busdma_context *ctx; uint8_t extended_type, buffer_type, i; @@ -1408,17 +1409,11 @@ mps_diag_register(struct mps_softc *sc, mps_fw_diag_re *return_code = MPS_FW_DIAG_ERROR_NO_BUFFER; return (MPS_DIAG_FAILURE); } - if (bus_dma_tag_create( sc->mps_parent_dmat, /* parent */ - 1, 0, /* algnmnt, boundary */ - BUS_SPACE_MAXADDR_32BIT,/* lowaddr */ - BUS_SPACE_MAXADDR, /* highaddr */ - NULL, NULL, /* filter, filterarg */ - buffer_size, /* maxsize */ - 1, /* nsegments */ - buffer_size, /* maxsegsize */ - 0, /* flags */ - NULL, NULL, /* lockfunc, lockarg */ - &sc->fw_diag_dmat)) { + bus_dma_template_init(&t, sc->mps_parent_dmat); + t.lowaddr = BUS_SPACE_MAXADDR_32BIT; + t.maxsize = t.maxsegsize = buffer_size; + t.nsegments = 1; + if (bus_dma_template_tag(&t, &sc->fw_diag_dmat)) { mps_dprint(sc, MPS_ERROR, "Cannot allocate FW diag buffer DMA tag\n"); *return_code = MPS_FW_DIAG_ERROR_NO_BUFFER; From owner-svn-src-all@freebsd.org Fri Sep 11 23:37:50 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3FE863E986D; Fri, 11 Sep 2020 23:37:50 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BpBy60tGRz42NH; Fri, 11 Sep 2020 23:37:50 +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 017AFB6EB; Fri, 11 Sep 2020 23:37:50 +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 08BNbnmv035871; Fri, 11 Sep 2020 23:37:49 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08BNbn6W035870; Fri, 11 Sep 2020 23:37:49 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202009112337.08BNbn6W035870@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 11 Sep 2020 23:37:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365645 - in head/tools/regression/geom: ConfCmp Data Ref X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/tools/regression/geom: ConfCmp Data Ref X-SVN-Commit-Revision: 365645 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.33 Precedence: list List-Id: "SVN commit messages 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, 11 Sep 2020 23:37:50 -0000 Author: imp Date: Fri Sep 11 23:37:49 2020 New Revision: 365645 URL: https://svnweb.freebsd.org/changeset/base/365645 Log: Remove disk images / tests from alpha, sun and pc98 These images are no longer relevant... However, I've also not tested the regression test here to see if it still works or not... It needs a lot of love regardless... Deleted: head/tools/regression/geom/ConfCmp/a2.conf head/tools/regression/geom/ConfCmp/a2a.conf head/tools/regression/geom/ConfCmp/a2b.conf head/tools/regression/geom/ConfCmp/a2c.conf head/tools/regression/geom/ConfCmp/a2d.conf head/tools/regression/geom/Data/disk.alpha.da0.xml head/tools/regression/geom/Data/disk.alpha2.da0.xml head/tools/regression/geom/Data/disk.pc98.wdc0.xml head/tools/regression/geom/Data/disk.sun.da0.xml head/tools/regression/geom/Data/disk.sun.da1.xml head/tools/regression/geom/Ref/disk.alpha.da0.xml head/tools/regression/geom/Ref/disk.alpha2.da0.xml head/tools/regression/geom/Ref/disk.pc98.wdc0.xml head/tools/regression/geom/Ref/disk.sun.da0.xml head/tools/regression/geom/Ref/disk.sun.da1.xml From owner-svn-src-all@freebsd.org Sat Sep 12 00:06:46 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 577CC3EA721; Sat, 12 Sep 2020 00:06:46 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BpCbV1h3Mz43Cd; Sat, 12 Sep 2020 00:06:46 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1C703C4BD; Sat, 12 Sep 2020 00:06:46 +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 08C06j6P053914; Sat, 12 Sep 2020 00:06:45 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08C06job053913; Sat, 12 Sep 2020 00:06:45 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <202009120006.08C06job053913@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Sat, 12 Sep 2020 00:06:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365646 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 365646 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.33 Precedence: list List-Id: "SVN commit messages 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, 12 Sep 2020 00:06:46 -0000 Author: gjb Date: Sat Sep 12 00:06:45 2020 New Revision: 365646 URL: https://svnweb.freebsd.org/changeset/base/365646 Log: Enclose BRANCH_OVERRIDE in quotes in order to fix an issue with freebsd-update(8) builds, where BRANCH is suffixed with -p0 for builds. Noticed by: gordon With help from: cperciva MFC after: 3 days MFC note: before 12.2-BETA2 Sponsored by: Rubicon Communications, LLC (netgate.com) Modified: head/sys/conf/newvers.sh Modified: head/sys/conf/newvers.sh ============================================================================== --- head/sys/conf/newvers.sh Fri Sep 11 23:37:49 2020 (r365645) +++ head/sys/conf/newvers.sh Sat Sep 12 00:06:45 2020 (r365646) @@ -54,7 +54,7 @@ TYPE="FreeBSD" REVISION="13.0" -BRANCH=${BRANCH_OVERRIDE:-CURRENT} +BRANCH="${BRANCH_OVERRIDE:-CURRENT}" RELEASE="${REVISION}-${BRANCH}" VERSION="${TYPE} ${RELEASE}" From owner-svn-src-all@freebsd.org Sat Sep 12 00:22:02 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E4CA83EA96A; Sat, 12 Sep 2020 00:22:02 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BpCx65qcYz444f; Sat, 12 Sep 2020 00:22:02 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 AB3A3C3DC; Sat, 12 Sep 2020 00:22:02 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08C0M2ee065946; Sat, 12 Sep 2020 00:22:02 GMT (envelope-from erj@FreeBSD.org) Received: (from erj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08C0M2WF065944; Sat, 12 Sep 2020 00:22:02 GMT (envelope-from erj@FreeBSD.org) Message-Id: <202009120022.08C0M2WF065944@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: erj set sender to erj@FreeBSD.org using -f From: Eric Joyner Date: Sat, 12 Sep 2020 00:22:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365647 - stable/12/sys/dev/ixl X-SVN-Group: stable-12 X-SVN-Commit-Author: erj X-SVN-Commit-Paths: stable/12/sys/dev/ixl X-SVN-Commit-Revision: 365647 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.33 Precedence: list List-Id: "SVN commit messages 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, 12 Sep 2020 00:22:03 -0000 Author: erj Date: Sat Sep 12 00:22:02 2020 New Revision: 365647 URL: https://svnweb.freebsd.org/changeset/base/365647 Log: MFC r358698 and r364241 r358698: ixl: Add missing conversions from/to LE16 r364241: Remove redeclaration found by gcc build Together, these should allow ixl(4) to work properly on powerpc64 and prevent build warnings there. PR: 249254 Reported by: pkubaj@ MFC after: 3 days Modified: stable/12/sys/dev/ixl/i40e_prototype.h stable/12/sys/dev/ixl/ixl_pf_main.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/ixl/i40e_prototype.h ============================================================================== --- stable/12/sys/dev/ixl/i40e_prototype.h Sat Sep 12 00:06:45 2020 (r365646) +++ stable/12/sys/dev/ixl/i40e_prototype.h Sat Sep 12 00:22:02 2020 (r365647) @@ -627,6 +627,4 @@ enum i40e_status_code i40e_read_phy_register(struct i4 enum i40e_status_code i40e_write_phy_register(struct i40e_hw *hw, u8 page, u16 reg, u8 phy_addr, u16 value); u8 i40e_get_phy_address(struct i40e_hw *hw, u8 dev_num); -enum i40e_status_code i40e_blink_phy_link_led(struct i40e_hw *hw, - u32 time, u32 interval); #endif /* _I40E_PROTOTYPE_H_ */ Modified: stable/12/sys/dev/ixl/ixl_pf_main.c ============================================================================== --- stable/12/sys/dev/ixl/ixl_pf_main.c Sat Sep 12 00:06:45 2020 (r365646) +++ stable/12/sys/dev/ixl/ixl_pf_main.c Sat Sep 12 00:22:02 2020 (r365647) @@ -729,20 +729,22 @@ ixl_switch_config(struct ixl_pf *pf) if (pf->dbg_mask & IXL_DBG_SWITCH_INFO) { device_printf(dev, "Switch config: header reported: %d in structure, %d total\n", - sw_config->header.num_reported, sw_config->header.num_total); - for (int i = 0; i < sw_config->header.num_reported; i++) { + LE16_TO_CPU(sw_config->header.num_reported), + LE16_TO_CPU(sw_config->header.num_total)); + for (int i = 0; + i < LE16_TO_CPU(sw_config->header.num_reported); i++) { device_printf(dev, "-> %d: type=%d seid=%d uplink=%d downlink=%d\n", i, sw_config->element[i].element_type, - sw_config->element[i].seid, - sw_config->element[i].uplink_seid, - sw_config->element[i].downlink_seid); + LE16_TO_CPU(sw_config->element[i].seid), + LE16_TO_CPU(sw_config->element[i].uplink_seid), + LE16_TO_CPU(sw_config->element[i].downlink_seid)); } } /* Simplified due to a single VSI */ - vsi->uplink_seid = sw_config->element[0].uplink_seid; - vsi->downlink_seid = sw_config->element[0].downlink_seid; - vsi->seid = sw_config->element[0].seid; + vsi->uplink_seid = LE16_TO_CPU(sw_config->element[0].uplink_seid); + vsi->downlink_seid = LE16_TO_CPU(sw_config->element[0].downlink_seid); + vsi->seid = LE16_TO_CPU(sw_config->element[0].seid); return (ret); } @@ -1219,12 +1221,14 @@ ixl_add_hw_filters(struct ixl_vsi *vsi, int flags, int bcopy(f->macaddr, b->mac_addr, ETHER_ADDR_LEN); if (f->vlan == IXL_VLAN_ANY) { b->vlan_tag = 0; - b->flags = I40E_AQC_MACVLAN_ADD_IGNORE_VLAN; + b->flags = CPU_TO_LE16( + I40E_AQC_MACVLAN_ADD_IGNORE_VLAN); } else { - b->vlan_tag = f->vlan; + b->vlan_tag = CPU_TO_LE16(f->vlan); b->flags = 0; } - b->flags |= I40E_AQC_MACVLAN_ADD_PERFECT_MATCH; + b->flags |= CPU_TO_LE16( + I40E_AQC_MACVLAN_ADD_PERFECT_MATCH); f->flags &= ~IXL_FILTER_ADD; j++; From owner-svn-src-all@freebsd.org Sat Sep 12 00:33:12 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CE7983EABE7; Sat, 12 Sep 2020 00:33:12 +0000 (UTC) (envelope-from jmg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BpDB05V0Nz44qw; Sat, 12 Sep 2020 00:33:12 +0000 (UTC) (envelope-from jmg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 866C2C998; Sat, 12 Sep 2020 00:33:12 +0000 (UTC) (envelope-from jmg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08C0XCRl072209; Sat, 12 Sep 2020 00:33:12 GMT (envelope-from jmg@FreeBSD.org) Received: (from jmg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08C0XCeb072206; Sat, 12 Sep 2020 00:33:12 GMT (envelope-from jmg@FreeBSD.org) Message-Id: <202009120033.08C0XCeb072206@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jmg set sender to jmg@FreeBSD.org using -f From: John-Mark Gurney Date: Sat, 12 Sep 2020 00:33:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365648 - in head/sys: dev/usb/net modules/usb/ure X-SVN-Group: head X-SVN-Commit-Author: jmg X-SVN-Commit-Paths: in head/sys: dev/usb/net modules/usb/ure X-SVN-Commit-Revision: 365648 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.33 Precedence: list List-Id: "SVN commit messages 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, 12 Sep 2020 00:33:12 -0000 Author: jmg Date: Sat Sep 12 00:33:11 2020 New Revision: 365648 URL: https://svnweb.freebsd.org/changeset/base/365648 Log: A major update to the ure driver. This update adds support for: HW VLAN tagging HW checksum offload for IPv4 and IPv6 tx and rx aggreegation (for full gige speeds) multiple transactions In my testing, I am able to get 900-950Mbps depending upon TCP or UDP, which is a significant improvement over the previous 91Mbps (~8kint/sec*1500bytes/packet*1packet/int). Reviewed by: hselasky MFC after: 2 months Differential Revision: https://reviews.freebsd.org/D25809 Modified: head/sys/dev/usb/net/if_ure.c head/sys/dev/usb/net/if_urereg.h head/sys/modules/usb/ure/Makefile Modified: head/sys/dev/usb/net/if_ure.c ============================================================================== --- head/sys/dev/usb/net/if_ure.c Sat Sep 12 00:22:02 2020 (r365647) +++ head/sys/dev/usb/net/if_ure.c Sat Sep 12 00:33:11 2020 (r365648) @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -43,6 +44,10 @@ __FBSDID("$FreeBSD$"); #include #include +/* needed for checksum offload */ +#include +#include + #include #include @@ -60,6 +65,8 @@ __FBSDID("$FreeBSD$"); #include "miibus_if.h" +#include "opt_inet6.h" + #ifdef USB_DEBUG static int ure_debug = 0; @@ -69,6 +76,21 @@ SYSCTL_INT(_hw_usb_ure, OID_AUTO, debug, CTLFLAG_RWTUN "Debug level"); #endif +#ifdef USB_DEBUG_VAR +#ifdef USB_DEBUG +#define DEVPRINTFN(n,dev,fmt,...) do { \ + if ((USB_DEBUG_VAR) >= (n)) { \ + device_printf((dev), "%s: " fmt, \ + __FUNCTION__ ,##__VA_ARGS__); \ + } \ +} while (0) +#define DEVPRINTF(...) DEVPRINTFN(1, __VA_ARGS__) +#else +#define DEVPRINTF(...) do { } while (0) +#define DEVPRINTFN(...) do { } while (0) +#endif +#endif + /* * Various supported device vendors/products. */ @@ -118,6 +140,8 @@ static int ure_write_4(struct ure_softc *, uint16_t, u static uint16_t ure_ocp_reg_read(struct ure_softc *, uint16_t); static void ure_ocp_reg_write(struct ure_softc *, uint16_t, uint16_t); +static int ure_sysctl_chipver(SYSCTL_HANDLER_ARGS); + static void ure_read_chipver(struct ure_softc *); static int ure_attach_post_sub(struct usb_ether *); static void ure_reset(struct ure_softc *); @@ -128,28 +152,91 @@ static void ure_rtl8152_init(struct ure_softc *); static void ure_rtl8153_init(struct ure_softc *); static void ure_disable_teredo(struct ure_softc *); static void ure_init_fifo(struct ure_softc *); +static void ure_rxcsum(int capenb, struct ure_rxpkt *rp, struct mbuf *m); +static int ure_txcsum(struct mbuf *m, int caps, uint32_t *regout); -static const struct usb_config ure_config[URE_N_TRANSFER] = { - [URE_BULK_DT_WR] = { +static const struct usb_config ure_config_rx[URE_N_TRANSFER] = { + { .type = UE_BULK, .endpoint = UE_ADDR_ANY, - .direction = UE_DIR_OUT, - .bufsize = MCLBYTES, - .flags = {.pipe_bof = 1,.force_short_xfer = 1,}, - .callback = ure_bulk_write_callback, - .timeout = 10000, /* 10 seconds */ + .direction = UE_DIR_IN, + .bufsize = URE_TRANSFER_SIZE, + .flags = {.pipe_bof = 1,.short_xfer_ok = 1,}, + .callback = ure_bulk_read_callback, + .timeout = 0, /* no timeout */ }, - [URE_BULK_DT_RD] = { + { .type = UE_BULK, .endpoint = UE_ADDR_ANY, .direction = UE_DIR_IN, - .bufsize = 16384, + .bufsize = URE_TRANSFER_SIZE, .flags = {.pipe_bof = 1,.short_xfer_ok = 1,}, .callback = ure_bulk_read_callback, .timeout = 0, /* no timeout */ }, +#if URE_N_TRANSFER == 4 + { + .type = UE_BULK, + .endpoint = UE_ADDR_ANY, + .direction = UE_DIR_IN, + .bufsize = URE_TRANSFER_SIZE, + .flags = {.pipe_bof = 1,.short_xfer_ok = 1,}, + .callback = ure_bulk_read_callback, + .timeout = 0, /* no timeout */ + }, + { + .type = UE_BULK, + .endpoint = UE_ADDR_ANY, + .direction = UE_DIR_IN, + .bufsize = URE_TRANSFER_SIZE, + .flags = {.pipe_bof = 1,.short_xfer_ok = 1,}, + .callback = ure_bulk_read_callback, + .timeout = 0, /* no timeout */ + }, +#endif }; +static const struct usb_config ure_config_tx[URE_N_TRANSFER] = { + { + .type = UE_BULK, + .endpoint = UE_ADDR_ANY, + .direction = UE_DIR_OUT, + .bufsize = URE_TRANSFER_SIZE, + .flags = {.pipe_bof = 1,.force_short_xfer = 1,}, + .callback = ure_bulk_write_callback, + .timeout = 10000, /* 10 seconds */ + }, + { + .type = UE_BULK, + .endpoint = UE_ADDR_ANY, + .direction = UE_DIR_OUT, + .bufsize = URE_TRANSFER_SIZE, + .flags = {.pipe_bof = 1,.force_short_xfer = 1,}, + .callback = ure_bulk_write_callback, + .timeout = 10000, /* 10 seconds */ + }, +#if URE_N_TRANSFER == 4 + { + .type = UE_BULK, + .endpoint = UE_ADDR_ANY, + .direction = UE_DIR_OUT, + .bufsize = URE_TRANSFER_SIZE, + .flags = {.pipe_bof = 1,.force_short_xfer = 1,}, + .callback = ure_bulk_write_callback, + .timeout = 10000, /* 10 seconds */ + }, + { + .type = UE_BULK, + .endpoint = UE_ADDR_ANY, + .direction = UE_DIR_OUT, + .bufsize = URE_TRANSFER_SIZE, + .flags = {.pipe_bof = 1,.force_short_xfer = 1,}, + .callback = ure_bulk_write_callback, + .timeout = 10000, /* 10 seconds */ + }, +#endif +}; + static device_method_t ure_methods[] = { /* Device interface. */ DEVMETHOD(device_probe, ure_probe), @@ -419,11 +506,13 @@ ure_miibus_statchg(device_t dev) case IFM_10_T: case IFM_100_TX: sc->sc_flags |= URE_FLAG_LINK; + sc->sc_rxstarted = 0; break; case IFM_1000_T: if ((sc->sc_flags & URE_FLAG_8152) != 0) break; sc->sc_flags |= URE_FLAG_LINK; + sc->sc_rxstarted = 0; break; default: break; @@ -475,13 +564,28 @@ ure_attach(device_t dev) mtx_init(&sc->sc_mtx, device_get_nameunit(dev), NULL, MTX_DEF); iface_index = URE_IFACE_IDX; - error = usbd_transfer_setup(uaa->device, &iface_index, sc->sc_xfer, - ure_config, URE_N_TRANSFER, sc, &sc->sc_mtx); + error = usbd_transfer_setup(uaa->device, &iface_index, sc->sc_rx_xfer, + ure_config_rx, URE_N_TRANSFER, sc, &sc->sc_mtx); if (error != 0) { - device_printf(dev, "allocating USB transfers failed\n"); + device_printf(dev, "allocating USB RX transfers failed\n"); goto detach; } + error = usbd_transfer_setup(uaa->device, &iface_index, sc->sc_tx_xfer, + ure_config_tx, URE_N_TRANSFER, sc, &sc->sc_mtx); + if (error != 0) { + usbd_transfer_unsetup(sc->sc_rx_xfer, URE_N_TRANSFER); + device_printf(dev, "allocating USB TX transfers failed\n"); + goto detach; + } + + /* Mark all TX transfers as available */ + for (int i = 0; i < URE_N_TRANSFER; i++) { + sc->sc_txavail[i] = sc->sc_tx_xfer[i]; + DEVPRINTF(dev, "sc_txavail[%d] = %p\n", i, sc->sc_txavail[i]); + } + sc->sc_txpos = 0; + ue->ue_sc = sc; ue->ue_dev = dev; ue->ue_udev = uaa->device; @@ -506,13 +610,50 @@ ure_detach(device_t dev) struct ure_softc *sc = device_get_softc(dev); struct usb_ether *ue = &sc->sc_ue; - usbd_transfer_unsetup(sc->sc_xfer, URE_N_TRANSFER); + usbd_transfer_unsetup(sc->sc_tx_xfer, URE_N_TRANSFER); + usbd_transfer_unsetup(sc->sc_rx_xfer, URE_N_TRANSFER); uether_ifdetach(ue); mtx_destroy(&sc->sc_mtx); return (0); } +/* + * Copy from USB buffers to a new mbuf chain with pkt header. + * + * This will use m_getm2 to get a mbuf chain w/ properly sized mbuf + * clusters as necessary. + */ +static struct mbuf * +ure_makembuf(struct usb_page_cache *pc, usb_frlength_t offset, + usb_frlength_t len) +{ + struct usb_page_search_res; + struct mbuf *m, *mb; + usb_frlength_t tlen; + + m = m_getm2(NULL, len + ETHER_ALIGN, M_NOWAIT, MT_DATA, M_PKTHDR); + if (m == NULL) + return (m); + + /* uether_newbuf does this. */ + m_adj(m, ETHER_ALIGN); + + m->m_pkthdr.len = len; + + for (mb = m; len > 0; mb = mb->m_next) { + tlen = MIN(len, M_TRAILINGSPACE(mb)); + + usbd_copy_out(pc, offset, mtod(mb, uint8_t *), tlen); + mb->m_len = tlen; + + offset += tlen; + len -= tlen; + } + + return (m); +} + static void ure_bulk_read_callback(struct usb_xfer *xfer, usb_error_t error) { @@ -520,27 +661,84 @@ ure_bulk_read_callback(struct usb_xfer *xfer, usb_erro struct usb_ether *ue = &sc->sc_ue; struct ifnet *ifp = uether_getifp(ue); struct usb_page_cache *pc; + struct mbuf *m; struct ure_rxpkt pkt; - int actlen, len; + int actlen, off, len; + int caps; + uint32_t pktcsum; usbd_xfer_status(xfer, &actlen, NULL, NULL, NULL); switch (USB_GET_STATE(xfer)) { case USB_ST_TRANSFERRED: - if (actlen < (int)(sizeof(pkt))) { - if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); - goto tr_setup; - } + off = 0; pc = usbd_xfer_get_frame(xfer, 0); - usbd_copy_out(pc, 0, &pkt, sizeof(pkt)); - len = le32toh(pkt.ure_pktlen) & URE_RXPKT_LEN_MASK; - len -= ETHER_CRC_LEN; - if (actlen < (int)(len + sizeof(pkt))) { - if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); - goto tr_setup; + caps = if_getcapenable(ifp); + DEVPRINTFN(13, sc->sc_ue.ue_dev, "rcb start\n"); + while (actlen > 0) { + if (actlen < (int)(sizeof(pkt))) { + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); + goto tr_setup; + } + usbd_copy_out(pc, off, &pkt, sizeof(pkt)); + + off += sizeof(pkt); + actlen -= sizeof(pkt); + + len = le32toh(pkt.ure_pktlen) & URE_RXPKT_LEN_MASK; + + DEVPRINTFN(13, sc->sc_ue.ue_dev, + "rxpkt: %#x, %#x, %#x, %#x, %#x, %#x\n", + pkt.ure_pktlen, pkt.ure_csum, pkt.ure_misc, + pkt.ure_rsvd2, pkt.ure_rsvd3, pkt.ure_rsvd4); + DEVPRINTFN(13, sc->sc_ue.ue_dev, "len: %d\n", len); + + if (len >= URE_RXPKT_LEN_MASK) { + /* + * drop the rest of this segment. With out + * more information, we cannot know where next + * packet starts. Blindly continuing would + * cause a packet in packet attack, allowing + * one VLAN to inject packets w/o a VLAN tag, + * or injecting packets into other VLANs. + */ + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); + goto tr_setup; + } + + if (actlen < len) { + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); + goto tr_setup; + } + + if (len != 0) + m = ure_makembuf(pc, off, len - ETHER_CRC_LEN); + else + m = NULL; + if (m == NULL) { + if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1); + } else { + /* make mbuf and queue */ + pktcsum = le32toh(pkt.ure_csum); + if (caps & IFCAP_VLAN_HWTAGGING && + pktcsum & URE_RXPKT_RX_VLAN_TAG) { + m->m_pkthdr.ether_vtag = + bswap16(pktcsum & + URE_RXPKT_VLAN_MASK); + m->m_flags |= M_VLANTAG; + } + + /* set the necessary flags for rx checksum */ + ure_rxcsum(caps, &pkt, m); + + uether_rxmbuf(ue, m, len - ETHER_CRC_LEN); + } + + off += roundup(len, URE_RXPKT_ALIGN); + actlen -= roundup(len, URE_RXPKT_ALIGN); } + DEVPRINTFN(13, sc->sc_ue.ue_dev, "rcb end\n"); - uether_rxbuf(ue, pc, sizeof(pkt), len); /* FALLTHROUGH */ case USB_ST_SETUP: tr_setup: @@ -570,52 +768,118 @@ ure_bulk_write_callback(struct usb_xfer *xfer, usb_err struct usb_page_cache *pc; struct mbuf *m; struct ure_txpkt txpkt; + uint32_t regtmp; int len, pos; + int rem; + int caps; switch (USB_GET_STATE(xfer)) { case USB_ST_TRANSFERRED: DPRINTFN(11, "transfer complete\n"); ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; + /* FALLTHROUGH */ case USB_ST_SETUP: tr_setup: - if ((sc->sc_flags & URE_FLAG_LINK) == 0 || - (ifp->if_drv_flags & IFF_DRV_OACTIVE) != 0) { - /* - * don't send anything if there is no link ! - */ - return; - } - IFQ_DRV_DEQUEUE(&ifp->if_snd, m); - if (m == NULL) + if ((sc->sc_flags & URE_FLAG_LINK) == 0) { + /* don't send anything if there is no link! */ break; - pos = 0; - len = m->m_pkthdr.len; + } + pc = usbd_xfer_get_frame(xfer, 0); - memset(&txpkt, 0, sizeof(txpkt)); - txpkt.ure_pktlen = htole32((len & URE_TXPKT_LEN_MASK) | - URE_TKPKT_TX_FS | URE_TKPKT_TX_LS); - usbd_copy_in(pc, pos, &txpkt, sizeof(txpkt)); - pos += sizeof(txpkt); - usbd_m_copy_in(pc, pos, m, 0, m->m_pkthdr.len); - pos += m->m_pkthdr.len; + caps = if_getcapenable(ifp); - if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); + pos = 0; + rem = URE_TRANSFER_SIZE; + while (rem > sizeof(txpkt)) { + IFQ_DRV_DEQUEUE(&ifp->if_snd, m); + if (m == NULL) + break; - /* - * If there's a BPF listener, bounce a copy - * of this frame to him. - */ - BPF_MTAP(ifp, m); + /* + * make sure we don't ever send too large of a + * packet + */ + len = m->m_pkthdr.len; + if ((len & URE_TXPKT_LEN_MASK) != len) { + device_printf(sc->sc_ue.ue_dev, + "pkt len too large: %#x", len); +pkterror: + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); + m_freem(m); + continue; + } - m_freem(m); + if (sizeof(txpkt) + + roundup(len, URE_TXPKT_ALIGN) > rem) { + /* out of space */ + IFQ_DRV_PREPEND(&ifp->if_snd, m); + m = NULL; + break; + } + txpkt = (struct ure_txpkt){}; + txpkt.ure_pktlen = htole32((len & URE_TXPKT_LEN_MASK) | + URE_TKPKT_TX_FS | URE_TKPKT_TX_LS); + if (m->m_flags & M_VLANTAG) { + txpkt.ure_csum = htole32( + bswap16(m->m_pkthdr.ether_vtag & + URE_TXPKT_VLAN_MASK) | URE_TXPKT_VLAN); + } + if (ure_txcsum(m, caps, ®tmp)) { + device_printf(sc->sc_ue.ue_dev, + "pkt l4 off too large"); + goto pkterror; + } + txpkt.ure_csum |= htole32(regtmp); + + DEVPRINTFN(13, sc->sc_ue.ue_dev, + "txpkt: mbflg: %#x, %#x, %#x\n", + m->m_pkthdr.csum_flags, le32toh(txpkt.ure_pktlen), + le32toh(txpkt.ure_csum)); + + usbd_copy_in(pc, pos, &txpkt, sizeof(txpkt)); + + pos += sizeof(txpkt); + rem -= sizeof(txpkt); + + usbd_m_copy_in(pc, pos, m, 0, len); + + pos += roundup(len, URE_TXPKT_ALIGN); + rem -= roundup(len, URE_TXPKT_ALIGN); + + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); + + /* + * If there's a BPF listener, bounce a copy + * of this frame to him. + */ + BPF_MTAP(ifp, m); + + m_freem(m); + } + + /* no packets to send */ + if (pos == 0) + break; + /* Set frame length. */ usbd_xfer_set_frame_len(xfer, 0, pos); usbd_transfer_submit(xfer); - ifp->if_drv_flags |= IFF_DRV_OACTIVE; + + KASSERT(sc->sc_txpos >= 0 && sc->sc_txpos <= URE_N_TRANSFER, + ("sc_txpos invalid: %d", sc->sc_txpos)); + if (sc->sc_txpos < URE_N_TRANSFER && + !IFQ_DRV_IS_EMPTY(&ifp->if_snd)) { + xfer = sc->sc_txavail[sc->sc_txpos++]; + usbd_transfer_start(xfer); + } + + if (sc->sc_txpos == URE_N_TRANSFER) + ifp->if_drv_flags |= IFF_DRV_OACTIVE; return; + default: /* Error */ DPRINTFN(11, "transfer error, %s\n", usbd_errstr(error)); @@ -623,13 +887,22 @@ tr_setup: if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; + if (error == USB_ERR_TIMEOUT) { + DEVPRINTFN(12, sc->sc_ue.ue_dev, + "pkt tx timeout\n"); + } + if (error != USB_ERR_CANCELLED) { /* try to clear stall first */ usbd_xfer_set_stall(xfer); goto tr_setup; } - return; } + + KASSERT(sc->sc_txpos > 0 && sc->sc_txpos <= URE_N_TRANSFER, ("sc_txpos invalid: %d", sc->sc_txpos)); + sc->sc_txavail[(--(sc->sc_txpos))] = xfer; + if (sc->sc_txpos < URE_N_TRANSFER) + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; } static void @@ -638,6 +911,7 @@ ure_read_chipver(struct ure_softc *sc) uint16_t ver; ver = ure_read_2(sc, URE_PLA_TCR1, URE_MCU_TYPE_PLA) & URE_VERSION_MASK; + sc->sc_ver = ver; switch (ver) { case 0x4c00: sc->sc_chip |= URE_CHIP_VER_4C00; @@ -664,11 +938,31 @@ ure_read_chipver(struct ure_softc *sc) } } +static int +ure_sysctl_chipver(SYSCTL_HANDLER_ARGS) +{ + struct sbuf sb; + struct ure_softc *sc = arg1; + int error; + + sbuf_new_for_sysctl(&sb, NULL, 0, req); + + sbuf_printf(&sb, "%04x", sc->sc_ver); + + error = sbuf_finish(&sb); + sbuf_delete(&sb); + + return (error); +} + static void ure_attach_post(struct usb_ether *ue) { struct ure_softc *sc = uether_getsc(ue); + struct sysctl_ctx_list *sctx; + struct sysctl_oid *soid; + sc->sc_rxstarted = 0; sc->sc_phyno = 0; /* Determine the chip version. */ @@ -694,6 +988,13 @@ ure_attach_post(struct usb_ether *ue) sc->sc_ue.ue_eaddr[0] &= ~0x01; /* unicast */ sc->sc_ue.ue_eaddr[0] |= 0x02; /* locally administered */ } + + sctx = device_get_sysctl_ctx(sc->sc_ue.ue_dev); + soid = device_get_sysctl_tree(sc->sc_ue.ue_dev); + SYSCTL_ADD_PROC(sctx, SYSCTL_CHILDREN(soid), OID_AUTO, "chipver", + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, sc, 0, + ure_sysctl_chipver, "A", + "Return string with chip version."); } static int @@ -710,9 +1011,22 @@ ure_attach_post_sub(struct usb_ether *ue) ifp->if_ioctl = ure_ioctl; ifp->if_init = uether_init; IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen); - ifp->if_snd.ifq_drv_maxlen = ifqmaxlen; + /* + * Try to keep two transfers full at a time. + * ~(TRANSFER_SIZE / 80 bytes/pkt * 2 buffers in flight) + */ + ifp->if_snd.ifq_drv_maxlen = 512; IFQ_SET_READY(&ifp->if_snd); + if_setcapabilitiesbit(ifp, IFCAP_VLAN_MTU, 0); + if_setcapabilitiesbit(ifp, IFCAP_VLAN_HWTAGGING, 0); + if_setcapabilitiesbit(ifp, IFCAP_VLAN_HWCSUM|IFCAP_HWCSUM, 0); + if_sethwassist(ifp, CSUM_IP|CSUM_IP_UDP|CSUM_IP_TCP); +#ifdef INET6 + if_setcapabilitiesbit(ifp, IFCAP_HWCSUM_IPV6, 0); +#endif + if_setcapenable(ifp, if_getcapabilities(ifp)); + mtx_lock(&Giant); error = mii_attach(ue->ue_dev, &ue->ue_miibus, ifp, uether_ifmedia_upd, ue->ue_methods->ue_mii_sts, @@ -727,6 +1041,7 @@ ure_init(struct usb_ether *ue) { struct ure_softc *sc = uether_getsc(ue); struct ifnet *ifp = uether_getifp(ue); + uint16_t cpcr; URE_LOCK_ASSERT(sc, MA_OWNED); @@ -752,6 +1067,17 @@ ure_init(struct usb_ether *ue) ure_read_2(sc, URE_PLA_FMC, URE_MCU_TYPE_PLA) | URE_FMC_FCR_MCU_EN); + /* Enable RX VLANs if enabled */ + cpcr = ure_read_2(sc, URE_PLA_CPCR, URE_MCU_TYPE_PLA); + if (if_getcapenable(ifp) & IFCAP_VLAN_HWTAGGING) { + DEVPRINTFN(12, sc->sc_ue.ue_dev, "enabled hw vlan tag\n"); + cpcr |= URE_CPCR_RX_VLAN; + } else { + DEVPRINTFN(12, sc->sc_ue.ue_dev, "disabled hw vlan tag\n"); + cpcr &= ~URE_CPCR_RX_VLAN; + } + ure_write_2(sc, URE_PLA_CPCR, URE_MCU_TYPE_PLA, cpcr); + /* Enable transmit and receive. */ ure_write_1(sc, URE_PLA_CR, URE_MCU_TYPE_PLA, ure_read_1(sc, URE_PLA_CR, URE_MCU_TYPE_PLA) | URE_CR_RE | @@ -764,7 +1090,7 @@ ure_init(struct usb_ether *ue) /* Configure RX filters. */ ure_rxfilter(ue); - usbd_xfer_set_stall(sc->sc_xfer[URE_BULK_DT_WR]); + usbd_xfer_set_stall(sc->sc_tx_xfer[0]); /* Indicate we are up and running. */ ifp->if_drv_flags |= IFF_DRV_RUNNING; @@ -777,15 +1103,29 @@ static void ure_tick(struct usb_ether *ue) { struct ure_softc *sc = uether_getsc(ue); + struct ifnet *ifp = uether_getifp(ue); struct mii_data *mii = GET_MII(sc); URE_LOCK_ASSERT(sc, MA_OWNED); + KASSERT(sc->sc_txpos >= 0 && sc->sc_txpos <= URE_N_TRANSFER, ("sc_txpos invalid: %d", sc->sc_txpos)); + (void)ifp; + DEVPRINTFN(13, sc->sc_ue.ue_dev, + "sc_txpos: %d, oactive: %d\n", sc->sc_txpos, !!(ifp->if_drv_flags & IFF_DRV_OACTIVE)); + for (int i = 0; i < URE_N_TRANSFER; i++) + DEVPRINTFN(13, sc->sc_ue.ue_dev, + "rx[%d] = %d\n", i, USB_GET_STATE(sc->sc_rx_xfer[i])); + + for (int i = 0; i < URE_N_TRANSFER; i++) + DEVPRINTFN(13, sc->sc_ue.ue_dev, + "tx[%d] = %d\n", i, USB_GET_STATE(sc->sc_tx_xfer[i])); + mii_tick(mii); if ((sc->sc_flags & URE_FLAG_LINK) == 0 && mii->mii_media_status & IFM_ACTIVE && IFM_SUBTYPE(mii->mii_media_active) != IFM_NONE) { sc->sc_flags |= URE_FLAG_LINK; + sc->sc_rxstarted = 0; ure_start(ue); } } @@ -828,15 +1168,17 @@ ure_rxfilter(struct usb_ether *ue) goto done; } - rxmode |= URE_RCR_AM; + /* calculate multicast masks */ if_foreach_llmaddr(ifp, ure_hash_maddr, &hashes); h = bswap32(hashes[0]); hashes[0] = bswap32(hashes[1]); hashes[1] = h; - rxmode |= URE_RCR_AM; + rxmode |= URE_RCR_AM; /* accept multicast packets */ done: + DEVPRINTFN(14, ue->ue_dev, "rxfilt: RCR: %#x\n", + ure_read_4(sc, URE_PLA_RCR, URE_MCU_TYPE_PLA)); ure_write_4(sc, URE_PLA_MAR0, URE_MCU_TYPE_PLA, hashes[0]); ure_write_4(sc, URE_PLA_MAR4, URE_MCU_TYPE_PLA, hashes[1]); ure_write_4(sc, URE_PLA_RCR, URE_MCU_TYPE_PLA, rxmode); @@ -846,12 +1188,34 @@ static void ure_start(struct usb_ether *ue) { struct ure_softc *sc = uether_getsc(ue); + struct usb_xfer *xfer; + struct ifnet *ifp; + URE_LOCK_ASSERT(sc, MA_OWNED); + + if (!sc->sc_rxstarted) { + sc->sc_rxstarted = 1; + for (int i = 0; i < URE_N_TRANSFER; i++) + usbd_transfer_start(sc->sc_rx_xfer[i]); + } + /* * start the USB transfers, if not already started: */ - usbd_transfer_start(sc->sc_xfer[URE_BULK_DT_RD]); - usbd_transfer_start(sc->sc_xfer[URE_BULK_DT_WR]); + if (sc->sc_txpos == URE_N_TRANSFER) { + ifp = uether_getifp(&sc->sc_ue); + + ifp->if_drv_flags |= IFF_DRV_OACTIVE; + return; + } + + KASSERT(sc->sc_txpos >= 0 && sc->sc_txpos < URE_N_TRANSFER, ("sc_txpos invalid: %d", sc->sc_txpos)); + xfer = sc->sc_txavail[sc->sc_txpos++]; + if (sc->sc_txpos == URE_N_TRANSFER) { + ifp = uether_getifp(&sc->sc_ue); + ifp->if_drv_flags |= IFF_DRV_OACTIVE; + } + usbd_transfer_start(xfer); } static void @@ -921,9 +1285,31 @@ ure_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) ifr = (struct ifreq *)data; error = 0; reinit = 0; - if (cmd == SIOCSIFCAP) { + switch (cmd) { + case SIOCSIFCAP: URE_LOCK(sc); mask = ifr->ifr_reqcap ^ ifp->if_capenable; + if ((mask & IFCAP_VLAN_HWTAGGING) != 0 && + (ifp->if_capabilities & IFCAP_VLAN_HWTAGGING) != 0) { + ifp->if_capenable ^= IFCAP_VLAN_HWTAGGING; + reinit++; + } + if ((mask & IFCAP_TXCSUM) != 0 && + (ifp->if_capabilities & IFCAP_TXCSUM) != 0) { + ifp->if_capenable ^= IFCAP_TXCSUM; + } + if ((mask & IFCAP_RXCSUM) != 0 && + (ifp->if_capabilities & IFCAP_RXCSUM) != 0) { + ifp->if_capenable ^= IFCAP_RXCSUM; + } + if ((mask & IFCAP_TXCSUM_IPV6) != 0 && + (ifp->if_capabilities & IFCAP_TXCSUM_IPV6) != 0) { + ifp->if_capenable ^= IFCAP_TXCSUM_IPV6; + } + if ((mask & IFCAP_RXCSUM_IPV6) != 0 && + (ifp->if_capabilities & IFCAP_RXCSUM_IPV6) != 0) { + ifp->if_capenable ^= IFCAP_RXCSUM_IPV6; + } if (reinit > 0 && ifp->if_drv_flags & IFF_DRV_RUNNING) ifp->if_drv_flags &= ~IFF_DRV_RUNNING; else @@ -931,8 +1317,29 @@ ure_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) URE_UNLOCK(sc); if (reinit > 0) uether_init(ue); - } else + break; + + case SIOCSIFMTU: + /* + * in testing large MTUs "crashes" the device, it + * leaves the device w/ a broken state where link + * is in a bad state. + */ + if (ifr->ifr_mtu < ETHERMIN || + ifr->ifr_mtu > (4096 - ETHER_HDR_LEN - + ETHER_VLAN_ENCAP_LEN - ETHER_CRC_LEN)) { + error = EINVAL; + break; + } + URE_LOCK(sc); + if (if_getmtu(ifp) != ifr->ifr_mtu) + if_setmtu(ifp, ifr->ifr_mtu); + URE_UNLOCK(sc); + break; + + default: error = uether_ioctl(ifp, cmd, data); + } return (error); } @@ -971,10 +1378,10 @@ ure_rtl8152_init(struct ure_softc *sc) URE_GPHY_STS_MSK | URE_SPEED_DOWN_MSK | URE_SPDWN_RXDV_MSK | URE_SPDWN_LINKCHG_MSK); - /* Disable Rx aggregation. */ + /* Enable Rx aggregation. */ ure_write_2(sc, URE_USB_USB_CTRL, URE_MCU_TYPE_USB, - ure_read_2(sc, URE_USB_USB_CTRL, URE_MCU_TYPE_USB) | - URE_RX_AGG_DISABLE); + ure_read_2(sc, URE_USB_USB_CTRL, URE_MCU_TYPE_USB) & + ~URE_RX_AGG_DISABLE); /* Disable ALDPS. */ ure_ocp_reg_write(sc, URE_OCP_ALDPS_CONFIG, URE_ENPDNPS | URE_LINKENA | @@ -1123,10 +1530,10 @@ ure_rtl8153_init(struct ure_softc *sc) ure_init_fifo(sc); - /* Disable Rx aggregation. */ + /* Enable Rx aggregation. */ ure_write_2(sc, URE_USB_USB_CTRL, URE_MCU_TYPE_USB, - ure_read_2(sc, URE_USB_USB_CTRL, URE_MCU_TYPE_USB) | - URE_RX_AGG_DISABLE); + ure_read_2(sc, URE_USB_USB_CTRL, URE_MCU_TYPE_USB) & + ~URE_RX_AGG_DISABLE); val = ure_read_2(sc, URE_USB_U2P3_CTRL, URE_MCU_TYPE_USB); if (!(sc->sc_chip & (URE_CHIP_VER_5C00 | URE_CHIP_VER_5C10))) @@ -1150,12 +1557,15 @@ ure_stop(struct usb_ether *ue) ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); sc->sc_flags &= ~URE_FLAG_LINK; + sc->sc_rxstarted = 0; /* * stop all the transfers, if not already stopped: */ - usbd_transfer_stop(sc->sc_xfer[URE_BULK_DT_WR]); - usbd_transfer_stop(sc->sc_xfer[URE_BULK_DT_RD]); + for (int i = 0; i < URE_N_TRANSFER; i++) { + usbd_transfer_stop(sc->sc_rx_xfer[i]); + usbd_transfer_stop(sc->sc_tx_xfer[i]); + } } static void @@ -1183,6 +1593,7 @@ ure_init_fifo(struct ure_softc *sc) ure_disable_teredo(sc); + DEVPRINTFN(14, sc->sc_ue.ue_dev, "init_fifo: RCR: %#x\n", ure_read_4(sc, URE_PLA_RCR, URE_MCU_TYPE_PLA)); ure_write_4(sc, URE_PLA_RCR, URE_MCU_TYPE_PLA, ure_read_4(sc, URE_PLA_RCR, URE_MCU_TYPE_PLA) & ~URE_RCR_ACPT_ALL); @@ -1280,4 +1691,129 @@ ure_init_fifo(struct ure_softc *sc) /* Configure Tx FIFO threshold. */ ure_write_4(sc, URE_PLA_TXFIFO_CTRL, URE_MCU_TYPE_PLA, URE_TXFIFO_THR_NORMAL); +} + +/* + * Update mbuf for rx checksum from hardware + */ +static void +ure_rxcsum(int capenb, struct ure_rxpkt *rp, struct mbuf *m) +{ + int flags; + uint32_t csum, misc; + int tcp, udp; + + m->m_pkthdr.csum_flags = 0; + + if (!(capenb & IFCAP_RXCSUM)) + return; + + csum = le32toh(rp->ure_csum); + misc = le32toh(rp->ure_misc); + + tcp = udp = 0; + + flags = 0; + if (csum & URE_RXPKT_IPV4_CS) + flags |= CSUM_IP_CHECKED; + else if (csum & URE_RXPKT_IPV6_CS) + flags = 0; + + tcp = rp->ure_csum & URE_RXPKT_TCP_CS; + udp = rp->ure_csum & URE_RXPKT_UDP_CS; + + if (__predict_true((flags & CSUM_IP_CHECKED) && + !(misc & URE_RXPKT_IP_F))) { + flags |= CSUM_IP_VALID; + } + if (__predict_true( + (tcp && !(misc & URE_RXPKT_TCP_F)) || + (udp && !(misc & URE_RXPKT_UDP_F)))) { + flags |= CSUM_DATA_VALID|CSUM_PSEUDO_HDR; + m->m_pkthdr.csum_data = 0xFFFF; + } + + m->m_pkthdr.csum_flags = flags; +} + +/* + * If the L4 checksum offset is larger than 0x7ff (2047), return failure. + * We currently restrict MTU such that it can't happen, and even if we + * did have a large enough MTU, only a very specially crafted IPv6 packet + * with MANY headers could possibly come close. + * + * Returns 0 for success, and 1 if the packet cannot be checksummed and + * should be dropped. + */ +static int +ure_txcsum(struct mbuf *m, int caps, uint32_t *regout) +{ + struct ip ip; + struct ether_header *eh; + int flags; + uint32_t data; + uint32_t reg; + int l3off, l4off; + uint16_t type; + + *regout = 0; + flags = m->m_pkthdr.csum_flags; + if (flags == 0) + return (0); + + if (__predict_true(m->m_len >= (int)sizeof(*eh))) { + eh = mtod(m, struct ether_header *); + type = eh->ether_type; + } else + m_copydata(m, offsetof(struct ether_header, ether_type), + sizeof(type), (caddr_t)&type); + + switch (type = htons(type)) { + case ETHERTYPE_IP: + case ETHERTYPE_IPV6: + l3off = ETHER_HDR_LEN; + break; + case ETHERTYPE_VLAN: + /* XXX - what about QinQ? */ + l3off = ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN; + break; + default: + return (0); + } + + reg = 0; + + if (flags & CSUM_IP) + reg |= URE_TXPKT_IPV4_CS; + + data = m->m_pkthdr.csum_data; + if (flags & (CSUM_IP_TCP | CSUM_IP_UDP)) { + m_copydata(m, l3off, sizeof ip, (caddr_t)&ip); + l4off = l3off + (ip.ip_hl << 2) + data; + if (__predict_false(l4off > URE_L4_OFFSET_MAX)) + return (1); + + reg |= URE_TXPKT_IPV4_CS; + if (flags & CSUM_IP_TCP) + reg |= URE_TXPKT_TCP_CS; + else if (flags & CSUM_IP_UDP) + reg |= URE_TXPKT_UDP_CS; + reg |= l4off << URE_L4_OFFSET_SHIFT; + } +#ifdef INET6 + else if (flags & (CSUM_IP6_TCP | CSUM_IP6_UDP)) { + l4off = l3off + data; + if (__predict_false(l4off > URE_L4_OFFSET_MAX)) + return (1); + + reg |= URE_TXPKT_IPV6_CS; + if (flags & CSUM_IP6_TCP) + reg |= URE_TXPKT_TCP_CS; + else if (flags & CSUM_IP6_UDP) + reg |= URE_TXPKT_UDP_CS; + reg |= l4off << URE_L4_OFFSET_SHIFT; + } +#endif + *regout = reg; + return 0; } Modified: head/sys/dev/usb/net/if_urereg.h ============================================================================== --- head/sys/dev/usb/net/if_urereg.h Sat Sep 12 00:22:02 2020 (r365647) +++ head/sys/dev/usb/net/if_urereg.h Sat Sep 12 00:33:11 2020 (r365648) @@ -143,6 +143,10 @@ #define URE_RCR_APM 0x00000002 #define URE_RCR_AM 0x00000004 #define URE_RCR_AB 0x00000008 +#define URE_RCR_AR 0x00000010 /* runt */ +#define URE_RCR_AER 0x00000020 /* error pkts */ +#define URE_RCR_ACPTFLOW 0x00000080 +#define URE_RCR_RXEMPTY 0x00020000 #define URE_RCR_ACPT_ALL \ (URE_RCR_AAP | URE_RCR_APM | URE_RCR_AM | URE_RCR_AB) @@ -391,35 +395,65 @@ struct ure_intrpkt { uint8_t ure_col_cnt; } __packed; +#define URE_RXPKT_ALIGN 8 struct ure_rxpkt { uint32_t ure_pktlen; #define URE_RXPKT_LEN_MASK 0x7fff - uint32_t ure_rsvd0; - uint32_t ure_rsvd1; + uint32_t ure_csum; +/* Linux driver has this in ure_misc, but my device has it in ure_csum */ +#define URE_RXPKT_VLAN_MASK 0xffff *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sat Sep 12 01:48:00 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EEE823EDA75; Sat, 12 Sep 2020 01:48:00 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BpFrJ642bz4BCP; Sat, 12 Sep 2020 01:48:00 +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 B36E3D4BE; Sat, 12 Sep 2020 01:48: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 08C1m0Q7015899; Sat, 12 Sep 2020 01:48:00 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08C1lxGg015891; Sat, 12 Sep 2020 01:47:59 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202009120147.08C1lxGg015891@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 12 Sep 2020 01:47:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365649 - in stable/12: libexec libexec/phttpget share/mk tools/build/mk usr.sbin/portsnap usr.sbin/portsnap/phttpget X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable/12: libexec libexec/phttpget share/mk tools/build/mk usr.sbin/portsnap usr.sbin/portsnap/phttpget X-SVN-Commit-Revision: 365649 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.33 Precedence: list List-Id: "SVN commit messages 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, 12 Sep 2020 01:48:01 -0000 Author: kevans Date: Sat Sep 12 01:47:59 2020 New Revision: 365649 URL: https://svnweb.freebsd.org/changeset/base/365649 Log: MFC r365490-r365491: Remove FREEBSD_UPDATE dependency on PORTSNAP r365490: phttpget: move out of portsnap Currently, WITHOUT_PORTSNAP forces WITHOUT_FREEBSD_UPDATE because the latter relies on phttpget, which lives inside the portsnap build bits. Remove the dependency between these two options by moving phttpget out into ^/libexec and building/installing it if either WITH_PORTSNAP or WITH_FREEBSD_UPDATE. Future work could remove the conditional if it's decided that users will use it independently of either the current in-base consumers. r365491: opts: FREEBSD_UPDATE no longer relies on PORTSNAP phttpget is no longer tied to the portsnap build as of r365490. Added: stable/12/libexec/phttpget/ - copied from r365491, head/libexec/phttpget/ Deleted: stable/12/usr.sbin/portsnap/phttpget/ Modified: stable/12/libexec/Makefile stable/12/share/mk/src.opts.mk stable/12/tools/build/mk/OptionalObsoleteFiles.inc stable/12/usr.sbin/portsnap/Makefile Directory Properties: stable/12/ (props changed) Modified: stable/12/libexec/Makefile ============================================================================== --- stable/12/libexec/Makefile Sat Sep 12 00:33:11 2020 (r365648) +++ stable/12/libexec/Makefile Sat Sep 12 01:47:59 2020 (r365649) @@ -13,6 +13,7 @@ SUBDIR= ${_atf} \ ${_mail.local} \ ${_makewhatis.local} \ ${_mknetid} \ + ${_phttpget} \ ${_pppoed} \ rc \ revnetgroup \ @@ -46,6 +47,10 @@ SUBDIR+= bootpd .if ${MK_FINGER} != "no" SUBDIR+= fingerd +.endif + +.if ${MK_FREEBSD_UPDATE} != "no" || ${MK_PORTSNAP} != "no" +_phttpget= phttpget .endif .if ${MK_FTP} != "no" Modified: stable/12/share/mk/src.opts.mk ============================================================================== --- stable/12/share/mk/src.opts.mk Sat Sep 12 00:33:11 2020 (r365648) +++ stable/12/share/mk/src.opts.mk Sat Sep 12 01:47:59 2020 (r365649) @@ -527,11 +527,6 @@ MK_AUTHPF:= no MK_OFED_EXTRA:= no .endif -.if ${MK_PORTSNAP} == "no" -# freebsd-update depends on phttpget from portsnap -MK_FREEBSD_UPDATE:= no -.endif - .if ${MK_TESTS} == "no" MK_DTRACE_TESTS:= no .endif Modified: stable/12/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- stable/12/tools/build/mk/OptionalObsoleteFiles.inc Sat Sep 12 00:33:11 2020 (r365648) +++ stable/12/tools/build/mk/OptionalObsoleteFiles.inc Sat Sep 12 01:47:59 2020 (r365649) @@ -2851,6 +2851,11 @@ OLD_FILES+=usr/share/man/man5/freebsd-update.conf.5.gz OLD_FILES+=usr/share/man/man8/freebsd-update.8.gz .endif +.if ${MK_FREEBSD_UPDATE} == no && ${MK_PORTSNAP} == no +OLD_FILES+=usr/libexec/phttpget +OLD_FILES+=usr/share/man/man8/phttpget.8.gz +.endif + .if ${MK_GAMES} == no OLD_FILES+=usr/bin/caesar OLD_FILES+=usr/bin/factor @@ -7870,10 +7875,8 @@ OLD_FILES+=usr/share/man/man8/pmcstudy.8.gz .if ${MK_PORTSNAP} == no OLD_FILES+=etc/portsnap.conf OLD_FILES+=usr/libexec/make_index -OLD_FILES+=usr/libexec/phttpget OLD_FILES+=usr/sbin/portsnap OLD_FILES+=usr/share/examples/etc/portsnap.conf -OLD_FILES+=usr/share/man/man8/phttpget.8.gz OLD_FILES+=usr/share/man/man8/portsnap.8.gz .endif Modified: stable/12/usr.sbin/portsnap/Makefile ============================================================================== --- stable/12/usr.sbin/portsnap/Makefile Sat Sep 12 00:33:11 2020 (r365648) +++ stable/12/usr.sbin/portsnap/Makefile Sat Sep 12 01:47:59 2020 (r365649) @@ -1,5 +1,5 @@ # $FreeBSD$ -SUBDIR= portsnap make_index phttpget +SUBDIR= portsnap make_index .include From owner-svn-src-all@freebsd.org Sat Sep 12 01:54:47 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A7A6D3EDDEF; Sat, 12 Sep 2020 01:54:47 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BpG073xhBz4Bs5; Sat, 12 Sep 2020 01:54: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 6BE30D900; Sat, 12 Sep 2020 01:54: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 08C1slwk022316; Sat, 12 Sep 2020 01:54:47 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08C1slEH022315; Sat, 12 Sep 2020 01:54:47 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202009120154.08C1slEH022315@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 12 Sep 2020 01:54:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365650 - stable/12/tools/build/options X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/12/tools/build/options X-SVN-Commit-Revision: 365650 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.33 Precedence: list List-Id: "SVN commit messages 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, 12 Sep 2020 01:54:47 -0000 Author: kevans Date: Sat Sep 12 01:54:47 2020 New Revision: 365650 URL: https://svnweb.freebsd.org/changeset/base/365650 Log: Add missing WITHOUT_CAROOT description This should have been MFC'd as part of r353800, but was not because caroot had not been MFC'd at that time. As such, this is a direct commit to stable/12. Added: stable/12/tools/build/options/WITHOUT_CAROOT - copied unchanged from r365649, head/tools/build/options/WITHOUT_CAROOT Copied: stable/12/tools/build/options/WITHOUT_CAROOT (from r365649, head/tools/build/options/WITHOUT_CAROOT) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/tools/build/options/WITHOUT_CAROOT Sat Sep 12 01:54:47 2020 (r365650, copy of r365649, head/tools/build/options/WITHOUT_CAROOT) @@ -0,0 +1,3 @@ +.\" $FreeBSD$ +Set to not add the trusted certificates from the Mozilla NSS bundle to +base. From owner-svn-src-all@freebsd.org Sat Sep 12 01:55:08 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 718323EE03C; Sat, 12 Sep 2020 01:55:08 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BpG0X2pgvz4CQr; Sat, 12 Sep 2020 01:55:08 +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 43D48D4ED; Sat, 12 Sep 2020 01:55:08 +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 08C1t80u022413; Sat, 12 Sep 2020 01:55:08 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08C1t8gC022412; Sat, 12 Sep 2020 01:55:08 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202009120155.08C1t8gC022412@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 12 Sep 2020 01:55:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365651 - stable/12/share/man/man5 X-SVN-Group: stable-12 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/12/share/man/man5 X-SVN-Commit-Revision: 365651 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.33 Precedence: list List-Id: "SVN commit messages 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, 12 Sep 2020 01:55:08 -0000 Author: kevans Date: Sat Sep 12 01:55:07 2020 New Revision: 365651 URL: https://svnweb.freebsd.org/changeset/base/365651 Log: Regen src.conf(5) after r365649 Modified: stable/12/share/man/man5/src.conf.5 Modified: stable/12/share/man/man5/src.conf.5 ============================================================================== --- stable/12/share/man/man5/src.conf.5 Sat Sep 12 01:54:47 2020 (r365650) +++ stable/12/share/man/man5/src.conf.5 Sat Sep 12 01:55:07 2020 (r365651) @@ -1,6 +1,6 @@ .\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman. .\" $FreeBSD$ -.Dd April 9, 2020 +.Dd September 11, 2020 .Dt SRC.CONF 5 .Os .Sh NAME @@ -188,7 +188,7 @@ as part of the normal system build. .Pp This is a default setting on -arm64/aarch64 and riscv/riscv64. +arm64/aarch64, riscv/riscv64 and riscv/riscv64sf. When set, it enforces these options: .Pp .Bl -item -compact @@ -211,7 +211,7 @@ Do not build GNU binutils as part of the bootstrap process. .Pp This is a default setting on -arm64/aarch64 and riscv/riscv64. +arm64/aarch64, riscv/riscv64 and riscv/riscv64sf. .It Va WITH_BINUTILS_BOOTSTRAP Build GNU binutils as part of the bootstrap process. @@ -294,6 +294,9 @@ When set, it enforces these options: .It .Va WITHOUT_CASPER .El +.It Va WITHOUT_CAROOT +Set to not add the trusted certificates from the Mozilla NSS bundle to +base. .It Va WITHOUT_CASPER Set to not build Casper program and related libraries. .It Va WITH_CCACHE_BUILD @@ -355,13 +358,15 @@ When set, it enforces these options: Set to not build the Clang C/C++ compiler during the regular phase of the build. .Pp This is a default setting on -riscv/riscv64 and sparc64/sparc64. +sparc64/sparc64. When set, it enforces these options: .Pp .Bl -item -compact .It .Va WITHOUT_CLANG_EXTRAS .It +.Va WITHOUT_CLANG_FORMAT +.It .Va WITHOUT_CLANG_FULL .It .Va WITHOUT_LLVM_COV @@ -370,7 +375,7 @@ When set, it enforces these options: Set to build the Clang C/C++ compiler during the normal phase of the build. .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. +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, powerpc/powerpcspe, riscv/riscv64 and riscv/riscv64sf. .It Va WITHOUT_CLANG_BOOTSTRAP Set to not build the Clang C/C++ compiler during the bootstrap phase of the build. @@ -378,26 +383,28 @@ To be able to build the system, either gcc or clang bo enabled unless an alternate compiler is provided via XCC. .Pp This is a default setting on -mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64 and sparc64/sparc64. +mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe and sparc64/sparc64. .It Va WITH_CLANG_BOOTSTRAP Set to build the Clang C/C++ compiler during the bootstrap phase of the build. .Pp This is a default setting on -amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64 and i386/i386. +amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, riscv/riscv64 and riscv/riscv64sf. .It Va WITH_CLANG_EXTRAS Set to build additional clang and llvm tools, such as bugpoint. +.It Va WITH_CLANG_FORMAT +Set to build clang-format. .It Va WITHOUT_CLANG_FULL Set to avoid building the ARCMigrate, Rewriter and StaticAnalyzer components of the Clang C/C++ compiler. .Pp This is a default setting on -riscv/riscv64 and sparc64/sparc64. +sparc64/sparc64. .It Va WITH_CLANG_FULL Set to build the ARCMigrate, Rewriter and StaticAnalyzer components of the Clang C/C++ compiler. .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. +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, powerpc/powerpcspe, riscv/riscv64 and riscv/riscv64sf. .It Va WITHOUT_CLANG_IS_CC Set to install the GCC compiler as .Pa /usr/bin/cc , @@ -406,7 +413,7 @@ and .Pa /usr/bin/cpp . .Pp This is a default setting on -mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64 and sparc64/sparc64. +mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe and sparc64/sparc64. .It Va WITH_CLANG_IS_CC Set to install the Clang C/C++ compiler as .Pa /usr/bin/cc , @@ -415,7 +422,7 @@ and .Pa /usr/bin/cpp . .Pp This is a default setting on -amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64 and i386/i386. +amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, riscv/riscv64 and riscv/riscv64sf. .It Va WITHOUT_CPP Set to not build .Xr cpp 1 . @@ -464,7 +471,15 @@ When set, it enforces these options: .It .Va WITHOUT_OPENSSL .It +.Va WITHOUT_PKGBOOTSTRAP +.It +.Va WITHOUT_SVN +.It +.Va WITHOUT_SVNLITE +.It .Va WITHOUT_UNBOUND +.It +.Va WITHOUT_WIRELESS .El .Pp When set, these options are also in effect: @@ -490,7 +505,7 @@ Set to not build .Xr cxgbetool 8 .Pp This is a default setting on -arm/arm, arm/armv6, arm/armv7, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpcspe and riscv/riscv64. +arm/arm, arm/armv6, arm/armv7, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpcspe, riscv/riscv64 and riscv/riscv64sf. .It Va WITH_CXGBETOOL Set to build .Xr cxgbetool 8 @@ -513,6 +528,8 @@ When set, it enforces these options: .It .Va WITHOUT_CLANG_EXTRAS .It +.Va WITHOUT_CLANG_FORMAT +.It .Va WITHOUT_CLANG_FULL .It .Va WITHOUT_DTRACE_TESTS @@ -655,7 +672,7 @@ and .Xr efivar 8 . .Pp This is a default setting on -mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64 and sparc64/sparc64. +mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. .It Va WITH_EFI Set to build .Xr efivar 3 @@ -719,7 +736,7 @@ Set to not build games. Set to not build and install gcc and g++ as part of the normal build process. .Pp This is a default setting on -amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386 and riscv/riscv64. +amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, riscv/riscv64 and riscv/riscv64sf. .It Va WITH_GCC Set to build and install gcc and g++. .Pp @@ -732,7 +749,7 @@ unless an alternative compiler is provided via XCC. .Pp This is a default setting on -amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386 and riscv/riscv64. +amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, riscv/riscv64 and riscv/riscv64sf. .It Va WITH_GCC_BOOTSTRAP Set to build gcc and g++ as part of the bootstrap process. .Pp @@ -747,7 +764,7 @@ Set to not build .Xr gdb 1 . .Pp This is a default setting on -arm64/aarch64 and riscv/riscv64. +arm64/aarch64, riscv/riscv64 and riscv/riscv64sf. .It Va WITH_GDB Set to build .Xr gdb 1 . @@ -774,19 +791,19 @@ to be used as a fallback for if a newer version is not installed. .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, powerpc/powerpcspe and riscv/riscv64. +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, powerpc/powerpcspe, riscv/riscv64 and riscv/riscv64sf. .It Va WITHOUT_GNUCXX Do not build the GNU C++ stack (g++, libstdc++). This is the default on platforms where clang is the system compiler. .Pp This is a default setting on -amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64 and i386/i386. +amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, riscv/riscv64 and riscv/riscv64sf. .It Va WITH_GNUCXX Build the GNU C++ stack (g++, libstdc++). This is the default on platforms where gcc is the system compiler. .Pp This is a default setting on -mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64 and sparc64/sparc64. +mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe and sparc64/sparc64. .It Va WITHOUT_GNU_DIFF Set to not build GNU .Xr diff 1 @@ -813,13 +830,13 @@ Set to build the BSD licensed version of the device tr than the GPLed one from elinux.org. .Pp This is a default setting on -amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64 and i386/i386. +amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, riscv/riscv64 and riscv/riscv64sf. .It Va WITH_GPL_DTC Set to build the GPL'd version of the device tree compiler from elinux.org, instead of the BSD licensed one. .Pp This is a default setting on -mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64 and sparc64/sparc64. +mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe and sparc64/sparc64. .It Va WITHOUT_GSSAPI Set to not build libgssapi. .It Va WITHOUT_HAST @@ -834,7 +851,7 @@ Set to not build HTML docs. Set to not build or install HyperV utilities. .Pp This is a default setting on -arm/arm, arm/armv6, arm/armv7, arm64/aarch64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64 and sparc64/sparc64. +arm/arm, arm/armv6, arm/armv7, arm64/aarch64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. .It Va WITH_HYPERV Set to build or install HyperV utilities. .Pp @@ -1011,17 +1028,17 @@ library. Set to not build LLVM's lld linker. .Pp This is a default setting on -riscv/riscv64 and sparc64/sparc64. +sparc64/sparc64. .It Va WITH_LLD Set to build LLVM's lld linker. .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. +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, powerpc/powerpcspe, riscv/riscv64 and riscv/riscv64sf. .It Va WITHOUT_LLDB Set to not build the LLDB debugger. .Pp This is a default setting on -arm/arm, arm/armv6, arm/armv7, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64 and sparc64/sparc64. +arm/arm, arm/armv6, arm/armv7, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. .It Va WITH_LLDB Set to build the LLDB debugger. .Pp @@ -1034,22 +1051,22 @@ To be able to build the system, either Binutils or LLD enabled unless an alternate linker is provided via XLD. .Pp This is a default setting on -arm/arm, arm/armv6, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64 and sparc64/sparc64. +arm/arm, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe and sparc64/sparc64. .It Va WITH_LLD_BOOTSTRAP Set to build the LLD linker during the bootstrap phase of the build. .Pp This is a default setting on -amd64/amd64, arm/armv7, arm64/aarch64 and i386/i386. +amd64/amd64, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, riscv/riscv64 and riscv/riscv64sf. .It Va WITHOUT_LLD_IS_LD Set to use GNU binutils ld as the system linker, instead of LLVM's LLD. .Pp This is a default setting on -arm/arm, arm/armv6, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64 and sparc64/sparc64. +arm/arm, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe and sparc64/sparc64. .It Va WITH_LLD_IS_LD Set to use LLVM's LLD as the system linker, instead of GNU binutils ld. .Pp This is a default setting on -amd64/amd64, arm/armv7, arm64/aarch64 and i386/i386. +amd64/amd64, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, riscv/riscv64 and riscv/riscv64sf. .It Va WITH_LLVM_ASSERTIONS Set to enable debugging assertions in LLVM. .It Va WITHOUT_LLVM_COV @@ -1058,14 +1075,14 @@ Set to not build the tool. .Pp This is a default setting on -riscv/riscv64 and sparc64/sparc64. +sparc64/sparc64. .It Va WITH_LLVM_COV Set to build the .Xr llvm-cov 1 tool. .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. +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, powerpc/powerpcspe, riscv/riscv64 and riscv/riscv64sf. .It Va WITHOUT_LLVM_LIBUNWIND Set to use GCC's stack unwinder (instead of LLVM's libunwind). .Pp @@ -1075,7 +1092,7 @@ arm/arm, arm/armv6, arm/armv7, powerpc/powerpc, powerp Set to use LLVM's libunwind stack unwinder (instead of GCC's unwinder). .Pp This is a default setting on -amd64/amd64, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf and riscv/riscv64. +amd64/amd64, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, riscv/riscv64 and riscv/riscv64sf. .It Va WITHOUT_LLVM_TARGET_AARCH64 Set to not build LLVM target support for AArch64. The @@ -1083,7 +1100,7 @@ The option should be used rather than this in most cases. .Pp This is a default setting on -arm/arm and arm/armv6. +arm/arm. .It Va WITH_LLVM_TARGET_AARCH64 Set to build LLVM target support for AArch64. The @@ -1091,7 +1108,7 @@ The option should be used rather than this in most cases. .Pp This is a default setting on -amd64/amd64, 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, powerpc/powerpcspe, riscv/riscv64 and sparc64/sparc64. +amd64/amd64, 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, powerpc/powerpcspe, riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. .It Va WITHOUT_LLVM_TARGET_ALL Set to only build the required LLVM target support. This option is preferred to specific target support options. @@ -1114,6 +1131,10 @@ is set explicitly) (unless .Va WITH_LLVM_TARGET_POWERPC is set explicitly) +.It Va WITHOUT_LLVM_TARGET_RISCV +(unless +.Va WITH_LLVM_TARGET_RISCV +is set explicitly) .It Va WITHOUT_LLVM_TARGET_SPARC (unless .Va WITH_LLVM_TARGET_SPARC @@ -1136,7 +1157,7 @@ The option should be used rather than this in most cases. .Pp This is a default setting on -arm/arm and arm/armv6. +arm/arm. .It Va WITH_LLVM_TARGET_MIPS Set to build LLVM target support for MIPS. The @@ -1144,7 +1165,7 @@ The option should be used rather than this in most cases. .Pp This is a default setting on -amd64/amd64, 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, powerpc/powerpcspe, riscv/riscv64 and sparc64/sparc64. +amd64/amd64, 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, powerpc/powerpcspe, riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. .It Va WITHOUT_LLVM_TARGET_POWERPC Set to not build LLVM target support for PowerPC. The @@ -1152,7 +1173,7 @@ The option should be used rather than this in most cases. .Pp This is a default setting on -arm/arm and arm/armv6. +arm/arm. .It Va WITH_LLVM_TARGET_POWERPC Set to build LLVM target support for PowerPC. The @@ -1160,12 +1181,23 @@ The option should be used rather than this in most cases. .Pp This is a default setting on -amd64/amd64, 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, powerpc/powerpcspe, riscv/riscv64 and sparc64/sparc64. +amd64/amd64, 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, powerpc/powerpcspe, riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. +.It Va WITHOUT_LLVM_TARGET_RISCV +Set to not build LLVM target support for RISC-V. +The +.Va LLVM_TARGET_ALL +option should be used rather than this in most cases. +.Pp +This is a default setting on +arm/arm. .It Va WITH_LLVM_TARGET_RISCV Set to build LLVM target support for RISC-V. The .Va LLVM_TARGET_ALL option should be used rather than this in most cases. +.Pp +This is a default setting on +amd64/amd64, 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, powerpc/powerpcspe, riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. .It Va WITHOUT_LLVM_TARGET_SPARC Set to not build LLVM target support for SPARC. The @@ -1173,7 +1205,7 @@ The option should be used rather than this in most cases. .Pp This is a default setting on -arm/arm and arm/armv6. +arm/arm. .It Va WITH_LLVM_TARGET_SPARC Set to build LLVM target support for SPARC. The @@ -1181,7 +1213,7 @@ The option should be used rather than this in most cases. .Pp This is a default setting on -amd64/amd64, 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, powerpc/powerpcspe, riscv/riscv64 and sparc64/sparc64. +amd64/amd64, 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, powerpc/powerpcspe, riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. .It Va WITHOUT_LLVM_TARGET_X86 Set to not build LLVM target support for X86. The @@ -1189,7 +1221,7 @@ The option should be used rather than this in most cases. .Pp This is a default setting on -arm/arm and arm/armv6. +arm/arm. .It Va WITH_LLVM_TARGET_X86 Set to build LLVM target support for X86. The @@ -1197,7 +1229,7 @@ The option should be used rather than this in most cases. .Pp This is a default setting on -amd64/amd64, 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, powerpc/powerpcspe, riscv/riscv64 and sparc64/sparc64. +amd64/amd64, 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, powerpc/powerpcspe, riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. .It Va WITH_LOADER_EFI_SECUREBOOT Enable building .Xr loader 8 @@ -1218,7 +1250,7 @@ powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe Set to build GELI bootloader support. .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 and riscv/riscv64. +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, riscv/riscv64 and riscv/riscv64sf. .It Va WITHOUT_LOADER_LUA Set to not build LUA bindings for the boot loader. .Pp @@ -1228,12 +1260,12 @@ powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe Set to build LUA bindings for the boot loader. .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 and riscv/riscv64. +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, riscv/riscv64 and riscv/riscv64sf. .It Va WITHOUT_LOADER_OFW Disable building of openfirmware bootloader components. .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 and riscv/riscv64. +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, riscv/riscv64 and riscv/riscv64sf. .It Va WITH_LOADER_OFW Set to build openfirmware bootloader components. .Pp @@ -1243,7 +1275,7 @@ powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe Disable building of ubldr. .Pp This is a default setting on -amd64/amd64, arm64/aarch64, i386/i386, riscv/riscv64 and sparc64/sparc64. +amd64/amd64, arm64/aarch64, i386/i386, riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. .It Va WITH_LOADER_UBOOT Set to build ubldr. .Pp @@ -1407,7 +1439,7 @@ Set to not build .Xr mlx5tool 8 .Pp This is a default setting on -arm/arm, arm/armv6, arm/armv7, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpcspe and riscv/riscv64. +arm/arm, arm/armv6, arm/armv7, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpcspe, riscv/riscv64 and riscv/riscv64sf. .It Va WITH_MLX5TOOL Set to build .Xr mlx5tool 8 @@ -1485,7 +1517,7 @@ and related programs. Set to not build nvme related tools and kernel modules. .Pp This is a default setting on -arm/arm, arm/armv6, arm/armv7, arm64/aarch64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpcspe, riscv/riscv64 and sparc64/sparc64. +arm/arm, arm/armv6, arm/armv7, arm64/aarch64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpcspe, riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. .It Va WITH_NVME Set to build nvme related tools and kernel modules. @@ -1506,12 +1538,12 @@ Enable building openldap support for kerberos. Set to not build LLVM's OpenMP runtime. .Pp This is a default setting on -arm/arm, arm/armv6, arm/armv7, arm64/aarch64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpcspe, riscv/riscv64 and sparc64/sparc64. +arm/arm, arm/armv6, arm/armv7, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpcspe, riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. .It Va WITH_OPENMP Set to build LLVM's OpenMP runtime. .Pp This is a default setting on -amd64/amd64, i386/i386 and powerpc/powerpc64. +amd64/amd64, arm64/aarch64, i386/i386 and powerpc/powerpc64. .It Va WITHOUT_OPENSSH Set to not build OpenSSH. .It Va WITHOUT_OPENSSL @@ -1530,7 +1562,15 @@ When set, it enforces these options: .It .Va WITHOUT_OPENSSH .It +.Va WITHOUT_PKGBOOTSTRAP +.It +.Va WITHOUT_SVN +.It +.Va WITHOUT_SVNLITE +.It .Va WITHOUT_UNBOUND +.It +.Va WITHOUT_WIRELESS .El .Pp When set, these options are also in effect: @@ -1586,12 +1626,6 @@ and related programs. Set to not build or install .Xr portsnap 8 and related files. -When set, it enforces these options: -.Pp -.Bl -item -compact -.It -.Va WITHOUT_FREEBSD_UPDATE -.El .It Va WITHOUT_PPP Set to not build .Xr ppp 8 @@ -1607,7 +1641,7 @@ Set to build profiled libraries for use with .Xr gprof 8 . .Pp This is a default setting on -amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mipsn32, mips/mipselhf, mips/mipshf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64 and sparc64/sparc64. +amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mipsn32, mips/mipselhf, mips/mipshf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. .It Va WITHOUT_QUOTAS Set to not build .Xr quota 1 @@ -1697,7 +1731,7 @@ mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mi Set to build world with propolice stack smashing protection. .Pp This is a default setting on -amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64 and sparc64/sparc64. +amd64/amd64, arm/arm, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. .It Va WITH_STAGING Enable staging of files to a stage tree. This can be best thought of as auto-install to @@ -1859,6 +1893,8 @@ When set, it enforces these options: .It .Va WITHOUT_CLANG_EXTRAS .It +.Va WITHOUT_CLANG_FORMAT +.It .Va WITHOUT_CLANG_FULL .It .Va WITHOUT_GCC @@ -1961,14 +1997,9 @@ When set, it enforces these options: .Bl -item -compact .It .Va WITHOUT_ZONEINFO_LEAPSECONDS_SUPPORT -.It -.Va WITHOUT_ZONEINFO_OLD_TIMEZONES_SUPPORT .El .It Va WITH_ZONEINFO_LEAPSECONDS_SUPPORT Set to build leapsecond information in to the timezone database. -.It Va WITH_ZONEINFO_OLD_TIMEZONES_SUPPORT -Set to build backward compatibility timezone aliases in to the timezone -database. .El .Sh FILES .Bl -tag -compact -width Pa From owner-svn-src-all@freebsd.org Sat Sep 12 07:04:01 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 98B973F6077; Sat, 12 Sep 2020 07:04:01 +0000 (UTC) (envelope-from jah@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BpNrx3KJdz4VbF; Sat, 12 Sep 2020 07:04:01 +0000 (UTC) (envelope-from jah@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 3B228111C2; Sat, 12 Sep 2020 07:04:01 +0000 (UTC) (envelope-from jah@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08C7416T014154; Sat, 12 Sep 2020 07:04:01 GMT (envelope-from jah@FreeBSD.org) Received: (from jah@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08C7401Z014153; Sat, 12 Sep 2020 07:04:00 GMT (envelope-from jah@FreeBSD.org) Message-Id: <202009120704.08C7401Z014153@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jah set sender to jah@FreeBSD.org using -f From: "Jason A. Harmening" Date: Sat, 12 Sep 2020 07:04:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365652 - in head/sys: sys x86/x86 X-SVN-Group: head X-SVN-Commit-Author: jah X-SVN-Commit-Paths: in head/sys: sys x86/x86 X-SVN-Commit-Revision: 365652 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.33 Precedence: list List-Id: "SVN commit messages 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, 12 Sep 2020 07:04:01 -0000 Author: jah Date: Sat Sep 12 07:04:00 2020 New Revision: 365652 URL: https://svnweb.freebsd.org/changeset/base/365652 Log: amd64: prevent KCSan false positives on LAPIC mapping For configurations without x2APIC support (guests, older hardware), the global LAPIC MMIO mapping will trigger false-positive KCSan reports as it will appear that multiple CPUs are concurrently reading and writing the same address. This isn't actually true, as the underlying physical access will be performed on the local CPU's APIC. Additionally, because LAPIC access can happen during event timer configuration, the resulting KCSan printf can produce a panic due to attempted recursion on event timer resources. Add a __nosanitizethread preprocessor define to prevent the compiler from inserting TSan hooks, and apply it to the x86 LAPIC accessors. PR: 249149 Reported by: gbe Reviewed by: andrew, kib Tested by: gbe Differential Revision: https://reviews.freebsd.org/D26354 Modified: head/sys/sys/cdefs.h head/sys/x86/x86/local_apic.c Modified: head/sys/sys/cdefs.h ============================================================================== --- head/sys/sys/cdefs.h Sat Sep 12 01:55:07 2020 (r365651) +++ head/sys/sys/cdefs.h Sat Sep 12 07:04:00 2020 (r365652) @@ -880,8 +880,10 @@ */ #if __has_attribute(no_sanitize) && defined(__clang__) #define __nosanitizeaddress __attribute__((no_sanitize("address"))) +#define __nosanitizethread __attribute__((no_sanitize("thread"))) #else #define __nosanitizeaddress +#define __nosanitizethread #endif /* Guard variables and structure members by lock. */ Modified: head/sys/x86/x86/local_apic.c ============================================================================== --- head/sys/x86/x86/local_apic.c Sat Sep 12 01:55:07 2020 (r365651) +++ head/sys/x86/x86/local_apic.c Sat Sep 12 07:04:00 2020 (r365652) @@ -215,7 +215,17 @@ SYSCTL_INT(_hw_apic, OID_AUTO, timer_tsc_deadline, CTL static void lapic_calibrate_initcount(struct lapic *la); static void lapic_calibrate_deadline(struct lapic *la); -static uint32_t +/* + * Use __nosanitizethread to exempt the LAPIC I/O accessors from KCSan + * instrumentation. Otherwise, if x2APIC is not available, use of the global + * lapic_map will generate a KCSan false positive. While the mapping is + * shared among all CPUs, the physical access will always take place on the + * local CPU's APIC, so there isn't in fact a race here. Furthermore, the + * KCSan warning printf can cause a panic if issued during LAPIC access, + * due to attempted recursive use of event timer resources. + */ + +static uint32_t __nosanitizethread lapic_read32(enum LAPIC_REGISTERS reg) { uint32_t res; @@ -228,7 +238,7 @@ lapic_read32(enum LAPIC_REGISTERS reg) return (res); } -static void +static void __nosanitizethread lapic_write32(enum LAPIC_REGISTERS reg, uint32_t val) { @@ -241,7 +251,7 @@ lapic_write32(enum LAPIC_REGISTERS reg, uint32_t val) } } -static void +static void __nosanitizethread lapic_write32_nofence(enum LAPIC_REGISTERS reg, uint32_t val) { From owner-svn-src-all@freebsd.org Sat Sep 12 09:44:51 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 41C533D1FE1; Sat, 12 Sep 2020 09:44: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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BpSQW0h08z4dv5; Sat, 12 Sep 2020 09:44:51 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EB71613306; Sat, 12 Sep 2020 09:44: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 08C9ios6012371; Sat, 12 Sep 2020 09:44:50 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08C9ioQh012370; Sat, 12 Sep 2020 09:44:50 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202009120944.08C9ioQh012370@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 12 Sep 2020 09:44:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365653 - stable/12/libexec/rtld-elf X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/libexec/rtld-elf X-SVN-Commit-Revision: 365653 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.33 Precedence: list List-Id: "SVN commit messages 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, 12 Sep 2020 09:44:51 -0000 Author: kib Date: Sat Sep 12 09:44:50 2020 New Revision: 365653 URL: https://svnweb.freebsd.org/changeset/base/365653 Log: MFC r365368: rtld: do not process absent dynamic. PR: 249121 Modified: stable/12/libexec/rtld-elf/rtld.c Directory Properties: stable/12/ (props changed) Modified: stable/12/libexec/rtld-elf/rtld.c ============================================================================== --- stable/12/libexec/rtld-elf/rtld.c Sat Sep 12 07:04:00 2020 (r365652) +++ stable/12/libexec/rtld-elf/rtld.c Sat Sep 12 09:44:50 2020 (r365653) @@ -1066,7 +1066,10 @@ digest_dynamic1(Obj_Entry *obj, int early, const Elf_D *dyn_runpath = NULL; obj->bind_now = false; - for (dynp = obj->dynamic; dynp->d_tag != DT_NULL; dynp++) { + dynp = obj->dynamic; + if (dynp == NULL) + return; + for (; dynp->d_tag != DT_NULL; dynp++) { switch (dynp->d_tag) { case DT_REL: From owner-svn-src-all@freebsd.org Sat Sep 12 09:46:14 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D054D3D2184; Sat, 12 Sep 2020 09:46: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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BpSS65CzXz4f6V; Sat, 12 Sep 2020 09:46: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 96679130AA; Sat, 12 Sep 2020 09:46: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 08C9kEUb012551; Sat, 12 Sep 2020 09:46:14 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08C9kEhp012550; Sat, 12 Sep 2020 09:46:14 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202009120946.08C9kEhp012550@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 12 Sep 2020 09:46:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365654 - stable/12/libexec/rtld-elf X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/libexec/rtld-elf X-SVN-Commit-Revision: 365654 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.33 Precedence: list List-Id: "SVN commit messages 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, 12 Sep 2020 09:46:14 -0000 Author: kib Date: Sat Sep 12 09:46:14 2020 New Revision: 365654 URL: https://svnweb.freebsd.org/changeset/base/365654 Log: MFC r365369: rtld: do not refuse to relocate objects without dynamic symtabs. PR: 249121 Modified: stable/12/libexec/rtld-elf/rtld.c Directory Properties: stable/12/ (props changed) Modified: stable/12/libexec/rtld-elf/rtld.c ============================================================================== --- stable/12/libexec/rtld-elf/rtld.c Sat Sep 12 09:44:50 2020 (r365653) +++ stable/12/libexec/rtld-elf/rtld.c Sat Sep 12 09:46:14 2020 (r365654) @@ -2979,11 +2979,8 @@ relocate_object(Obj_Entry *obj, bool bind_now, Obj_Ent dbg("relocating \"%s\"", obj->path); if (obj->symtab == NULL || obj->strtab == NULL || - !(obj->valid_hash_sysv || obj->valid_hash_gnu)) { - _rtld_error("%s: Shared object has no run-time symbol table", - obj->path); - return (-1); - } + !(obj->valid_hash_sysv || obj->valid_hash_gnu)) + dbg("object %s has no run-time symbol table", obj->path); /* There are relocations to the write-protected text segment. */ if (obj->textrel && reloc_textrel_prot(obj, true) != 0) From owner-svn-src-all@freebsd.org Sat Sep 12 09:47:26 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 179DD3D20CD; Sat, 12 Sep 2020 09:47:26 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BpSTT6xzPz4fZQ; Sat, 12 Sep 2020 09:47:25 +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 D32B81330D; Sat, 12 Sep 2020 09:47:25 +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 08C9lPM1012682; Sat, 12 Sep 2020 09:47:25 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08C9lPpB012681; Sat, 12 Sep 2020 09:47:25 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202009120947.08C9lPpB012681@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 12 Sep 2020 09:47:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r365655 - stable/11/libexec/rtld-elf X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/libexec/rtld-elf X-SVN-Commit-Revision: 365655 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.33 Precedence: list List-Id: "SVN commit messages 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, 12 Sep 2020 09:47:26 -0000 Author: kib Date: Sat Sep 12 09:47:25 2020 New Revision: 365655 URL: https://svnweb.freebsd.org/changeset/base/365655 Log: MFC r365368: rtld: do not process absent dynamic. PR: 249121 Modified: stable/11/libexec/rtld-elf/rtld.c Directory Properties: stable/11/ (props changed) Modified: stable/11/libexec/rtld-elf/rtld.c ============================================================================== --- stable/11/libexec/rtld-elf/rtld.c Sat Sep 12 09:46:14 2020 (r365654) +++ stable/11/libexec/rtld-elf/rtld.c Sat Sep 12 09:47:25 2020 (r365655) @@ -1066,7 +1066,10 @@ digest_dynamic1(Obj_Entry *obj, int early, const Elf_D *dyn_runpath = NULL; obj->bind_now = false; - for (dynp = obj->dynamic; dynp->d_tag != DT_NULL; dynp++) { + dynp = obj->dynamic; + if (dynp == NULL) + return; + for (; dynp->d_tag != DT_NULL; dynp++) { switch (dynp->d_tag) { case DT_REL: From owner-svn-src-all@freebsd.org Sat Sep 12 09:47:59 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 198F93D1F11; Sat, 12 Sep 2020 09:47:59 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BpSV66Xnbz4fbl; Sat, 12 Sep 2020 09:47:58 +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 C3F2213383; Sat, 12 Sep 2020 09:47:58 +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 08C9lwbc012772; Sat, 12 Sep 2020 09:47:58 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08C9lwi5012771; Sat, 12 Sep 2020 09:47:58 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202009120947.08C9lwi5012771@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 12 Sep 2020 09:47:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r365656 - stable/11/libexec/rtld-elf X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/libexec/rtld-elf X-SVN-Commit-Revision: 365656 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.33 Precedence: list List-Id: "SVN commit messages 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, 12 Sep 2020 09:47:59 -0000 Author: kib Date: Sat Sep 12 09:47:58 2020 New Revision: 365656 URL: https://svnweb.freebsd.org/changeset/base/365656 Log: MFC r365369: rtld: do not refuse to relocate objects without dynamic symtabs. PR: 249121 Modified: stable/11/libexec/rtld-elf/rtld.c Directory Properties: stable/11/ (props changed) Modified: stable/11/libexec/rtld-elf/rtld.c ============================================================================== --- stable/11/libexec/rtld-elf/rtld.c Sat Sep 12 09:47:25 2020 (r365655) +++ stable/11/libexec/rtld-elf/rtld.c Sat Sep 12 09:47:58 2020 (r365656) @@ -2955,11 +2955,8 @@ relocate_object(Obj_Entry *obj, bool bind_now, Obj_Ent dbg("relocating \"%s\"", obj->path); if (obj->symtab == NULL || obj->strtab == NULL || - !(obj->valid_hash_sysv || obj->valid_hash_gnu)) { - _rtld_error("%s: Shared object has no run-time symbol table", - obj->path); - return (-1); - } + !(obj->valid_hash_sysv || obj->valid_hash_gnu)) + dbg("object %s has no run-time symbol table", obj->path); /* There are relocations to the write-protected text segment. */ if (obj->textrel && reloc_textrel_prot(obj, true) != 0) From owner-svn-src-all@freebsd.org Sat Sep 12 11:19:55 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 204113D410C; Sat, 12 Sep 2020 11:19:55 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BpVXC06vzz3WCH; Sat, 12 Sep 2020 11:19:55 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DC83114593; Sat, 12 Sep 2020 11:19:54 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08CBJsW7068279; Sat, 12 Sep 2020 11:19:54 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08CBJsNU068278; Sat, 12 Sep 2020 11:19:54 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202009121119.08CBJsNU068278@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 12 Sep 2020 11:19:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365657 - head/usr.sbin/traceroute6 X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/usr.sbin/traceroute6 X-SVN-Commit-Revision: 365657 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.33 Precedence: list List-Id: "SVN commit messages 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, 12 Sep 2020 11:19:55 -0000 Author: tuexen Date: Sat Sep 12 11:19:54 2020 New Revision: 365657 URL: https://svnweb.freebsd.org/changeset/base/365657 Log: Simplify code, no functional change. Since https://svnweb.freebsd.org/base?view=revision&revision=365378 UDP is handled the same way as SCTP and TCP (using a raw socket). Therefore use the same code path. Modified: head/usr.sbin/traceroute6/traceroute6.c Modified: head/usr.sbin/traceroute6/traceroute6.c ============================================================================== --- head/usr.sbin/traceroute6/traceroute6.c Sat Sep 12 09:47:58 2020 (r365656) +++ head/usr.sbin/traceroute6/traceroute6.c Sat Sep 12 11:19:54 2020 (r365657) @@ -568,15 +568,10 @@ main(int argc, char *argv[]) case IPPROTO_ICMPV6: sndsock = rcvsock; break; - case IPPROTO_UDP: - if ((sndsock = socket(AF_INET6, SOCK_RAW, IPPROTO_UDP)) < 0) { - perror("socket(SOCK_RAW)"); - exit(5); - } - break; case IPPROTO_NONE: case IPPROTO_SCTP: case IPPROTO_TCP: + case IPPROTO_UDP: if ((sndsock = socket(AF_INET6, SOCK_RAW, useproto)) < 0) { perror("socket(SOCK_RAW)"); exit(5); From owner-svn-src-all@freebsd.org Sat Sep 12 11:24:37 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6DD033D43C9; Sat, 12 Sep 2020 11:24:37 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BpVdd2HcPz3Wkx; Sat, 12 Sep 2020 11:24:37 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2EDF014477; Sat, 12 Sep 2020 11:24:37 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08CBObvS073890; Sat, 12 Sep 2020 11:24:37 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08CBObhF073889; Sat, 12 Sep 2020 11:24:37 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202009121124.08CBObhF073889@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 12 Sep 2020 11:24:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365658 - head/usr.sbin/traceroute6 X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/usr.sbin/traceroute6 X-SVN-Commit-Revision: 365658 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.33 Precedence: list List-Id: "SVN commit messages 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, 12 Sep 2020 11:24:37 -0000 Author: tuexen Date: Sat Sep 12 11:24:36 2020 New Revision: 365658 URL: https://svnweb.freebsd.org/changeset/base/365658 Log: Fix the length of probe packets when using UDP. Since https://svnweb.freebsd.org/changeset/base/365378 a raw socket is used for sending UDP probe packets instead of a UDP socket. So don't compensate for the UDP header anymore. Modified: head/usr.sbin/traceroute6/traceroute6.c Modified: head/usr.sbin/traceroute6/traceroute6.c ============================================================================== --- head/usr.sbin/traceroute6/traceroute6.c Sat Sep 12 11:19:54 2020 (r365657) +++ head/usr.sbin/traceroute6/traceroute6.c Sat Sep 12 11:24:36 2020 (r365658) @@ -677,8 +677,6 @@ main(int argc, char *argv[]) minlen, MAXPACKET); exit(1); } - if (useproto == IPPROTO_UDP) - datalen -= sizeof(struct udphdr); if ((useproto == IPPROTO_SCTP) && (datalen & 3)) { fprintf(stderr, "traceroute6: packet size must be a multiple of 4.\n"); From owner-svn-src-all@freebsd.org Sat Sep 12 12:45:32 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6022A3D6F5B; Sat, 12 Sep 2020 12:45:32 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BpXR01vSkz3g2b; Sat, 12 Sep 2020 12:45:32 +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 1FE79152B7; Sat, 12 Sep 2020 12:45:32 +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 08CCjVB6028797; Sat, 12 Sep 2020 12:45:31 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08CCjV3o028796; Sat, 12 Sep 2020 12:45:31 GMT (envelope-from kp@FreeBSD.org) Message-Id: <202009121245.08CCjV3o028796@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Sat, 12 Sep 2020 12:45:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365659 - stable/12/sys/net X-SVN-Group: stable-12 X-SVN-Commit-Author: kp X-SVN-Commit-Paths: stable/12/sys/net X-SVN-Commit-Revision: 365659 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.33 Precedence: list List-Id: "SVN commit messages 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, 12 Sep 2020 12:45:32 -0000 Author: kp Date: Sat Sep 12 12:45:31 2020 New Revision: 365659 URL: https://svnweb.freebsd.org/changeset/base/365659 Log: MFC r365457: net: mitigate vnet / epair cleanup races There's a race where dying vnets move their interfaces back to their original vnet, and if_epair cleanup (where deleting one interface also deletes the other end of the epair). This is commonly triggered by the pf tests, but also by cleanup of vnet jails. As we've not yet been able to fix the root cause of the issue work around the panic by not dereferencing a NULL softc in epair_qflush() and by not re-attaching DYING interfaces. This isn't a full fix, but makes a very common panic far less likely. PR: 244703, 238870 Modified: stable/12/sys/net/if.c stable/12/sys/net/if_epair.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/net/if.c ============================================================================== --- stable/12/sys/net/if.c Sat Sep 12 11:24:36 2020 (r365658) +++ stable/12/sys/net/if.c Sat Sep 12 12:45:31 2020 (r365659) @@ -1280,6 +1280,10 @@ if_vmove(struct ifnet *ifp, struct vnet *new_vnet) ifindex_free_locked(ifp->if_index); IFNET_WUNLOCK(); + /* Don't re-attach DYING interfaces. */ + if (ifp->if_flags & IFF_DYING) + return; + /* * Perform interface-specific reassignment tasks, if provided by * the driver. Modified: stable/12/sys/net/if_epair.c ============================================================================== --- stable/12/sys/net/if_epair.c Sat Sep 12 11:24:36 2020 (r365658) +++ stable/12/sys/net/if_epair.c Sat Sep 12 12:45:31 2020 (r365659) @@ -609,8 +609,14 @@ epair_qflush(struct ifnet *ifp) struct epair_softc *sc; sc = ifp->if_softc; - KASSERT(sc != NULL, ("%s: ifp=%p, epair_softc gone? sc=%p\n", - __func__, ifp, sc)); + + /* + * See epair_clone_destroy(), we can end up getting called twice. + * Don't do anything on the second call. + */ + if (sc == NULL) + return; + /* * Remove this ifp from all backpointer lists. The interface will not * usable for flushing anyway nor should it have anything to flush From owner-svn-src-all@freebsd.org Sat Sep 12 16:33:06 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D64353DCB73; Sat, 12 Sep 2020 16:33:06 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BpdTZ5H2wz4CTN; Sat, 12 Sep 2020 16:33:06 +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 9870F17DF6; Sat, 12 Sep 2020 16:33:06 +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 08CGX6pb072945; Sat, 12 Sep 2020 16:33:06 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08CGX6bf072943; Sat, 12 Sep 2020 16:33:06 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202009121633.08CGX6bf072943@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 12 Sep 2020 16:33:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365661 - in stable: 11/contrib/llvm-project/compiler-rt/lib/builtins 11/lib/libcompiler_rt 11/sys/sys 12/contrib/llvm-project/compiler-rt/lib/builtins 12/lib/libcompiler_rt 12/sys/sys X-SVN-Group: stable-12 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in stable: 11/contrib/llvm-project/compiler-rt/lib/builtins 11/lib/libcompiler_rt 11/sys/sys 12/contrib/llvm-project/compiler-rt/lib/builtins 12/lib/libcompiler_rt 12/sys/sys X-SVN-Commit-Revision: 365661 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.33 Precedence: list List-Id: "SVN commit messages 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, 12 Sep 2020 16:33:06 -0000 Author: dim Date: Sat Sep 12 16:33:05 2020 New Revision: 365661 URL: https://svnweb.freebsd.org/changeset/base/365661 Log: MFC r364753: Add atomic and bswap functions to libcompiler_rt There have been several mentions on our mailing lists about missing atomic functions in our system libraries (e.g. __atomic_load_8 and friends), and recently I saw __bswapdi2 and __bswapsi2 mentioned too. To address this, add implementations for the functions from compiler-rt to the system compiler support libraries, e.g. libcompiler_rt.a and and libgcc_s.so. This also needs a small fixup in compiler-rt's atomic.c, to ensure that 32-bit mips can build correctly. Bump __FreeBSD_version to make it easier for port maintainers to detect when these functions were added. Differential Revision: https://reviews.freebsd.org/D26159 MFC r364782: After r364753, there should be no need to suppress -Watomic-alignment warnings anymore for compiler-rt's atomic.c. This occurred because the IS_LOCK_FREE_8 macro was not correctly defined to 0 for mips, and this caused the compiler to emit a runtime call to __atomic_is_lock_free(), and that triggers the warning. MFC r365509: Follow-up r364753 by enabling compiler-rt's atomic implementation only for clang, as it uses clang specific builtins, and does not compile correctly with gcc. Note that gcc packages usually come with their own libatomic, providing these primitives. MFC r365588: Follow-up r364753 by only using arm's stdatomic.c implementation, as it already covers the functions in compiler-rt's atomic.c, leading to conflicts when linking. PR: 230888 Modified: stable/12/contrib/llvm-project/compiler-rt/lib/builtins/atomic.c stable/12/lib/libcompiler_rt/Makefile.inc stable/12/sys/sys/param.h Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/contrib/llvm-project/compiler-rt/lib/builtins/atomic.c stable/11/lib/libcompiler_rt/Makefile.inc stable/11/sys/sys/param.h Directory Properties: stable/11/ (props changed) Modified: stable/12/contrib/llvm-project/compiler-rt/lib/builtins/atomic.c ============================================================================== --- stable/12/contrib/llvm-project/compiler-rt/lib/builtins/atomic.c Sat Sep 12 15:18:52 2020 (r365660) +++ stable/12/contrib/llvm-project/compiler-rt/lib/builtins/atomic.c Sat Sep 12 16:33:05 2020 (r365661) @@ -124,8 +124,8 @@ static __inline Lock *lock_for_pointer(void *ptr) { #define IS_LOCK_FREE_2 __c11_atomic_is_lock_free(2) #define IS_LOCK_FREE_4 __c11_atomic_is_lock_free(4) -/// 32 bit PowerPC doesn't support 8-byte lock_free atomics -#if !defined(__powerpc64__) && defined(__powerpc__) +/// 32 bit MIPS and PowerPC don't support 8-byte lock_free atomics +#if defined(__mips__) || (!defined(__powerpc64__) && defined(__powerpc__)) #define IS_LOCK_FREE_8 0 #else #define IS_LOCK_FREE_8 __c11_atomic_is_lock_free(8) Modified: stable/12/lib/libcompiler_rt/Makefile.inc ============================================================================== --- stable/12/lib/libcompiler_rt/Makefile.inc Sat Sep 12 15:18:52 2020 (r365660) +++ stable/12/lib/libcompiler_rt/Makefile.inc Sat Sep 12 16:33:05 2020 (r365661) @@ -18,6 +18,8 @@ SRCF+= ashldi3 SRCF+= ashlti3 SRCF+= ashrdi3 SRCF+= ashrti3 +SRCF+= bswapdi2 +SRCF+= bswapsi2 SRCF+= clear_cache SRCF+= clzdi2 SRCF+= clzsi2 @@ -121,6 +123,13 @@ SRCF+= umoddi3 SRCF+= umodsi3 SRCF+= umodti3 +# Enable compiler-rt's atomic implementation only for clang, as it uses clang +# specific builtins, and gcc packages usually come with their own libatomic. +# Exclude arm which has its own implementations of atomic functions, below. +.if "${COMPILER_TYPE}" == "clang" && ${MACHINE_CPUARCH} != "arm" +SRCF+= atomic +.endif + # Avoid using SSE2 instructions on i386, if unsupported. .if ${MACHINE_CPUARCH} == "i386" && empty(MACHINE_CPU:Msse2) SRCS+= floatdidf.c @@ -213,12 +222,6 @@ CFLAGS+= -DEMIT_SYNC_ATOMICS SRCF+= stdatomic .endif -.if "${COMPILER_TYPE}" == "clang" && \ - (${MACHINE_ARCH} == "powerpc" || ${MACHINE_ARCH} == "powerpcspe") -SRCS+= atomic.c -CFLAGS.atomic.c+= -Wno-atomic-alignment -.endif - .for file in ${SRCF} .if ${MACHINE_ARCH:Marmv[67]*} && (!defined(CPUTYPE) || ${CPUTYPE:M*soft*} == "") \ && exists(${CRTSRC}/${CRTARCH}/${file}vfp.S) @@ -240,18 +243,9 @@ SRCS+= aeabi_memmove.S SRCS+= aeabi_memset.S SRCS+= aeabi_uidivmod.S SRCS+= aeabi_uldivmod.S -SRCS+= bswapdi2.S -SRCS+= bswapsi2.S SRCS+= switch16.S SRCS+= switch32.S SRCS+= switch8.S SRCS+= switchu8.S SRCS+= sync_synchronize.S -.endif - -# On some archs GCC-6.3 requires bswap32 built-in. -.if ${MACHINE_CPUARCH} == "mips" || ${MACHINE_CPUARCH} == "riscv" || \ - ${MACHINE_CPUARCH} == "sparc64" -SRCS+= bswapdi2.c -SRCS+= bswapsi2.c .endif Modified: stable/12/sys/sys/param.h ============================================================================== --- stable/12/sys/sys/param.h Sat Sep 12 15:18:52 2020 (r365660) +++ stable/12/sys/sys/param.h Sat Sep 12 16:33:05 2020 (r365661) @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1202500 /* Master, propagated to newvers */ +#define __FreeBSD_version 1202501 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-all@freebsd.org Sat Sep 12 16:33:07 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B384B3DCB75; Sat, 12 Sep 2020 16:33:07 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BpdTb4KW3z4CTJ; Sat, 12 Sep 2020 16:33:07 +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 77BE5180A2; Sat, 12 Sep 2020 16:33:07 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08CGX7an072955; Sat, 12 Sep 2020 16:33:07 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08CGX6Pl072952; Sat, 12 Sep 2020 16:33:06 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202009121633.08CGX6Pl072952@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 12 Sep 2020 16:33: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: r365661 - in stable: 11/contrib/llvm-project/compiler-rt/lib/builtins 11/lib/libcompiler_rt 11/sys/sys 12/contrib/llvm-project/compiler-rt/lib/builtins 12/lib/libcompiler_rt 12/sys/sys X-SVN-Group: stable-11 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in stable: 11/contrib/llvm-project/compiler-rt/lib/builtins 11/lib/libcompiler_rt 11/sys/sys 12/contrib/llvm-project/compiler-rt/lib/builtins 12/lib/libcompiler_rt 12/sys/sys X-SVN-Commit-Revision: 365661 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.33 Precedence: list List-Id: "SVN commit messages 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, 12 Sep 2020 16:33:07 -0000 Author: dim Date: Sat Sep 12 16:33:05 2020 New Revision: 365661 URL: https://svnweb.freebsd.org/changeset/base/365661 Log: MFC r364753: Add atomic and bswap functions to libcompiler_rt There have been several mentions on our mailing lists about missing atomic functions in our system libraries (e.g. __atomic_load_8 and friends), and recently I saw __bswapdi2 and __bswapsi2 mentioned too. To address this, add implementations for the functions from compiler-rt to the system compiler support libraries, e.g. libcompiler_rt.a and and libgcc_s.so. This also needs a small fixup in compiler-rt's atomic.c, to ensure that 32-bit mips can build correctly. Bump __FreeBSD_version to make it easier for port maintainers to detect when these functions were added. Differential Revision: https://reviews.freebsd.org/D26159 MFC r364782: After r364753, there should be no need to suppress -Watomic-alignment warnings anymore for compiler-rt's atomic.c. This occurred because the IS_LOCK_FREE_8 macro was not correctly defined to 0 for mips, and this caused the compiler to emit a runtime call to __atomic_is_lock_free(), and that triggers the warning. MFC r365509: Follow-up r364753 by enabling compiler-rt's atomic implementation only for clang, as it uses clang specific builtins, and does not compile correctly with gcc. Note that gcc packages usually come with their own libatomic, providing these primitives. MFC r365588: Follow-up r364753 by only using arm's stdatomic.c implementation, as it already covers the functions in compiler-rt's atomic.c, leading to conflicts when linking. PR: 230888 Modified: stable/11/contrib/llvm-project/compiler-rt/lib/builtins/atomic.c stable/11/lib/libcompiler_rt/Makefile.inc stable/11/sys/sys/param.h Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/contrib/llvm-project/compiler-rt/lib/builtins/atomic.c stable/12/lib/libcompiler_rt/Makefile.inc stable/12/sys/sys/param.h Directory Properties: stable/12/ (props changed) Modified: stable/11/contrib/llvm-project/compiler-rt/lib/builtins/atomic.c ============================================================================== --- stable/11/contrib/llvm-project/compiler-rt/lib/builtins/atomic.c Sat Sep 12 15:18:52 2020 (r365660) +++ stable/11/contrib/llvm-project/compiler-rt/lib/builtins/atomic.c Sat Sep 12 16:33:05 2020 (r365661) @@ -124,8 +124,8 @@ static __inline Lock *lock_for_pointer(void *ptr) { #define IS_LOCK_FREE_2 __c11_atomic_is_lock_free(2) #define IS_LOCK_FREE_4 __c11_atomic_is_lock_free(4) -/// 32 bit PowerPC doesn't support 8-byte lock_free atomics -#if !defined(__powerpc64__) && defined(__powerpc__) +/// 32 bit MIPS and PowerPC don't support 8-byte lock_free atomics +#if defined(__mips__) || (!defined(__powerpc64__) && defined(__powerpc__)) #define IS_LOCK_FREE_8 0 #else #define IS_LOCK_FREE_8 __c11_atomic_is_lock_free(8) Modified: stable/11/lib/libcompiler_rt/Makefile.inc ============================================================================== --- stable/11/lib/libcompiler_rt/Makefile.inc Sat Sep 12 15:18:52 2020 (r365660) +++ stable/11/lib/libcompiler_rt/Makefile.inc Sat Sep 12 16:33:05 2020 (r365661) @@ -18,6 +18,8 @@ SRCF+= ashldi3 SRCF+= ashlti3 SRCF+= ashrdi3 SRCF+= ashrti3 +SRCF+= bswapdi2 +SRCF+= bswapsi2 SRCF+= clear_cache SRCF+= clzdi2 SRCF+= clzsi2 @@ -117,6 +119,14 @@ SRCF+= udivti3 SRCF+= umoddi3 SRCF+= umodti3 +# Enable compiler-rt's atomic implementation only for clang, as it uses clang +# specific builtins, and gcc packages usually come with their own libatomic. +# Exclude arm which has its own implementations of atomic functions, below. +.if "${COMPILER_TYPE}" == "clang" && \ + !(${MACHINE_CPUARCH} == "arm" || ${MACHINE_CPUARCH} == "armv6") +SRCF+= atomic +.endif + # Avoid using SSE2 instructions on i386, if unsupported. .if ${MACHINE_CPUARCH} == "i386" && empty(MACHINE_CPU:Msse2) SRCS+= floatdidf.c @@ -215,12 +225,6 @@ CFLAGS+= -DEMIT_SYNC_ATOMICS SRCF+= stdatomic .endif -.if "${COMPILER_TYPE}" == "clang" && \ - (${MACHINE_ARCH} == "powerpc" || ${MACHINE_ARCH} == "powerpcspe") -SRCS+= atomic.c -CFLAGS.atomic.c+= -Wno-atomic-alignment -.endif - .for file in ${SRCF} .if ${MACHINE_ARCH:Marmv6*} && (!defined(CPUTYPE) || ${CPUTYPE:M*soft*} == "") \ && exists(${CRTSRC}/${CRTARCH}/${file}vfp.S) @@ -242,18 +246,9 @@ SRCS+= aeabi_memmove.S SRCS+= aeabi_memset.S SRCS+= aeabi_uidivmod.S SRCS+= aeabi_uldivmod.S -SRCS+= bswapdi2.S -SRCS+= bswapsi2.S SRCS+= switch16.S SRCS+= switch32.S SRCS+= switch8.S SRCS+= switchu8.S SRCS+= sync_synchronize.S .endif - -# GCC-6.3 on mips32 requires bswap32 built-in. -.if ${MACHINE_CPUARCH} == "mips" -SRCS+= bswapdi2.c -SRCS+= bswapsi2.c -.endif - Modified: stable/11/sys/sys/param.h ============================================================================== --- stable/11/sys/sys/param.h Sat Sep 12 15:18:52 2020 (r365660) +++ stable/11/sys/sys/param.h Sat Sep 12 16:33:05 2020 (r365661) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1104506 /* Master, propagated to newvers */ +#define __FreeBSD_version 1104507 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-all@freebsd.org Sat Sep 12 16:50:06 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F295F3DD418; Sat, 12 Sep 2020 16:50:06 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BpdsB684yz4DQh; Sat, 12 Sep 2020 16:50:06 +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 B74C017E73; Sat, 12 Sep 2020 16:50:06 +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 08CGo6BV079761; Sat, 12 Sep 2020 16:50:06 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08CGo5Eq079753; Sat, 12 Sep 2020 16:50:05 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202009121650.08CGo5Eq079753@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 12 Sep 2020 16:50:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365662 - in stable: 11/contrib/jemalloc 11/contrib/jemalloc/doc 11/lib/libc/stdlib/jemalloc 11/share/man/man5 11/share/mk 11/tools/build/options 12/contrib/jemalloc 12/contrib/jemalloc... X-SVN-Group: stable-12 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in stable: 11/contrib/jemalloc 11/contrib/jemalloc/doc 11/lib/libc/stdlib/jemalloc 11/share/man/man5 11/share/mk 11/tools/build/options 12/contrib/jemalloc 12/contrib/jemalloc/doc 12/lib/libc/stdlib/j... X-SVN-Commit-Revision: 365662 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.33 Precedence: list List-Id: "SVN commit messages 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, 12 Sep 2020 16:50:07 -0000 Author: dim Date: Sat Sep 12 16:50:04 2020 New Revision: 365662 URL: https://svnweb.freebsd.org/changeset/base/365662 Log: MFC r365371: Turn MALLOC_PRODUCTION into a regular src.conf(5) option For historical reasons, defining MALLOC_PRODUCTION in /etc/make.conf has been used to turn off potentially expensive debug checks and statistics gathering in the implementation of malloc(3). It seems more consistent to turn this into a regular src.conf(5) option, e.g. WITH_MALLOC_PRODUCTION / WITHOUT_MALLOC_PRODUCTION. This can then be toggled similar to any other source build option, and turned on or off by default for e.g. stable branches. Reviewed by: imp, #manpages Differential Revision: https://reviews.freebsd.org/D26337 MFC r365373: Follow-up r365371 by removing sentences which indicate the state of the MK_MALLOC_PRODUCTION option on -CURRENT. Also, for the sake of backwards compatibility, support the old way of enabling 'production malloc', e.g. by adding a define in make.conf(5). Added: stable/12/tools/build/options/WITHOUT_MALLOC_PRODUCTION - copied, changed from r365371, head/tools/build/options/WITHOUT_MALLOC_PRODUCTION stable/12/tools/build/options/WITH_MALLOC_PRODUCTION - copied, changed from r365371, head/tools/build/options/WITH_MALLOC_PRODUCTION Modified: stable/12/contrib/jemalloc/FREEBSD-diffs stable/12/contrib/jemalloc/doc/jemalloc.3 stable/12/lib/libc/stdlib/jemalloc/Makefile.inc stable/12/share/man/man5/make.conf.5 stable/12/share/man/man5/src.conf.5 stable/12/share/mk/src.opts.mk Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Added: stable/11/tools/build/options/WITHOUT_MALLOC_PRODUCTION - copied, changed from r365371, head/tools/build/options/WITHOUT_MALLOC_PRODUCTION stable/11/tools/build/options/WITH_MALLOC_PRODUCTION - copied, changed from r365371, head/tools/build/options/WITH_MALLOC_PRODUCTION Modified: stable/11/contrib/jemalloc/FREEBSD-diffs stable/11/contrib/jemalloc/doc/jemalloc.3 stable/11/lib/libc/stdlib/jemalloc/Makefile.inc stable/11/share/man/man5/make.conf.5 stable/11/share/man/man5/src.conf.5 stable/11/share/mk/src.opts.mk Directory Properties: stable/11/ (props changed) Modified: stable/12/contrib/jemalloc/FREEBSD-diffs ============================================================================== --- stable/12/contrib/jemalloc/FREEBSD-diffs Sat Sep 12 16:33:05 2020 (r365661) +++ stable/12/contrib/jemalloc/FREEBSD-diffs Sat Sep 12 16:50:04 2020 (r365662) @@ -14,7 +14,7 @@ index 1e12fd3a..c42a7e10 100644 + . + Additionally, is enabled in development + versions of FreeBSD (controlled by the -+ MALLOC_PRODUCTION make variable). ++ MK_MALLOC_PRODUCTION make variable). + Modified: stable/12/contrib/jemalloc/doc/jemalloc.3 ============================================================================== --- stable/12/contrib/jemalloc/doc/jemalloc.3 Sat Sep 12 16:33:05 2020 (r365661) +++ stable/12/contrib/jemalloc/doc/jemalloc.3 Sat Sep 12 16:50:04 2020 (r365662) @@ -43,7 +43,7 @@ The following configuration options are enabled in lib \fB\-\-with\-malloc\-conf=abort_conf:false\fR\&. Additionally, \fB\-\-enable\-debug\fR is enabled in development versions of FreeBSD (controlled by the -\fBMALLOC_PRODUCTION\fR +\fBMK_MALLOC_PRODUCTION\fR make variable)\&. .SH "SYNOPSIS" .sp Modified: stable/12/lib/libc/stdlib/jemalloc/Makefile.inc ============================================================================== --- stable/12/lib/libc/stdlib/jemalloc/Makefile.inc Sat Sep 12 16:33:05 2020 (r365661) +++ stable/12/lib/libc/stdlib/jemalloc/Makefile.inc Sat Sep 12 16:50:04 2020 (r365662) @@ -44,6 +44,6 @@ MLINKS+= \ jemalloc.3 nallocx.3 \ jemalloc.3 malloc.conf.5 -.if defined(MALLOC_PRODUCTION) +.if ${MK_MALLOC_PRODUCTION} != "no" || defined(MALLOC_PRODUCTION) CFLAGS+= -DMALLOC_PRODUCTION .endif Modified: stable/12/share/man/man5/make.conf.5 ============================================================================== --- stable/12/share/man/man5/make.conf.5 Sat Sep 12 16:33:05 2020 (r365661) +++ stable/12/share/man/man5/make.conf.5 Sat Sep 12 16:50:04 2020 (r365662) @@ -401,12 +401,6 @@ console driver to and allow access over FireWire(IEEE1394) using .Xr dconschat 8 . Currently, only i386 and amd64 are supported. -.It Va MALLOC_PRODUCTION -.Pq Vt bool -Set this to disable assertions and statistics gathering in -.Xr malloc 3 . -It also defaults the A and J runtime options to off. -Disabled by default on -CURRENT. .It Va MAN_ARCH .Pq Vt str Space-delimited list of one or more MACHINE and/or MACHINE_ARCH values Modified: stable/12/share/man/man5/src.conf.5 ============================================================================== --- stable/12/share/man/man5/src.conf.5 Sat Sep 12 16:33:05 2020 (r365661) +++ stable/12/share/man/man5/src.conf.5 Sat Sep 12 16:50:04 2020 (r365662) @@ -1,6 +1,6 @@ .\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman. .\" $FreeBSD$ -.Dd September 11, 2020 +.Dd September 12, 2020 .Dt SRC.CONF 5 .Os .Sh NAME @@ -1357,6 +1357,10 @@ if executed as an unprivileged user. See .Xr tests 7 for more details. +.It Va WITH_MALLOC_PRODUCTION +Set to disable assertions and statistics gathering in +.Xr malloc 3 . +It also defaults the A and J runtime options to off. .It Va WITHOUT_MAN Set to not build manual pages. When set, these options are also in effect: Modified: stable/12/share/mk/src.opts.mk ============================================================================== --- stable/12/share/mk/src.opts.mk Sat Sep 12 16:33:05 2020 (r365661) +++ stable/12/share/mk/src.opts.mk Sat Sep 12 16:50:04 2020 (r365662) @@ -208,6 +208,7 @@ __DEFAULT_NO_OPTIONS = \ LOADER_FIREWIRE \ LOADER_FORCE_LE \ LOADER_VERIEXEC_PASS_MANIFEST \ + MALLOC_PRODUCTION \ NAND \ OFED_EXTRA \ OPENLDAP \ Copied and modified: stable/12/tools/build/options/WITHOUT_MALLOC_PRODUCTION (from r365371, head/tools/build/options/WITHOUT_MALLOC_PRODUCTION) ============================================================================== --- head/tools/build/options/WITHOUT_MALLOC_PRODUCTION Sat Sep 5 23:30:17 2020 (r365371, copy source) +++ stable/12/tools/build/options/WITHOUT_MALLOC_PRODUCTION Sat Sep 12 16:50:04 2020 (r365662) @@ -2,4 +2,3 @@ Set to enable assertions and statistics gathering in .Xr malloc 3 . It also defaults the A and J runtime options to on. -Enabled by default on -CURRENT. Copied and modified: stable/12/tools/build/options/WITH_MALLOC_PRODUCTION (from r365371, head/tools/build/options/WITH_MALLOC_PRODUCTION) ============================================================================== --- head/tools/build/options/WITH_MALLOC_PRODUCTION Sat Sep 5 23:30:17 2020 (r365371, copy source) +++ stable/12/tools/build/options/WITH_MALLOC_PRODUCTION Sat Sep 12 16:50:04 2020 (r365662) @@ -2,4 +2,3 @@ Set to disable assertions and statistics gathering in .Xr malloc 3 . It also defaults the A and J runtime options to off. -Disabled by default on -CURRENT. From owner-svn-src-all@freebsd.org Sat Sep 12 16:50:08 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A61E33DCFC8; Sat, 12 Sep 2020 16:50:08 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BpdsD3z0jz4D8F; Sat, 12 Sep 2020 16:50:08 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6C25617BE9; Sat, 12 Sep 2020 16:50:08 +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 08CGo8kH079775; Sat, 12 Sep 2020 16:50:08 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08CGo6Nh079767; Sat, 12 Sep 2020 16:50:06 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202009121650.08CGo6Nh079767@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 12 Sep 2020 16:50: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: r365662 - in stable: 11/contrib/jemalloc 11/contrib/jemalloc/doc 11/lib/libc/stdlib/jemalloc 11/share/man/man5 11/share/mk 11/tools/build/options 12/contrib/jemalloc 12/contrib/jemalloc... X-SVN-Group: stable-11 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in stable: 11/contrib/jemalloc 11/contrib/jemalloc/doc 11/lib/libc/stdlib/jemalloc 11/share/man/man5 11/share/mk 11/tools/build/options 12/contrib/jemalloc 12/contrib/jemalloc/doc 12/lib/libc/stdlib/j... X-SVN-Commit-Revision: 365662 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.33 Precedence: list List-Id: "SVN commit messages 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, 12 Sep 2020 16:50:08 -0000 Author: dim Date: Sat Sep 12 16:50:04 2020 New Revision: 365662 URL: https://svnweb.freebsd.org/changeset/base/365662 Log: MFC r365371: Turn MALLOC_PRODUCTION into a regular src.conf(5) option For historical reasons, defining MALLOC_PRODUCTION in /etc/make.conf has been used to turn off potentially expensive debug checks and statistics gathering in the implementation of malloc(3). It seems more consistent to turn this into a regular src.conf(5) option, e.g. WITH_MALLOC_PRODUCTION / WITHOUT_MALLOC_PRODUCTION. This can then be toggled similar to any other source build option, and turned on or off by default for e.g. stable branches. Reviewed by: imp, #manpages Differential Revision: https://reviews.freebsd.org/D26337 MFC r365373: Follow-up r365371 by removing sentences which indicate the state of the MK_MALLOC_PRODUCTION option on -CURRENT. Also, for the sake of backwards compatibility, support the old way of enabling 'production malloc', e.g. by adding a define in make.conf(5). Added: stable/11/tools/build/options/WITHOUT_MALLOC_PRODUCTION - copied, changed from r365371, head/tools/build/options/WITHOUT_MALLOC_PRODUCTION stable/11/tools/build/options/WITH_MALLOC_PRODUCTION - copied, changed from r365371, head/tools/build/options/WITH_MALLOC_PRODUCTION Modified: stable/11/contrib/jemalloc/FREEBSD-diffs stable/11/contrib/jemalloc/doc/jemalloc.3 stable/11/lib/libc/stdlib/jemalloc/Makefile.inc stable/11/share/man/man5/make.conf.5 stable/11/share/man/man5/src.conf.5 stable/11/share/mk/src.opts.mk Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Added: stable/12/tools/build/options/WITHOUT_MALLOC_PRODUCTION - copied, changed from r365371, head/tools/build/options/WITHOUT_MALLOC_PRODUCTION stable/12/tools/build/options/WITH_MALLOC_PRODUCTION - copied, changed from r365371, head/tools/build/options/WITH_MALLOC_PRODUCTION Modified: stable/12/contrib/jemalloc/FREEBSD-diffs stable/12/contrib/jemalloc/doc/jemalloc.3 stable/12/lib/libc/stdlib/jemalloc/Makefile.inc stable/12/share/man/man5/make.conf.5 stable/12/share/man/man5/src.conf.5 stable/12/share/mk/src.opts.mk Directory Properties: stable/12/ (props changed) Modified: stable/11/contrib/jemalloc/FREEBSD-diffs ============================================================================== --- stable/11/contrib/jemalloc/FREEBSD-diffs Sat Sep 12 16:33:05 2020 (r365661) +++ stable/11/contrib/jemalloc/FREEBSD-diffs Sat Sep 12 16:50:04 2020 (r365662) @@ -14,7 +14,7 @@ index c4a44e3..4626e9b 100644 + , , and + . Additionally, + is enabled in development versions of -+ FreeBSD (controlled by the MALLOC_PRODUCTION make ++ FreeBSD (controlled by the MK_MALLOC_PRODUCTION make + variable). + Modified: stable/11/contrib/jemalloc/doc/jemalloc.3 ============================================================================== --- stable/11/contrib/jemalloc/doc/jemalloc.3 Sat Sep 12 16:33:05 2020 (r365661) +++ stable/11/contrib/jemalloc/doc/jemalloc.3 Sat Sep 12 16:50:04 2020 (r365662) @@ -45,7 +45,7 @@ The following configuration options are enabled in lib \fB\-\-enable\-xmalloc\fR\&. Additionally, \fB\-\-enable\-debug\fR is enabled in development versions of FreeBSD (controlled by the -\fBMALLOC_PRODUCTION\fR +\fBMK_MALLOC_PRODUCTION\fR make variable)\&. .SH "SYNOPSIS" .sp Modified: stable/11/lib/libc/stdlib/jemalloc/Makefile.inc ============================================================================== --- stable/11/lib/libc/stdlib/jemalloc/Makefile.inc Sat Sep 12 16:33:05 2020 (r365661) +++ stable/11/lib/libc/stdlib/jemalloc/Makefile.inc Sat Sep 12 16:50:04 2020 (r365662) @@ -44,6 +44,6 @@ MLINKS+= \ jemalloc.3 nallocx.3 \ jemalloc.3 malloc.conf.5 -.if defined(MALLOC_PRODUCTION) +.if ${MK_MALLOC_PRODUCTION} != "no" || defined(MALLOC_PRODUCTION) CFLAGS+= -DMALLOC_PRODUCTION .endif Modified: stable/11/share/man/man5/make.conf.5 ============================================================================== --- stable/11/share/man/man5/make.conf.5 Sat Sep 12 16:33:05 2020 (r365661) +++ stable/11/share/man/man5/make.conf.5 Sat Sep 12 16:50:04 2020 (r365662) @@ -388,12 +388,6 @@ console driver to and allow access over FireWire(IEEE1394) using .Xr dconschat 8 . Currently, only i386 and amd64 are supported. -.It Va MALLOC_PRODUCTION -.Pq Vt bool -Set this to disable assertions and statistics gathering in -.Xr malloc 3 . -It also defaults the A and J runtime options to off. -Disabled by default on -CURRENT. .It Va MODULES_WITH_WORLD .Pq Vt bool Set to build modules with the system instead of the kernel. Modified: stable/11/share/man/man5/src.conf.5 ============================================================================== --- stable/11/share/man/man5/src.conf.5 Sat Sep 12 16:33:05 2020 (r365661) +++ stable/11/share/man/man5/src.conf.5 Sat Sep 12 16:50:04 2020 (r365662) @@ -1,6 +1,6 @@ .\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman. .\" $FreeBSD$ -.Dd May 5, 2020 +.Dd September 12, 2020 .Dt SRC.CONF 5 .Os .Sh NAME @@ -315,6 +315,8 @@ When set, it enforces these options: .It .Va WITHOUT_CLANG_EXTRAS .It +.Va WITHOUT_CLANG_FORMAT +.It .Va WITHOUT_CLANG_FULL .It .Va WITHOUT_LLVM_COV @@ -339,6 +341,8 @@ This is a default setting on amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm64/aarch64, i386/i386 and pc98/i386. .It Va WITH_CLANG_EXTRAS Set to build additional clang and llvm tools, such as bugpoint. +.It Va WITH_CLANG_FORMAT +Set to build clang-format. .It Va WITHOUT_CLANG_FULL Set to avoid building the ARCMigrate, Rewriter and StaticAnalyzer components of the Clang C/C++ compiler. @@ -460,6 +464,8 @@ When set, it enforces these options: .It .Va WITHOUT_CLANG_EXTRAS .It +.Va WITHOUT_CLANG_FORMAT +.It .Va WITHOUT_CLANG_FULL .It .Va WITHOUT_GNUCXX @@ -1177,6 +1183,10 @@ MTA selector. Set to not install .Xr make 1 and related support files. +.It Va WITH_MALLOC_PRODUCTION +Set to disable assertions and statistics gathering in +.Xr malloc 3 . +It also defaults the A and J runtime options to off. .It Va WITHOUT_MAN Set to not build manual pages. When set, these options are also in effect: @@ -1356,12 +1366,12 @@ Enable building openldap support for kerberos. Set to not build LLVM's OpenMP runtime. .Pp This is a default setting on -arm/arm, arm/armeb, arm/armv6, arm64/aarch64, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, powerpc/powerpc and sparc64/sparc64. +arm/arm, arm/armeb, arm/armv6, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, powerpc/powerpc and sparc64/sparc64. .It Va WITH_OPENMP Set to build LLVM's OpenMP runtime. .Pp This is a default setting on -amd64/amd64, i386/i386, pc98/i386 and powerpc/powerpc64. +amd64/amd64, arm64/aarch64, i386/i386, pc98/i386 and powerpc/powerpc64. .It Va WITHOUT_OPENSSH Set to not build OpenSSH. .It Va WITHOUT_OPENSSL @@ -1651,6 +1661,8 @@ When set, it enforces these options: .Va WITHOUT_CLANG .It .Va WITHOUT_CLANG_EXTRAS +.It +.Va WITHOUT_CLANG_FORMAT .It .Va WITHOUT_CLANG_FULL .It Modified: stable/11/share/mk/src.opts.mk ============================================================================== --- stable/11/share/mk/src.opts.mk Sat Sep 12 16:33:05 2020 (r365661) +++ stable/11/share/mk/src.opts.mk Sat Sep 12 16:50:04 2020 (r365662) @@ -203,6 +203,7 @@ __DEFAULT_NO_OPTIONS = \ LOADER_FORCE_LE \ LOADER_VERBOSE \ NAND \ + MALLOC_PRODUCTION \ OFED_EXTRA \ OPENLDAP \ REPRODUCIBLE_BUILD \ Copied and modified: stable/11/tools/build/options/WITHOUT_MALLOC_PRODUCTION (from r365371, head/tools/build/options/WITHOUT_MALLOC_PRODUCTION) ============================================================================== --- head/tools/build/options/WITHOUT_MALLOC_PRODUCTION Sat Sep 5 23:30:17 2020 (r365371, copy source) +++ stable/11/tools/build/options/WITHOUT_MALLOC_PRODUCTION Sat Sep 12 16:50:04 2020 (r365662) @@ -2,4 +2,3 @@ Set to enable assertions and statistics gathering in .Xr malloc 3 . It also defaults the A and J runtime options to on. -Enabled by default on -CURRENT. Copied and modified: stable/11/tools/build/options/WITH_MALLOC_PRODUCTION (from r365371, head/tools/build/options/WITH_MALLOC_PRODUCTION) ============================================================================== --- head/tools/build/options/WITH_MALLOC_PRODUCTION Sat Sep 5 23:30:17 2020 (r365371, copy source) +++ stable/11/tools/build/options/WITH_MALLOC_PRODUCTION Sat Sep 12 16:50:04 2020 (r365662) @@ -2,4 +2,3 @@ Set to disable assertions and statistics gathering in .Xr malloc 3 . It also defaults the A and J runtime options to off. -Disabled by default on -CURRENT. From owner-svn-src-all@freebsd.org Sat Sep 12 17:23:52 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CA6093DE063; Sat, 12 Sep 2020 17:23:52 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bpfc84xyrz4Fg8; Sat, 12 Sep 2020 17:23:52 +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 8E041189A3; Sat, 12 Sep 2020 17:23:52 +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 08CHNq0D004273; Sat, 12 Sep 2020 17:23:52 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08CHNqvx004272; Sat, 12 Sep 2020 17:23:52 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202009121723.08CHNqvx004272@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 12 Sep 2020 17:23:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365663 - head/tools/regression/geom/MdLoad X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/tools/regression/geom/MdLoad X-SVN-Commit-Revision: 365663 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.33 Precedence: list List-Id: "SVN commit messages 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, 12 Sep 2020 17:23:52 -0000 Author: imp Date: Sat Sep 12 17:23:51 2020 New Revision: 365663 URL: https://svnweb.freebsd.org/changeset/base/365663 Log: Make this compile again by fixing err args to have formats Also, add NO_OBJ=t top the Makefie, since the test-harnest expects to run it in place. Modified: head/tools/regression/geom/MdLoad/Makefile head/tools/regression/geom/MdLoad/MdLoad.c Modified: head/tools/regression/geom/MdLoad/Makefile ============================================================================== --- head/tools/regression/geom/MdLoad/Makefile Sat Sep 12 16:50:04 2020 (r365662) +++ head/tools/regression/geom/MdLoad/Makefile Sat Sep 12 17:23:51 2020 (r365663) @@ -2,6 +2,7 @@ PROG= MdLoad LIBADD= sbuf bsdxml +NO_OBJ= t MAN= Modified: head/tools/regression/geom/MdLoad/MdLoad.c ============================================================================== --- head/tools/regression/geom/MdLoad/MdLoad.c Sat Sep 12 16:50:04 2020 (r365662) +++ head/tools/regression/geom/MdLoad/MdLoad.c Sat Sep 12 17:23:51 2020 (r365663) @@ -216,7 +216,7 @@ g_simdisk_xml_load(const char *file) fd = open(file, O_RDONLY); if (fd < 0) - err(1, file); + err(1, "%s", file); fstat(fd, &st); p = mmap(NULL, st.st_size, PROT_READ, MAP_NOCORE|MAP_PRIVATE, fd, 0); i = XML_Parse(parser, p, st.st_size, 1); From owner-svn-src-all@freebsd.org Sat Sep 12 17:24:02 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2DE5B3DE084; Sat, 12 Sep 2020 17:24:02 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BpfcJ6Nc8z4G1L; Sat, 12 Sep 2020 17:24:00 +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 928DC1895D; Sat, 12 Sep 2020 17:24:00 +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 08CHO0WE004334; Sat, 12 Sep 2020 17:24:00 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08CHO04m004333; Sat, 12 Sep 2020 17:24:00 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202009121724.08CHO04m004333@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 12 Sep 2020 17:24:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365664 - head/tools/regression/geom X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/tools/regression/geom X-SVN-Commit-Revision: 365664 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.33 Precedence: list List-Id: "SVN commit messages 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, 12 Sep 2020 17:24:02 -0000 Author: imp Date: Sat Sep 12 17:24:00 2020 New Revision: 365664 URL: https://svnweb.freebsd.org/changeset/base/365664 Log: Fix trailing whitespace Modified: head/tools/regression/geom/RunTest.t Modified: head/tools/regression/geom/RunTest.t ============================================================================== --- head/tools/regression/geom/RunTest.t Sat Sep 12 17:23:51 2020 (r365663) +++ head/tools/regression/geom/RunTest.t Sat Sep 12 17:24:00 2020 (r365664) @@ -32,11 +32,11 @@ do fi MdLoad/MdLoad md${MD} $f if [ -f Ref/$b ] ; then - if diskinfo /dev/md${MD}* | - diff -I '$FreeBSD' -u Ref/$b - > $TMP; then + if diskinfo /dev/md${MD}* | + diff -I '\$FreeBSD' -u Ref/$b - > $TMP; then echo "ok - $b" else - echo "not ok - $b" + echo "not ok - $b" sed 's/^/# /' $TMP fi else From owner-svn-src-all@freebsd.org Sat Sep 12 17:24:05 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EF0533DDFA4; Sat, 12 Sep 2020 17:24:05 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BpfcP0031z4Fgx; Sat, 12 Sep 2020 17:24:04 +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 BEBB2189A5; Sat, 12 Sep 2020 17:24:04 +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 08CHO4kp004385; Sat, 12 Sep 2020 17:24:04 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08CHO4TQ004384; Sat, 12 Sep 2020 17:24:04 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202009121724.08CHO4TQ004384@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 12 Sep 2020 17:24:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365665 - head/tools/regression/geom/Ref X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/tools/regression/geom/Ref X-SVN-Commit-Revision: 365665 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.33 Precedence: list List-Id: "SVN commit messages 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, 12 Sep 2020 17:24:06 -0000 Author: imp Date: Sat Sep 12 17:24:04 2020 New Revision: 365665 URL: https://svnweb.freebsd.org/changeset/base/365665 Log: Update flp test for new diskinfo output The floppy test passes with this. The others fail due to 'integrity checks' failing in GPART. It's not at all clear those integrity checks are legit or if the test samples were bogusly generated by FreeBSD. Modified: head/tools/regression/geom/Ref/disk.empty.flp.xml Modified: head/tools/regression/geom/Ref/disk.empty.flp.xml ============================================================================== --- head/tools/regression/geom/Ref/disk.empty.flp.xml Sat Sep 12 17:24:00 2020 (r365664) +++ head/tools/regression/geom/Ref/disk.empty.flp.xml Sat Sep 12 17:24:04 2020 (r365665) @@ -1,2 +1,2 @@ $FreeBSD$ -/dev/md34 512 1474560 2880 80 2 18 +/dev/md34 512 1474560 2880 0 0 80 2 18 From owner-svn-src-all@freebsd.org Sat Sep 12 18:23:27 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DE3AE3DF375; Sat, 12 Sep 2020 18:23:27 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bpgwv5WsPz4LBS; Sat, 12 Sep 2020 18:23:27 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 A0D21194A8; Sat, 12 Sep 2020 18:23:27 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08CINRMn043324; Sat, 12 Sep 2020 18:23:27 GMT (envelope-from bdragon@FreeBSD.org) Received: (from bdragon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08CINRNl043323; Sat, 12 Sep 2020 18:23:27 GMT (envelope-from bdragon@FreeBSD.org) Message-Id: <202009121823.08CINRNl043323@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdragon set sender to bdragon@FreeBSD.org using -f From: Brandon Bergren Date: Sat, 12 Sep 2020 18:23:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365666 - head/contrib/llvm-project/clang/lib/Basic X-SVN-Group: head X-SVN-Commit-Author: bdragon X-SVN-Commit-Paths: head/contrib/llvm-project/clang/lib/Basic X-SVN-Commit-Revision: 365666 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.33 Precedence: list List-Id: "SVN commit messages 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, 12 Sep 2020 18:23:27 -0000 Author: bdragon Date: Sat Sep 12 18:23:27 2020 New Revision: 365666 URL: https://svnweb.freebsd.org/changeset/base/365666 Log: [PowerPC64LE] Fix platform definitions for powerpc64le-*-freebsd* Teach clang that powerpc64le-*-freebsd* is a valid triple. This is already in upstream clang, but was too late for llvm 11.0.0. Apply it directly for now, until it can be backported to llvm 11.0.1. See upstream https://reviews.llvm.org/D73425 for details. Reviewed by: dim (upstream version), emaste Approved by: emaste Differential Revision: https://reviews.freebsd.org/D26400 Modified: head/contrib/llvm-project/clang/lib/Basic/Targets.cpp Modified: head/contrib/llvm-project/clang/lib/Basic/Targets.cpp ============================================================================== --- head/contrib/llvm-project/clang/lib/Basic/Targets.cpp Sat Sep 12 17:24:04 2020 (r365665) +++ head/contrib/llvm-project/clang/lib/Basic/Targets.cpp Sat Sep 12 18:23:27 2020 (r365666) @@ -358,6 +358,8 @@ TargetInfo *AllocateTarget(const llvm::Triple &Triple, switch (os) { case llvm::Triple::Linux: return new LinuxTargetInfo(Triple, Opts); + case llvm::Triple::FreeBSD: + return new FreeBSDTargetInfo(Triple, Opts); case llvm::Triple::NetBSD: return new NetBSDTargetInfo(Triple, Opts); case llvm::Triple::OpenBSD: From owner-svn-src-all@freebsd.org Sat Sep 12 18:40:40 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3DA2D3DFD96; Sat, 12 Sep 2020 18:40:40 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BphJm0kN5z4MX3; Sat, 12 Sep 2020 18:40:40 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 D7573190EF; Sat, 12 Sep 2020 18:40:39 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08CIediS051642; Sat, 12 Sep 2020 18:40:39 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08CIedei051640; Sat, 12 Sep 2020 18:40:39 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <202009121840.08CIedei051640@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Sat, 12 Sep 2020 18:40:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365667 - stable/12/sys/geom/part X-SVN-Group: stable-12 X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: stable/12/sys/geom/part X-SVN-Commit-Revision: 365667 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.33 Precedence: list List-Id: "SVN commit messages 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, 12 Sep 2020 18:40:40 -0000 Author: eugen Date: Sat Sep 12 18:40:39 2020 New Revision: 365667 URL: https://svnweb.freebsd.org/changeset/base/365667 Log: MFC r365477: geom_part: extend kern.geom.part.check_integrity to work on GPT In short, this change allows accessing partition and recovering secondary GPT in case it is unaccessible but primary table is fine. Reported by: Alex Korchmar Modified: stable/12/sys/geom/part/g_part.c stable/12/sys/geom/part/g_part_gpt.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/geom/part/g_part.c ============================================================================== --- stable/12/sys/geom/part/g_part.c Sat Sep 12 18:23:27 2020 (r365666) +++ stable/12/sys/geom/part/g_part.c Sat Sep 12 18:40:39 2020 (r365667) @@ -135,9 +135,9 @@ struct g_part_alias_list { SYSCTL_DECL(_kern_geom); SYSCTL_NODE(_kern_geom, OID_AUTO, part, CTLFLAG_RW, 0, "GEOM_PART stuff"); -static u_int check_integrity = 1; +u_int geom_part_check_integrity = 1; SYSCTL_UINT(_kern_geom_part, OID_AUTO, check_integrity, - CTLFLAG_RWTUN, &check_integrity, 1, + CTLFLAG_RWTUN, &geom_part_check_integrity, 1, "Enable integrity checking"); static u_int auto_resize = 1; SYSCTL_UINT(_kern_geom_part, OID_AUTO, auto_resize, @@ -420,7 +420,7 @@ g_part_check_integrity(struct g_part_table *table, str if (failed != 0) { printf("GEOM_PART: integrity check failed (%s, %s)\n", pp->name, table->gpt_scheme->name); - if (check_integrity != 0) + if (geom_part_check_integrity != 0) return (EINVAL); table->gpt_corrupt = 1; } Modified: stable/12/sys/geom/part/g_part_gpt.c ============================================================================== --- stable/12/sys/geom/part/g_part_gpt.c Sat Sep 12 18:23:27 2020 (r365666) +++ stable/12/sys/geom/part/g_part_gpt.c Sat Sep 12 18:40:39 2020 (r365667) @@ -64,6 +64,8 @@ SYSCTL_UINT(_kern_geom_part_gpt, OID_AUTO, allow_nesti CTASSERT(offsetof(struct gpt_hdr, padding) == 92); CTASSERT(sizeof(struct gpt_ent) == 128); +extern u_int geom_part_check_integrity; + #define EQUUID(a,b) (memcmp(a, b, sizeof(struct uuid)) == 0) #define MBRSIZE 512 @@ -460,8 +462,9 @@ gpt_read_hdr(struct g_part_gpt_table *table, struct g_ if (hdr->hdr_lba_self != table->lba[elt]) goto fail; hdr->hdr_lba_alt = le64toh(buf->hdr_lba_alt); - if (hdr->hdr_lba_alt == hdr->hdr_lba_self || - hdr->hdr_lba_alt > last) + if (hdr->hdr_lba_alt == hdr->hdr_lba_self) + goto fail; + if (hdr->hdr_lba_alt > last && geom_part_check_integrity) goto fail; /* Check the managed area. */ From owner-svn-src-all@freebsd.org Sat Sep 12 18:42:15 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3A3D23E003C; Sat, 12 Sep 2020 18:42:15 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BphLb0q3Yz4Mtn; Sat, 12 Sep 2020 18:42:15 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 F36E0196E6; Sat, 12 Sep 2020 18:42:14 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08CIgEAI056404; Sat, 12 Sep 2020 18:42:14 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08CIgEBa056402; Sat, 12 Sep 2020 18:42:14 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <202009121842.08CIgEBa056402@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Sat, 12 Sep 2020 18:42:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r365668 - stable/11/sys/geom/part X-SVN-Group: stable-11 X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: stable/11/sys/geom/part X-SVN-Commit-Revision: 365668 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.33 Precedence: list List-Id: "SVN commit messages 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, 12 Sep 2020 18:42:15 -0000 Author: eugen Date: Sat Sep 12 18:42:14 2020 New Revision: 365668 URL: https://svnweb.freebsd.org/changeset/base/365668 Log: MFC r365477: geom_part: extend kern.geom.part.check_integrity to work on GPT In short, this change allows accessing partition and recovering secondary GPT in case it is unaccessible but primary table is fine. Reported by: Alex Korchmar Modified: stable/11/sys/geom/part/g_part.c stable/11/sys/geom/part/g_part_gpt.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/geom/part/g_part.c ============================================================================== --- stable/11/sys/geom/part/g_part.c Sat Sep 12 18:40:39 2020 (r365667) +++ stable/11/sys/geom/part/g_part.c Sat Sep 12 18:42:14 2020 (r365668) @@ -132,9 +132,9 @@ struct g_part_alias_list { SYSCTL_DECL(_kern_geom); SYSCTL_NODE(_kern_geom, OID_AUTO, part, CTLFLAG_RW, 0, "GEOM_PART stuff"); -static u_int check_integrity = 1; +u_int geom_part_check_integrity = 1; SYSCTL_UINT(_kern_geom_part, OID_AUTO, check_integrity, - CTLFLAG_RWTUN, &check_integrity, 1, + CTLFLAG_RWTUN, &geom_part_check_integrity, 1, "Enable integrity checking"); /* @@ -409,7 +409,7 @@ g_part_check_integrity(struct g_part_table *table, str if (failed != 0) { printf("GEOM_PART: integrity check failed (%s, %s)\n", pp->name, table->gpt_scheme->name); - if (check_integrity != 0) + if (geom_part_check_integrity != 0) return (EINVAL); table->gpt_corrupt = 1; } Modified: stable/11/sys/geom/part/g_part_gpt.c ============================================================================== --- stable/11/sys/geom/part/g_part_gpt.c Sat Sep 12 18:40:39 2020 (r365667) +++ stable/11/sys/geom/part/g_part_gpt.c Sat Sep 12 18:42:14 2020 (r365668) @@ -54,6 +54,8 @@ FEATURE(geom_part_gpt, "GEOM partitioning class for GP CTASSERT(offsetof(struct gpt_hdr, padding) == 92); CTASSERT(sizeof(struct gpt_ent) == 128); +extern u_int geom_part_check_integrity; + #define EQUUID(a,b) (memcmp(a, b, sizeof(struct uuid)) == 0) #define MBRSIZE 512 @@ -448,8 +450,9 @@ gpt_read_hdr(struct g_part_gpt_table *table, struct g_ if (hdr->hdr_lba_self != table->lba[elt]) goto fail; hdr->hdr_lba_alt = le64toh(buf->hdr_lba_alt); - if (hdr->hdr_lba_alt == hdr->hdr_lba_self || - hdr->hdr_lba_alt > last) + if (hdr->hdr_lba_alt == hdr->hdr_lba_self) + goto fail; + if (hdr->hdr_lba_alt > last && geom_part_check_integrity) goto fail; /* Check the managed area. */ From owner-svn-src-all@freebsd.org Sat Sep 12 18:58:37 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 321AF3E0484; Sat, 12 Sep 2020 18:58:37 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BphjT0brpz4NdN; Sat, 12 Sep 2020 18:58:37 +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 EC36319C18; Sat, 12 Sep 2020 18:58:36 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08CIwaeW062992; Sat, 12 Sep 2020 18:58:36 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08CIwaxU062991; Sat, 12 Sep 2020 18:58:36 GMT (envelope-from kp@FreeBSD.org) Message-Id: <202009121858.08CIwaxU062991@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Sat, 12 Sep 2020 18:58:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r365669 - releng/12.2/sys/net X-SVN-Group: releng X-SVN-Commit-Author: kp X-SVN-Commit-Paths: releng/12.2/sys/net X-SVN-Commit-Revision: 365669 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.33 Precedence: list List-Id: "SVN commit messages 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, 12 Sep 2020 18:58:37 -0000 Author: kp Date: Sat Sep 12 18:58:36 2020 New Revision: 365669 URL: https://svnweb.freebsd.org/changeset/base/365669 Log: MFC r365457: net: mitigate vnet / epair cleanup races There's a race where dying vnets move their interfaces back to their original vnet, and if_epair cleanup (where deleting one interface also deletes the other end of the epair). This is commonly triggered by the pf tests, but also by cleanup of vnet jails. As we've not yet been able to fix the root cause of the issue work around the panic by not dereferencing a NULL softc in epair_qflush() and by not re-attaching DYING interfaces. This isn't a full fix, but makes a very common panic far less likely. PR: 244703, 238870 Approved by: re (gjb) Modified: releng/12.2/sys/net/if.c releng/12.2/sys/net/if_epair.c Directory Properties: releng/12.2/ (props changed) Modified: releng/12.2/sys/net/if.c ============================================================================== --- releng/12.2/sys/net/if.c Sat Sep 12 18:42:14 2020 (r365668) +++ releng/12.2/sys/net/if.c Sat Sep 12 18:58:36 2020 (r365669) @@ -1280,6 +1280,10 @@ if_vmove(struct ifnet *ifp, struct vnet *new_vnet) ifindex_free_locked(ifp->if_index); IFNET_WUNLOCK(); + /* Don't re-attach DYING interfaces. */ + if (ifp->if_flags & IFF_DYING) + return; + /* * Perform interface-specific reassignment tasks, if provided by * the driver. Modified: releng/12.2/sys/net/if_epair.c ============================================================================== --- releng/12.2/sys/net/if_epair.c Sat Sep 12 18:42:14 2020 (r365668) +++ releng/12.2/sys/net/if_epair.c Sat Sep 12 18:58:36 2020 (r365669) @@ -609,8 +609,14 @@ epair_qflush(struct ifnet *ifp) struct epair_softc *sc; sc = ifp->if_softc; - KASSERT(sc != NULL, ("%s: ifp=%p, epair_softc gone? sc=%p\n", - __func__, ifp, sc)); + + /* + * See epair_clone_destroy(), we can end up getting called twice. + * Don't do anything on the second call. + */ + if (sc == NULL) + return; + /* * Remove this ifp from all backpointer lists. The interface will not * usable for flushing anyway nor should it have anything to flush From owner-svn-src-all@freebsd.org Sat Sep 12 19:13:18 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6551F3E0819; Sat, 12 Sep 2020 19:13:18 +0000 (UTC) (envelope-from ronald-lists@klop.ws) Received: from smarthost1.greenhost.nl (smarthost1.greenhost.nl [195.190.28.88]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bpj2N5FDzz4PXS; Sat, 12 Sep 2020 19:13:15 +0000 (UTC) (envelope-from ronald-lists@klop.ws) Received: from smtp.greenhost.nl ([213.108.110.112]) by smarthost1.greenhost.nl with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1kHAxU-0003Tb-Q8; Sat, 12 Sep 2020 21:13:14 +0200 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=klop.ws; s=mail; h=In-Reply-To:Message-ID:From:Content-Transfer-Encoding:MIME-Version: Date:References:Subject:To:Content-Type:Sender:Reply-To:Cc:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=/rzhUdtBbmwJFFhT42vPB+pj5W+IxfbDkgRKBkwoG+M=; b=kaE3MB5FHRfEOmK9xxLAs/6tRi vOqBigIb33o3cP/emQchOvYo0nI7tNKDtwC+hFvPCWQDMi0Z3Q1PNwq9riHV2TZcHt7UXrNkAYFiM mYWB6I+ps3cZefJyN5P+3F02owx6Q5G9y0/D7ZhPNT32Hw/Ob421sJSrxKMi+csnVOfs=; Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org, "Dimitry Andric" Subject: Re: svn commit: r365662 - in stable: 11/contrib/jemalloc 11/contrib/jemalloc/doc 11/lib/libc/stdlib/jemalloc 11/share/man/man5 11/share/mk 11/tools/build/options 12/contrib/jemalloc 12/contrib/jemalloc... References: <202009121650.08CGo5Eq079753@repo.freebsd.org> Date: Sat, 12 Sep 2020 21:13:10 +0200 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: "Ronald Klop" Message-ID: In-Reply-To: <202009121650.08CGo5Eq079753@repo.freebsd.org> User-Agent: Opera Mail/12.16 (FreeBSD) X-Authenticated-As-Hash: 398f5522cb258ce43cb679602f8cfe8b62a256d1 X-Virus-Scanned: by clamav at smarthost1.samage.net X-Spam-Level: / X-Spam-Score: -0.4 X-Spam-Status: No, score=-0.4 required=5.0 tests=ALL_TRUSTED, BAYES_50, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF autolearn=disabled version=3.4.2 X-Scan-Signature: 1629bd954af37e9bd463cbe85bf61e19 X-Rspamd-Queue-Id: 4Bpj2N5FDzz4PXS X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=pass header.d=klop.ws header.s=mail header.b=kaE3MB5F; dmarc=none; spf=pass (mx1.freebsd.org: domain of ronald-lists@klop.ws designates 195.190.28.88 as permitted sender) smtp.mailfrom=ronald-lists@klop.ws X-Spamd-Result: default: False [-1.77 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.05)[-1.051]; R_DKIM_ALLOW(-0.20)[klop.ws:s=mail]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:195.190.28.64/27]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[klop.ws]; NEURAL_HAM_LONG(-0.99)[-0.990]; RWL_MAILSPIKE_GOOD(0.00)[195.190.28.88:from]; RCPT_COUNT_FIVE(0.00)[5]; NEURAL_SPAM_SHORT(0.27)[0.268]; DKIM_TRACE(0.00)[klop.ws:+]; RCVD_IN_DNSWL_NONE(0.00)[195.190.28.88:from]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; MID_RHS_NOT_FQDN(0.50)[]; ASN(0.00)[asn:47172, ipnet:195.190.28.0/24, country:NL]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[svn-src-all,svn-src-stable,svn-src-stable-12]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 12 Sep 2020 19:13:18 -0000 Hi, Isn't this important enough for a note in UPDATING? Or a message in the backwards compatibility code to point the user to the new setting? Regards, Ronald. On Sat, 12 Sep 2020 18:50:05 +0200, Dimitry Andric wrote: > Author: dim > Date: Sat Sep 12 16:50:04 2020 > New Revision: 365662 > URL: https://svnweb.freebsd.org/changeset/base/365662 > > Log: > MFC r365371: > Turn MALLOC_PRODUCTION into a regular src.conf(5) option > For historical reasons, defining MALLOC_PRODUCTION in /etc/make.conf has > been used to turn off potentially expensive debug checks and statistics > gathering in the implementation of malloc(3). > It seems more consistent to turn this into a regular src.conf(5) option, > e.g. WITH_MALLOC_PRODUCTION / WITHOUT_MALLOC_PRODUCTION. This can then > be toggled similar to any other source build option, and turned on or > off by default for e.g. stable branches. > Reviewed by: imp, #manpages > Differential Revision: https://reviews.freebsd.org/D26337 > MFC r365373: > Follow-up r365371 by removing sentences which indicate the state of the > MK_MALLOC_PRODUCTION option on -CURRENT. > Also, for the sake of backwards compatibility, support the old way of > enabling 'production malloc', e.g. by adding a define in make.conf(5). > > Added: > stable/12/tools/build/options/WITHOUT_MALLOC_PRODUCTION > - copied, changed from r365371, > head/tools/build/options/WITHOUT_MALLOC_PRODUCTION > stable/12/tools/build/options/WITH_MALLOC_PRODUCTION > - copied, changed from r365371, > head/tools/build/options/WITH_MALLOC_PRODUCTION > Modified: > stable/12/contrib/jemalloc/FREEBSD-diffs > stable/12/contrib/jemalloc/doc/jemalloc.3 > stable/12/lib/libc/stdlib/jemalloc/Makefile.inc > stable/12/share/man/man5/make.conf.5 > stable/12/share/man/man5/src.conf.5 > stable/12/share/mk/src.opts.mk > Directory Properties: > stable/12/ (props changed) > > Changes in other areas also in this revision: > Added: > stable/11/tools/build/options/WITHOUT_MALLOC_PRODUCTION > - copied, changed from r365371, > head/tools/build/options/WITHOUT_MALLOC_PRODUCTION > stable/11/tools/build/options/WITH_MALLOC_PRODUCTION > - copied, changed from r365371, > head/tools/build/options/WITH_MALLOC_PRODUCTION > Modified: > stable/11/contrib/jemalloc/FREEBSD-diffs > stable/11/contrib/jemalloc/doc/jemalloc.3 > stable/11/lib/libc/stdlib/jemalloc/Makefile.inc > stable/11/share/man/man5/make.conf.5 > stable/11/share/man/man5/src.conf.5 > stable/11/share/mk/src.opts.mk > Directory Properties: > stable/11/ (props changed) > > Modified: stable/12/contrib/jemalloc/FREEBSD-diffs > ============================================================================== > --- stable/12/contrib/jemalloc/FREEBSD-diffs Sat Sep 12 16:33:05 > 2020 (r365661) > +++ stable/12/contrib/jemalloc/FREEBSD-diffs Sat Sep 12 16:50:04 > 2020 (r365662) > @@ -14,7 +14,7 @@ index 1e12fd3a..c42a7e10 100644 > + . > + Additionally, is enabled in > development > + versions of FreeBSD (controlled by the > -+ MALLOC_PRODUCTION make variable). > ++ MK_MALLOC_PRODUCTION make variable). > + > > > > Modified: stable/12/contrib/jemalloc/doc/jemalloc.3 > ============================================================================== > --- stable/12/contrib/jemalloc/doc/jemalloc.3 Sat Sep 12 16:33:05 > 2020 (r365661) > +++ stable/12/contrib/jemalloc/doc/jemalloc.3 Sat Sep 12 16:50:04 > 2020 (r365662) > @@ -43,7 +43,7 @@ The following configuration options are enabled in lib > \fB\-\-with\-malloc\-conf=abort_conf:false\fR\&. Additionally, > \fB\-\-enable\-debug\fR > is enabled in development versions of FreeBSD (controlled by the > -\fBMALLOC_PRODUCTION\fR > +\fBMK_MALLOC_PRODUCTION\fR > make variable)\&. > .SH "SYNOPSIS" > .sp > > Modified: stable/12/lib/libc/stdlib/jemalloc/Makefile.inc > ============================================================================== > --- stable/12/lib/libc/stdlib/jemalloc/Makefile.inc Sat Sep 12 16:33:05 > 2020 (r365661) > +++ stable/12/lib/libc/stdlib/jemalloc/Makefile.inc Sat Sep 12 16:50:04 > 2020 (r365662) > @@ -44,6 +44,6 @@ MLINKS+= \ > jemalloc.3 nallocx.3 \ > jemalloc.3 malloc.conf.5 > -.if defined(MALLOC_PRODUCTION) > +.if ${MK_MALLOC_PRODUCTION} != "no" || defined(MALLOC_PRODUCTION) > CFLAGS+= -DMALLOC_PRODUCTION > .endif > > Modified: stable/12/share/man/man5/make.conf.5 > ============================================================================== > --- stable/12/share/man/man5/make.conf.5 Sat Sep 12 16:33:05 > 2020 (r365661) > +++ stable/12/share/man/man5/make.conf.5 Sat Sep 12 16:50:04 > 2020 (r365662) > @@ -401,12 +401,6 @@ console driver to > and allow access over FireWire(IEEE1394) using > .Xr dconschat 8 . > Currently, only i386 and amd64 are supported. > -.It Va MALLOC_PRODUCTION > -.Pq Vt bool > -Set this to disable assertions and statistics gathering in > -.Xr malloc 3 . > -It also defaults the A and J runtime options to off. > -Disabled by default on -CURRENT. > .It Va MAN_ARCH > .Pq Vt str > Space-delimited list of one or more MACHINE and/or MACHINE_ARCH values > > Modified: stable/12/share/man/man5/src.conf.5 > ============================================================================== > --- stable/12/share/man/man5/src.conf.5 Sat Sep 12 16:33:05 > 2020 (r365661) > +++ stable/12/share/man/man5/src.conf.5 Sat Sep 12 16:50:04 > 2020 (r365662) > @@ -1,6 +1,6 @@ > .\" DO NOT EDIT-- this file is @generated by > tools/build/options/makeman. > .\" $FreeBSD$ > -.Dd September 11, 2020 > +.Dd September 12, 2020 > .Dt SRC.CONF 5 > .Os > .Sh NAME > @@ -1357,6 +1357,10 @@ if executed as an unprivileged user. > See > .Xr tests 7 > for more details. > +.It Va WITH_MALLOC_PRODUCTION > +Set to disable assertions and statistics gathering in > +.Xr malloc 3 . > +It also defaults the A and J runtime options to off. > .It Va WITHOUT_MAN > Set to not build manual pages. > When set, these options are also in effect: > > Modified: stable/12/share/mk/src.opts.mk > ============================================================================== > --- stable/12/share/mk/src.opts.mk Sat Sep 12 16:33:05 2020 (r365661) > +++ stable/12/share/mk/src.opts.mk Sat Sep 12 16:50:04 2020 (r365662) > @@ -208,6 +208,7 @@ __DEFAULT_NO_OPTIONS = \ > LOADER_FIREWIRE \ > LOADER_FORCE_LE \ > LOADER_VERIEXEC_PASS_MANIFEST \ > + MALLOC_PRODUCTION \ > NAND \ > OFED_EXTRA \ > OPENLDAP \ > > Copied and modified: > stable/12/tools/build/options/WITHOUT_MALLOC_PRODUCTION (from r365371, > head/tools/build/options/WITHOUT_MALLOC_PRODUCTION) > ============================================================================== > --- head/tools/build/options/WITHOUT_MALLOC_PRODUCTION Sat Sep 5 > 23:30:17 2020 (r365371, copy source) > +++ stable/12/tools/build/options/WITHOUT_MALLOC_PRODUCTION Sat Sep 12 > 16:50:04 2020 (r365662) > @@ -2,4 +2,3 @@ > Set to enable assertions and statistics gathering in > .Xr malloc 3 . > It also defaults the A and J runtime options to on. > -Enabled by default on -CURRENT. > > Copied and modified: > stable/12/tools/build/options/WITH_MALLOC_PRODUCTION (from r365371, > head/tools/build/options/WITH_MALLOC_PRODUCTION) > ============================================================================== > --- head/tools/build/options/WITH_MALLOC_PRODUCTION Sat Sep 5 23:30:17 > 2020 (r365371, copy source) > +++ stable/12/tools/build/options/WITH_MALLOC_PRODUCTION Sat Sep 12 > 16:50:04 2020 (r365662) > @@ -2,4 +2,3 @@ > Set to disable assertions and statistics gathering in > .Xr malloc 3 . > It also defaults the A and J runtime options to off. > -Disabled by default on -CURRENT. > _______________________________________________ > svn-src-all@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-all > To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" From owner-svn-src-all@freebsd.org Sat Sep 12 19:13:40 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 59A773E054C; Sat, 12 Sep 2020 19:13:40 +0000 (UTC) (envelope-from zeising@freebsd.org) Received: from mail.daemonic.se (mail.daemonic.se [IPv6:2607:f740:d:20::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 4Bpj2r02j4z4Py6; Sat, 12 Sep 2020 19:13:39 +0000 (UTC) (envelope-from zeising@freebsd.org) Received: from cid.daemonic.se (localhost [IPv6:::1]) by mail.daemonic.se (Postfix) with ESMTP id 4Bpj2n5x3vz3n8N; Sat, 12 Sep 2020 19:13:37 +0000 (UTC) X-Virus-Scanned: amavisd-new at daemonic.se Received: from mail.daemonic.se ([127.0.0.1]) (using TLS with cipher ECDHE-RSA-AES128-GCM-SHA256) by cid.daemonic.se (mailscanner.daemonic.se [127.0.0.1]) (amavisd-new, port 10587) with ESMTPS id NpxruqwEhiHZ; Sat, 12 Sep 2020 19:13:37 +0000 (UTC) Received: from vivi.daemonic.se (vivi.daemonic.se [IPv6:2001:470:dca9:1200::4]) by mail.daemonic.se (Postfix) with ESMTPSA id 4Bpj2k3jfLz3mRL; Sat, 12 Sep 2020 19:13:34 +0000 (UTC) Subject: Re: svn commit: r365640 - in head: share/man/man5 share/man/man7 tools/build/options To: Gordon Bergling , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202009111809.08BI9nR9034084@repo.freebsd.org> From: Niclas Zeising Message-ID: <642a5e43-5c57-746b-7fb0-ae686a0fa19b@freebsd.org> Date: Sat, 12 Sep 2020 21:13:33 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 In-Reply-To: <202009111809.08BI9nR9034084@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4Bpj2r02j4z4Py6 X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [0.00 / 15.00]; local_wl_from(0.00)[freebsd.org]; ASN(0.00)[asn:36236, ipnet:2607:f740:d::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages 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, 12 Sep 2020 19:13:40 -0000 On 2020-09-11 20:09, Gordon Bergling wrote: > Author: gbe (doc committer) > Date: Fri Sep 11 18:09:49 2020 > New Revision: 365640 > URL: https://svnweb.freebsd.org/changeset/base/365640 > > Log: > Improvements for the src.conf(5) and build(7) man pages > > PR: 203863 (based on) > Submitted by: Russell Haley > Reviewed by: bcr, imp > Approved by: imp > MFC after: 1 week > Differential Revision: https://reviews.freebsd.org/D26343 > > Modified: > head/share/man/man5/src.conf.5 > head/share/man/man7/build.7 > head/tools/build/options/makeman > > Modified: head/share/man/man5/src.conf.5 > ============================================================================== > --- head/share/man/man5/src.conf.5 Fri Sep 11 17:05:09 2020 (r365639) > +++ head/share/man/man5/src.conf.5 Fri Sep 11 18:09:49 2020 (r365640) > @@ -1,6 +1,6 @@ > .\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman. As the comment above hints, this file is generated by a tool, and should not be edited directly. This will be overwritten the next time someone regenerates the manual page. You have to update the template in tools/build/options/makeman and regenerate the manual from there. > .\" $FreeBSD$ > -.Dd September 8, 2020 > +.Dd September 11, 2020 > .Dt SRC.CONF 5 > .Os > .Sh NAME > @@ -9,7 +9,8 @@ > .Sh DESCRIPTION > The > .Nm > -file contains settings that will apply to every build involving the > +file contains variables that control what components will be generated during > +the build process of the > .Fx > source tree; see > .Xr build 7 . > Regards -- Niclas Zeising From owner-svn-src-all@freebsd.org Sat Sep 12 19:33:30 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4DFEA3E1250; Sat, 12 Sep 2020 19:33:30 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BpjTk1dsvz4RQG; Sat, 12 Sep 2020 19:33:30 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1B0B119E50; Sat, 12 Sep 2020 19:33:30 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08CJXTbw088007; Sat, 12 Sep 2020 19:33:29 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08CJXPsZ087986; Sat, 12 Sep 2020 19:33:25 GMT (envelope-from bz@FreeBSD.org) Message-Id: <202009121933.08CJXPsZ087986@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Sat, 12 Sep 2020 19:33:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r365670 - in releng/12.2: lib/lib80211 sbin/ifconfig share/man/man4 sys/contrib/dev/ath/ath_hal/ar9300 sys/dev/an sys/dev/ath sys/dev/ath/ath_dfs/null sys/dev/ath/ath_hal sys/dev/ath/at... X-SVN-Group: releng X-SVN-Commit-Author: bz X-SVN-Commit-Paths: in releng/12.2: lib/lib80211 sbin/ifconfig share/man/man4 sys/contrib/dev/ath/ath_hal/ar9300 sys/dev/an sys/dev/ath sys/dev/ath/ath_dfs/null sys/dev/ath/ath_hal sys/dev/ath/ath_hal/ah_regdomain sys/de... X-SVN-Commit-Revision: 365670 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.33 Precedence: list List-Id: "SVN commit messages 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, 12 Sep 2020 19:33:30 -0000 Author: bz Date: Sat Sep 12 19:33:25 2020 New Revision: 365670 URL: https://svnweb.freebsd.org/changeset/base/365670 Log: MFS r365608: Merge WiFi net80211, drivers, and management in order to support better 11n and upcoming 11ac. This includes an ath(4) update, some run(4) 11n support, 11n for otus(4), A-MPDU, A-MSDU, A-MPDU+A-MSDU and Fast frames options, scanning fixes, enhanced PRIV checks for jails, restored parent device name printing, improvements for upcoming VHT support, lots of under-the-hood infrastructure improvements, new device ID, debug tools updates, some whitespace changes (to make future MFCs easier). This does not include (most) epoch(9) related changes as too much other infrastructure was not merged for that. Tested on: some ath(4) AP, run(4) STA, and rtwn(4) STA Discussed with: adrian (extremely briefly) Sponsored by: Rubicon Communications, LLC (d/b/a "Netgate") [partially] Approved by: re (gjb) Relnotes: yes Added: releng/12.2/tools/tools/ath/athani/ - copied from r365608, stable/12/tools/tools/ath/athani/ Modified: releng/12.2/lib/lib80211/lib80211_regdomain.c releng/12.2/lib/lib80211/lib80211_regdomain.h releng/12.2/lib/lib80211/regdomain.xml releng/12.2/sbin/ifconfig/ifieee80211.c releng/12.2/share/man/man4/ath.4 releng/12.2/share/man/man4/net80211.4 releng/12.2/share/man/man4/run.4 releng/12.2/sys/contrib/dev/ath/ath_hal/ar9300/ar9300.h releng/12.2/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_ani.c releng/12.2/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_eeprom.c releng/12.2/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.c releng/12.2/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_misc.c releng/12.2/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_phy.c releng/12.2/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_reset.c releng/12.2/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_stub_funcs.c releng/12.2/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_stub_funcs.h releng/12.2/sys/contrib/dev/ath/ath_hal/ar9300/ar9300eep.h releng/12.2/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_ap121.h releng/12.2/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_aphrodite.h releng/12.2/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_cus157.h releng/12.2/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_generic.h releng/12.2/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_hb112.h releng/12.2/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_hb116.h releng/12.2/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_osprey_k31.h releng/12.2/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_wasp_2.h releng/12.2/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_xb112.h releng/12.2/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_xb113.h releng/12.2/sys/dev/an/if_an.c releng/12.2/sys/dev/ath/ah_osdep.c releng/12.2/sys/dev/ath/ah_osdep_ar5210.c releng/12.2/sys/dev/ath/ah_osdep_ar5211.c releng/12.2/sys/dev/ath/ah_osdep_ar5212.c releng/12.2/sys/dev/ath/ah_osdep_ar5416.c releng/12.2/sys/dev/ath/ah_osdep_ar9300.c releng/12.2/sys/dev/ath/ath_dfs/null/dfs_null.c releng/12.2/sys/dev/ath/ath_hal/ah.c releng/12.2/sys/dev/ath/ath_hal/ah.h releng/12.2/sys/dev/ath/ath_hal/ah_eeprom_9287.c releng/12.2/sys/dev/ath/ath_hal/ah_eeprom_9287.h releng/12.2/sys/dev/ath/ath_hal/ah_eeprom_v14.c releng/12.2/sys/dev/ath/ath_hal/ah_eeprom_v3.c releng/12.2/sys/dev/ath/ath_hal/ah_eeprom_v3.h releng/12.2/sys/dev/ath/ath_hal/ah_eeprom_v4k.c releng/12.2/sys/dev/ath/ath_hal/ah_internal.h releng/12.2/sys/dev/ath/ath_hal/ah_regdomain.c releng/12.2/sys/dev/ath/ath_hal/ah_regdomain/ah_rd_domains.h releng/12.2/sys/dev/ath/ath_hal/ah_regdomain/ah_rd_freqbands.h releng/12.2/sys/dev/ath/ath_hal/ah_soc.h releng/12.2/sys/dev/ath/ath_hal/ar5210/ar5210.h releng/12.2/sys/dev/ath/ath_hal/ar5210/ar5210_recv.c releng/12.2/sys/dev/ath/ath_hal/ar5210/ar5210_reset.c releng/12.2/sys/dev/ath/ath_hal/ar5211/ar5211.h releng/12.2/sys/dev/ath/ath_hal/ar5211/ar5211_keycache.c releng/12.2/sys/dev/ath/ath_hal/ar5211/ar5211_misc.c releng/12.2/sys/dev/ath/ath_hal/ar5211/ar5211_phy.c releng/12.2/sys/dev/ath/ath_hal/ar5211/ar5211_recv.c releng/12.2/sys/dev/ath/ath_hal/ar5211/ar5211_xmit.c releng/12.2/sys/dev/ath/ath_hal/ar5211/ar5211phy.h releng/12.2/sys/dev/ath/ath_hal/ar5211/ar5211reg.h releng/12.2/sys/dev/ath/ath_hal/ar5212/ar2316.c releng/12.2/sys/dev/ath/ath_hal/ar5212/ar2317.c releng/12.2/sys/dev/ath/ath_hal/ar5212/ar2413.c releng/12.2/sys/dev/ath/ath_hal/ar5212/ar2425.c releng/12.2/sys/dev/ath/ath_hal/ar5212/ar5111.c releng/12.2/sys/dev/ath/ath_hal/ar5212/ar5112.c releng/12.2/sys/dev/ath/ath_hal/ar5212/ar5212.h releng/12.2/sys/dev/ath/ath_hal/ar5212/ar5212_ani.c releng/12.2/sys/dev/ath/ath_hal/ar5212/ar5212_interrupts.c releng/12.2/sys/dev/ath/ath_hal/ar5212/ar5212_keycache.c releng/12.2/sys/dev/ath/ath_hal/ar5212/ar5212_misc.c releng/12.2/sys/dev/ath/ath_hal/ar5212/ar5212_phy.c releng/12.2/sys/dev/ath/ath_hal/ar5212/ar5212_recv.c releng/12.2/sys/dev/ath/ath_hal/ar5212/ar5212_reset.c releng/12.2/sys/dev/ath/ath_hal/ar5212/ar5212_xmit.c releng/12.2/sys/dev/ath/ath_hal/ar5212/ar5212phy.h releng/12.2/sys/dev/ath/ath_hal/ar5212/ar5413.c releng/12.2/sys/dev/ath/ath_hal/ar5312/ar5312_eeprom.c releng/12.2/sys/dev/ath/ath_hal/ar5312/ar5312_gpio.c releng/12.2/sys/dev/ath/ath_hal/ar5312/ar5312_interrupts.c releng/12.2/sys/dev/ath/ath_hal/ar5312/ar5312_reset.c releng/12.2/sys/dev/ath/ath_hal/ar5312/ar5312reg.h releng/12.2/sys/dev/ath/ath_hal/ar5312/ar5315_gpio.c releng/12.2/sys/dev/ath/ath_hal/ar5416/ar2133.c releng/12.2/sys/dev/ath/ath_hal/ar5416/ar5416.h releng/12.2/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c releng/12.2/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c releng/12.2/sys/dev/ath/ath_hal/ar5416/ar5416_beacon.c releng/12.2/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c releng/12.2/sys/dev/ath/ath_hal/ar5416/ar5416_cal.h releng/12.2/sys/dev/ath/ath_hal/ar5416/ar5416_gpio.c releng/12.2/sys/dev/ath/ath_hal/ar5416/ar5416_power.c releng/12.2/sys/dev/ath/ath_hal/ar5416/ar5416_recv.c releng/12.2/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c releng/12.2/sys/dev/ath/ath_hal/ar5416/ar5416_spectral.c releng/12.2/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c releng/12.2/sys/dev/ath/ath_hal/ar5416/ar5416desc.h releng/12.2/sys/dev/ath/ath_hal/ar5416/ar5416reg.h releng/12.2/sys/dev/ath/ath_hal/ar9001/ar9130_attach.c releng/12.2/sys/dev/ath/ath_hal/ar9001/ar9160_attach.c releng/12.2/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c releng/12.2/sys/dev/ath/ath_hal/ar9002/ar9280_olc.c releng/12.2/sys/dev/ath/ath_hal/ar9002/ar9285.c releng/12.2/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c releng/12.2/sys/dev/ath/ath_hal/ar9002/ar9285_btcoex.c releng/12.2/sys/dev/ath/ath_hal/ar9002/ar9285_diversity.c releng/12.2/sys/dev/ath/ath_hal/ar9002/ar9285_reset.c releng/12.2/sys/dev/ath/ath_hal/ar9002/ar9287_attach.c releng/12.2/sys/dev/ath/ath_hal/ar9002/ar9287_cal.c releng/12.2/sys/dev/ath/ath_hal/ar9002/ar9287_reset.c releng/12.2/sys/dev/ath/ath_rate/amrr/amrr.c releng/12.2/sys/dev/ath/ath_rate/onoe/onoe.c releng/12.2/sys/dev/ath/ath_rate/sample/sample.c releng/12.2/sys/dev/ath/ath_rate/sample/sample.h releng/12.2/sys/dev/ath/ath_rate/sample/tx_schedules.h releng/12.2/sys/dev/ath/if_ath.c releng/12.2/sys/dev/ath/if_ath_ahb.c releng/12.2/sys/dev/ath/if_ath_beacon.c releng/12.2/sys/dev/ath/if_ath_beacon.h releng/12.2/sys/dev/ath/if_ath_btcoex.c releng/12.2/sys/dev/ath/if_ath_dfs.c releng/12.2/sys/dev/ath/if_ath_drv.c releng/12.2/sys/dev/ath/if_ath_ioctl.c releng/12.2/sys/dev/ath/if_ath_led.c releng/12.2/sys/dev/ath/if_ath_lna_div.c releng/12.2/sys/dev/ath/if_ath_misc.h releng/12.2/sys/dev/ath/if_ath_pci.c releng/12.2/sys/dev/ath/if_ath_pci_devlist.h releng/12.2/sys/dev/ath/if_ath_rate.c releng/12.2/sys/dev/ath/if_ath_rx.c releng/12.2/sys/dev/ath/if_ath_rx_edma.c releng/12.2/sys/dev/ath/if_ath_spectral.c releng/12.2/sys/dev/ath/if_ath_sysctl.c releng/12.2/sys/dev/ath/if_ath_tx.c releng/12.2/sys/dev/ath/if_ath_tx.h releng/12.2/sys/dev/ath/if_ath_tx_edma.c releng/12.2/sys/dev/ath/if_ath_tx_ht.c releng/12.2/sys/dev/ath/if_athioctl.h releng/12.2/sys/dev/ath/if_athrate.h releng/12.2/sys/dev/ath/if_athvar.h releng/12.2/sys/dev/bwi/bwimac.c releng/12.2/sys/dev/bwi/bwiphy.c releng/12.2/sys/dev/bwi/bwirf.c releng/12.2/sys/dev/bwi/if_bwi.c releng/12.2/sys/dev/bwi/if_bwi_pci.c releng/12.2/sys/dev/bwi/if_bwireg.h releng/12.2/sys/dev/bwn/if_bwn.c releng/12.2/sys/dev/bwn/if_bwn_pci.c releng/12.2/sys/dev/bwn/if_bwn_pcivar.h releng/12.2/sys/dev/bwn/if_bwn_phy_g.c releng/12.2/sys/dev/bwn/if_bwnvar.h releng/12.2/sys/dev/iwm/if_iwm.c releng/12.2/sys/dev/iwn/if_iwn.c releng/12.2/sys/dev/mwl/if_mwl.c releng/12.2/sys/dev/mwl/if_mwl_pci.c releng/12.2/sys/dev/mwl/mwlreg.h releng/12.2/sys/dev/otus/if_otus.c releng/12.2/sys/dev/otus/if_otusreg.h releng/12.2/sys/dev/rtwn/if_rtwn.c releng/12.2/sys/dev/rtwn/if_rtwn_beacon.c releng/12.2/sys/dev/rtwn/if_rtwn_calib.c releng/12.2/sys/dev/rtwn/if_rtwn_cam.c releng/12.2/sys/dev/rtwn/if_rtwn_efuse.c releng/12.2/sys/dev/rtwn/if_rtwn_fw.c releng/12.2/sys/dev/rtwn/if_rtwn_fw.h releng/12.2/sys/dev/rtwn/if_rtwn_ridx.h releng/12.2/sys/dev/rtwn/if_rtwn_rx.c releng/12.2/sys/dev/rtwn/if_rtwn_rx.h releng/12.2/sys/dev/rtwn/if_rtwn_task.c releng/12.2/sys/dev/rtwn/if_rtwn_tx.c releng/12.2/sys/dev/rtwn/if_rtwnreg.h releng/12.2/sys/dev/rtwn/if_rtwnvar.h releng/12.2/sys/dev/rtwn/pci/rtwn_pci_attach.c releng/12.2/sys/dev/rtwn/pci/rtwn_pci_reg.c releng/12.2/sys/dev/rtwn/pci/rtwn_pci_rx.c releng/12.2/sys/dev/rtwn/pci/rtwn_pci_tx.c releng/12.2/sys/dev/rtwn/pci/rtwn_pci_var.h releng/12.2/sys/dev/rtwn/rtl8188e/pci/r88ee.h releng/12.2/sys/dev/rtwn/rtl8188e/pci/r88ee_reg.h releng/12.2/sys/dev/rtwn/rtl8188e/r88e.h releng/12.2/sys/dev/rtwn/rtl8188e/r88e_beacon.c releng/12.2/sys/dev/rtwn/rtl8188e/r88e_calib.c releng/12.2/sys/dev/rtwn/rtl8188e/r88e_chan.c releng/12.2/sys/dev/rtwn/rtl8188e/r88e_fw.c releng/12.2/sys/dev/rtwn/rtl8188e/r88e_init.c releng/12.2/sys/dev/rtwn/rtl8188e/r88e_led.c releng/12.2/sys/dev/rtwn/rtl8188e/r88e_priv.h releng/12.2/sys/dev/rtwn/rtl8188e/r88e_reg.h releng/12.2/sys/dev/rtwn/rtl8188e/r88e_rf.c releng/12.2/sys/dev/rtwn/rtl8188e/r88e_rom.c releng/12.2/sys/dev/rtwn/rtl8188e/r88e_rx.c releng/12.2/sys/dev/rtwn/rtl8188e/r88e_tx.c releng/12.2/sys/dev/rtwn/rtl8188e/usb/r88eu.h releng/12.2/sys/dev/rtwn/rtl8188e/usb/r88eu_attach.c releng/12.2/sys/dev/rtwn/rtl8188e/usb/r88eu_init.c releng/12.2/sys/dev/rtwn/rtl8192c/pci/r92ce.h releng/12.2/sys/dev/rtwn/rtl8192c/pci/r92ce_attach.c releng/12.2/sys/dev/rtwn/rtl8192c/pci/r92ce_calib.c releng/12.2/sys/dev/rtwn/rtl8192c/pci/r92ce_fw.c releng/12.2/sys/dev/rtwn/rtl8192c/pci/r92ce_init.c releng/12.2/sys/dev/rtwn/rtl8192c/pci/r92ce_priv.h releng/12.2/sys/dev/rtwn/rtl8192c/pci/r92ce_reg.h releng/12.2/sys/dev/rtwn/rtl8192c/pci/r92ce_rx.c releng/12.2/sys/dev/rtwn/rtl8192c/pci/r92ce_tx.c releng/12.2/sys/dev/rtwn/rtl8192c/r92c.h releng/12.2/sys/dev/rtwn/rtl8192c/r92c_attach.c releng/12.2/sys/dev/rtwn/rtl8192c/r92c_beacon.c releng/12.2/sys/dev/rtwn/rtl8192c/r92c_calib.c releng/12.2/sys/dev/rtwn/rtl8192c/r92c_chan.c releng/12.2/sys/dev/rtwn/rtl8192c/r92c_fw.c releng/12.2/sys/dev/rtwn/rtl8192c/r92c_init.c releng/12.2/sys/dev/rtwn/rtl8192c/r92c_priv.h releng/12.2/sys/dev/rtwn/rtl8192c/r92c_reg.h releng/12.2/sys/dev/rtwn/rtl8192c/r92c_rf.c releng/12.2/sys/dev/rtwn/rtl8192c/r92c_rom.c releng/12.2/sys/dev/rtwn/rtl8192c/r92c_rx.c releng/12.2/sys/dev/rtwn/rtl8192c/r92c_tx.c releng/12.2/sys/dev/rtwn/rtl8192c/r92c_tx_desc.h releng/12.2/sys/dev/rtwn/rtl8192c/usb/r92cu.h releng/12.2/sys/dev/rtwn/rtl8192c/usb/r92cu_attach.c releng/12.2/sys/dev/rtwn/rtl8192c/usb/r92cu_init.c releng/12.2/sys/dev/rtwn/rtl8192c/usb/r92cu_led.c releng/12.2/sys/dev/rtwn/rtl8192c/usb/r92cu_priv.h releng/12.2/sys/dev/rtwn/rtl8192c/usb/r92cu_reg.h releng/12.2/sys/dev/rtwn/rtl8192c/usb/r92cu_rx.c releng/12.2/sys/dev/rtwn/rtl8192c/usb/r92cu_tx.c releng/12.2/sys/dev/rtwn/rtl8192c/usb/r92cu_tx_desc.h releng/12.2/sys/dev/rtwn/rtl8192e/r92e.h releng/12.2/sys/dev/rtwn/rtl8192e/r92e_chan.c releng/12.2/sys/dev/rtwn/rtl8192e/r92e_priv.h releng/12.2/sys/dev/rtwn/rtl8192e/usb/r92eu.h releng/12.2/sys/dev/rtwn/rtl8812a/r12a.h releng/12.2/sys/dev/rtwn/rtl8812a/r12a_beacon.c releng/12.2/sys/dev/rtwn/rtl8812a/r12a_calib.c releng/12.2/sys/dev/rtwn/rtl8812a/r12a_caps.c releng/12.2/sys/dev/rtwn/rtl8812a/r12a_chan.c releng/12.2/sys/dev/rtwn/rtl8812a/r12a_fw.c releng/12.2/sys/dev/rtwn/rtl8812a/r12a_fw_cmd.h releng/12.2/sys/dev/rtwn/rtl8812a/r12a_init.c releng/12.2/sys/dev/rtwn/rtl8812a/r12a_led.c releng/12.2/sys/dev/rtwn/rtl8812a/r12a_priv.h releng/12.2/sys/dev/rtwn/rtl8812a/r12a_reg.h releng/12.2/sys/dev/rtwn/rtl8812a/r12a_rf.c releng/12.2/sys/dev/rtwn/rtl8812a/r12a_rom.c releng/12.2/sys/dev/rtwn/rtl8812a/r12a_rx.c releng/12.2/sys/dev/rtwn/rtl8812a/r12a_tx.c releng/12.2/sys/dev/rtwn/rtl8812a/r12a_tx_desc.h releng/12.2/sys/dev/rtwn/rtl8812a/usb/r12au.h releng/12.2/sys/dev/rtwn/rtl8812a/usb/r12au_attach.c releng/12.2/sys/dev/rtwn/rtl8812a/usb/r12au_init.c releng/12.2/sys/dev/rtwn/rtl8812a/usb/r12au_rx.c releng/12.2/sys/dev/rtwn/rtl8812a/usb/r12au_tx.c releng/12.2/sys/dev/rtwn/rtl8821a/r21a.h releng/12.2/sys/dev/rtwn/rtl8821a/r21a_beacon.c releng/12.2/sys/dev/rtwn/rtl8821a/r21a_calib.c releng/12.2/sys/dev/rtwn/rtl8821a/r21a_chan.c releng/12.2/sys/dev/rtwn/rtl8821a/r21a_fw.c releng/12.2/sys/dev/rtwn/rtl8821a/r21a_init.c releng/12.2/sys/dev/rtwn/rtl8821a/r21a_led.c releng/12.2/sys/dev/rtwn/rtl8821a/r21a_priv.h releng/12.2/sys/dev/rtwn/rtl8821a/r21a_reg.h releng/12.2/sys/dev/rtwn/rtl8821a/r21a_rom.c releng/12.2/sys/dev/rtwn/rtl8821a/r21a_rx.c releng/12.2/sys/dev/rtwn/rtl8821a/usb/r21au.h releng/12.2/sys/dev/rtwn/rtl8821a/usb/r21au_attach.c releng/12.2/sys/dev/rtwn/rtl8821a/usb/r21au_dfs.c releng/12.2/sys/dev/rtwn/rtl8821a/usb/r21au_init.c releng/12.2/sys/dev/rtwn/usb/rtwn_usb_attach.c releng/12.2/sys/dev/rtwn/usb/rtwn_usb_attach.h releng/12.2/sys/dev/rtwn/usb/rtwn_usb_ep.c releng/12.2/sys/dev/rtwn/usb/rtwn_usb_reg.c releng/12.2/sys/dev/rtwn/usb/rtwn_usb_tx.c releng/12.2/sys/dev/usb/usbdevs releng/12.2/sys/dev/usb/wlan/if_rsu.c releng/12.2/sys/dev/usb/wlan/if_run.c releng/12.2/sys/dev/usb/wlan/if_runreg.h releng/12.2/sys/dev/usb/wlan/if_runvar.h releng/12.2/sys/dev/usb/wlan/if_zyd.c releng/12.2/sys/dev/wi/if_wavelan_ieee.h releng/12.2/sys/dev/wi/if_wi.c releng/12.2/sys/dev/wi/if_wi_macio.c releng/12.2/sys/dev/wi/if_wi_pccard.c releng/12.2/sys/dev/wi/if_wi_pci.c releng/12.2/sys/dev/wpi/if_wpireg.h releng/12.2/sys/dev/wtap/if_wtap.c releng/12.2/sys/kern/kern_jail.c releng/12.2/sys/net80211/_ieee80211.h releng/12.2/sys/net80211/ieee80211.c releng/12.2/sys/net80211/ieee80211.h releng/12.2/sys/net80211/ieee80211_adhoc.c releng/12.2/sys/net80211/ieee80211_amrr.c releng/12.2/sys/net80211/ieee80211_ddb.c releng/12.2/sys/net80211/ieee80211_freebsd.c releng/12.2/sys/net80211/ieee80211_freebsd.h releng/12.2/sys/net80211/ieee80211_hostap.c releng/12.2/sys/net80211/ieee80211_ht.c releng/12.2/sys/net80211/ieee80211_ht.h releng/12.2/sys/net80211/ieee80211_input.h releng/12.2/sys/net80211/ieee80211_ioctl.c releng/12.2/sys/net80211/ieee80211_ioctl.h releng/12.2/sys/net80211/ieee80211_node.c releng/12.2/sys/net80211/ieee80211_node.h releng/12.2/sys/net80211/ieee80211_output.c releng/12.2/sys/net80211/ieee80211_phy.h releng/12.2/sys/net80211/ieee80211_power.c releng/12.2/sys/net80211/ieee80211_proto.c releng/12.2/sys/net80211/ieee80211_proto.h releng/12.2/sys/net80211/ieee80211_regdomain.c releng/12.2/sys/net80211/ieee80211_scan_sta.c releng/12.2/sys/net80211/ieee80211_scan_sw.c releng/12.2/sys/net80211/ieee80211_sta.c releng/12.2/sys/net80211/ieee80211_sta.h releng/12.2/sys/net80211/ieee80211_var.h releng/12.2/sys/net80211/ieee80211_vht.c releng/12.2/sys/net80211/ieee80211_vht.h releng/12.2/sys/sys/priv.h releng/12.2/tools/tools/ath/Makefile releng/12.2/tools/tools/ath/ath_ee_9300_print/main.c releng/12.2/tools/tools/ath/athratestats/main.c releng/12.2/tools/tools/net80211/wlanstats/main.c releng/12.2/tools/tools/net80211/wlanstats/wlanstats.c Directory Properties: releng/12.2/ (props changed) Modified: releng/12.2/lib/lib80211/lib80211_regdomain.c ============================================================================== --- releng/12.2/lib/lib80211/lib80211_regdomain.c Sat Sep 12 18:58:36 2020 (r365669) +++ releng/12.2/lib/lib80211/lib80211_regdomain.c Sat Sep 12 19:33:25 2020 (r365670) @@ -192,7 +192,7 @@ decode_flag(struct mystate *mt, const char *p, int len FLAG(IEEE80211_CHAN_VHT40), FLAG(IEEE80211_CHAN_VHT80), /* - * XXX VHT80_80? This likely should be done by + * XXX VHT80P80? This likely should be done by * 80MHz chan logic in net80211 / ifconfig. */ FLAG(IEEE80211_CHAN_VHT160), Modified: releng/12.2/lib/lib80211/lib80211_regdomain.h ============================================================================== --- releng/12.2/lib/lib80211/lib80211_regdomain.h Sat Sep 12 18:58:36 2020 (r365669) +++ releng/12.2/lib/lib80211/lib80211_regdomain.h Sat Sep 12 19:33:25 2020 (r365670) @@ -73,10 +73,10 @@ struct regdomain { netband_head bands_11b; /* 11b operation */ netband_head bands_11g; /* 11g operation */ netband_head bands_11a; /* 11a operation */ - netband_head bands_11ng;/* 11ng operation */ - netband_head bands_11na;/* 11na operation */ - netband_head bands_11ac;/* 11ac 5GHz operation */ - netband_head bands_11acg;/* 11ac 2GHz operation */ + netband_head bands_11ng; /* 11ng operation */ + netband_head bands_11na; /* 11na operation */ + netband_head bands_11ac; /* 11ac 5GHz operation */ + netband_head bands_11acg; /* 11ac 2GHz operation */ LIST_ENTRY(regdomain) next; }; Modified: releng/12.2/lib/lib80211/regdomain.xml ============================================================================== --- releng/12.2/lib/lib80211/regdomain.xml Sat Sep 12 18:58:36 2020 (r365669) +++ releng/12.2/lib/lib80211/regdomain.xml Sat Sep 12 19:33:25 2020 (r365670) @@ -111,6 +111,44 @@ IEEE80211_CHAN_HT40 + + + + 17 + IEEE80211_CHAN_HT20 + IEEE80211_CHAN_VHT20 + + + + 17 + IEEE80211_CHAN_HT40 + IEEE80211_CHAN_VHT40 + + + + 17 + IEEE80211_CHAN_HT40 + IEEE80211_CHAN_VHT80 + + + + 17 + IEEE80211_CHAN_HT20 + IEEE80211_CHAN_VHT20 + + + + 17 + IEEE80211_CHAN_HT40 + IEEE80211_CHAN_VHT40 + + + + 17 + IEEE80211_CHAN_HT40 + IEEE80211_CHAN_VHT80 + + @@ -1735,6 +1773,21 @@ 20 20 IEEE80211_CHAN_A + + 5180 5240 + 20 20 + IEEE80211_CHAN_A + + + 5180 5240 + 40 20 + IEEE80211_CHAN_A + + + 5180 5240 + 80 20 + IEEE80211_CHAN_A + 5180 5240 40 20 @@ -1823,6 +1876,21 @@ 5745 5805 20 20 + IEEE80211_CHAN_A + + + 5745 5805 + 20 20 + IEEE80211_CHAN_A + + + 5745 5805 + 40 20 + IEEE80211_CHAN_A + + + 5745 5805 + 80 20 IEEE80211_CHAN_A Modified: releng/12.2/sbin/ifconfig/ifieee80211.c ============================================================================== --- releng/12.2/sbin/ifconfig/ifieee80211.c Sat Sep 12 18:58:36 2020 (r365669) +++ releng/12.2/sbin/ifconfig/ifieee80211.c Sat Sep 12 19:33:25 2020 (r365670) @@ -125,8 +125,19 @@ #define IEEE80211_NODE_AMSDU_RX 0x040000 /* AMSDU rx enabled */ #define IEEE80211_NODE_AMSDU_TX 0x080000 /* AMSDU tx enabled */ #define IEEE80211_NODE_VHT 0x100000 /* VHT enabled */ +#define IEEE80211_NODE_LDPC 0x200000 /* LDPC enabled */ +#define IEEE80211_NODE_UAPSD 0x400000 /* UAPSD enabled */ #endif +/* XXX should also figure out where to put these for k/u-space sharing. */ +#ifndef IEEE80211_FVHT_VHT +#define IEEE80211_FVHT_VHT 0x000000001 /* CONF: VHT supported */ +#define IEEE80211_FVHT_USEVHT40 0x000000002 /* CONF: Use VHT40 */ +#define IEEE80211_FVHT_USEVHT80 0x000000004 /* CONF: Use VHT80 */ +#define IEEE80211_FVHT_USEVHT160 0x000000008 /* CONF: Use VHT160 */ +#define IEEE80211_FVHT_USEVHT80P80 0x000000010 /* CONF: Use VHT 80+80 */ +#endif + #define MAXCHAN 1536 /* max 1.5K channels */ #define MAXCOL 78 @@ -1804,6 +1815,12 @@ set80211ldpc(const char *val, int d, int s, const stru set80211(s, IEEE80211_IOC_LDPC, ldpc, 0, NULL); } +static void +set80211uapsd(const char *val, int d, int s, const struct afswtch *rafp) +{ + set80211(s, IEEE80211_IOC_UAPSD, d, 0, NULL); +} + static DECL_CMD_FUNC(set80211ampdulimit, val, d) { @@ -2159,8 +2176,6 @@ regdomain_addchans(struct ieee80211req_chaninfo *ci, /* * VHT first - HT is a subset. - * - * XXX TODO: VHT80p80, VHT160 is not yet done. */ if (flags & IEEE80211_CHAN_VHT) { if ((chanFlags & IEEE80211_CHAN_VHT20) && @@ -2184,7 +2199,20 @@ regdomain_addchans(struct ieee80211req_chaninfo *ci, "VHT80 channel\n", freq); continue; } - + if ((chanFlags & IEEE80211_CHAN_VHT160) && + (flags & IEEE80211_CHAN_VHT160) == 0) { + if (verbose) + printf("%u: skip, not a " + "VHT160 channel\n", freq); + continue; + } + if ((chanFlags & IEEE80211_CHAN_VHT80P80) && + (flags & IEEE80211_CHAN_VHT80P80) == 0) { + if (verbose) + printf("%u: skip, not a " + "VHT80+80 channel\n", freq); + continue; + } flags &= ~IEEE80211_CHAN_VHT; flags |= chanFlags & IEEE80211_CHAN_VHT; } @@ -2370,7 +2398,7 @@ regdomain_makechannels( &dc->dc_chaninfo); } - /* XXX TODO: VHT80_80, VHT160 */ + /* XXX TODO: VHT80P80, VHT160 */ } if (!LIST_EMPTY(&rd->bands_11ng) && dc->dc_htcaps != 0) { @@ -2631,6 +2659,10 @@ getflags(int flags) *cp++ = 't'; if (flags & IEEE80211_NODE_AMSDU_RX) *cp++ = 'r'; + if (flags & IEEE80211_NODE_UAPSD) + *cp++ = 'U'; + if (flags & IEEE80211_NODE_LDPC) + *cp++ = 'L'; *cp = '\0'; return flagstring; } @@ -3840,8 +3872,8 @@ list_stations(int s) , "TXSEQ" , "RXSEQ" ); - else - printf("%-17.17s %4s %4s %4s %4s %4s %6s %6s %4s %-7s\n" + else + printf("%-17.17s %4s %4s %4s %4s %4s %6s %6s %4s %-12s\n" , "ADDR" , "AID" , "CHAN" @@ -3875,8 +3907,8 @@ list_stations(int s) , gettxseq(si) , getrxseq(si) ); - else - printf("%s %4u %4d %3dM %4.1f %4d %6d %6d %-4.4s %-7.7s" + else + printf("%s %4u %4d %3dM %4.1f %4d %6d %6d %-4.4s %-12.12s" , ether_ntoa((const struct ether_addr*) si->isi_macaddr) , IEEE80211_AID(si->isi_associd) @@ -3937,8 +3969,11 @@ get_chaninfo(const struct ieee80211_channel *c, int pr if (IEEE80211_IS_CHAN_TURBO(c)) strlcat(buf, " Turbo", bsize); if (precise) { - /* XXX should make VHT80U, VHT80D */ - if (IEEE80211_IS_CHAN_VHT80(c) && + if (IEEE80211_IS_CHAN_VHT80P80(c)) + strlcat(buf, " vht/80p80", bsize); + else if (IEEE80211_IS_CHAN_VHT160(c)) + strlcat(buf, " vht/160", bsize); + else if (IEEE80211_IS_CHAN_VHT80(c) && IEEE80211_IS_CHAN_HT40D(c)) strlcat(buf, " vht/80-", bsize); else if (IEEE80211_IS_CHAN_VHT80(c) && @@ -3992,10 +4027,11 @@ print_chaninfo(const struct ieee80211_channel *c, int static int chanpref(const struct ieee80211_channel *c) { + + if (IEEE80211_IS_CHAN_VHT80P80(c)) + return 90; if (IEEE80211_IS_CHAN_VHT160(c)) return 80; - if (IEEE80211_IS_CHAN_VHT80_80(c)) - return 75; if (IEEE80211_IS_CHAN_VHT80(c)) return 70; if (IEEE80211_IS_CHAN_VHT40(c)) @@ -4767,6 +4803,23 @@ getid(int s, int ix, void *data, size_t len, int *plen return 0; } +static int +getdevicename(int s, void *data, size_t len, int *plen) +{ + struct ieee80211req ireq; + + (void) memset(&ireq, 0, sizeof(ireq)); + (void) strlcpy(ireq.i_name, name, sizeof(ireq.i_name)); + ireq.i_type = IEEE80211_IOC_IC_NAME; + ireq.i_val = -1; + ireq.i_data = data; + ireq.i_len = len; + if (ioctl(s, SIOCG80211, &ireq) < 0) + return (-1); + *plen = ireq.i_len; + return (0); +} + static void ieee80211_status(int s) { @@ -5288,30 +5341,40 @@ end: break; } } + if (get80211val(s, IEEE80211_IOC_UAPSD, &val) != -1) { + switch (val) { + case 0: + LINE_CHECK("-uapsd"); + break; + case 1: + LINE_CHECK("uapsd"); + break; + } + } } if (IEEE80211_IS_CHAN_VHT(c) || verbose) { getvhtconf(s); - if (vhtconf & 0x1) + if (vhtconf & IEEE80211_FVHT_VHT) LINE_CHECK("vht"); else LINE_CHECK("-vht"); - if (vhtconf & 0x2) + if (vhtconf & IEEE80211_FVHT_USEVHT40) LINE_CHECK("vht40"); else LINE_CHECK("-vht40"); - if (vhtconf & 0x4) + if (vhtconf & IEEE80211_FVHT_USEVHT80) LINE_CHECK("vht80"); else LINE_CHECK("-vht80"); - if (vhtconf & 0x8) - LINE_CHECK("vht80p80"); - else - LINE_CHECK("-vht80p80"); - if (vhtconf & 0x10) + if (vhtconf & IEEE80211_FVHT_USEVHT160) LINE_CHECK("vht160"); else LINE_CHECK("-vht160"); + if (vhtconf & IEEE80211_FVHT_USEVHT80P80) + LINE_CHECK("vht80p80"); + else + LINE_CHECK("-vht80p80"); } if (get80211val(s, IEEE80211_IOC_WME, &wme) != -1) { @@ -5481,6 +5544,12 @@ end: } LINE_BREAK(); + + if (getdevicename(s, data, sizeof(data), &len) < 0) + return; + LINE_CHECK("parent interface: %s", data); + + LINE_BREAK(); } static int @@ -5872,6 +5941,8 @@ static struct cmd ieee80211_cmds[] = { DEF_CMD("-ldpctx", -1, set80211ldpc), DEF_CMD("ldpc", 3, set80211ldpc), /* NB: tx+rx */ DEF_CMD("-ldpc", -3, set80211ldpc), + DEF_CMD("uapsd", 1, set80211uapsd), + DEF_CMD("-uapsd", 0, set80211uapsd), DEF_CMD("puren", 1, set80211puren), DEF_CMD("-puren", 0, set80211puren), DEF_CMD("doth", 1, set80211doth), @@ -5904,16 +5975,16 @@ static struct cmd ieee80211_cmds[] = { DEF_CMD("-ht40", 0, set80211htconf), DEF_CMD("ht", 3, set80211htconf), /* NB: 20+40 */ DEF_CMD("-ht", 0, set80211htconf), - DEF_CMD("vht", 1, set80211vhtconf), - DEF_CMD("-vht", 0, set80211vhtconf), - DEF_CMD("vht40", 2, set80211vhtconf), - DEF_CMD("-vht40", -2, set80211vhtconf), - DEF_CMD("vht80", 4, set80211vhtconf), - DEF_CMD("-vht80", -4, set80211vhtconf), - DEF_CMD("vht80p80", 8, set80211vhtconf), - DEF_CMD("-vht80p80", -8, set80211vhtconf), - DEF_CMD("vht160", 16, set80211vhtconf), - DEF_CMD("-vht160", -16, set80211vhtconf), + DEF_CMD("vht", IEEE80211_FVHT_VHT, set80211vhtconf), + DEF_CMD("-vht", 0, set80211vhtconf), + DEF_CMD("vht40", IEEE80211_FVHT_USEVHT40, set80211vhtconf), + DEF_CMD("-vht40", -IEEE80211_FVHT_USEVHT40, set80211vhtconf), + DEF_CMD("vht80", IEEE80211_FVHT_USEVHT80, set80211vhtconf), + DEF_CMD("-vht80", -IEEE80211_FVHT_USEVHT80, set80211vhtconf), + DEF_CMD("vht160", IEEE80211_FVHT_USEVHT160, set80211vhtconf), + DEF_CMD("-vht160", -IEEE80211_FVHT_USEVHT160, set80211vhtconf), + DEF_CMD("vht80p80", IEEE80211_FVHT_USEVHT80P80, set80211vhtconf), + DEF_CMD("-vht80p80", -IEEE80211_FVHT_USEVHT80P80, set80211vhtconf), DEF_CMD("rifs", 1, set80211rifs), DEF_CMD("-rifs", 0, set80211rifs), DEF_CMD("smps", IEEE80211_HTCAP_SMPS_ENA, set80211smps), Modified: releng/12.2/share/man/man4/ath.4 ============================================================================== --- releng/12.2/share/man/man4/ath.4 Sat Sep 12 18:58:36 2020 (r365669) +++ releng/12.2/share/man/man4/ath.4 Sat Sep 12 19:33:25 2020 (r365670) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\"/ -.Dd April 14, 2014 +.Dd June 16, 2020 .Dt ATH 4 .Os .Sh NAME @@ -60,10 +60,10 @@ The driver provides support for wireless network adapters based on the Atheros AR5210, AR5211, AR5212, AR5416 and AR9300 programming APIs. These APIs are used by a wide variety of chips; most all chips with -a PCI and/or CardBus interface are supported. +a PCI, PCIe and/or CardBus interface are supported. .Pp Supported features include 802.11 and 802.3 frames, power management, BSS, -IBSS, MBSS, TDMA, and host-based access point operation modes. +IBSS, MBSS, WDS/DWDS TDMA, and host-based access point operation modes. All host/device interaction is via DMA. .Pp Please note that from FreeBSD-9.0, the @@ -148,12 +148,13 @@ For more information on configuring this device, see .Pp Devices supported by the .Nm -driver come in either Cardbus or mini-PCI packages. -Wireless cards in Cardbus slots may be inserted and ejected on the fly. +driver come in Cardbus, ExpressCard, Mini-PCI and Mini-PCIe packages. +Wireless cards in Cardbus and ExpressCard slots may be inserted and +ejected on the fly. .Sh HARDWARE The .Nm -driver supports all Atheros Cardbus and PCI cards, +driver supports all Atheros Cardbus, ExpressCard, PCI and PCIe cards, except those that are based on the AR5005VL chipset. .Sh EXAMPLES Join a specific BSS network with WEP encryption: @@ -293,8 +294,7 @@ device driver first appeared in Revision A1 of the D-LINK DWL-G520 and DWL-G650 are based on an Intersil PrismGT chip and are not supported by this driver. .Sh BUGS -The driver does not fully enable power-save operation of the chip -in station mode; consequently power use is suboptimal (e.g. on a laptop). +The driver does supports optional station mode power-save operation. .Pp The AR5210 can only do WEP in hardware; consequently hardware assisted WEP is disabled in order to allow software implementations of TKIP and CCMP to Modified: releng/12.2/share/man/man4/net80211.4 ============================================================================== --- releng/12.2/share/man/man4/net80211.4 Sat Sep 12 18:58:36 2020 (r365669) +++ releng/12.2/share/man/man4/net80211.4 Sat Sep 12 19:33:25 2020 (r365670) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 10, 2009 +.Dd August 7, 2020 .Dt NET80211 4 .Os .Sh NAME @@ -393,6 +393,16 @@ Valid values are: and .Dv IEEE80211_HWMP_ROOTMODE_RANN (send broadcast Root Announcement (RANN) frames). +.It Dv IEEE80211_IOC_IC_NAME +Return the underlying hardware +.Xr device 9 +name in the buffer pointed to by +.Va i_data +and the name length including terminating NUL character in +.Va i_len . +If the buffer length is too small to hold the full name +.Er EINVAL +will be returned. .It Dv IEEE80211_IOC_INACTIVITY Return whether or not the system handles inactivity processing in .Va i_val . Modified: releng/12.2/share/man/man4/run.4 ============================================================================== --- releng/12.2/share/man/man4/run.4 Sat Sep 12 18:58:36 2020 (r365669) +++ releng/12.2/share/man/man4/run.4 Sat Sep 12 19:33:25 2020 (r365670) @@ -16,7 +16,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 8, 2018 +.Dd June 16, 2020 .Dt RUN 4 .Os .Sh NAME @@ -251,5 +251,5 @@ driver was written by .Sh CAVEATS The .Nm -driver does not support any of the 802.11n capabilities offered by the +driver supports some of the 11n capabilities found in the RT2800, RT3000 and RT3900 chipsets. Modified: releng/12.2/sys/contrib/dev/ath/ath_hal/ar9300/ar9300.h ============================================================================== --- releng/12.2/sys/contrib/dev/ath/ath_hal/ar9300/ar9300.h Sat Sep 12 18:58:36 2020 (r365669) +++ releng/12.2/sys/contrib/dev/ath/ath_hal/ar9300/ar9300.h Sat Sep 12 19:33:25 2020 (r365670) @@ -19,18 +19,14 @@ #include "ar9300_freebsd_inc.h" -#define AH_BIG_ENDIAN 4321 -#define AH_LITTLE_ENDIAN 1234 - -#if _BYTE_ORDER == _BIG_ENDIAN -#define AH_BYTE_ORDER AH_BIG_ENDIAN -#else -#define AH_BYTE_ORDER AH_LITTLE_ENDIAN -#endif - /* XXX doesn't belong here */ #define AR_EEPROM_MODAL_SPURS 5 +/* Ensure that AH_BYTE_ORDER is defined */ +#ifndef AH_BYTE_ORDER +#error AH_BYTE_ORDER needs to be defined! +#endif + /* * (a) this should be N(a), * (b) FreeBSD does define nitems, @@ -43,10 +39,8 @@ #include "ah_devid.h" #include "ar9300eep.h" /* For Eeprom definitions */ - #define AR9300_MAGIC 0x19741014 - /* MAC register values */ #define INIT_CONFIG_STATUS 0x00000000 @@ -1396,7 +1390,7 @@ extern void ar9300_wowoffload_download_ns_info(struct extern HAL_BOOL ar9300_reset(struct ath_hal *ah, HAL_OPMODE opmode, struct ieee80211_channel *chan, HAL_HT_MACMODE macmode, u_int8_t txchainmask, u_int8_t rxchainmask, HAL_HT_EXTPROTSPACING extprotspacing, - HAL_BOOL b_channel_change, HAL_STATUS *status, int is_scan); + HAL_BOOL b_channel_change, HAL_STATUS *status, HAL_RESET_TYPE reset_type, int is_scan); extern HAL_BOOL ar9300_lean_channel_change(struct ath_hal *ah, HAL_OPMODE opmode, struct ieee80211_channel *chan, HAL_HT_MACMODE macmode, u_int8_t txchainmask, u_int8_t rxchainmask); extern HAL_BOOL ar9300_set_reset_reg(struct ath_hal *ah, u_int32_t type); @@ -1406,7 +1400,7 @@ extern u_int16_t ar9300_is_single_ant_power_save_poss extern void ar9300_set_operating_mode(struct ath_hal *ah, int opmode); extern HAL_BOOL ar9300_phy_disable(struct ath_hal *ah); extern HAL_BOOL ar9300_disable(struct ath_hal *ah); -extern HAL_BOOL ar9300_chip_reset(struct ath_hal *ah, struct ieee80211_channel *); +extern HAL_BOOL ar9300_chip_reset(struct ath_hal *ah, struct ieee80211_channel *, HAL_RESET_TYPE type); extern HAL_BOOL ar9300_calibration(struct ath_hal *ah, struct ieee80211_channel *chan, u_int8_t rxchainmask, HAL_BOOL longcal, HAL_BOOL *isIQdone, int is_scan, u_int32_t *sched_cals); extern void ar9300_reset_cal_valid(struct ath_hal *ah, Modified: releng/12.2/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_ani.c ============================================================================== --- releng/12.2/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_ani.c Sat Sep 12 18:58:36 2020 (r365669) +++ releng/12.2/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_ani.c Sat Sep 12 19:33:25 2020 (r365670) @@ -462,13 +462,55 @@ ar9300_ani_control(struct ath_hal *ah, HAL_ANI_CMD cmd u_int level = param; u_int is_on; + HALDEBUG(ah, HAL_DEBUG_ANI, "%s: cmd=%d, param=%d, chan=%p, funcmask=0x%08x\n", + __func__, + cmd, + param, + chan, + ahp->ah_ani_function); + + if (chan == NULL && cmd != HAL_ANI_MODE) { HALDEBUG(ah, HAL_DEBUG_UNMASKABLE, "%s: ignoring cmd 0x%02x - no channel\n", __func__, cmd); return AH_FALSE; } - switch (cmd & ahp->ah_ani_function) { + /* + * These two control the top-level cck/ofdm immunity levels and will + * program the rest of the values. + */ + if (cmd == HAL_ANI_NOISE_IMMUNITY_LEVEL) { + if (param > HAL_ANI_OFDM_NUM_LEVEL) + return AH_FALSE; + ar9300_ani_set_odfm_noise_immunity_level(ah, param); + return AH_TRUE; + } + + if (cmd == HAL_ANI_CCK_NOISE_IMMUNITY_LEVEL) { + if (param > HAL_ANI_CCK_NUM_LEVEL) + return AH_FALSE; + ar9300_ani_set_cck_noise_immunity_level(ah, param); + return AH_TRUE; + } + + /* + * Check to see if this command is available in the + * current operating mode. + */ + if (((1 << cmd) & ahp->ah_ani_function) == 0) { + HALDEBUG(ah, HAL_DEBUG_ANI, + "%s: early check: invalid cmd 0x%02x (allowed=0x%02x)\n", + __func__, cmd, ahp->ah_ani_function); + return AH_FALSE; + } + + /* + * The rest of these program in the requested parameter values + * into the PHY. + */ + switch (cmd) { + case HAL_ANI_OFDM_WEAK_SIGNAL_DETECTION: { int m1_thresh_low, m2_thresh_low; @@ -887,13 +929,16 @@ ar9300_ani_reset(struct ath_hal *ah, HAL_BOOL is_scann /* only allow a subset of functions in AP mode */ if (AH_PRIVATE(ah)->ah_opmode == HAL_M_HOSTAP) { if (IS_CHAN_2GHZ(ichan)) { - ahp->ah_ani_function = (HAL_ANI_SPUR_IMMUNITY_LEVEL | - HAL_ANI_FIRSTEP_LEVEL | - HAL_ANI_MRC_CCK); + ahp->ah_ani_function = (1 << HAL_ANI_SPUR_IMMUNITY_LEVEL) | + (1 << HAL_ANI_FIRSTEP_LEVEL) | + (1 << HAL_ANI_MRC_CCK); } else { ahp->ah_ani_function = 0; } + } else { + ahp->ah_ani_function = HAL_ANI_ALL; } + /* always allow mode (on/off) to be controlled */ ahp->ah_ani_function |= HAL_ANI_MODE; @@ -1172,6 +1217,7 @@ ar9300_ani_ar_poll(struct ath_hal *ah, const HAL_NODE_ cck_phy_err_cnt = OS_REG_READ(ah, AR_PHY_ERR_2); /* Populate HAL_ANISTATS */ + /* XXX TODO: are these correct? */ if (ani_stats) { ani_stats->cckphyerr_cnt = cck_phy_err_cnt - ani_state->cck_phy_err_count; @@ -1212,18 +1258,32 @@ ar9300_ani_ar_poll(struct ath_hal *ah, const HAL_NODE_ return; } + /* + * Calculate the OFDM/CCK phy error rate over the listen time interval. + * This is used in subsequent math to see if the OFDM/CCK phy error rate + * is above or below the threshold checks. + */ + ofdm_phy_err_rate = ani_state->ofdm_phy_err_count * 1000 / ani_state->listen_time; cck_phy_err_rate = ani_state->cck_phy_err_count * 1000 / ani_state->listen_time; HALDEBUG(ah, HAL_DEBUG_ANI, - "%s: listen_time=%d OFDM:%d errs=%d/s CCK:%d errs=%d/s ofdm_turn=%d\n", + "%s: listen_time=%d (total: %d) OFDM:%d errs=%d/s CCK:%d errs=%d/s ofdm_turn=%d\n", __func__, listen_time, + ani_state->listen_time, ani_state->ofdm_noise_immunity_level, ofdm_phy_err_rate, ani_state->cck_noise_immunity_level, cck_phy_err_rate, ani_state->ofdms_turn); + /* + * Check for temporary noise spurs. This is intended to be used by + * rate control to check if we should try higher packet rates or not. + * If the noise period is short enough then we shouldn't avoid trying + * higher rates but if the noise is high/sustained then it's likely + * not a great idea to try the higher MCS rates. + */ if (ani_state->listen_time >= HAL_NOISE_DETECT_PERIOD) { old_phy_noise_spur = ani_state->phy_noise_spur; if (ofdm_phy_err_rate <= ani_state->ofdm_trig_low && @@ -1236,7 +1296,7 @@ ar9300_ani_ar_poll(struct ath_hal *ah, const HAL_NODE_ } if (old_phy_noise_spur != ani_state->phy_noise_spur) { HALDEBUG(ah, HAL_DEBUG_ANI, - "%s: enviroment change from %d to %d\n", + "%s: environment change from %d to %d\n", __func__, old_phy_noise_spur, ani_state->phy_noise_spur); } } @@ -1259,6 +1319,10 @@ ar9300_ani_ar_poll(struct ath_hal *ah, const HAL_NODE_ ar9300_ani_lower_immunity(ah); ani_state->ofdms_turn = !ani_state->ofdms_turn; } + /* + * Force an ANI restart regardless of whether the lower immunity + * level was met. + */ HALDEBUG(ah, HAL_DEBUG_ANI, "%s: 1 listen_time=%d ofdm=%d/s cck=%d/s - " "calling ar9300_ani_restart\n", @@ -1292,6 +1356,13 @@ ar9300_ani_ar_poll(struct ath_hal *ah, const HAL_NODE_ ani_state->ofdms_turn = AH_TRUE; } } + + /* + * Note that currently this poll function doesn't reset the listen + * time after it accumulates a second worth of error samples. + * It will continue to accumulate samples until a counter overflows, + * or a raise threshold is met, or 5 seconds passes. + */ } /* Modified: releng/12.2/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_eeprom.c ============================================================================== --- releng/12.2/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_eeprom.c Sat Sep 12 18:58:36 2020 (r365669) +++ releng/12.2/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_eeprom.c Sat Sep 12 19:33:25 2020 (r365670) @@ -3040,6 +3040,33 @@ ar9300_eeprom_set_transmit_power(struct ath_hal *ah, ahp->reg_dmn = ath_hal_getctl(ah, chan); /* + * After reading FCC/OET 13TR1003 (Directional Gain of IEEE 802.11 + * MIMO devices employing cyclic delay diversity) and looking at what + * ath9k does, let's disable the CDD check until it's clearer exactly + * how the maximum cap should be applied here. + * + * Right now the CDD check is simply unconditionally reducing the + * gain of legacy and 1/2 stream rates depending upon the chainmask. + * (CDD is used when transmitting rates that don't already use up the + * full set of streams - eg OFDM or MCS0-7 on a 2 or 3 chain TX path.) + * + * It's dropping the 2-chain TX by 3dB and 3-chain by 5dB to "meet" + * power spectral density requirements but it's not currently taking + * into account how close to the regulatory limit the hardware/antenna + * system is already at. It doesn't help that the conductive testing + * limits have the array gain at 0dB for all AR9300/derivative + * configurations. + * + * It also doesn't let us do single chain transmit at the full allowed + * power for the regulatory/CTL limits as it subtracts it from what's + * programmed into the hardware. + * + * ath9k doesn't factor any of the CDD stuff into account, so I'm going + * to disable it here and in the TPC path until I get a better idea + * of what to really do here. + */ +#if 0 + /* * Always use CDD/direct per rate power table for register based approach. * For FCC, CDD calculations should factor in the array gain, hence * this adjust call. ETSI and MKK does not have this requirement. @@ -3050,6 +3077,7 @@ ar9300_eeprom_set_transmit_power(struct ath_hal *ah, __func__); ar9300_adjust_reg_txpower_cdd(ah, target_power_val_t2); } +#endif if (ar9300_eeprom_get(ahp, EEP_PAPRD_ENABLED)) { for (i = 0; i < ar9300_rate_size; i++) { Modified: releng/12.2/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.c ============================================================================== --- releng/12.2/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.c Sat Sep 12 18:58:36 2020 (r365669) +++ releng/12.2/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.c Sat Sep 12 19:33:25 2020 (r365670) @@ -355,7 +355,7 @@ ar9300_attach_freebsd_ops(struct ath_hal *ah) ah->ah_setRxDP = ar9300_set_rx_dp; ah->ah_enableReceive = ar9300_enable_receive; ah->ah_stopDmaReceive = ar9300_stop_dma_receive_freebsd; - ah->ah_startPcuReceive = ar9300_start_pcu_receive_freebsd; + ah->ah_startPcuReceive = ar9300_start_pcu_receive; ah->ah_stopPcuReceive = ar9300_stop_pcu_receive; ah->ah_setMulticastFilter = ar9300_set_multicast_filter; ah->ah_setMulticastFilterIndex = ar9300SetMulticastFilterIndex; @@ -543,6 +543,7 @@ ar9300_reset_freebsd(struct ath_hal *ah, HAL_OPMODE op HAL_HT_EXTPROTSPACING_20, /* always 20Mhz channel spacing */ bChannelChange, status, + resetType, AH_FALSE); /* XXX should really extend ath_hal_reset() */ return (r); @@ -678,14 +679,6 @@ ar9300_reset_cal_valid_freebsd(struct ath_hal *ah, return (is_cal_done); } - -void -ar9300_start_pcu_receive_freebsd(struct ath_hal *ah) -{ - - /* is_scanning flag == NULL */ - ar9300_start_pcu_receive(ah, AH_FALSE); -} /* * FreeBSD will just pass in the descriptor value as 'pa'. Modified: releng/12.2/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_misc.c ============================================================================== --- releng/12.2/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_misc.c Sat Sep 12 18:58:36 2020 (r365669) +++ releng/12.2/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_misc.c Sat Sep 12 19:33:25 2020 (r365670) @@ -1263,15 +1263,13 @@ ar9300_get_diag_state(struct ath_hal *ah, int request, if (ani == AH_NULL) return AH_FALSE; /* Convert ar9300 HAL to FreeBSD HAL ANI state */ - /* XXX TODO: add all of these to the HAL ANI state structure */ bzero(&ahp->ext_ani_state, sizeof(ahp->ext_ani_state)); - /* XXX should this be OFDM or CCK noise immunity level? */ ahp->ext_ani_state.noiseImmunityLevel = ani->ofdm_noise_immunity_level; ahp->ext_ani_state.spurImmunityLevel = ani->spur_immunity_level; ahp->ext_ani_state.firstepLevel = ani->firstep_level; ahp->ext_ani_state.ofdmWeakSigDetectOff = ani->ofdm_weak_sig_detect_off; - /* mrc_cck_off */ - /* cck_noise_immunity_level */ + ahp->ext_ani_state.mrcCck = !! ani->mrc_cck_off; + ahp->ext_ani_state.cckNoiseImmunityLevel = ani->cck_noise_immunity_level; ahp->ext_ani_state.listenTime = ani->listen_time; @@ -1289,12 +1287,18 @@ ar9300_get_diag_state(struct ath_hal *ah, int request, 0 : sizeof(HAL_ANI_STATS); return AH_TRUE; case HAL_DIAG_ANI_CMD: + { + HAL_ANI_CMD savefunc = ahp->ah_ani_function; if (argsize != 2*sizeof(u_int32_t)) { return AH_FALSE; } + /* temporarly allow all functions so we can override */ + ahp->ah_ani_function = HAL_ANI_ALL; ar9300_ani_control( ah, ((const u_int32_t *)args)[0], ((const u_int32_t *)args)[1]); + ahp->ah_ani_function = savefunc; return AH_TRUE; + } #if 0 case HAL_DIAG_TXCONT: /*AR9300_CONTTXMODE(ah, (struct ath_desc *)args, argsize );*/ Modified: releng/12.2/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_phy.c ============================================================================== --- releng/12.2/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_phy.c Sat Sep 12 18:58:36 2020 (r365669) +++ releng/12.2/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_phy.c Sat Sep 12 19:33:25 2020 (r365670) @@ -55,10 +55,12 @@ static inline void ar9300_init_rate_txpower_stbc(struc const HAL_RATE_TABLE *rt, HAL_BOOL is40, int rt_ss_offset, int rt_ds_offset, int rt_ts_offset, u_int8_t chainmask); +#if 0 static inline void ar9300_adjust_rate_txpower_cdd(struct ath_hal *ah, const HAL_RATE_TABLE *rt, HAL_BOOL is40, int rt_ss_offset, int rt_ds_offset, int rt_ts_offset, u_int8_t chainmask); +#endif #define AR9300_11A_RT_OFDM_OFFSET 0 HAL_RATE_TABLE ar9300_11a_table = { @@ -442,6 +444,8 @@ ar9300_adjust_reg_txpower_cdd(struct ath_hal *ah, ((int16_t)AH_MIN((ahp->twice_antenna_reduction - (ahp->twice_antenna_gain + AR9300_TXBF_2TX_ARRAY_GAIN)), 0)); cdd_power = ahp->upper_limit[1] + twice_array_gain; + + HALDEBUG(ah, HAL_DEBUG_CALIBRATE, "%s: 2 chain; cdd_power=%d", __func__, cdd_power); /* Adjust OFDM legacy rates as well */ for (i = ALL_TARGET_LEGACY_6_24; i <= ALL_TARGET_LEGACY_54; i++) { if (power_per_rate[i] > cdd_power) { @@ -471,6 +475,7 @@ ar9300_adjust_reg_txpower_cdd(struct ath_hal *ah, ((int16_t)AH_MIN((ahp->twice_antenna_reduction - (ahp->twice_antenna_gain + AR9300_TXBF_3TX_ARRAY_GAIN)), 0)); cdd_power = ahp->upper_limit[2] + twice_array_gain; + HALDEBUG(ah, HAL_DEBUG_CALIBRATE, "%s: 3 chain; cdd_power=%d", __func__, cdd_power); /* Adjust OFDM legacy rates as well */ for (i = ALL_TARGET_LEGACY_6_24; i <= ALL_TARGET_LEGACY_54; i++) { if (power_per_rate[i] > cdd_power) { @@ -531,6 +536,7 @@ ar9300_init_rate_txpower(struct ath_hal *ah, u_int mod AR9300_11NA_RT_HT_SS_OFFSET, AR9300_11NA_RT_HT_DS_OFFSET, AR9300_11NA_RT_HT_TS_OFFSET, chainmask); +#if 0 /* For FCC the array gain has to be factored for CDD mode */ if (is_reg_dmn_fcc(ath_hal_getctl(ah, chan))) { ar9300_adjust_rate_txpower_cdd(ah, rt, is40, @@ -538,6 +544,7 @@ ar9300_init_rate_txpower(struct ath_hal *ah, u_int mod AR9300_11NA_RT_HT_DS_OFFSET, AR9300_11NA_RT_HT_TS_OFFSET, chainmask); } +#endif break; case HAL_MODE_11G: ar9300_init_rate_txpower_cck(ah, rt, power_per_rate, chainmask); @@ -561,6 +568,7 @@ ar9300_init_rate_txpower(struct ath_hal *ah, u_int mod AR9300_11NG_RT_HT_SS_OFFSET, AR9300_11NG_RT_HT_DS_OFFSET, AR9300_11NG_RT_HT_TS_OFFSET, chainmask); +#if 0 /* For FCC the array gain needs to be factored for CDD mode */ if (is_reg_dmn_fcc(ath_hal_getctl(ah, chan))) { ar9300_adjust_rate_txpower_cdd(ah, rt, is40, @@ -568,6 +576,7 @@ ar9300_init_rate_txpower(struct ath_hal *ah, u_int mod AR9300_11NG_RT_HT_DS_OFFSET, AR9300_11NG_RT_HT_TS_OFFSET, chainmask); } +#endif break; default: HALDEBUG(ah, HAL_DEBUG_POWER_MGMT, "%s: invalid mode 0x%x\n", @@ -941,6 +950,10 @@ ar9300_init_rate_txpower_stbc(struct ath_hal *ah, cons return; } +/* + * To see why this is disabled, look at ar9300_eeprom.c for FCC/OET 13TR1003. + */ +#if 0 static inline void ar9300_adjust_rate_txpower_cdd(struct ath_hal *ah, const HAL_RATE_TABLE *rt, HAL_BOOL is40, @@ -1037,6 +1050,7 @@ ar9300_adjust_rate_txpower_cdd(struct ath_hal *ah, con return; } +#endif void ar9300_disp_tpc_tables(struct ath_hal *ah) { Modified: releng/12.2/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_reset.c ============================================================================== --- releng/12.2/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_reset.c Sat Sep 12 18:58:36 2020 (r365669) +++ releng/12.2/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_reset.c Sat Sep 12 19:33:25 2020 (r365670) @@ -2064,7 +2064,7 @@ ar9300_set_rf_mode(struct ath_hal *ah, struct ieee8021 * Places the hardware into reset and then pulls it out of reset */ HAL_BOOL -ar9300_chip_reset(struct ath_hal *ah, struct ieee80211_channel *chan) +ar9300_chip_reset(struct ath_hal *ah, struct ieee80211_channel *chan, HAL_RESET_TYPE reset_type) { struct ath_hal_9300 *ahp = AH9300(ah); int type = HAL_RESET_WARM; @@ -2080,8 +2080,13 @@ ar9300_chip_reset(struct ath_hal *ah, struct ieee80211 */ if (ahp->ah_chip_full_sleep || (ah->ah_config.ah_force_full_reset == 1) || + (reset_type == HAL_RESET_FORCE_COLD) || + (reset_type == HAL_RESET_BBPANIC) || OS_REG_READ(ah, AR_Q_TXE) || (OS_REG_READ(ah, AR_CR) & AR_CR_RXE)) { + HALDEBUG(ah, HAL_DEBUG_RESET, + "%s: full reset; reset_type=%d, full_sleep=%d\n", + __func__, reset_type, ahp->ah_chip_full_sleep); type = HAL_RESET_COLD; } @@ -4510,7 +4515,7 @@ HAL_BOOL ar9300_reset(struct ath_hal *ah, HAL_OPMODE opmode, struct ieee80211_channel *chan, HAL_HT_MACMODE macmode, u_int8_t txchainmask, u_int8_t rxchainmask, HAL_HT_EXTPROTSPACING extprotspacing, HAL_BOOL b_channel_change, - HAL_STATUS *status, int is_scan) + HAL_STATUS *status, HAL_RESET_TYPE reset_type, int is_scan) { #define FAIL(_code) do { ecode = _code; goto bad; } while (0) u_int32_t save_led_state; @@ -4864,7 +4869,7 @@ ar9300_reset(struct ath_hal *ah, HAL_OPMODE opmode, st /* Mark PHY inactive prior to reset, to be undone in ar9300_init_bb () */ ar9300_mark_phy_inactive(ah); - if (!ar9300_chip_reset(ah, chan)) { + if (!ar9300_chip_reset(ah, chan, reset_type)) { HALDEBUG(ah, HAL_DEBUG_RESET, "%s: chip reset failed\n", __func__); FAIL(HAL_EIO); } Modified: releng/12.2/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_stub_funcs.c ============================================================================== --- releng/12.2/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_stub_funcs.c Sat Sep 12 18:58:36 2020 (r365669) +++ releng/12.2/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_stub_funcs.c Sat Sep 12 19:33:25 2020 (r365670) @@ -691,7 +691,7 @@ ar9300_Stub_StopDmaReceive(struct ath_hal *ah) } void -ar9300_Stub_StartPcuReceive(struct ath_hal *ah) +ar9300_Stub_StartPcuReceive(struct ath_hal *ah, HAL_BOOL is_scanning) { ath_hal_printf(ah, "%s: called\n", __func__); Modified: releng/12.2/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_stub_funcs.h ============================================================================== --- releng/12.2/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_stub_funcs.h Sat Sep 12 18:58:36 2020 (r365669) +++ releng/12.2/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_stub_funcs.h Sat Sep 12 19:33:25 2020 (r365670) @@ -112,7 +112,7 @@ extern void ar9300_Stub_SetRxDP(struct ath_hal *ah, ui HAL_RX_QUEUE); extern void ar9300_Stub_EnableReceive(struct ath_hal *ah); extern HAL_BOOL ar9300_Stub_StopDmaReceive(struct ath_hal *ah); -extern void ar9300_Stub_StartPcuReceive(struct ath_hal *ah); +extern void ar9300_Stub_StartPcuReceive(struct ath_hal *ah, HAL_BOOL); extern void ar9300_Stub_StopPcuReceive(struct ath_hal *ah); extern void ar9300_Stub_SetMulticastFilter(struct ath_hal *ah, uint32_t filter0, uint32_t filter1); Modified: releng/12.2/sys/contrib/dev/ath/ath_hal/ar9300/ar9300eep.h ============================================================================== --- releng/12.2/sys/contrib/dev/ath/ath_hal/ar9300/ar9300eep.h Sat Sep 12 18:58:36 2020 (r365669) +++ releng/12.2/sys/contrib/dev/ath/ath_hal/ar9300/ar9300eep.h Sat Sep 12 19:33:25 2020 (r365670) @@ -18,13 +18,17 @@ #define _ATH_AR9300_EEP_H_ #include "opt_ah.h" - #include "ah.h" #if defined(WIN32) || defined(WIN64) #pragma pack (push, ar9300, 1) #endif +/* Ensure that AH_BYTE_ORDER is defined */ +#ifndef AH_BYTE_ORDER +#error AH_BYTE_ORDER needs to be defined! +#endif + /* FreeBSD extras - should be in ah_eeprom.h ? */ #define AR_EEPROM_EEPCAP_COMPRESS_DIS 0x0001 #define AR_EEPROM_EEPCAP_AES_DIS 0x0002 @@ -345,11 +349,13 @@ typedef struct CalCtlEdgePwr { u_int8_t flag :2, t_power :6; } __packed CAL_CTL_EDGE_PWR; -#else +#elif AH_BYTE_ORDER == AH_LITTLE_ENDIAN typedef struct CalCtlEdgePwr { u_int8_t t_power :6, flag :2; } __packed CAL_CTL_EDGE_PWR; +#else +#error AH_BYTE_ORDER undefined! #endif typedef struct ospCalCtlData_5G { Modified: releng/12.2/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_ap121.h ============================================================================== --- releng/12.2/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_ap121.h Sat Sep 12 18:58:36 2020 (r365669) +++ releng/12.2/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_ap121.h Sat Sep 12 19:33:25 2020 (r365670) @@ -25,6 +25,11 @@ #ifndef __ar9300templateAP121_h__ #define __ar9300templateAP121_h__ +/* Ensure that AH_BYTE_ORDER is defined */ +#ifndef AH_BYTE_ORDER +#error AH_BYTE_ORDER needs to be defined! +#endif + static ar9300_eeprom_t ar9300_template_ap121= { Modified: releng/12.2/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_aphrodite.h ============================================================================== --- releng/12.2/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_aphrodite.h Sat Sep 12 18:58:36 2020 (r365669) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sat Sep 12 19:40:06 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 24B633E16AB; Sat, 12 Sep 2020 19:40:06 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BpjdL0F2Pz4Rfj; Sat, 12 Sep 2020 19:40:06 +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 DCACE1A1B4; Sat, 12 Sep 2020 19:40:05 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08CJe5gU088359; Sat, 12 Sep 2020 19:40:05 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08CJe5ZA088356; Sat, 12 Sep 2020 19:40:05 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202009121940.08CJe5ZA088356@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 12 Sep 2020 19:40:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365671 - in stable: 11 11/share/man/man5 11/share/mk 12 12/share/man/man5 12/share/mk X-SVN-Group: stable-12 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in stable: 11 11/share/man/man5 11/share/mk 12 12/share/man/man5 12/share/mk X-SVN-Commit-Revision: 365671 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.33 Precedence: list List-Id: "SVN commit messages 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, 12 Sep 2020 19:40:06 -0000 Author: dim Date: Sat Sep 12 19:40:04 2020 New Revision: 365671 URL: https://svnweb.freebsd.org/changeset/base/365671 Log: Follow-up r365662 (MFC of r365371 and r365373) by correctly setting WITH_MALLOC_PRODUCTION for stable branches. Also add a note to UPDATING, to inform users about the new setting. Direct commit to stable/{11,12} as this does not apply to head. Noticed by: imp, Ronald Klop Modified: stable/12/UPDATING stable/12/share/man/man5/src.conf.5 stable/12/share/mk/src.opts.mk Changes in other areas also in this revision: Modified: stable/11/UPDATING stable/11/share/man/man5/src.conf.5 stable/11/share/mk/src.opts.mk Modified: stable/12/UPDATING ============================================================================== --- stable/12/UPDATING Sat Sep 12 19:33:25 2020 (r365670) +++ stable/12/UPDATING Sat Sep 12 19:40:04 2020 (r365671) @@ -16,6 +16,18 @@ 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. +20200912: + The make.conf(5) MALLOC_PRODUCTION variable, used for disabling and + enabling assertions and statistics gathering in malloc(3), has been + migrated to a src.conf(5) WITH/WITHOUT_MALLOC_PRODUCTION option. + + On stable branches, WITH_MALLOC_PRODUCTION is set by default, which + means that malloc(3) has assertions and statistics gathering disabled, + for improved performance. + + For backwards compatibility, the make.conf(5) MALLOC_PRODUCTION is still + honored, but it is now deprecated and undocumented. + 20200909: The resume code now notifies devd with the 'kernel' system rather than the old 'kern' subsystem to be consistent with Modified: stable/12/share/man/man5/src.conf.5 ============================================================================== --- stable/12/share/man/man5/src.conf.5 Sat Sep 12 19:33:25 2020 (r365670) +++ stable/12/share/man/man5/src.conf.5 Sat Sep 12 19:40:04 2020 (r365671) @@ -1357,10 +1357,10 @@ if executed as an unprivileged user. See .Xr tests 7 for more details. -.It Va WITH_MALLOC_PRODUCTION -Set to disable assertions and statistics gathering in +.It Va WITHOUT_MALLOC_PRODUCTION +Set to enable assertions and statistics gathering in .Xr malloc 3 . -It also defaults the A and J runtime options to off. +It also defaults the A and J runtime options to on. .It Va WITHOUT_MAN Set to not build manual pages. When set, these options are also in effect: Modified: stable/12/share/mk/src.opts.mk ============================================================================== --- stable/12/share/mk/src.opts.mk Sat Sep 12 19:33:25 2020 (r365670) +++ stable/12/share/mk/src.opts.mk Sat Sep 12 19:40:04 2020 (r365671) @@ -143,6 +143,7 @@ __DEFAULT_YES_OPTIONS = \ MAIL \ MAILWRAPPER \ MAKE \ + MALLOC_PRODUCTION \ NDIS \ NETCAT \ NETGRAPH \ @@ -208,7 +209,6 @@ __DEFAULT_NO_OPTIONS = \ LOADER_FIREWIRE \ LOADER_FORCE_LE \ LOADER_VERIEXEC_PASS_MANIFEST \ - MALLOC_PRODUCTION \ NAND \ OFED_EXTRA \ OPENLDAP \ From owner-svn-src-all@freebsd.org Sat Sep 12 19:40:06 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B2FFE3E16B2; Sat, 12 Sep 2020 19:40:06 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BpjdL4N6Qz4Rcx; Sat, 12 Sep 2020 19:40:06 +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 7AD9119E52; Sat, 12 Sep 2020 19:40:06 +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 08CJe6ad088367; Sat, 12 Sep 2020 19:40:06 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08CJe5GP088364; Sat, 12 Sep 2020 19:40:05 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202009121940.08CJe5GP088364@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 12 Sep 2020 19:40: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: r365671 - in stable: 11 11/share/man/man5 11/share/mk 12 12/share/man/man5 12/share/mk X-SVN-Group: stable-11 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in stable: 11 11/share/man/man5 11/share/mk 12 12/share/man/man5 12/share/mk X-SVN-Commit-Revision: 365671 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.33 Precedence: list List-Id: "SVN commit messages 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, 12 Sep 2020 19:40:06 -0000 Author: dim Date: Sat Sep 12 19:40:04 2020 New Revision: 365671 URL: https://svnweb.freebsd.org/changeset/base/365671 Log: Follow-up r365662 (MFC of r365371 and r365373) by correctly setting WITH_MALLOC_PRODUCTION for stable branches. Also add a note to UPDATING, to inform users about the new setting. Direct commit to stable/{11,12} as this does not apply to head. Noticed by: imp, Ronald Klop Modified: stable/11/UPDATING stable/11/share/man/man5/src.conf.5 stable/11/share/mk/src.opts.mk Changes in other areas also in this revision: Modified: stable/12/UPDATING stable/12/share/man/man5/src.conf.5 stable/12/share/mk/src.opts.mk Modified: stable/11/UPDATING ============================================================================== --- stable/11/UPDATING Sat Sep 12 19:33:25 2020 (r365670) +++ stable/11/UPDATING Sat Sep 12 19:40:04 2020 (r365671) @@ -16,6 +16,18 @@ 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. +20200912: + The make.conf(5) MALLOC_PRODUCTION variable, used for disabling and + enabling assertions and statistics gathering in malloc(3), has been + migrated to a src.conf(5) WITH/WITHOUT_MALLOC_PRODUCTION option. + + On stable branches, WITH_MALLOC_PRODUCTION is set by default, which + means that malloc(3) has assertions and statistics gathering disabled, + for improved performance. + + For backwards compatibility, the make.conf(5) MALLOC_PRODUCTION is still + honored, but it is now deprecated and undocumented. + 20200723: Clang, llvm, lld, lldb, compiler-rt, libc++, libunwind and openmp have been upgraded to 10.0.1. Please see the 20141231 entry below for Modified: stable/11/share/man/man5/src.conf.5 ============================================================================== --- stable/11/share/man/man5/src.conf.5 Sat Sep 12 19:33:25 2020 (r365670) +++ stable/11/share/man/man5/src.conf.5 Sat Sep 12 19:40:04 2020 (r365671) @@ -1183,10 +1183,10 @@ MTA selector. Set to not install .Xr make 1 and related support files. -.It Va WITH_MALLOC_PRODUCTION -Set to disable assertions and statistics gathering in +.It Va WITHOUT_MALLOC_PRODUCTION +Set to enable assertions and statistics gathering in .Xr malloc 3 . -It also defaults the A and J runtime options to off. +It also defaults the A and J runtime options to on. .It Va WITHOUT_MAN Set to not build manual pages. When set, these options are also in effect: Modified: stable/11/share/mk/src.opts.mk ============================================================================== --- stable/11/share/mk/src.opts.mk Sat Sep 12 19:33:25 2020 (r365670) +++ stable/11/share/mk/src.opts.mk Sat Sep 12 19:40:04 2020 (r365671) @@ -139,6 +139,7 @@ __DEFAULT_YES_OPTIONS = \ MAIL \ MAILWRAPPER \ MAKE \ + MALLOC_PRODUCTION \ MANDOCDB \ NDIS \ NETCAT \ @@ -203,7 +204,6 @@ __DEFAULT_NO_OPTIONS = \ LOADER_FORCE_LE \ LOADER_VERBOSE \ NAND \ - MALLOC_PRODUCTION \ OFED_EXTRA \ OPENLDAP \ REPRODUCIBLE_BUILD \ From owner-svn-src-all@freebsd.org Sat Sep 12 20:20:56 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7420E3E1E3B; Sat, 12 Sep 2020 20:20: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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BpkXS2W7Tz4T7p; Sat, 12 Sep 2020 20:20: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 396391A9C4; Sat, 12 Sep 2020 20:20: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 08CKKuwg013709; Sat, 12 Sep 2020 20:20:56 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08CKKuRg013693; Sat, 12 Sep 2020 20:20:56 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202009122020.08CKKuRg013693@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 12 Sep 2020 20:20:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r365672 - in stable: 11/contrib/jemalloc/include/jemalloc 12/contrib/jemalloc/include/jemalloc X-SVN-Group: stable-12 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in stable: 11/contrib/jemalloc/include/jemalloc 12/contrib/jemalloc/include/jemalloc X-SVN-Commit-Revision: 365672 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.33 Precedence: list List-Id: "SVN commit messages 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, 12 Sep 2020 20:20:56 -0000 Author: dim Date: Sat Sep 12 20:20:55 2020 New Revision: 365672 URL: https://svnweb.freebsd.org/changeset/base/365672 Log: Follow-up r365662 (MFC of r365371 and r365373) by also removing the header hack from jemalloc_FreeBSD.h, which rendered any make.conf MALLOC_PRODUCTION or src.conf WITH/WITHOUT_MALLOC_PRODUCTION irrelevant. Direct commit to stable/{11,12} as this does not apply to head. Noticed by: kevans Modified: stable/12/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h Changes in other areas also in this revision: Modified: stable/11/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h Modified: stable/12/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h ============================================================================== --- stable/12/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h Sat Sep 12 19:40:04 2020 (r365671) +++ stable/12/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h Sat Sep 12 20:20:55 2020 (r365672) @@ -5,7 +5,7 @@ #undef JEMALLOC_OVERRIDE_VALLOC #ifndef MALLOC_PRODUCTION -#define MALLOC_PRODUCTION +#define JEMALLOC_DEBUG #endif #undef JEMALLOC_DSS From owner-svn-src-all@freebsd.org Sat Sep 12 20:20:56 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C15283E1CC0; Sat, 12 Sep 2020 20:20: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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BpkXS4m89z4TDP; Sat, 12 Sep 2020 20:20: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 86CD71A9C5; Sat, 12 Sep 2020 20:20: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 08CKKutO014223; Sat, 12 Sep 2020 20:20:56 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08CKKumn014222; Sat, 12 Sep 2020 20:20:56 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202009122020.08CKKumn014222@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 12 Sep 2020 20:20: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: r365672 - in stable: 11/contrib/jemalloc/include/jemalloc 12/contrib/jemalloc/include/jemalloc X-SVN-Group: stable-11 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in stable: 11/contrib/jemalloc/include/jemalloc 12/contrib/jemalloc/include/jemalloc X-SVN-Commit-Revision: 365672 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.33 Precedence: list List-Id: "SVN commit messages 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, 12 Sep 2020 20:20:56 -0000 Author: dim Date: Sat Sep 12 20:20:55 2020 New Revision: 365672 URL: https://svnweb.freebsd.org/changeset/base/365672 Log: Follow-up r365662 (MFC of r365371 and r365373) by also removing the header hack from jemalloc_FreeBSD.h, which rendered any make.conf MALLOC_PRODUCTION or src.conf WITH/WITHOUT_MALLOC_PRODUCTION irrelevant. Direct commit to stable/{11,12} as this does not apply to head. Noticed by: kevans Modified: stable/11/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h Changes in other areas also in this revision: Modified: stable/12/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h Modified: stable/11/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h ============================================================================== --- stable/11/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h Sat Sep 12 19:40:04 2020 (r365671) +++ stable/11/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h Sat Sep 12 20:20:55 2020 (r365672) @@ -5,9 +5,6 @@ #undef JEMALLOC_OVERRIDE_VALLOC #ifndef MALLOC_PRODUCTION -#define MALLOC_PRODUCTION -#endif -#ifndef MALLOC_PRODUCTION #define JEMALLOC_DEBUG #endif From owner-svn-src-all@freebsd.org Sat Sep 12 21:50:27 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A82733E35D7; Sat, 12 Sep 2020 21:50:27 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BpmWl4HyJz4Xyf; Sat, 12 Sep 2020 21:50:27 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 769381B8E8; Sat, 12 Sep 2020 21:50:27 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08CLoR2A069561; Sat, 12 Sep 2020 21:50:27 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08CLoPNf069552; Sat, 12 Sep 2020 21:50:25 GMT (envelope-from bz@FreeBSD.org) Message-Id: <202009122150.08CLoPNf069552@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Sat, 12 Sep 2020 21:50:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r365673 - in releng/12.2: sbin/rtsol usr.sbin/rtsold X-SVN-Group: releng X-SVN-Commit-Author: bz X-SVN-Commit-Paths: in releng/12.2: sbin/rtsol usr.sbin/rtsold X-SVN-Commit-Revision: 365673 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.33 Precedence: list List-Id: "SVN commit messages 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, 12 Sep 2020 21:50:27 -0000 Author: bz Date: Sat Sep 12 21:50:25 2020 New Revision: 365673 URL: https://svnweb.freebsd.org/changeset/base/365673 Log: MFS r365630 (markj, bz) - Capsicumize rtsol(8) and rtsold(8). - Avoid relying on pollution from libcasper.h. - Add script for "M bit". Approved by: re (gjb) Added: releng/12.2/usr.sbin/rtsold/cap_llflags.c - copied unchanged from r365630, stable/12/usr.sbin/rtsold/cap_llflags.c releng/12.2/usr.sbin/rtsold/cap_script.c - copied unchanged from r365630, stable/12/usr.sbin/rtsold/cap_script.c releng/12.2/usr.sbin/rtsold/cap_sendmsg.c - copied unchanged from r365630, stable/12/usr.sbin/rtsold/cap_sendmsg.c Deleted: releng/12.2/usr.sbin/rtsold/probe.c Modified: releng/12.2/sbin/rtsol/Makefile releng/12.2/usr.sbin/rtsold/Makefile releng/12.2/usr.sbin/rtsold/dump.c releng/12.2/usr.sbin/rtsold/if.c releng/12.2/usr.sbin/rtsold/rtsock.c releng/12.2/usr.sbin/rtsold/rtsol.c releng/12.2/usr.sbin/rtsold/rtsold.8 releng/12.2/usr.sbin/rtsold/rtsold.c releng/12.2/usr.sbin/rtsold/rtsold.h Directory Properties: releng/12.2/ (props changed) Modified: releng/12.2/sbin/rtsol/Makefile ============================================================================== --- releng/12.2/sbin/rtsol/Makefile Sat Sep 12 20:20:55 2020 (r365672) +++ releng/12.2/sbin/rtsol/Makefile Sat Sep 12 21:50:25 2020 (r365673) @@ -18,10 +18,24 @@ PACKAGE=runtime PROG= rtsol -SRCS= rtsold.c rtsol.c if.c probe.c dump.c rtsock.c +SRCS= cap_llflags.c \ + cap_script.c \ + cap_sendmsg.c \ + dump.c \ + if.c \ + rtsol.c \ + rtsold.c \ + rtsock.c MAN= +LIBADD= util -WARNS?= 3 -CFLAGS+= -DSMALL +.include + +.if ${MK_DYNAMICROOT} == "no" +.warning ${PROG} built without libcasper support +.elif ${MK_CASPER} != "no" && !defined(RESCUE) +CFLAGS+= -DWITH_CASPER +LIBADD+= cap_syslog casper nv +.endif .include Modified: releng/12.2/usr.sbin/rtsold/Makefile ============================================================================== --- releng/12.2/usr.sbin/rtsold/Makefile Sat Sep 12 20:20:55 2020 (r365672) +++ releng/12.2/usr.sbin/rtsold/Makefile Sat Sep 12 21:50:25 2020 (r365673) @@ -17,8 +17,22 @@ PROG= rtsold MAN= rtsold.8 MLINKS= rtsold.8 rtsol.8 -SRCS= rtsold.c rtsol.c if.c probe.c dump.c rtsock.c +SRCS= cap_llflags.c \ + cap_script.c \ + cap_sendmsg.c \ + dump.c \ + if.c \ + rtsock.c \ + rtsol.c \ + rtsold.c -WARNS?= 3 +LIBADD= util + +.include + +.if ${MK_CASPER} != "no" +CFLAGS+= -DWITH_CASPER +LIBADD+= casper cap_syslog nv +.endif .include Copied: releng/12.2/usr.sbin/rtsold/cap_llflags.c (from r365630, stable/12/usr.sbin/rtsold/cap_llflags.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ releng/12.2/usr.sbin/rtsold/cap_llflags.c Sat Sep 12 21:50:25 2020 (r365673, copy of r365630, stable/12/usr.sbin/rtsold/cap_llflags.c) @@ -0,0 +1,158 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2018 The FreeBSD Foundation + * + * This software was developed by Mark Johnston 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 AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include +#include + +#include +#include + +#include "rtsold.h" + +/* + * A service to fetch the flags for the link-local IPv6 address on the specified + * interface. This cannot easily be done in capability mode because we need to + * use the routing socket sysctl API to find the link-local address of a + * particular interface. The SIOCGIFCONF ioctl is one other option, but as + * currently implemented it is less flexible (it cannot report the required + * buffer length), and hard-codes a buffer length limit. + */ + +static int +llflags_get(const char *ifname, int *flagsp) +{ + struct in6_ifreq ifr6; + struct ifaddrs *ifap, *ifa; + struct sockaddr_in6 *sin6; + int error, s; + + s = socket(PF_INET6, SOCK_DGRAM, 0); + if (s < 0) + return (-1); + + if (getifaddrs(&ifap) != 0) + return (-1); + error = -1; + for (ifa = ifap; ifa != NULL; ifa = ifa->ifa_next) { + if (strcmp(ifa->ifa_name, ifname) != 0) + continue; + if (ifa->ifa_addr->sa_family != AF_INET6) + continue; + + sin6 = (struct sockaddr_in6 *)(void *)ifa->ifa_addr; + if (!IN6_IS_ADDR_LINKLOCAL(&sin6->sin6_addr)) + continue; + + memset(&ifr6, 0, sizeof(ifr6)); + if (strlcpy(ifr6.ifr_name, ifname, sizeof(ifr6.ifr_name)) >= + sizeof(ifr6.ifr_name)) { + freeifaddrs(ifap); + errno = EINVAL; + return (-1); + } + memcpy(&ifr6.ifr_ifru.ifru_addr, sin6, sin6->sin6_len); + if (ioctl(s, SIOCGIFAFLAG_IN6, &ifr6) < 0) { + error = errno; + freeifaddrs(ifap); + errno = error; + return (-1); + } + + *flagsp = ifr6.ifr_ifru.ifru_flags6; + error = 0; + break; + } + (void)close(s); + freeifaddrs(ifap); + if (error == -1) + errno = ENOENT; + return (error); +} + +int +cap_llflags_get(cap_channel_t *cap, const char *ifname, int *flagsp) +{ +#ifdef WITH_CASPER + nvlist_t *nvl; + int error; + + nvl = nvlist_create(0); + nvlist_add_string(nvl, "cmd", "get"); + nvlist_add_string(nvl, "ifname", ifname); + nvl = cap_xfer_nvlist(cap, nvl); + if (nvl == NULL) + return (-1); + error = (int)dnvlist_get_number(nvl, "error", 0); + if (error == 0) + *flagsp = (int)nvlist_get_number(nvl, "flags"); + nvlist_destroy(nvl); + if (error != 0) + errno = error; + return (error == 0 ? 0 : -1); +#else + (void)cap; + return (llflags_get(ifname, flagsp)); +#endif +} + +#ifdef WITH_CASPER +static int +llflags_command(const char *cmd, const nvlist_t *limits __unused, + nvlist_t *nvlin, nvlist_t *nvlout) +{ + const char *ifname; + int flags; + + if (strcmp(cmd, "get") != 0) + return (EINVAL); + ifname = nvlist_get_string(nvlin, "ifname"); + if (llflags_get(ifname, &flags) != 0) + return (errno); + nvlist_add_number(nvlout, "flags", flags); + return (0); +} + +CREATE_SERVICE("rtsold.llflags", NULL, llflags_command, 0); +#endif /* WITH_CASPER */ Copied: releng/12.2/usr.sbin/rtsold/cap_script.c (from r365630, stable/12/usr.sbin/rtsold/cap_script.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ releng/12.2/usr.sbin/rtsold/cap_script.c Sat Sep 12 21:50:25 2020 (r365673, copy of r365630, stable/12/usr.sbin/rtsold/cap_script.c) @@ -0,0 +1,236 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2018 The FreeBSD Foundation + * + * This software was developed by Mark Johnston 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 AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include +#include + +#include +#include + +#include "rtsold.h" + +/* + * Run the script and return the write end of a pipe to the main process. + * Return -1 and set errno on error. + */ +static int +script_run(char **argv) +{ + pid_t pid; + int fd[2], null; + + if (pipe(fd) != 0) + return (-1); + if ((pid = fork()) < 0) + return (-1); + if (pid == 0) { + (void)close(fd[1]); + null = open("/dev/null", O_RDWR); + if (null < 0) + _exit(1); + if (dup2(fd[0], STDIN_FILENO) != STDIN_FILENO) + _exit(1); + + closefrom(3); + (void)execve(argv[0], argv, NULL); + _exit(1); + } else + (void)close(fd[0]); + + return (fd[1]); +} + +int +cap_script_run(cap_channel_t *cap, const char *const *argv) +{ +#ifdef WITH_CASPER + nvlist_t *nvl; + size_t argc; + int error, wfd; + + for (argc = 0; argv[argc] != NULL; argc++) + ; + + nvl = nvlist_create(0); + nvlist_add_string(nvl, "cmd", "script_run"); + nvlist_add_string_array(nvl, "argv", argv, argc); + nvl = cap_xfer_nvlist(cap, nvl); + if (nvl == NULL) + return (-1); + + error = (int)dnvlist_get_number(nvl, "error", 0); + if (error == 0) + wfd = nvlist_take_descriptor(nvl, "fd"); + nvlist_destroy(nvl); + if (error != 0) + errno = error; + return (error == 0 ? wfd : -1); +#else + (void)cap; + return (script_run(__DECONST(char **, argv))); +#endif +} + +/* + * Wait for a child process to exit, and return its status. + * Return -1 and set errno upon error. + */ +static int +script_wait(int *statusp) +{ + int error; + + error = wait(statusp); + return (error >= 0 ? 0 : -1); +} + +int +cap_script_wait(cap_channel_t *cap, int *statusp) +{ +#ifdef WITH_CASPER + nvlist_t *nvl; + int error; + + nvl = nvlist_create(0); + nvlist_add_string(nvl, "cmd", "script_wait"); + nvl = cap_xfer_nvlist(cap, nvl); + if (nvl == NULL) + return (-1); + + error = (int)dnvlist_get_number(nvl, "error", 0); + if (error == 0) + *statusp = (int)nvlist_get_number(nvl, "status"); + nvlist_destroy(nvl); + if (error != 0) + errno = error; + return (error == 0 ? 0 : -1); +#else + (void)cap; + return (script_wait(statusp)); +#endif +} + +#ifdef WITH_CASPER +static int +script_command(const char *cmd, const nvlist_t *limits, nvlist_t *nvlin, + nvlist_t *nvlout) +{ + cap_rights_t rights; + const char *const *iargv, *const *scripts; + char **argv; + size_t argc, i, nscripts; + int fd, status; + + if (strcmp(cmd, "script_wait") == 0) { + /* Wait for the result of a previous "script_run" command. */ + if (script_wait(&status) == -1) + return (errno); + nvlist_add_number(nvlout, "status", status); + return (0); + } + if (strcmp(cmd, "script_run") != 0) + return (EINVAL); + + /* + * Validate the argv against the limits specified at initialization + * time. + */ + iargv = nvlist_get_string_array(nvlin, "argv", &argc); + if (argc == 0) + return (EINVAL); + scripts = nvlist_get_string_array(limits, "scripts", &nscripts); + for (i = 0; i < nscripts; i++) + if (strcmp(iargv[0], scripts[i]) == 0) + break; + if (i == nscripts) + return (EINVAL); + + /* + * The nvlist API does not permit NULL pointers in an array, so we have + * to add the nul terminator ourselves. Yuck. + */ + argv = calloc(argc + 1, sizeof(*argv)); + if (argv == NULL) + return (errno); + memcpy(argv, iargv, sizeof(*argv) * argc); + + fd = script_run(argv); + if (fd < 0) + return (errno); + + (void)caph_rights_limit(fd, cap_rights_init(&rights, CAP_WRITE)); + nvlist_move_descriptor(nvlout, "fd", fd); + return (0); +} + +static int +script_limit(const nvlist_t *oldlimits, const nvlist_t *newlimits __unused) +{ + const char *name; + void *cookie; + int nvtype; + bool hasscripts; + + /* Limits may only be set once. */ + if (oldlimits != NULL) + return (ENOTCAPABLE); + + cookie = NULL; + hasscripts = false; + while ((name = nvlist_next(newlimits, &nvtype, &cookie)) != NULL) { + if (nvtype == NV_TYPE_STRING_ARRAY && + strcmp(name, "scripts") == 0) + hasscripts = true; + else + return (EINVAL); + } + if (!hasscripts) + return (EINVAL); + return (0); +} + +CREATE_SERVICE("rtsold.script", script_limit, script_command, 0); +#endif /* WITH_CASPER */ Copied: releng/12.2/usr.sbin/rtsold/cap_sendmsg.c (from r365630, stable/12/usr.sbin/rtsold/cap_sendmsg.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ releng/12.2/usr.sbin/rtsold/cap_sendmsg.c Sat Sep 12 21:50:25 2020 (r365673, copy of r365630, stable/12/usr.sbin/rtsold/cap_sendmsg.c) @@ -0,0 +1,282 @@ +/* $KAME: probe.c,v 1.17 2003/10/05 00:09:36 itojun Exp $ */ + +/*- + * SPDX-License-Identifier: BSD-3-Clause + * + * Copyright (C) 1998 WIDE Project. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the project nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE PROJECT 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 PROJECT 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$ + */ + +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include +#include + +#include +#include + +#include "rtsold.h" + +static int +getsocket(int *sockp, int proto) +{ + cap_rights_t rights; + int sock; + + if (*sockp >= 0) + return (0); + + if ((sock = socket(AF_INET6, SOCK_RAW, proto)) < 0) + return (-1); + cap_rights_init(&rights, CAP_CONNECT, CAP_SEND); + if (caph_rights_limit(sock, &rights) != 0) + return (-1); + *sockp = sock; + + return (0); +} + +static ssize_t +sendpacket(int sock, struct sockaddr_in6 *dst, uint32_t ifindex, int hoplimit, + const void *data, size_t len) +{ + uint8_t cmsg[CMSG_SPACE(sizeof(struct in6_pktinfo)) + + CMSG_SPACE(sizeof(int))]; + struct msghdr hdr; + struct iovec iov; + struct in6_pktinfo *pi; + struct cmsghdr *cm; + + memset(&hdr, 0, sizeof(hdr)); + hdr.msg_name = dst; + hdr.msg_namelen = sizeof(*dst); + hdr.msg_iov = &iov; + hdr.msg_iovlen = 1; + hdr.msg_control = cmsg; + hdr.msg_controllen = sizeof(cmsg); + + iov.iov_base = __DECONST(void *, data); + iov.iov_len = len; + + /* Specify the outbound interface. */ + cm = CMSG_FIRSTHDR(&hdr); + cm->cmsg_level = IPPROTO_IPV6; + cm->cmsg_type = IPV6_PKTINFO; + cm->cmsg_len = CMSG_LEN(sizeof(struct in6_pktinfo)); + pi = (struct in6_pktinfo *)(void *)CMSG_DATA(cm); + memset(&pi->ipi6_addr, 0, sizeof(pi->ipi6_addr)); /*XXX*/ + pi->ipi6_ifindex = ifindex; + + /* Specify the hop limit of the packet for safety. */ + cm = CMSG_NXTHDR(&hdr, cm); + cm->cmsg_level = IPPROTO_IPV6; + cm->cmsg_type = IPV6_HOPLIMIT; + cm->cmsg_len = CMSG_LEN(sizeof(int)); + memcpy(CMSG_DATA(cm), &hoplimit, sizeof(int)); + + return (sendmsg(sock, &hdr, 0)); +} + +static int +probe_defrouters(uint32_t ifindex, uint32_t linkid) +{ + static int probesock = -1; + struct sockaddr_in6 dst; + struct in6_defrouter *p, *ep; + char *buf; + size_t len; + int mib[4]; + + if (ifindex == 0) + return (0); + if (getsocket(&probesock, IPPROTO_NONE) != 0) + return (-1); + + mib[0] = CTL_NET; + mib[1] = PF_INET6; + mib[2] = IPPROTO_ICMPV6; + mib[3] = ICMPV6CTL_ND6_DRLIST; + if (sysctl(mib, nitems(mib), NULL, &len, NULL, 0) < 0) + return (-1); + if (len == 0) + return (0); + + memset(&dst, 0, sizeof(dst)); + dst.sin6_family = AF_INET6; + dst.sin6_len = sizeof(dst); + + buf = malloc(len); + if (buf == NULL) + return (-1); + if (sysctl(mib, nitems(mib), buf, &len, NULL, 0) < 0) + return (-1); + ep = (struct in6_defrouter *)(void *)(buf + len); + for (p = (struct in6_defrouter *)(void *)buf; p < ep; p++) { + if (ifindex != p->if_index) + continue; + if (!IN6_IS_ADDR_LINKLOCAL(&p->rtaddr.sin6_addr)) + continue; + dst.sin6_addr = p->rtaddr.sin6_addr; + dst.sin6_scope_id = linkid; + (void)sendpacket(probesock, &dst, ifindex, 1, NULL, 0); + } + free(buf); + + return (0); +} + +static int +rssend(uint32_t ifindex, uint32_t linkid, const void *data, size_t len) +{ + static int rssock = -1; + struct sockaddr_in6 dst; + ssize_t n; + + if (getsocket(&rssock, IPPROTO_ICMPV6) != 0) + return (-1); + + memset(&dst, 0, sizeof(dst)); + dst.sin6_family = AF_INET6; + dst.sin6_len = sizeof(dst); + dst.sin6_addr = (struct in6_addr)IN6ADDR_LINKLOCAL_ALLROUTERS_INIT; + dst.sin6_scope_id = linkid; + + n = sendpacket(rssock, &dst, ifindex, 255, data, len); + if (n < 0 || (size_t)n != len) + return (-1); + return (0); +} + +int +cap_probe_defrouters(cap_channel_t *cap, struct ifinfo *ifinfo) +{ +#ifdef WITH_CASPER + nvlist_t *nvl; + int error; + + nvl = nvlist_create(0); + nvlist_add_string(nvl, "cmd", "probe_defrouters"); + nvlist_add_number(nvl, "ifindex", ifinfo->sdl->sdl_index); + nvlist_add_number(nvl, "linkid", ifinfo->linkid); + + nvl = cap_xfer_nvlist(cap, nvl); + if (nvl == NULL) + return (errno); + error = (int)dnvlist_get_number(nvl, "error", 0); + nvlist_destroy(nvl); + errno = error; + return (error == 0 ? 0 : -1); +#else + (void)cap; + return (probe_defrouters(ifinfo->sdl->sdl_index, ifinfo->linkid)); +#endif +} + +int +cap_rssend(cap_channel_t *cap, struct ifinfo *ifinfo) +{ + int error; + +#ifdef WITH_CASPER + nvlist_t *nvl = nvlist_create(0); + nvlist_add_string(nvl, "cmd", "rssend"); + nvlist_add_number(nvl, "ifindex", ifinfo->sdl->sdl_index); + nvlist_add_number(nvl, "linkid", ifinfo->linkid); + nvlist_add_binary(nvl, "data", ifinfo->rs_data, ifinfo->rs_datalen); + + nvl = cap_xfer_nvlist(cap, nvl); + if (nvl == NULL) + return (errno); + error = (int)dnvlist_get_number(nvl, "error", 0); + nvlist_destroy(nvl); + errno = error; +#else + (void)cap; + error = rssend(ifinfo->sdl->sdl_index, ifinfo->linkid, ifinfo->rs_data, + ifinfo->rs_datalen); +#endif + + ifinfo->probes++; + if (error != 0 && (errno != ENETDOWN || dflag > 0)) { + error = errno; + warnmsg(LOG_ERR, __func__, "sendmsg on %s: %s", + ifinfo->ifname, strerror(errno)); + errno = error; + } + return (error == 0 ? 0 : -1); +} + +#ifdef WITH_CASPER +static int +sendmsg_command(const char *cmd, const nvlist_t *limits __unused, nvlist_t *nvlin, + nvlist_t *nvlout __unused) +{ + const void *data; + size_t len; + uint32_t ifindex, linkid; + int error; + + if (strcmp(cmd, "probe_defrouters") != 0 && + strcmp(cmd, "rssend") != 0) + return (EINVAL); + + ifindex = (uint32_t)nvlist_get_number(nvlin, "ifindex"); + linkid = (uint32_t)nvlist_get_number(nvlin, "linkid"); + if (strcmp(cmd, "probe_defrouters") == 0) { + error = probe_defrouters(ifindex, linkid); + } else { + data = nvlist_get_binary(nvlin, "data", &len); + error = rssend(ifindex, linkid, data, len); + } + if (error != 0) + return (errno); + return (0); +} + +CREATE_SERVICE("rtsold.sendmsg", NULL, sendmsg_command, 0); +#endif /* WITH_CASPER */ Modified: releng/12.2/usr.sbin/rtsold/dump.c ============================================================================== --- releng/12.2/usr.sbin/rtsold/dump.c Sat Sep 12 20:20:55 2020 (r365672) +++ releng/12.2/usr.sbin/rtsold/dump.c Sat Sep 12 21:50:25 2020 (r365673) @@ -34,6 +34,7 @@ */ #include +#include #include #include @@ -42,21 +43,20 @@ #include #include -#include -#include +#include +#include #include #include -#include +#include +#include #include "rtsold.h" -static FILE *fp; +static const char * const ifstatstr[] = + { "IDLE", "DELAY", "PROBE", "DOWN", "TENTATIVE" }; -static void dump_interface_status(void); -static const char * const ifstatstr[] = {"IDLE", "DELAY", "PROBE", "DOWN", "TENTATIVE"}; - -static void -dump_interface_status(void) +void +rtsold_dump(FILE *fp) { struct ifinfo *ifi; struct rainfo *rai; @@ -64,8 +64,14 @@ dump_interface_status(void) struct timespec now; char ntopbuf[INET6_ADDRSTRLEN]; - clock_gettime(CLOCK_MONOTONIC_FAST, &now); + if (fseek(fp, 0, SEEK_SET) != 0) { + warnmsg(LOG_ERR, __func__, "fseek(): %s", strerror(errno)); + return; + } + (void)ftruncate(fileno(fp), 0); + (void)clock_gettime(CLOCK_MONOTONIC_FAST, &now); + TAILQ_FOREACH(ifi, &ifinfo_head, ifi_next) { fprintf(fp, "Interface %s\n", ifi->ifname); fprintf(fp, " probe interval: "); @@ -78,6 +84,8 @@ dump_interface_status(void) } fprintf(fp, " interface status: %s\n", ifi->active > 0 ? "active" : "inactive"); + fprintf(fp, " managed config: %s\n", + ifi->managedconfig ? "on" : "off"); fprintf(fp, " other config: %s\n", ifi->otherconfig ? "on" : "off"); fprintf(fp, " rtsold status: %s\n", ifstatstr[ifi->state]); @@ -121,18 +129,28 @@ dump_interface_status(void) fprintf(fp, "\n"); } } + fflush(fp); } -void -rtsold_dump_file(const char *dumpfile) +FILE * +rtsold_init_dumpfile(const char *dumpfile) { + cap_rights_t rights; + FILE *fp; + if ((fp = fopen(dumpfile, "w")) == NULL) { - warnmsg(LOG_WARNING, __func__, "open a dump file(%s): %s", + warnmsg(LOG_WARNING, __func__, "opening a dump file(%s): %s", dumpfile, strerror(errno)); - return; + return (NULL); } - dump_interface_status(); - fclose(fp); + + cap_rights_init(&rights, CAP_FSTAT, CAP_FTRUNCATE, CAP_SEEK, CAP_WRITE); + if (caph_rights_limit(fileno(fp), &rights) != 0) { + warnmsg(LOG_WARNING, __func__, "caph_rights_limit(%s): %s", + dumpfile, strerror(errno)); + return (NULL); + } + return (fp); } const char * Modified: releng/12.2/usr.sbin/rtsold/if.c ============================================================================== --- releng/12.2/usr.sbin/rtsold/if.c Sat Sep 12 20:20:55 2020 (r365672) +++ releng/12.2/usr.sbin/rtsold/if.c Sat Sep 12 21:50:25 2020 (r365673) @@ -34,10 +34,11 @@ */ #include -#include -#include +#include #include #include +#include +#include #include #include @@ -51,6 +52,7 @@ #include #include +#include #include #include #include @@ -63,16 +65,28 @@ #include "rtsold.h" static int ifsock; - -static int get_llflag(const char *); static void get_rtaddrs(int, struct sockaddr *, struct sockaddr **); int ifinit(void) { - ifsock = rssock; + cap_rights_t rights; + int sock; - return(0); + sock = socket(AF_INET6, SOCK_RAW, IPPROTO_ICMPV6); + if (sock < 0) { + warnmsg(LOG_ERR, __func__, "socket(): %s", + strerror(errno)); + return (-1); + } + if (caph_rights_limit(sock, cap_rights_init(&rights, CAP_IOCTL)) < 0) { + warnmsg(LOG_ERR, __func__, "caph_rights_limit(): %s", + strerror(errno)); + (void)close(sock); + return (-1); + } + ifsock = sock; + return (0); } int @@ -150,10 +164,9 @@ interface_up(char *name) } close(s); - llflag = get_llflag(name); - if (llflag < 0) { + if (cap_llflags_get(capllflags, name, &llflag) != 0) { warnmsg(LOG_WARNING, __func__, - "get_llflag() failed, anyway I'll try"); + "cap_llflags_get() failed, anyway I'll try"); return (0); } @@ -273,8 +286,6 @@ lladdropt_fill(struct sockaddr_dl *sdl, struct nd_opt_ "unsupported link type(%d)", sdl->sdl_type); exit(1); } - - return; } struct sockaddr_dl * @@ -331,58 +342,6 @@ if_nametosdl(char *name) free(buf); return (ret_sdl); } - -/*------------------------------------------------------------*/ - -/* get ia6_flags for link-local addr on if. returns -1 on error. */ -static int -get_llflag(const char *name) -{ - struct ifaddrs *ifap, *ifa; - struct in6_ifreq ifr6; - struct sockaddr_in6 *sin6; - int s; - - if ((s = socket(PF_INET6, SOCK_DGRAM, 0)) < 0) { - warnmsg(LOG_ERR, __func__, "socket(SOCK_DGRAM): %s", - strerror(errno)); - exit(1); - } - if (getifaddrs(&ifap) != 0) { - warnmsg(LOG_ERR, __func__, "getifaddrs: %s", - strerror(errno)); - exit(1); - } - - for (ifa = ifap; ifa; ifa = ifa->ifa_next) { - if (strlen(ifa->ifa_name) != strlen(name) || - strncmp(ifa->ifa_name, name, strlen(name)) != 0) - continue; - if (ifa->ifa_addr->sa_family != AF_INET6) - continue; - sin6 = (struct sockaddr_in6 *)(void *)ifa->ifa_addr; - if (!IN6_IS_ADDR_LINKLOCAL(&sin6->sin6_addr)) - continue; - - memset(&ifr6, 0, sizeof(ifr6)); - strlcpy(ifr6.ifr_name, name, sizeof(ifr6.ifr_name)); - memcpy(&ifr6.ifr_ifru.ifru_addr, sin6, sin6->sin6_len); - if (ioctl(s, SIOCGIFAFLAG_IN6, &ifr6) < 0) { - warnmsg(LOG_ERR, __func__, - "ioctl(SIOCGIFAFLAG_IN6): %s", strerror(errno)); - exit(1); - } - - freeifaddrs(ifap); - close(s); - return (ifr6.ifr_ifru.ifru_flags6); - } - - freeifaddrs(ifap); - close(s); - return (-1); -} - static void get_rtaddrs(int addrs, struct sockaddr *sa, struct sockaddr **rti_info) Modified: releng/12.2/usr.sbin/rtsold/rtsock.c ============================================================================== --- releng/12.2/usr.sbin/rtsold/rtsock.c Sat Sep 12 20:20:55 2020 (r365672) +++ releng/12.2/usr.sbin/rtsold/rtsock.c Sat Sep 12 21:50:25 2020 (r365673) @@ -33,10 +33,11 @@ */ #include +#include +#include #include -#include #include -#include +#include #include #include @@ -46,6 +47,7 @@ #include #include *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sat Sep 12 23:49:44 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6EA283E56E7; Sat, 12 Sep 2020 23:49:44 +0000 (UTC) (envelope-from karels@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bpq9N2HpMz4gCf; Sat, 12 Sep 2020 23:49:44 +0000 (UTC) (envelope-from karels@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 2D97E1D309; Sat, 12 Sep 2020 23:49:44 +0000 (UTC) (envelope-from karels@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08CNnhoV044874; Sat, 12 Sep 2020 23:49:43 GMT (envelope-from karels@FreeBSD.org) Received: (from karels@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08CNnhpo044872; Sat, 12 Sep 2020 23:49:43 GMT (envelope-from karels@FreeBSD.org) Message-Id: <202009122349.08CNnhpo044872@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: karels set sender to karels@FreeBSD.org using -f From: Mike Karels Date: Sat, 12 Sep 2020 23:49:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365677 - head/sys/arm/broadcom/bcm2835 X-SVN-Group: head X-SVN-Commit-Author: karels X-SVN-Commit-Paths: head/sys/arm/broadcom/bcm2835 X-SVN-Commit-Revision: 365677 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.33 Precedence: list List-Id: "SVN commit messages 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, 12 Sep 2020 23:49:44 -0000 Author: karels Date: Sat Sep 12 23:49:43 2020 New Revision: 365677 URL: https://svnweb.freebsd.org/changeset/base/365677 Log: bcm2838_pci.c: Respect DMA limits of controller. Fixes for Raspberry Pi 4B PCIe / USB: - Pass through a DMA tag for the controller. - In theory the controller can access the lower 3 GB, but testing found that unreliable. OpenBSD also restricts DMA to the lowest 960 MiB. - Rename some constants to be a bit more meaningful. Submitted by: Robert Crowston, crowston at protonmail.com Reviewed by: mkarels, outside reviewers Differential Revision: https://reviews.freebsd.org/D26344 Modified: head/sys/arm/broadcom/bcm2835/bcm2838_pci.c Modified: head/sys/arm/broadcom/bcm2835/bcm2838_pci.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2838_pci.c Sat Sep 12 23:23:16 2020 (r365676) +++ head/sys/arm/broadcom/bcm2835/bcm2838_pci.c Sat Sep 12 23:49:43 2020 (r365677) @@ -57,9 +57,6 @@ __FBSDID("$FreeBSD$"); #include "pcib_if.h" #include "msi_if.h" -extern struct bus_space memmap_bus; - -#define BUS_SPACE_3G_MAXADDR 0xc0000000 #define PCI_ID_VAL3 0x43c #define CLASS_SHIFT 0x10 #define SUBCLASS_SHIFT 0x8 @@ -69,18 +66,18 @@ extern struct bus_space memmap_bus; #define BRIDGE_DISABLE_FLAG 0x1 #define BRIDGE_RESET_FLAG 0x2 #define REG_BRIDGE_SERDES_MODE 0x4204 -#define REG_BRIDGE_CONFIG 0x4008 -#define REG_BRIDGE_MEM_WINDOW_LOW 0x4034 -#define REG_BRIDGE_MEM_WINDOW_HIGH 0x4038 -#define REG_BRIDGE_MEM_WINDOW_1 0x403c +#define REG_DMA_CONFIG 0x4008 +#define REG_DMA_WINDOW_LOW 0x4034 +#define REG_DMA_WINDOW_HIGH 0x4038 +#define REG_DMA_WINDOW_1 0x403c #define REG_BRIDGE_GISB_WINDOW 0x402c #define REG_BRIDGE_STATE 0x4068 #define REG_BRIDGE_LINK_STATE 0x00bc -#define REG_BRIDGE_BUS_WINDOW_LOW 0x400c -#define REG_BRIDGE_BUS_WINDOW_HIGH 0x4010 -#define REG_BRIDGE_CPU_WINDOW_LOW 0x4070 -#define REG_BRIDGE_CPU_WINDOW_START_HIGH 0x4080 -#define REG_BRIDGE_CPU_WINDOW_END_HIGH 0x4084 +#define REG_BUS_WINDOW_LOW 0x400c +#define REG_BUS_WINDOW_HIGH 0x4010 +#define REG_CPU_WINDOW_LOW 0x4070 +#define REG_CPU_WINDOW_START_HIGH 0x4080 +#define REG_CPU_WINDOW_END_HIGH 0x4084 #define REG_MSI_ADDR_LOW 0x4044 #define REG_MSI_ADDR_HIGH 0x4048 @@ -95,12 +92,27 @@ extern struct bus_space memmap_bus; #define REG_EP_CONFIG_DATA 0x8000 /* - * These values were obtained from runtime inspection of a Linux system using a - * JTAG. The very limited documentation I have obtained from Broadcom does not - * explain how to compute them. + * The system memory controller can address up to 16 GiB of physical memory + * (although at time of writing the largest memory size available for purchase + * is 8 GiB). However, the system DMA controller is capable of accessing only a + * limited portion of the address space. Worse, the PCI-e controller has further + * constraints for DMA, and those limitations are not wholly clear to the + * author. NetBSD and Linux allow DMA on the lower 3 GiB of the physical memory, + * but experimentation shows DMA performed above 960 MiB results in data + * corruption with this driver. The limit of 960 MiB is taken from OpenBSD, but + * apparently that value was chosen for satisfying a constraint of an unrelated + * peripheral. + * + * Whatever the true maximum address, 960 MiB works. */ -#define REG_VALUE_4GB_WINDOW 0x11 -#define REG_VALUE_4GB_CONFIG 0x88003000 +#define DMA_HIGH_LIMIT 0x3c000000 +#define MAX_MEMORY_LOG2 0x21 +#define REG_VALUE_DMA_WINDOW_LOW (MAX_MEMORY_LOG2 - 0xf) +#define REG_VALUE_DMA_WINDOW_HIGH 0x0 +#define DMA_WINDOW_ENABLE 0x3000 +#define REG_VALUE_DMA_WINDOW_CONFIG \ + (((MAX_MEMORY_LOG2 - 0xf) << 0x1b) | DMA_WINDOW_ENABLE) + #define REG_VALUE_MSI_CONFIG 0xffe06540 struct bcm_pcib_irqsrc { @@ -112,6 +124,7 @@ struct bcm_pcib_irqsrc { struct bcm_pcib_softc { struct generic_pcie_fdt_softc base; device_t dev; + bus_dma_tag_t dmat; struct mtx config_mtx; struct mtx msi_mtx; struct resource *msi_irq_res; @@ -142,6 +155,15 @@ bcm_pcib_probe(device_t dev) return (BUS_PROBE_DEFAULT); } +static bus_dma_tag_t +bcm_pcib_get_dma_tag(device_t dev, device_t child) +{ + struct bcm_pcib_softc *sc; + + sc = device_get_softc(dev); + return (sc->dmat); +} + static void bcm_pcib_set_reg(struct bcm_pcib_softc *sc, uint32_t reg, uint32_t val) { @@ -614,6 +636,24 @@ bcm_pcib_attach(device_t dev) sc = device_get_softc(dev); sc->dev = dev; + /* + * This tag will be used in preference to the one created in + * pci_host_generic.c. + */ + error = bus_dma_tag_create(bus_get_dma_tag(dev), /* parent */ + 1, 0, /* alignment, bounds */ + DMA_HIGH_LIMIT, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filter, filterarg */ + DMA_HIGH_LIMIT, /* maxsize */ + BUS_SPACE_UNRESTRICTED, /* nsegments */ + DMA_HIGH_LIMIT, /* maxsegsize */ + 0, /* flags */ + NULL, NULL, /* lockfunc, lockarg */ + &sc->dmat); + if (error) + return (error); + error = pci_host_generic_setup_fdt(dev); if (error) return (error); @@ -632,17 +672,14 @@ bcm_pcib_attach(device_t dev) /* * Set PCI->CPU memory window. This encodes the inbound window showing - * up to 4 GiB of system memory to the controller, with zero offset. - * Thus, from the perspective of a device on the PCI-E bus, there is a - * 1:1 map from PCI-E bus addresses to system memory addresses. However, - * a hardware limitation means that the controller can only perform DMA - * on the lower 3 GiB of system memory. + * the system memory to the controller. */ - bcm_pcib_set_reg(sc, REG_BRIDGE_MEM_WINDOW_LOW, REG_VALUE_4GB_WINDOW); - bcm_pcib_set_reg(sc, REG_BRIDGE_MEM_WINDOW_HIGH, 0); - bcm_pcib_set_reg(sc, REG_BRIDGE_CONFIG, REG_VALUE_4GB_CONFIG); + bcm_pcib_set_reg(sc, REG_DMA_WINDOW_LOW, REG_VALUE_DMA_WINDOW_LOW); + bcm_pcib_set_reg(sc, REG_DMA_WINDOW_HIGH, REG_VALUE_DMA_WINDOW_HIGH); + bcm_pcib_set_reg(sc, REG_DMA_CONFIG, REG_VALUE_DMA_WINDOW_CONFIG); + bcm_pcib_set_reg(sc, REG_BRIDGE_GISB_WINDOW, 0); - bcm_pcib_set_reg(sc, REG_BRIDGE_MEM_WINDOW_1, 0); + bcm_pcib_set_reg(sc, REG_DMA_WINDOW_1, 0); bcm_pcib_enable_controller(sc); @@ -682,14 +719,14 @@ bcm_pcib_attach(device_t dev) phys_base = sc->base.base.ranges[0].phys_base; size = sc->base.base.ranges[0].size; - bcm_pcib_set_reg(sc, REG_BRIDGE_BUS_WINDOW_LOW, pci_base & 0xffffffff); - bcm_pcib_set_reg(sc, REG_BRIDGE_BUS_WINDOW_HIGH, pci_base >> 32); + bcm_pcib_set_reg(sc, REG_BUS_WINDOW_LOW, pci_base & 0xffffffff); + bcm_pcib_set_reg(sc, REG_BUS_WINDOW_HIGH, pci_base >> 32); - bcm_pcib_set_reg(sc, REG_BRIDGE_CPU_WINDOW_LOW, + bcm_pcib_set_reg(sc, REG_CPU_WINDOW_LOW, encode_cpu_window_low(phys_base, size)); - bcm_pcib_set_reg(sc, REG_BRIDGE_CPU_WINDOW_START_HIGH, + bcm_pcib_set_reg(sc, REG_CPU_WINDOW_START_HIGH, encode_cpu_window_start_high(phys_base)); - bcm_pcib_set_reg(sc, REG_BRIDGE_CPU_WINDOW_END_HIGH, + bcm_pcib_set_reg(sc, REG_CPU_WINDOW_END_HIGH, encode_cpu_window_end_high(phys_base, size)); /* @@ -718,6 +755,9 @@ bcm_pcib_attach(device_t dev) * Device method table. */ static device_method_t bcm_pcib_methods[] = { + /* Bus interface. */ + DEVMETHOD(bus_get_dma_tag, bcm_pcib_get_dma_tag), + /* Device interface. */ DEVMETHOD(device_probe, bcm_pcib_probe), DEVMETHOD(device_attach, bcm_pcib_attach), @@ -739,3 +779,4 @@ DEFINE_CLASS_1(pcib, bcm_pcib_driver, bcm_pcib_methods static devclass_t bcm_pcib_devclass; DRIVER_MODULE(bcm_pcib, simplebus, bcm_pcib_driver, bcm_pcib_devclass, 0, 0); + From owner-svn-src-all@freebsd.org Sat Sep 12 23:54:58 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C614D3E5C67; Sat, 12 Sep 2020 23:54:58 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BpqHQ4hSfz4gP2; Sat, 12 Sep 2020 23:54:58 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 6B8AA1D0BD; Sat, 12 Sep 2020 23:54:58 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08CNswQN050825; Sat, 12 Sep 2020 23:54:58 GMT (envelope-from bdragon@FreeBSD.org) Received: (from bdragon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08CNsw81050824; Sat, 12 Sep 2020 23:54:58 GMT (envelope-from bdragon@FreeBSD.org) Message-Id: <202009122354.08CNsw81050824@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdragon set sender to bdragon@FreeBSD.org using -f From: Brandon Bergren Date: Sat, 12 Sep 2020 23:54:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365678 - head/sys/powerpc/aim X-SVN-Group: head X-SVN-Commit-Author: bdragon X-SVN-Commit-Paths: head/sys/powerpc/aim X-SVN-Commit-Revision: 365678 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.33 Precedence: list List-Id: "SVN commit messages 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, 12 Sep 2020 23:54:58 -0000 Author: bdragon Date: Sat Sep 12 23:54:57 2020 New Revision: 365678 URL: https://svnweb.freebsd.org/changeset/base/365678 Log: [PowerPC] Add PVO_PADDR macro to mmu_oea.c to match mmu_oea64.c changes Use a PVO_PADDR macro on 32 bit as well, to reduce the difference between mmu_oea.c and mmu_oea64.c. Equivilent to the changes in r363222. Modified: head/sys/powerpc/aim/mmu_oea.c Modified: head/sys/powerpc/aim/mmu_oea.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea.c Sat Sep 12 23:49:43 2020 (r365677) +++ head/sys/powerpc/aim/mmu_oea.c Sat Sep 12 23:54:57 2020 (r365678) @@ -157,6 +157,9 @@ __FBSDID("$FreeBSD$"); #define VSID_TO_SR(vsid) ((vsid) & 0xf) #define VSID_TO_HASH(vsid) (((vsid) >> 4) & 0xfffff) +/* Get physical address from PVO. */ +#define PVO_PADDR(pvo) ((pvo)->pvo_pte.pte.pte_lo & PTE_RPGN) + struct ofw_map { vm_offset_t om_va; vm_size_t om_len; @@ -1265,7 +1268,7 @@ moea_extract(pmap_t pm, vm_offset_t va) if (pvo == NULL) pa = 0; else - pa = (pvo->pvo_pte.pte.pte_lo & PTE_RPGN) | (va & ADDR_POFF); + pa = PVO_PADDR(pvo) | (va & ADDR_POFF); PMAP_UNLOCK(pm); return (pa); } @@ -1287,7 +1290,7 @@ moea_extract_and_hold(pmap_t pmap, vm_offset_t va, vm_ if (pvo != NULL && (pvo->pvo_pte.pte.pte_hi & PTE_VALID) && ((pvo->pvo_pte.pte.pte_lo & PTE_PP) == PTE_RW || (prot & VM_PROT_WRITE) == 0)) { - m = PHYS_TO_VM_PAGE(pvo->pvo_pte.pte.pte_lo & PTE_RPGN); + m = PHYS_TO_VM_PAGE(PVO_PADDR(pvo)); if (!vm_page_wire_mapped(m)) m = NULL; } @@ -1535,7 +1538,7 @@ moea_kextract(vm_offset_t va) PMAP_LOCK(kernel_pmap); pvo = moea_pvo_find_va(kernel_pmap, va & ~ADDR_POFF, NULL); KASSERT(pvo != NULL, ("moea_kextract: no addr found")); - pa = (pvo->pvo_pte.pte.pte_lo & PTE_RPGN) | (va & ADDR_POFF); + pa = PVO_PADDR(pvo) | (va & ADDR_POFF); PMAP_UNLOCK(kernel_pmap); return (pa); } @@ -2001,7 +2004,7 @@ moea_pvo_enter(pmap_t pm, uma_zone_t zone, struct pvo_ mtx_lock(&moea_table_mutex); LIST_FOREACH(pvo, &moea_pvo_table[ptegidx], pvo_olink) { if (pvo->pvo_pmap == pm && PVO_VADDR(pvo) == va) { - if ((pvo->pvo_pte.pte.pte_lo & PTE_RPGN) == pa && + if (PVO_PADDR(pvo) == pa && (pvo->pvo_pte.pte.pte_lo & PTE_PP) == (pte_lo & PTE_PP)) { /* @@ -2129,7 +2132,7 @@ moea_pvo_remove(struct pvo_entry *pvo, int pteidx) if ((pvo->pvo_vaddr & PVO_MANAGED) == PVO_MANAGED) { struct vm_page *pg; - pg = PHYS_TO_VM_PAGE(pvo->pvo_pte.pte.pte_lo & PTE_RPGN); + pg = PHYS_TO_VM_PAGE(PVO_PADDR(pvo)); if (pg != NULL) { moea_attr_save(pg, pvo->pvo_pte.pte.pte_lo & (PTE_REF | PTE_CHG)); @@ -2696,8 +2699,7 @@ moea_sync_icache(pmap_t pm, vm_offset_t va, vm_size_t len = MIN(lim - va, sz); pvo = moea_pvo_find_va(pm, va & ~ADDR_POFF, NULL); if (pvo != NULL) { - pa = (pvo->pvo_pte.pte.pte_lo & PTE_RPGN) | - (va & ADDR_POFF); + pa = PVO_PADDR(pvo) | (va & ADDR_POFF); moea_syncicache(pa, len); } va += len;