From owner-svn-src-head@freebsd.org Sun Sep 6 03:07:15 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@freebsd.org Sat Sep 5 19:43:00 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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:06:35 +0000 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@freebsd.org Sat Sep 5 20:41:41 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E041F3D5A0C for ; Sat, 5 Sep 2020 20:41:41 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qv1-xf35.google.com (mail-qv1-xf35.google.com [IPv6:2607:f8b0:4864:20::f35]) (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 4BkRKd0CMrz3cBZ for ; Sat, 5 Sep 2020 20:41:40 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qv1-xf35.google.com with SMTP id f11so4801642qvw.3 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=exa2HA/CJVBIoDUJTI+/NVBsypfOioIVafN9JgqBP5762w+ukEkg/DaztMyJPgIELt PWr8+i8wsZvRx/ldLosvoqbeB8viXM7oNKgPgPzQzA+tjzgiC5thT67rAXB76gYVA7rE +rfufyRwUQXOIQjAMnHZVPaO0GbxyyKPO1RXhyugF0cSL+vkcvoQCWA2MOmjAsz3tSWM qdjaMkS4Ev1EOM4kBPZyqDjASrYvO5IC+udWWVSJyljfEVEeZ0eFYe/5x6aFUYV4jW87 VlwIYn2S7Ict6bnCviMD22GMwB30OEb3WgX/MQeoF58GqbkAlVw5Fmrse4+RR7EebzGM fZ4w== X-Gm-Message-State: AOAM5308ZFnKsB3m27k6rvOf7J/zA+wH+G0GKRjH9eaxOeh1aRTTkyWF Yir7HHpxI35+N3VFdxvbd0AJC8tvANLIoG4UBLHwRfDHaoGAdg== 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: 4BkRKd0CMrz3cBZ 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::f35) smtp.mailfrom=wlosh@bsdimp.com X-Spamd-Result: default: False [-2.60 / 15.00]; RCVD_TLS_ALL(0.00)[]; ARC_NA(0.00)[]; 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-head@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::f35: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:~]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[imp@bsdimp.com,wlosh@bsdimp.com]; MAILMAN_DEST(0.00)[svn-src-head]; RCVD_COUNT_TWO(0.00)[2] X-Mailman-Approved-At: Sun, 06 Sep 2020 09:07:09 +0000 Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.33 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Sep 2020 20:41:41 -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-head@freebsd.org Sun Sep 6 09:08:08 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@freebsd.org Sun Sep 6 14:04:04 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@freebsd.org Sun Sep 6 15:44:10 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@freebsd.org Sun Sep 6 18:32:48 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@freebsd.org Sun Sep 6 18:39:38 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@freebsd.org Sun Sep 6 19:25:32 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@freebsd.org Sun Sep 6 20:03:33 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@freebsd.org Sun Sep 6 20:32:14 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@freebsd.org Sun Sep 6 20:46:16 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@freebsd.org Sun Sep 6 21:11:21 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 13CA53DE732 for ; Sun, 6 Sep 2020 21:11:21 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) (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 4Bl3xN1CDBz4V57 for ; Sun, 6 Sep 2020 21:11:19 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: by mail-wm1-f46.google.com with SMTP id a65so12049185wme.5 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=b/MBdXQM40z1ZIjf8a22uA9Q4RSlJYu/IeSS7DtBDLaaxD/KJVkvC50VHl83q3mUUD map6hSqGWRf22bMU+NHMTGij9JNJghGTmq5Jet42AdcIIEGt52Uo6g1Z2lbhp8lzaxHT tMUHwUI/y6T8BPXHdiYsEDaxmDgbESUeuTNwsSLpRaHd9aex1VXkSsgbritnEG/bk2+6 WAvuvi1VbpJmQfrsWUjxlBRYiydxEI/FGd+o4E4BCyu7uMhigUGAk9WhoY+EGg7RnY7O C9q4V982xy6dtXOB7Y54EdY3i+9WzJqUmzykKBkkOIEvV2zOSTVO7QDPFPIuWHzsfI3R qvGg== X-Gm-Message-State: AOAM5302lxIxpPHNfkb4/lZhUee9q8nyRxUH87vf7H3otbFQ1v5mD4rO CHG8dM33e9ZqXCzo76VOMNCv/g== 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: 4Bl3xN1CDBz4V57 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.46 as permitted sender) smtp.mailfrom=jrtc27@jrtc27.com X-Spamd-Result: default: False [-2.62 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17:c]; MV_CASE(0.50)[]; 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]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.07)[-1.075]; 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-head@freebsd.org]; DMARC_NA(0.00)[freebsd.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[209.85.128.46:from]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.128.46:from]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[svn-src-head] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 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-head@freebsd.org Mon Sep 7 06:27:19 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Sep 7 06:29:41 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Sep 7 06:32:04 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Sep 7 06:39:01 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Sep 7 06:44:25 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Sep 7 06:48:09 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Sep 7 06:49:08 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Sep 7 06:53:30 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Sep 7 07:44:15 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Sep 7 10:13:55 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Sep 7 13:44:55 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Sep 7 14:39:11 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A45723CB4A4 for ; Mon, 7 Sep 2020 14:39:11 +0000 (UTC) (envelope-from noreply@tovarioseni6.fun) Received: from tovarioseni6.fun (tovarioseni6.fun [62.4.16.53]) (using TLSv1.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 4BlWBR0P3Mz4BGT for ; Mon, 7 Sep 2020 14:39:10 +0000 (UTC) (envelope-from noreply@tovarioseni6.fun) Received: by tovarioseni6.fun for ; Mon, 7 Sep 2020 16:39:10 +0200 (envelope-from ) Message-ID: <2d45b11de8e1313d1a5fe9ba4e8bf1fddc53bbc2@tovarioseni6.fun> Reply-To: Acuna Cameron From: Acuna Cameron To: svn-src-head@freebsd.org Subject: Receipt 7535754 Date: Mon, 7 Sep 2020 07:39:09 -0700 MIME-Version: 1.0 Precedence: bulk X-Rspamd-Queue-Id: 4BlWBR0P3Mz4BGT X-Spamd-Bar: - X-Spamd-Result: default: False [-1.37 / 15.00]; HAS_REPLYTO(0.00)[noreply@tovarioseni6.fun]; R_SPF_ALLOW(-0.20)[+ip4:62.4.16.53:c]; TO_DN_NONE(0.00)[]; URI_COUNT_ODD(1.00)[1]; DKIM_TRACE(0.00)[tovarioseni6.fun:+]; DMARC_POLICY_ALLOW(-0.50)[tovarioseni6.fun,reject]; 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)[]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.97)[-0.969]; R_DKIM_ALLOW(-0.20)[tovarioseni6.fun: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-head@freebsd.org]; NEURAL_HAM_LONG(-0.97)[-0.972]; HAS_LIST_UNSUB(-0.01)[]; RCPT_COUNT_ONE(0.00)[1]; SUBJECT_ENDS_SPACES(0.50)[]; NEURAL_SPAM_SHORT(0.08)[0.085]; MAILMAN_DEST(0.00)[svn-src-head] 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-head@freebsd.org X-Mailman-Version: 2.1.33 List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Sep 2020 14:39:11 -0000 Hello Dear client, Remuneration invoicing #255646 Click here for download Document Best Regards From owner-svn-src-head@freebsd.org Mon Sep 7 15:35:42 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Sep 7 17:19:31 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Sep 7 18:15:59 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Sep 7 20:05:19 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Sep 7 20:10:04 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Sep 7 20:25:55 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Sep 7 21:32:28 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Sep 7 21:37:17 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Mon Sep 7 23:28:33 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 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-head@freebsd.org Tue Sep 8 00:15:18 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Sep 8 00:44:37 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Sep 8 00:48:18 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Sep 8 01:27:04 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Sep 8 03:00:34 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Sep 8 04:44:38 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Sep 8 05:46:11 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Sep 8 06:18:35 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Sep 8 06:19:23 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Sep 8 07:10:27 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Sep 8 07:24:08 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Sep 8 10:36:12 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Sep 8 11:35:37 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Sep 8 11:46:33 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Sep 8 12:01:30 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Sep 8 12:25:01 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Sep 8 12:48:53 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Sep 8 13:21:15 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Sep 8 13:24:45 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Sep 8 14:20:33 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Sep 8 14:54:11 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Sep 8 15:01:50 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Sep 8 15:08:21 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Sep 8 15:36:39 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Sep 8 15:39:20 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Sep 8 15:42:16 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Sep 8 16:06:26 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Sep 8 16:06:46 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Sep 8 16:07:47 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Sep 8 17:47:31 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Sep 8 20:03:41 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Sep 8 21:39:35 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Sep 8 21:40:37 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Sep 8 21:50:40 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Sep 8 22:20:14 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Sep 8 22:23:54 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Sep 8 22:41:36 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Sep 8 22:42:42 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Sep 8 22:59:44 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Sep 8 23:22:12 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Sep 8 23:28:11 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Sep 8 23:38:50 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Sep 8 23:48:19 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Tue Sep 8 23:48:50 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 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-head@freebsd.org Wed Sep 9 00:00:44 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@freebsd.org Wed Sep 9 00:06:35 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@freebsd.org Wed Sep 9 00:39:48 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@freebsd.org Wed Sep 9 00:40:55 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@freebsd.org Wed Sep 9 00:41:31 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@freebsd.org Wed Sep 9 02:42:21 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@freebsd.org Wed Sep 9 02:45:47 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@freebsd.org Wed Sep 9 05:49:07 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@freebsd.org Wed Sep 9 05:51:57 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@freebsd.org Wed Sep 9 06:13:50 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@freebsd.org Wed Sep 9 06:34:53 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3B0993E681D for ; Wed, 9 Sep 2020 06:34:53 +0000 (UTC) (envelope-from ruslanngaripov@gmail.com) Received: from mail-lj1-x22d.google.com (mail-lj1-x22d.google.com [IPv6:2a00:1450:4864:20::22d]) (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 4BmXLh4xcxz3YBl for ; Wed, 9 Sep 2020 06:34:52 +0000 (UTC) (envelope-from ruslanngaripov@gmail.com) Received: by mail-lj1-x22d.google.com with SMTP id u4so1978810ljd.10 for ; Tue, 08 Sep 2020 23:34:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=xa4VwCWx+Czca5NRz28LxHdL/E2lfy4ndGBHan6FItY=; b=fK/i77X9yR2l1cVd68whTCwPrJHpB4Yf7rluTas0qVViFebVF7rfku/XBpeA9lcAIP +rsvyBUI8BMvWkgVOtXjGWDO6SB9CvP32cQTBUfy40V70p7xBHk2jgF8o3AThnNoKm7x Jspvp4Ox5niYN6U7g9lFIqnBqbN2p8a2fvyhzF9DMSGAgHaABnUSP0yJfRVeIoKQjSxi /J7NaJ8nV5k1V/oQ0CW2ZXViNLm2YKYt3juQL1ZXgDjQm9o9X0KLsmkqhaArX/YAQzvS zY8nl6B84adL3wb1ZBUOD57pBtuPMFjqRDaKkTL1cnSY9Vwwa3NNHXkZ87nroOJoQ/9F 2lBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=xa4VwCWx+Czca5NRz28LxHdL/E2lfy4ndGBHan6FItY=; b=G/jX2YdjD2lJipbylYWibz5nIfaraClO1vi/yts/Bwbfw+a0xp5wT/t4qGiedJZ8x6 9JrDh9sBim12ydYVXmNPfV2TMvNYQbM4tX4JipLEBH6ipgwrlpVkAsg1U2+QpsnRHEVd KRzp59wMnpUjRhj0nzlm1hcrty8beWgxX+0H+Uy+pPmJolZJ70d06UNKXA1y1emlCI7G r8SDBMMccyLN5g/eSWM0MnxvCu3uEOPLYxaQPYT8BzN+r57L2mwMFKZCmrZRhKd2ClbB zN+cAE8j+t9ycV1lO5RKscHZuOL5oQ+LDlS5vCb0n63V8qY0I0V/C6/qivrBr1pIeNv2 vxZg== X-Gm-Message-State: AOAM531W5ub2pqt4jPU0vU6C9h7bhd3PotoCFLoX0GnuUC2Hc1svh5aq SN+laqNIjYCXwgLtWwSmWXwSxyAFd6R+0HXujQ01xmJf5QA= X-Google-Smtp-Source: ABdhPJxyPAG1DDcN9FAHsTAk3dYs/ivWvtQfSVjMdXC7gJOiKFAs3Ym4lbWvphI6bxaACmKEnVrxpH+6xgWmB2ZGEYU= X-Received: by 2002:a2e:918f:: with SMTP id f15mr1119938ljg.435.1599633290903; Tue, 08 Sep 2020 23:34:50 -0700 (PDT) MIME-Version: 1.0 From: Ruslan Garipov Date: Wed, 9 Sep 2020 11:34:40 +0500 Message-ID: Subject: Re: svn commit: r364891 - in head: . release release/scripts To: svn-src-head@freebsd.org X-Rspamd-Queue-Id: 4BmXLh4xcxz3YBl X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=fK/i77X9; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of ruslanngaripov@gmail.com designates 2a00:1450:4864:20::22d as permitted sender) smtp.mailfrom=ruslanngaripov@gmail.com X-Spamd-Result: default: False [-1.68 / 15.00]; FAKE_REPLY(1.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-head@freebsd.org]; TO_DN_NONE(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_LONG(-0.93)[-0.931]; NEURAL_HAM_MEDIUM(-0.91)[-0.914]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::22d:from]; NEURAL_SPAM_SHORT(0.17)[0.167]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; MAILMAN_DEST(0.00)[svn-src-head]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.33 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Sep 2020 06:34:53 -0000 I'm sorry for the late response. 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. From owner-svn-src-head@freebsd.org Wed Sep 9 06:45:56 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@freebsd.org Wed Sep 9 08:38:50 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@freebsd.org Wed Sep 9 09:08:10 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@freebsd.org Wed Sep 9 11:11:51 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@freebsd.org Wed Sep 9 12:58:20 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@freebsd.org Wed Sep 9 13:44:36 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@freebsd.org Wed Sep 9 13:51:17 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@freebsd.org Wed Sep 9 16:13:34 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@freebsd.org Wed Sep 9 16:35:52 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@freebsd.org Wed Sep 9 18:07:15 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@freebsd.org Wed Sep 9 18:08:36 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A91A23D7933 for ; Wed, 9 Sep 2020 18:08:36 +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 4Bmql844JQz4Z02 for ; Wed, 9 Sep 2020 18:08:36 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-qt1-f180.google.com (mail-qt1-f180.google.com [209.85.160.180]) (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 6A93311334 for ; Wed, 9 Sep 2020 18:08:36 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qt1-f180.google.com with SMTP id k25so2699085qtu.4 for ; Wed, 09 Sep 2020 11:08:36 -0700 (PDT) X-Gm-Message-State: AOAM533d/ckShr6qcrpGKm87vq+z0OFrmnilTbNvDquKK5PmPxT7n92o zJs16RH9ZQADjLpmQVbjY7zpIv1EWcd7R97GGA0= X-Received: by 2002:ac8:72d6:: with SMTP id o22mt4521148qtp.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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@freebsd.org Wed Sep 9 18:11:04 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@freebsd.org Wed Sep 9 19:07:35 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@freebsd.org Wed Sep 9 20:48:58 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@freebsd.org Wed Sep 9 21:00:11 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@freebsd.org Wed Sep 9 21:01:37 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@freebsd.org Wed Sep 9 21:08:46 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@freebsd.org Wed Sep 9 21:34:32 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@freebsd.org Wed Sep 9 21:35:45 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@freebsd.org Wed Sep 9 21:39:07 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@freebsd.org Wed Sep 9 21:45:00 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@freebsd.org Wed Sep 9 21:45:19 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@freebsd.org Wed Sep 9 21:47:40 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@freebsd.org Wed Sep 9 21:50:25 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@freebsd.org Wed Sep 9 22:02:31 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@freebsd.org Wed Sep 9 22:07:55 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@freebsd.org Wed Sep 9 22:12:53 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@freebsd.org Wed Sep 9 22:18:45 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@freebsd.org Wed Sep 9 22:20:37 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@freebsd.org Wed Sep 9 22:22:02 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 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-head@freebsd.org Wed Sep 9 22:41:46 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 11DA63DF969; Wed, 9 Sep 2020 22:41:46 +0000 (UTC) (envelope-from junchoon@dec.sakura.ne.jp) Received: from dec.sakura.ne.jp (dec.sakura.ne.jp [210.188.226.8]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4BmxpJ5W27z427x; Wed, 9 Sep 2020 22:41:43 +0000 (UTC) (envelope-from junchoon@dec.sakura.ne.jp) Received: from kalamity.joker.local (180-198-4-200.nagoya1.commufa.jp [180.198.4.200]) (authenticated bits=0) by dec.sakura.ne.jp (8.15.2/8.15.2/[SAKURA-WEB]/20080708) with ESMTPA id 089MfZGG027306; Thu, 10 Sep 2020 07:41:35 +0900 (JST) (envelope-from junchoon@dec.sakura.ne.jp) Date: Thu, 10 Sep 2020 07:41:35 +0900 From: Tomoaki AOKI To: svn-src-head@freebsd.org Cc: freebsd-current@freebsd.org, bz@FreeBSD.org Subject: Re: svn commit: r365419 - in head/sys/dev: ath bwi iwm iwn mwl otus usb/wlan wtap Message-Id: <20200910074135.45d5b208b083c93efbce9259@dec.sakura.ne.jp> Reply-To: junchoon@dec.sakura.ne.jp Organization: Junchoon corps X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.32; amd64-portbld-freebsd12.1) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4BmxpJ5W27z427x X-Spamd-Bar: ++++ Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of junchoon@dec.sakura.ne.jp has no SPF policy when checking 210.188.226.8) smtp.mailfrom=junchoon@dec.sakura.ne.jp X-Spamd-Result: default: False [4.12 / 15.00]; HAS_REPLYTO(0.00)[junchoon@dec.sakura.ne.jp]; RCVD_VIA_SMTP_AUTH(0.00)[]; MV_CASE(0.50)[]; REPLYTO_ADDR_EQ_FROM(0.00)[]; TO_DN_NONE(0.00)[]; HAS_ORG_HEADER(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; R_DKIM_NA(0.00)[]; ASN(0.00)[asn:9370, ipnet:210.188.224.0/19, country:JP]; MID_RHS_MATCH_FROM(0.00)[]; RECEIVED_SPAMHAUS_PBL(0.00)[180.198.4.200:received]; FAKE_REPLY(1.00)[]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_SPAM_SHORT(0.41)[0.411]; MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+]; AUTH_NA(1.00)[]; NEURAL_SPAM_MEDIUM(0.86)[0.863]; DMARC_NA(0.00)[sakura.ne.jp]; NEURAL_SPAM_LONG(0.44)[0.444]; R_SPF_NA(0.00)[no SPF record]; RCVD_COUNT_TWO(0.00)[2]; MAILMAN_DEST(0.00)[freebsd-current,svn-src-head] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Sep 2020 22:41:46 -0000 This breaks at least iwm. (Other drivers not tested.) Messages below are repeatedly shown and no carrier detected. Manually reverting this commit fixes the issue. iwm0: failed to send antennas before calibration: 35 iwm_run_init_ucode: failed 35 iwm_init_hw failed 35 iwm0: could not initiate scan and lesser times messages below. iwm0: iwm_send_phy_db_data: Cannot send HCMD of Phy DB cfg section, 35 iwm_init_hw failed 35 iwm0: could not initiate scan > 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); (snip) > 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 (snip) -- Tomoaki AOKI From owner-svn-src-head@freebsd.org Thu Sep 10 00:46:39 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@freebsd.org Thu Sep 10 00:50:19 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@freebsd.org Thu Sep 10 01:49:54 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@freebsd.org Thu Sep 10 02:48:56 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@freebsd.org Thu Sep 10 04:00:13 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@freebsd.org Thu Sep 10 05:15:24 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@freebsd.org Thu Sep 10 05:56:43 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@freebsd.org Thu Sep 10 06:32:26 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@freebsd.org Thu Sep 10 07:05:31 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@freebsd.org Thu Sep 10 09:37:30 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@freebsd.org Thu Sep 10 09:42:40 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@freebsd.org Thu Sep 10 09:50:44 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@freebsd.org Thu Sep 10 10:24:41 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1ACDE3D1D03; Thu, 10 Sep 2020 10:24:41 +0000 (UTC) (envelope-from bz@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 4BnFPN6y0Wz3Y7c; Thu, 10 Sep 2020 10:24:40 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mx1.sbone.de (cross.sbone.de [195.201.62.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mx1.sbone.de", Issuer "SBone.DE" (not verified)) (Authenticated sender: bz/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id B770618B15; Thu, 10 Sep 2020 10:24:40 +0000 (UTC) (envelope-from bz@FreeBSD.org) 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 E23848D4A229; Thu, 10 Sep 2020 10:24:38 +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 9D58DE70849; Thu, 10 Sep 2020 10:24:37 +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 ZuuFZCuVtidO; Thu, 10 Sep 2020 10:24:33 +0000 (UTC) Received: from [127.0.0.1] (unknown [IPv6:fde9:577b:c1a9:4902:90a7:9bcf:f86b:190f]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 2249BE707C1; Thu, 10 Sep 2020 10:23:48 +0000 (UTC) From: "Bjoern A. Zeeb" To: "Tomoaki AOKI" Cc: svn-src-head@freebsd.org, freebsd-current@freebsd.org Subject: Re: svn commit: r365419 - in head/sys/dev: ath bwi iwm iwn mwl otus usb/wlan wtap Date: Thu, 10 Sep 2020 10:22:05 +0000 X-Mailer: MailMate (2.0BETAr6151) Message-ID: <178A8155-90E0-4B3E-BBCB-D3C7CA4C62B2@FreeBSD.org> In-Reply-To: <20200910074135.45d5b208b083c93efbce9259@dec.sakura.ne.jp> References: <20200910074135.45d5b208b083c93efbce9259@dec.sakura.ne.jp> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Sep 2020 10:24:41 -0000 On 9 Sep 2020, at 22:41, Tomoaki AOKI wrote: > This breaks at least iwm. (Other drivers not tested.) > > Messages below are repeatedly shown and no carrier detected. > Manually reverting this commit fixes the issue. > > iwm0: failed to send antennas before calibration: 35 > iwm_run_init_ucode: failed 35 > iwm_init_hw failed 35 > iwm0: could not initiate scan > > > and lesser times messages below. > > iwm0: iwm_send_phy_db_data: Cannot send HCMD of Phy DB cfg section, 35 > iwm_init_hw failed 35 > iwm0: could not initiate scan > I=E2=80=99ll try to test iwm as well, in case you are faster, can you ple= ase = try this instead of reverting; the previous version never made it past = the first return anymore in the last years it seems, so we can remove = the function entirely to keep the status quo: Sorry for the oversight. Index: if_iwm.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 --- if_iwm.c (revision 365559) +++ if_iwm.c (working copy) @@ -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 } } -static int -iwm_media_change(struct ifnet *ifp) -{ - struct ieee80211vap *vap =3D ifp->if_softc; - struct ieee80211com *ic =3D vap->iv_ic; - struct iwm_softc *sc =3D ic->ic_softc; - int error; - - error =3D ieee80211_media_change(ifp); - if (error !=3D 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 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 =3D opmode; return vap; > >> 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 >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> --- head/sys/dev/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); > > (snip) > >> Modified: head/sys/dev/iwm/if_iwm.c >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> --- head/sys/dev/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 =3D ieee80211_media_change(ifp); >> - if (error !=3D ENETRESET) >> - return error; >> + if (error !=3D 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 > > (snip) > > > -- = > Tomoaki AOKI From owner-svn-src-head@freebsd.org Thu Sep 10 13:57:57 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@freebsd.org Thu Sep 10 14:11:25 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@freebsd.org Thu Sep 10 14:11:32 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Sep 2020 14:11:33 -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-head@freebsd.org Thu Sep 10 14:12:26 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@freebsd.org Thu Sep 10 14:13:50 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@freebsd.org Thu Sep 10 14:22:56 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@freebsd.org Thu Sep 10 14:26:44 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@freebsd.org Thu Sep 10 14:58:47 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@freebsd.org Thu Sep 10 15:37:10 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@freebsd.org Thu Sep 10 15:37:17 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@freebsd.org Thu Sep 10 15:37:22 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@freebsd.org Thu Sep 10 15:37:27 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@freebsd.org Thu Sep 10 15:37:34 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Sep 2020 15:37:35 -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-head@freebsd.org Thu Sep 10 16:47:14 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Sep 2020 16:47:16 -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-head@freebsd.org Thu Sep 10 17:15:45 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@freebsd.org Thu Sep 10 17:18:26 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@freebsd.org Thu Sep 10 17:21:41 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@freebsd.org Thu Sep 10 17:23:30 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@freebsd.org Thu Sep 10 17:48:28 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@freebsd.org Thu Sep 10 17:53:01 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@freebsd.org Thu Sep 10 17:58:24 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@freebsd.org Thu Sep 10 18:19:46 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@freebsd.org Thu Sep 10 18:27:53 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@freebsd.org Thu Sep 10 18:41:16 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@freebsd.org Thu Sep 10 18:49:00 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@freebsd.org Thu Sep 10 19:25:53 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@freebsd.org Thu Sep 10 20:54:45 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@freebsd.org Thu Sep 10 21:25:17 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@freebsd.org Thu Sep 10 21:31:02 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@freebsd.org Thu Sep 10 22:22:23 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@freebsd.org Thu Sep 10 23:46:14 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 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-head@freebsd.org Fri Sep 11 00:06:17 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@freebsd.org Fri Sep 11 02:02:13 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@freebsd.org Fri Sep 11 02:02:17 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@freebsd.org Fri Sep 11 05:45:28 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@freebsd.org Fri Sep 11 09:13:46 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@freebsd.org Fri Sep 11 09:15:50 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@freebsd.org Fri Sep 11 10:07:10 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@freebsd.org Fri Sep 11 12:55:28 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@freebsd.org Fri Sep 11 13:28:42 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@freebsd.org Fri Sep 11 14:02:59 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2E3813DB76E; Fri, 11 Sep 2020 14:02:59 +0000 (UTC) (envelope-from junchoon@dec.sakura.ne.jp) Received: from dec.sakura.ne.jp (dec.sakura.ne.jp [210.188.226.8]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4BnyBn6QV5z4NZK; Fri, 11 Sep 2020 14:02:57 +0000 (UTC) (envelope-from junchoon@dec.sakura.ne.jp) Received: from kalamity.joker.local (180-198-4-200.nagoya1.commufa.jp [180.198.4.200]) (authenticated bits=0) by dec.sakura.ne.jp (8.15.2/8.15.2/[SAKURA-WEB]/20080708) with ESMTPA id 08BE2nm2061247; Fri, 11 Sep 2020 23:02:49 +0900 (JST) (envelope-from junchoon@dec.sakura.ne.jp) Date: Fri, 11 Sep 2020 23:02:48 +0900 From: Tomoaki AOKI To: freebsd-current@freebsd.org Cc: svn-src-head@freebsd.org, "Bjoern A. Zeeb" Subject: Re: svn commit: r365419 - in head/sys/dev: ath bwi iwm iwn mwl otus usb/wlan wtap Message-Id: <20200911230248.d520bf8a1f3397be5d0f26c3@dec.sakura.ne.jp> In-Reply-To: <178A8155-90E0-4B3E-BBCB-D3C7CA4C62B2@FreeBSD.org> References: <20200910074135.45d5b208b083c93efbce9259@dec.sakura.ne.jp> <178A8155-90E0-4B3E-BBCB-D3C7CA4C62B2@FreeBSD.org> Reply-To: junchoon@dec.sakura.ne.jp Organization: Junchoon corps X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.32; amd64-portbld-freebsd12.1) Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-2022-JP Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4BnyBn6QV5z4NZK X-Spamd-Bar: +++ Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of junchoon@dec.sakura.ne.jp has no SPF policy when checking 210.188.226.8) smtp.mailfrom=junchoon@dec.sakura.ne.jp X-Spamd-Result: default: False [3.11 / 15.00]; HAS_REPLYTO(0.00)[junchoon@dec.sakura.ne.jp]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; REPLYTO_ADDR_EQ_FROM(0.00)[]; HAS_ORG_HEADER(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; R_DKIM_NA(0.00)[]; ASN(0.00)[asn:9370, ipnet:210.188.224.0/19, country:JP]; MID_RHS_MATCH_FROM(0.00)[]; RECEIVED_SPAMHAUS_PBL(0.00)[180.198.4.200:received]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_SPAM_SHORT(0.53)[0.528]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[sakura.ne.jp]; AUTH_NA(1.00)[]; NEURAL_SPAM_MEDIUM(0.30)[0.300]; MIME_TRACE(0.00)[0:+]; NEURAL_SPAM_LONG(0.88)[0.882]; R_SPF_NA(0.00)[no SPF record]; RCVD_COUNT_TWO(0.00)[2]; MAILMAN_DEST(0.00)[svn-src-head,freebsd-current] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Sep 2020 14:02:59 -0000 On Thu, 10 Sep 2020 10:22:05 +0000 "Bjoern A. Zeeb" wrote: > On 9 Sep 2020, at 22:41, Tomoaki AOKI wrote: > > > This breaks at least iwm. (Other drivers not tested.) > > > > Messages below are repeatedly shown and no carrier detected. > > Manually reverting this commit fixes the issue. > > > > iwm0: failed to send antennas before calibration: 35 > > iwm_run_init_ucode: failed 35 > > iwm_init_hw failed 35 > > iwm0: could not initiate scan > > > > > > and lesser times messages below. > > > > iwm0: iwm_send_phy_db_data: Cannot send HCMD of Phy DB cfg section, 35 > > iwm_init_hw failed 35 > > iwm0: could not initiate scan > > > > > I$B!G(Bll try to test iwm as well, in case you are faster, can you please > try this instead of reverting; the previous version never made it past > the first return anymore in the last years it seems, so we can remove > the function entirely to keep the status quo: > > Sorry for the oversight. Your patch (needed to fix some line wrapping, though) fixed the issue for me. Thanks! BTW, I also needed to revert r365549 [1] not to fail build, regardless your patch is applied or not. Just now, I noticed a fix is proposed [2] via phablicator by Alan Somers, but I've not tested it yet. [1] https://lists.freebsd.org/pipermail/svn-src-head/2020-September/139761.html [2] https://lists.freebsd.org/pipermail/freebsd-current/2020-September/077095.html Regards. > > > Index: if_iwm.c > =================================================================== > --- if_iwm.c (revision 365559) > +++ if_iwm.c (working copy) > @@ -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 > } > } > > -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 > > 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; > > > > > > > >> 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); > > > > (snip) > > > >> 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 > > > > (snip) > > > > > > -- > > Tomoaki AOKI > _______________________________________________ > freebsd-current@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-current > To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org" > -- Tomoaki AOKI From owner-svn-src-head@freebsd.org Fri Sep 11 14:18:48 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@freebsd.org Fri Sep 11 14:20:26 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 57D923DC114; Fri, 11 Sep 2020 14:20:26 +0000 (UTC) (envelope-from bz@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 4BnyZy1h5pz4PgX; Fri, 11 Sep 2020 14:20:26 +0000 (UTC) (envelope-from bz@FreeBSD.org) 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)) (Authenticated sender: bz/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 0303924CAB; Fri, 11 Sep 2020 14:20:26 +0000 (UTC) (envelope-from bz@FreeBSD.org) 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 F0D0F8D4A21C; Fri, 11 Sep 2020 14:20:24 +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 7C3F1E707D9; Fri, 11 Sep 2020 14:20:24 +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 XOabU2wzLfne; Fri, 11 Sep 2020 14:20:23 +0000 (UTC) Received: from [127.0.0.1] (unknown [IPv6:fde9:577b:c1a9:4902:2585:28cd:7660:77ea]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id E7468E707D8; Fri, 11 Sep 2020 14:20:22 +0000 (UTC) From: "Bjoern A. Zeeb" To: "Tomoaki AOKI" Cc: freebsd-current@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r365419 - in head/sys/dev: ath bwi iwm iwn mwl otus usb/wlan wtap Date: Fri, 11 Sep 2020 14:20:22 +0000 X-Mailer: MailMate (2.0BETAr6151) Message-ID: In-Reply-To: <20200911230248.d520bf8a1f3397be5d0f26c3@dec.sakura.ne.jp> References: <20200910074135.45d5b208b083c93efbce9259@dec.sakura.ne.jp> <178A8155-90E0-4B3E-BBCB-D3C7CA4C62B2@FreeBSD.org> <20200911230248.d520bf8a1f3397be5d0f26c3@dec.sakura.ne.jp> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Sep 2020 14:20:26 -0000 On 11 Sep 2020, at 14:02, Tomoaki AOKI wrote: > On Thu, 10 Sep 2020 10:22:05 +0000 > "Bjoern A. Zeeb" wrote: > >> On 9 Sep 2020, at 22:41, Tomoaki AOKI wrote: >> >>> This breaks at least iwm. (Other drivers not tested.) >>> >>> Messages below are repeatedly shown and no carrier detected. >>> Manually reverting this commit fixes the issue. >>> >>> iwm0: failed to send antennas before calibration: 35 >>> iwm_run_init_ucode: failed 35 >>> iwm_init_hw failed 35 >>> iwm0: could not initiate scan >>> >>> >>> and lesser times messages below. >>> >>> iwm0: iwm_send_phy_db_data: Cannot send HCMD of Phy DB cfg section, >>> 35 >>> iwm_init_hw failed 35 >>> iwm0: could not initiate scan >>> >> >> >> I’ll try to test iwm as well, in case you are faster, can you >> please >> try this instead of reverting; the previous version never made it >> past >> the first return anymore in the last years it seems, so we can remove >> the function entirely to keep the status quo: >> >> Sorry for the oversight. > > Your patch (needed to fix some line wrapping, though) fixed the issue > for me. Thanks! Committed in r365633 in HEAD. stable/12 already has the fix (#if 0ed the code). I’ll merged the change in 3 days to keep the code in sync. Thanks a lot for reporting and testing! Bjoern From owner-svn-src-head@freebsd.org Fri Sep 11 16:13:46 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@freebsd.org Fri Sep 11 16:56:38 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@freebsd.org Fri Sep 11 17:00:39 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@freebsd.org Fri Sep 11 17:04:10 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@freebsd.org Fri Sep 11 17:05:09 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@freebsd.org Fri Sep 11 18:09:50 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@freebsd.org Fri Sep 11 19:45:27 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@freebsd.org Fri Sep 11 20:32:41 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@freebsd.org Fri Sep 11 20:49:37 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@freebsd.org Fri Sep 11 21:43:35 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@freebsd.org Fri Sep 11 21:52:21 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@freebsd.org Fri Sep 11 22:27:36 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@freebsd.org Fri Sep 11 23:37:50 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 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-head@freebsd.org Sat Sep 12 00:06:46 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@freebsd.org Sat Sep 12 00:33:12 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@freebsd.org Sat Sep 12 03:20:26 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9CF473F10B3; Sat, 12 Sep 2020 03:20:26 +0000 (UTC) (envelope-from junchoon@dec.sakura.ne.jp) Received: from dec.sakura.ne.jp (dec.sakura.ne.jp [210.188.226.8]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4BpHty1rTsz4JKn; Sat, 12 Sep 2020 03:20:25 +0000 (UTC) (envelope-from junchoon@dec.sakura.ne.jp) Received: from kalamity.joker.local (180-198-4-200.nagoya1.commufa.jp [180.198.4.200]) (authenticated bits=0) by dec.sakura.ne.jp (8.15.2/8.15.2/[SAKURA-WEB]/20080708) with ESMTPA id 08C3KNik072772; Sat, 12 Sep 2020 12:20:23 +0900 (JST) (envelope-from junchoon@dec.sakura.ne.jp) Date: Sat, 12 Sep 2020 12:20:23 +0900 From: Tomoaki AOKI To: freebsd-current@freebsd.org Cc: svn-src-head@freebsd.org, "Bjoern A. Zeeb" Subject: Re: svn commit: r365419 - in head/sys/dev: ath bwi iwm iwn mwl otus usb/wlan wtap Message-Id: <20200912122023.a5493c53bffb124b80c3c6ee@dec.sakura.ne.jp> In-Reply-To: References: <20200910074135.45d5b208b083c93efbce9259@dec.sakura.ne.jp> <178A8155-90E0-4B3E-BBCB-D3C7CA4C62B2@FreeBSD.org> <20200911230248.d520bf8a1f3397be5d0f26c3@dec.sakura.ne.jp> Reply-To: junchoon@dec.sakura.ne.jp Organization: Junchoon corps X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.32; amd64-portbld-freebsd12.1) Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-2022-JP Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4BpHty1rTsz4JKn 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:9370, ipnet:210.188.224.0/19, country:JP] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Sep 2020 03:20:26 -0000 On Fri, 11 Sep 2020 14:20:22 +0000 "Bjoern A. Zeeb" wrote: > On 11 Sep 2020, at 14:02, Tomoaki AOKI wrote: > > > On Thu, 10 Sep 2020 10:22:05 +0000 > > "Bjoern A. Zeeb" wrote: > > > >> On 9 Sep 2020, at 22:41, Tomoaki AOKI wrote: > >> > >>> This breaks at least iwm. (Other drivers not tested.) > >>> > >>> Messages below are repeatedly shown and no carrier detected. > >>> Manually reverting this commit fixes the issue. > >>> > >>> iwm0: failed to send antennas before calibration: 35 > >>> iwm_run_init_ucode: failed 35 > >>> iwm_init_hw failed 35 > >>> iwm0: could not initiate scan > >>> > >>> > >>> and lesser times messages below. > >>> > >>> iwm0: iwm_send_phy_db_data: Cannot send HCMD of Phy DB cfg section, > >>> 35 > >>> iwm_init_hw failed 35 > >>> iwm0: could not initiate scan > >>> > >> > >> > >> I$B!G(Bll try to test iwm as well, in case you are faster, can you > >> please > >> try this instead of reverting; the previous version never made it > >> past > >> the first return anymore in the last years it seems, so we can remove > >> the function entirely to keep the status quo: > >> > >> Sorry for the oversight. > > > > Your patch (needed to fix some line wrapping, though) fixed the issue > > for me. Thanks! > > Committed in r365633 in HEAD. stable/12 already has the fix (#if 0ed > the code). > I$B!G(Bll merged the change in 3 days to keep the code in sync. > > > Thanks a lot for reporting and testing! > > Bjoern Confirmed. Thanks! > _______________________________________________ > freebsd-current@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-current > To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org" > -- Tomoaki AOKI From owner-svn-src-head@freebsd.org Sat Sep 12 07:04:01 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@freebsd.org Sat Sep 12 11:19:55 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@freebsd.org Sat Sep 12 11:24:37 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@freebsd.org Sat Sep 12 17:23:52 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@freebsd.org Sat Sep 12 17:24:02 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@freebsd.org Sat Sep 12 17:24:05 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@freebsd.org Sat Sep 12 18:23:27 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@freebsd.org Sat Sep 12 19:13:40 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@freebsd.org Sat Sep 12 23:49:44 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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-head@freebsd.org Sat Sep 12 23:54:58 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org 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-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 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;