From owner-svn-src-head@freebsd.org Sun Apr 16 00:07:20 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 75729D3FDAF; Sun, 16 Apr 2017 00:07:20 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-wm0-f51.google.com (mail-wm0-f51.google.com [74.125.82.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 14689A9E; Sun, 16 Apr 2017 00:07:19 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-wm0-f51.google.com with SMTP id t189so13941887wmt.1; Sat, 15 Apr 2017 17:07: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:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=Fg0mfZND90/+U03b8wyA+qBCIR9011iIVZMgoEhBuSo=; b=ODF+NgGJ04915RXe4+zoMNH61Zz6bpJ4LWODcd4HxmiNKFlVLSOMYrSH8HTn25/7Cr /FNHPufsNinz1vuOHfRJMj8+EAo2MJPy9HNZFVJLx39XjZHQv3m4dIOCoUjh4GawPKAE rF+b9X1ihRScAxHLayUCUsW8bVEQwtcKHT/E/rlEq7NmZmYR1e8UIQR6Pc69b3vIiwwt GRlzegMPskOGrdCKg0ceEYwmuVADfBUUL+yaIULJprzlgMl5U6/lF8LOWScETyDAEJIz xQHuk8RU+a/I1NZOsTUdegSHUghCe7EhvPC7T/wteps5swShY9RHKZC0EmUP9E24uq9M 2NIg== X-Gm-Message-State: AN3rC/6sFTdVI/ldHnSUHCPN5Onja4w7uHrEORjbw8Jd1GdOX62grdhP 59yTM6QW2gzVIg== X-Received: by 10.28.207.204 with SMTP id f195mr3705360wmg.72.1492300871704; Sat, 15 Apr 2017 17:01:11 -0700 (PDT) Received: from mail-wr0-f178.google.com (mail-wr0-f178.google.com. [209.85.128.178]) by smtp.gmail.com with ESMTPSA id b188sm4360346wmh.6.2017.04.15.17.01.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 15 Apr 2017 17:01:11 -0700 (PDT) Received: by mail-wr0-f178.google.com with SMTP id o21so66916248wrb.2; Sat, 15 Apr 2017 17:01:11 -0700 (PDT) X-Received: by 10.223.160.214 with SMTP id n22mr13509738wrn.198.1492300871390; Sat, 15 Apr 2017 17:01:11 -0700 (PDT) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.80.169.4 with HTTP; Sat, 15 Apr 2017 17:01:10 -0700 (PDT) In-Reply-To: <201704152337.v3FNb2m1014053@pdx.rh.CN85.dnsmgr.net> References: <201704152005.v3FK5M2j002459@repo.freebsd.org> <201704152337.v3FNb2m1014053@pdx.rh.CN85.dnsmgr.net> From: Conrad Meyer Date: Sat, 15 Apr 2017 17:01:10 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r316978 - in head: contrib/zstd etc/mtree lib lib/libzstd share/mk usr.bin usr.bin/zstd To: "Rodney W. Grimes" Cc: Baptiste Daroussin , src-committers , 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.23 Precedence: list List-Id: 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, 16 Apr 2017 00:07:20 -0000 On Sat, Apr 15, 2017 at 4:37 PM, Rodney W. Grimes wrote: > And we need this in base for what great purpose??? Can you tone down the condescension, Rod? Being rude doesn't help you make your case. We already have zlib, bzip2, and xz in base. zstd is just one more that fills an important niche. If you're not familiar with it, zstd is a relatively recent new compression algorithm that provides a better compression/performance point relative to zlib at any point along the -0/-9 curve. It performs favorably to bzip2 and xz as well, although it's not dominant at all points relative to those two. See the last figure in https://clearlinux.org/blogs/linux-os-data-compression-options-comparing-behavior for a better idea of what niche it fills. Thanks, Conrad From owner-svn-src-head@freebsd.org Sun Apr 16 00:09:47 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9B0FCD3FF09; Sun, 16 Apr 2017 00:09:47 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from mx1.scaleengine.net (mx1.scaleengine.net [209.51.186.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1C1F6C67; Sun, 16 Apr 2017 00:09:47 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from [192.168.1.10] (unknown [192.168.1.10]) (Authenticated sender: allanjude.freebsd@scaleengine.com) by mx1.scaleengine.net (Postfix) with ESMTPSA id BD6E4DEDD; Sun, 16 Apr 2017 00:09:44 +0000 (UTC) Subject: Re: svn commit: r316978 - in head: contrib/zstd etc/mtree lib lib/libzstd share/mk usr.bin usr.bin/zstd To: rgrimes@freebsd.org, Baptiste Daroussin References: <201704152337.v3FNb2m1014053@pdx.rh.CN85.dnsmgr.net> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Allan Jude Message-ID: Date: Sat, 15 Apr 2017 20:09:31 -0400 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <201704152337.v3FNb2m1014053@pdx.rh.CN85.dnsmgr.net> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="MXCfp1blvxdCEt9VCiixXb6uho1PsTtuj" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 16 Apr 2017 00:09:47 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --MXCfp1blvxdCEt9VCiixXb6uho1PsTtuj Content-Type: multipart/mixed; boundary="PlPD1NikJ78VxJFJvFBiP2SP6pVupxt1a"; protected-headers="v1" From: Allan Jude To: rgrimes@freebsd.org, Baptiste Daroussin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: Subject: Re: svn commit: r316978 - in head: contrib/zstd etc/mtree lib lib/libzstd share/mk usr.bin usr.bin/zstd References: <201704152337.v3FNb2m1014053@pdx.rh.CN85.dnsmgr.net> In-Reply-To: <201704152337.v3FNb2m1014053@pdx.rh.CN85.dnsmgr.net> --PlPD1NikJ78VxJFJvFBiP2SP6pVupxt1a Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 2017-04-15 19:37, Rodney W. Grimes wrote: > And we need this in base for what great purpose??? >=20 It is a new faster compression algorithm from the creator of LZ4, Yann Collet. It offers compression ratios similar or great than gzip, but 4-6x faster compression, and 2-3x faster decompression (in excess of 1 gigabyte per second per core). It will be used in ZFS shortly, and is expected to supplant gzip/bzip2 for compressed kernel/memdisk in the loader for pxeboot / iscsi boot etc.= >=20 >> Author: bapt >> Date: Sat Apr 15 20:05:22 2017 >> New Revision: 316978 >> URL: https://svnweb.freebsd.org/changeset/base/316978 >> >> Log: >> Import zstandard 1.1.4 in base >> =20 >> zstandard is a new compression library/tool which is very fast at >> compression/decompression >> =20 >> For now import as a private library >> --=20 Allan Jude --PlPD1NikJ78VxJFJvFBiP2SP6pVupxt1a-- --MXCfp1blvxdCEt9VCiixXb6uho1PsTtuj Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.16 (MingW32) iQIcBAEBAgAGBQJY8rY/AAoJEBmVNT4SmAt+dBwQANogMqwDoAuBTRiOoHOPns3u S46rR+hyw8+YhAvlk7PYUKnjRz+3U6GgoKI3dTA0pQssS5XWdoyDCr+U3ua6Ic0y 8UTeLwBAznNs8xCg8qVVCQT65Wb/5aRvLXAQqGwJsUNDhbv/UrxfJT0c6hwSRImv QZm7QLAP6EuoDsf4wH+zoUoCj/RcgxZdflsclHI1cx9J1H7afIP9UEwAyHhLSYj/ yfVynJVHQxWWtIImixoa32gcT+gqD1GztYCOq6MCXsbFBs02Hdn/TiX0fwhie+bs iIX03EFNlNhTlD28fWGX02MZf5C3NbBvbztfv0ccZP9FBfb0U7CvCaP3EbH/J5oZ aTn9O322pra81PlniHjDZ4pcF4SgY5V0RhKJ0Y7LYV6foVLJ7hjvoEu7GIJpWCJo U6gPa6nHMPJ5UrQQ4aNZApWoyKX4Y9UykIaHQjp/W1jgDVJxzL81lntIkQJgc2DD C+oM8f8O7dqi1nnobEzaXzt3em+1VIp7SEUUmZknMj8DbzHjSDIhDGVT93EtJu4l 25ebxduB3Gf+Ac6ys7vUTty0inhK2Z/C2Fm++mesKl0JOmdmn6V0WR9IAjZfcBAv N/i8ZS41DXo3dSbe7t4ohdp8CwfqgSFtrPJmyYMfbqSdry+BmHUBc7VmoyWtMQXb Xdps7/9NeYCIkQF8NKzE =Itcb -----END PGP SIGNATURE----- --MXCfp1blvxdCEt9VCiixXb6uho1PsTtuj-- From owner-svn-src-head@freebsd.org Sun Apr 16 01:00:27 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4885AD2AED7; Sun, 16 Apr 2017 01:00:27 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-wm0-f50.google.com (mail-wm0-f50.google.com [74.125.82.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DD214FA3; Sun, 16 Apr 2017 01:00:26 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-wm0-f50.google.com with SMTP id y18so4756262wmh.0; Sat, 15 Apr 2017 18:00: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:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=XHdeUJSdgYev7HiS8jRUliDt6izDYGN2MWr99SpCUvY=; b=snwWSs285oqb7wTyNAxrajQyf13qkeTk13/95+Nn9zQ6PiDCraa0jnIKSPhzOji7ZY 4nAMecSog26Zzk0cRPjUU9bT5hvj6up+SqM5ewpMLYOdhTH4nMku7HwjD7dLM5NaxiuS QhgsMGY0Ca8OLJjh6S4gg2dIpFDVF8bncGswf9MxB6Y4SUixbOtDjl2k7DAweAlcCnf6 HFGgM7FQtWHzE7qAf1QTE1qPf/2kLm17WCgPm5forJBBUzdHXa9KO0+fqGpBpR4Hot6v 2qStomp9ptA8NR8nlR+Iv+fFnGbyQ2BDtaPBIMNYRdtFq0oUQBA7Rg42NXHAswkeenVL MABQ== X-Gm-Message-State: AN3rC/7W1jdYdKrvrrYUUSvZqorisUYkI8XeWq713jvXYnUWRbpmNZ8Y PUn8WILMX4xXGjjBOlY= X-Received: by 10.28.198.65 with SMTP id w62mr3723416wmf.80.1492304419090; Sat, 15 Apr 2017 18:00:19 -0700 (PDT) Received: from mail-wm0-f50.google.com (mail-wm0-f50.google.com. [74.125.82.50]) by smtp.gmail.com with ESMTPSA id k199sm4484229wmd.20.2017.04.15.18.00.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 15 Apr 2017 18:00:18 -0700 (PDT) Received: by mail-wm0-f50.google.com with SMTP id u2so14180927wmu.0; Sat, 15 Apr 2017 18:00:18 -0700 (PDT) X-Received: by 10.28.16.148 with SMTP id 142mr3759831wmq.75.1492304418789; Sat, 15 Apr 2017 18:00:18 -0700 (PDT) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.80.169.4 with HTTP; Sat, 15 Apr 2017 18:00:18 -0700 (PDT) In-Reply-To: <20170415222136.6c58a00d@thor.intern.walstatt.dynvpn.de> References: <201704152003.v3FK3o3w002356@repo.freebsd.org> <20170415222136.6c58a00d@thor.intern.walstatt.dynvpn.de> From: Conrad Meyer Date: Sat, 15 Apr 2017 18:00:18 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r316977 - head/sys/dev/syscons To: "O. Hartmann" Cc: FreeBSD CURRENT , svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 16 Apr 2017 01:00:27 -0000 On Sat, Apr 15, 2017 at 1:21 PM, O. Hartmann wrote: > Am Sat, 15 Apr 2017 20:03:50 +0000 (UTC) > Bruce Evans schrieb: > >> Author: bde >> Date: Sat Apr 15 20:03:50 2017 >> New Revision: 316977 >> URL: https://svnweb.freebsd.org/changeset/base/316977 > > There is a lot of development going on theses days for syscons. What's about vt()? vt() is > considered broken for x11/nvidia-driver and vt() is considered a requirement when UEFI is > boot scheme, isn't it? > > I'm just curious. Hi O., Bruce uses syscons and cares enough to improve it. He likely does not care about UEFI and definitely does not care about vt. I don't think there's anything wrong with that. We can't force volunteers to work on things they are not interested in. Best, Conrad From owner-svn-src-head@freebsd.org Sun Apr 16 01:13:48 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6E85DD3587E; Sun, 16 Apr 2017 01:13:48 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 40C7A1AF2; Sun, 16 Apr 2017 01:13:48 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3G1DlAT028402; Sun, 16 Apr 2017 01:13:47 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3G1DlbA028401; Sun, 16 Apr 2017 01:13:47 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201704160113.v3G1DlbA028401@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sun, 16 Apr 2017 01:13:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316993 - head/contrib/ipfilter/lib X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 16 Apr 2017 01:13:48 -0000 Author: cy Date: Sun Apr 16 01:13:47 2017 New Revision: 316993 URL: https://svnweb.freebsd.org/changeset/base/316993 Log: Fix CID 1372601, possible NULL pointer dereference should reallocarray() fail. Reported by: Coverity CID 1372601 MFC after: 1 week Modified: head/contrib/ipfilter/lib/parsefields.c Modified: head/contrib/ipfilter/lib/parsefields.c ============================================================================== --- head/contrib/ipfilter/lib/parsefields.c Sat Apr 15 23:35:57 2017 (r316992) +++ head/contrib/ipfilter/lib/parsefields.c Sun Apr 16 01:13:47 2017 (r316993) @@ -32,6 +32,10 @@ wordtab_t *parsefields(table, arg) fields = malloc(2 * sizeof(*fields)); } else { fields = reallocarray(fields, num + 1, sizeof(*fields)); + if (fields == NULL) { + perror("memory allocation error at __LINE__ in __FUNCTIOIN__ in __FILE__"); + abort(); + } } if (t == NULL) { From owner-svn-src-head@freebsd.org Sun Apr 16 01:15:39 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 17C8ED35ABB; Sun, 16 Apr 2017 01:15:39 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DC2AA1D94; Sun, 16 Apr 2017 01:15:38 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3G1FcpE028511; Sun, 16 Apr 2017 01:15:38 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3G1FcL3028510; Sun, 16 Apr 2017 01:15:38 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201704160115.v3G1FcL3028510@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sun, 16 Apr 2017 01:15:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316994 - head/contrib/ipfilter/tools X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 16 Apr 2017 01:15:39 -0000 Author: cy Date: Sun Apr 16 01:15:37 2017 New Revision: 316994 URL: https://svnweb.freebsd.org/changeset/base/316994 Log: Fix CID 1372600, possible NULL pointer dereference should reallocarray() fail. Reported by: Coverity CID 1372600 MFC after: 1 week Modified: head/contrib/ipfilter/tools/ipf_y.y Modified: head/contrib/ipfilter/tools/ipf_y.y ============================================================================== --- head/contrib/ipfilter/tools/ipf_y.y Sun Apr 16 01:13:47 2017 (r316993) +++ head/contrib/ipfilter/tools/ipf_y.y Sun Apr 16 01:15:37 2017 (r316994) @@ -2195,6 +2195,10 @@ char *phrase; for (i = 0, s = strtok(phrase, " \r\n\t"); s != NULL; s = strtok(NULL, " \r\n\t"), i++) { fb = reallocarray(fb, i / 4 + 1, sizeof(*fb)); + if (fb == NULL) { + perror("memory allocation error at __LINE__ in __FUNCTION__ in __FILE"); + abort(); + } l = (u_32_t)strtol(s, NULL, 0); switch (i & 3) { From owner-svn-src-head@freebsd.org Sun Apr 16 01:40:18 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8A8ADD40BBA; Sun, 16 Apr 2017 01:40:18 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 67A72F9F; Sun, 16 Apr 2017 01:40:18 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3G1eHpA036886; Sun, 16 Apr 2017 01:40:17 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3G1eHMK036884; Sun, 16 Apr 2017 01:40:17 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201704160140.v3G1eHMK036884@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 16 Apr 2017 01:40:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316995 - head/sys/dev/mii X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 16 Apr 2017 01:40:18 -0000 Author: ian Date: Sun Apr 16 01:40:17 2017 New Revision: 316995 URL: https://svnweb.freebsd.org/changeset/base/316995 Log: Add support for the Micrel KSZ8081 ethernet PHY. The only thing this phy needs that the ukphy driver doesn't provide is that the value in the proprietary Phy Control 2 Register must be saved before doing a soft reset and restored afterwards. Most modern phys have "sticky bits" for low-level config that survive a reset, but on this one the values in all registers go back to defaults, wiping out any board- specific config set up by the bootloader/bios/whatever. Modified: head/sys/dev/mii/micphy.c head/sys/dev/mii/miidevs Modified: head/sys/dev/mii/micphy.c ============================================================================== --- head/sys/dev/mii/micphy.c Sun Apr 16 01:15:37 2017 (r316994) +++ head/sys/dev/mii/micphy.c Sun Apr 16 01:40:17 2017 (r316995) @@ -76,10 +76,13 @@ __FBSDID("$FreeBSD$"); #define MII_KSZ9031_TX_DATA_PAD_SKEW 0x6 #define MII_KSZ9031_CLOCK_PAD_SKEW 0x8 +#define MII_KSZ8081_PHYCTL2 0x1f + #define PS_TO_REG(p) ((p) / 200) static int micphy_probe(device_t); static int micphy_attach(device_t); +static void micphy_reset(struct mii_softc *); static int micphy_service(struct mii_softc *, struct mii_data *, int); static device_method_t micphy_methods[] = { @@ -102,6 +105,7 @@ static driver_t micphy_driver = { DRIVER_MODULE(micphy, miibus, micphy_driver, micphy_devclass, 0, 0); static const struct mii_phydesc micphys[] = { + MII_PHY_DESC(MICREL, KSZ8081), MII_PHY_DESC(MICREL, KSZ9021), MII_PHY_DESC(MICREL, KSZ9031), MII_PHY_END @@ -110,7 +114,7 @@ static const struct mii_phydesc micphys[ static const struct mii_phy_funcs micphy_funcs = { micphy_service, ukphy_status, - mii_phy_reset + micphy_reset }; static uint32_t @@ -257,6 +261,10 @@ micphy_attach(device_t dev) mii_phy_dev_attach(dev, MIIF_NOMANPAUSE, &micphy_funcs, 1); mii_phy_setmedia(sc); + /* Nothing further to configure for 8081 model. */ + if (sc->mii_mpd_model == MII_MODEL_MICREL_KSZ8081) + return (0); + miibus = device_get_parent(dev); parent = device_get_parent(miibus); @@ -271,6 +279,24 @@ micphy_attach(device_t dev) return (0); } +static void +micphy_reset(struct mii_softc *sc) +{ + int reg; + + /* + * The 8081 has no "sticky bits" that survive a soft reset; several bits + * in the Phy Control Register 2 must be preserved across the reset. + * These bits are set up by the bootloader; they control how the phy + * interfaces to the board (such as clock frequency and LED behavior). + */ + if (sc->mii_mpd_model == MII_MODEL_MICREL_KSZ8081) + reg = PHY_READ(sc, MII_KSZ8081_PHYCTL2); + mii_phy_reset(sc); + if (sc->mii_mpd_model == MII_MODEL_MICREL_KSZ8081) + PHY_WRITE(sc, MII_KSZ8081_PHYCTL2, reg); +} + static int micphy_service(struct mii_softc *sc, struct mii_data *mii, int cmd) { Modified: head/sys/dev/mii/miidevs ============================================================================== --- head/sys/dev/mii/miidevs Sun Apr 16 01:15:37 2017 (r316994) +++ head/sys/dev/mii/miidevs Sun Apr 16 01:40:17 2017 (r316995) @@ -282,6 +282,7 @@ model MARVELL E1000_5 0x0005 Marvell 88 model MARVELL E1111 0x000c Marvell 88E1111 Gigabit PHY /* Micrel PHYs */ +model MICREL KSZ8081 0x0016 Micrel KSZ8081 10/100 PHY model MICREL KSZ9021 0x0021 Micrel KSZ9021 10/100/1000 PHY model MICREL KSZ9031 0x0022 Micrel KSZ9031 10/100/1000 PHY From owner-svn-src-head@freebsd.org Sun Apr 16 01:50:07 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 56D92D3519E; Sun, 16 Apr 2017 01:50:07 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-wm0-f42.google.com (mail-wm0-f42.google.com [74.125.82.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EC01E18E6; Sun, 16 Apr 2017 01:50:06 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-wm0-f42.google.com with SMTP id o81so15115916wmb.1; Sat, 15 Apr 2017 18:50: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:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=02nqjgniJ9dQSXb2knYaGpPLIstMh8S8IlASkZnie3g=; b=SA6fM1PT26DtqYtCxK6hm10IqEWTfZ53Xe7YAgQBbaCb5Ey0s5IM8XmbQJCw8VXxHj I4GGaJ0SkYWFAupa1q+CDoWG3m91bA02iXtE11EohF82lDi4dWxqjJClYbpp0Z+O6KGG DSE5Ko0wIBUc1wo8dCof49Z0BzjYMljIoX1kj2PDYI1h9J4e03APGXFBCylq0DTsWDoY En3jbxVWpiTt99uuDcGGA/7LXpZnj/w+xZls9aD4B9OfBh62KElsnJLJhRkU/WDjh88s qcCWqHjX53u2UpyU0l1H/7BoUJsyhs8yhU5GhwtLjdraf6H5afKuZ8xekAInl6Idbk+P FBVQ== X-Gm-Message-State: AN3rC/4Zb/kqtrt4xov4jXGvl313vaNyjpQ89ovS98RTARG0z57KKj3G 4WyqU4+ziuvOntgJTlY= X-Received: by 10.28.86.68 with SMTP id k65mr4018304wmb.112.1492307399084; Sat, 15 Apr 2017 18:49:59 -0700 (PDT) Received: from mail-wm0-f53.google.com (mail-wm0-f53.google.com. [74.125.82.53]) by smtp.gmail.com with ESMTPSA id v8sm55641wrd.42.2017.04.15.18.49.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 15 Apr 2017 18:49:59 -0700 (PDT) Received: by mail-wm0-f53.google.com with SMTP id o81so15115852wmb.1; Sat, 15 Apr 2017 18:49:58 -0700 (PDT) X-Received: by 10.28.16.148 with SMTP id 142mr3836682wmq.75.1492307398778; Sat, 15 Apr 2017 18:49:58 -0700 (PDT) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.80.169.4 with HTTP; Sat, 15 Apr 2017 18:49:58 -0700 (PDT) In-Reply-To: <201704160113.v3G1DlbA028401@repo.freebsd.org> References: <201704160113.v3G1DlbA028401@repo.freebsd.org> From: Conrad Meyer Date: Sat, 15 Apr 2017 18:49:58 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r316993 - head/contrib/ipfilter/lib To: Cy Schubert Cc: src-committers , 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.23 Precedence: list List-Id: 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, 16 Apr 2017 01:50:07 -0000 On Sat, Apr 15, 2017 at 6:13 PM, Cy Schubert wrote: > Author: cy > Date: Sun Apr 16 01:13:47 2017 > New Revision: 316993 > URL: https://svnweb.freebsd.org/changeset/base/316993 > > Log: > Fix CID 1372601, possible NULL pointer dereference should > reallocarray() fail. > > Reported by: Coverity CID 1372601 > MFC after: 1 week > > Modified: > head/contrib/ipfilter/lib/parsefields.c > > Modified: head/contrib/ipfilter/lib/parsefields.c > ============================================================================== > --- head/contrib/ipfilter/lib/parsefields.c Sat Apr 15 23:35:57 2017 (r316992) > +++ head/contrib/ipfilter/lib/parsefields.c Sun Apr 16 01:13:47 2017 (r316993) > @@ -32,6 +32,10 @@ wordtab_t *parsefields(table, arg) > fields = malloc(2 * sizeof(*fields)); > } else { > fields = reallocarray(fields, num + 1, sizeof(*fields)); > + if (fields == NULL) { > + perror("memory allocation error at __LINE__ in __FUNCTIOIN__ in __FILE__"); Hey Cy, Does this actually work? I was under the impression it wouldn't work. Instead, maybe warnx("... error at %d in %s in %s", __LINE__, __func__, __FILE__)? Best, Conrad From owner-svn-src-head@freebsd.org Sun Apr 16 03:34:42 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7860AD40799; Sun, 16 Apr 2017 03:34:42 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 25199309; Sun, 16 Apr 2017 03:34:41 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from spqr.komquats.com ([96.50.22.10]) by shaw.ca with SMTP id zaxNcUaVIsa1kzaxOcitIA; Sat, 15 Apr 2017 21:34:35 -0600 X-Authority-Analysis: v=2.2 cv=W+NIbVek c=1 sm=1 tr=0 a=jvE2nwUzI0ECrNeyr98KWA==:117 a=jvE2nwUzI0ECrNeyr98KWA==:17 a=kj9zAlcOel0A:10 a=AzvcPWV-tVgA:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=zm8RW0_Aktz8uO5TyfIA:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy8 [10.2.2.6]) by spqr.komquats.com (Postfix) with ESMTPS id EEEB62028; Sat, 15 Apr 2017 20:34:32 -0700 (PDT) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id v3G3YWKc032550; Sat, 15 Apr 2017 20:34:32 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201704160334.v3G3YWKc032550@slippy.cwsent.com> X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.6 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: cem@freebsd.org cc: Cy Schubert , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r316993 - head/contrib/ipfilter/lib In-Reply-To: Message from Conrad Meyer of "Sat, 15 Apr 2017 18:49:58 -0700." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sat, 15 Apr 2017 20:34:32 -0700 X-CMAE-Envelope: MS4wfIEK3Bs2fGGmEUAhrkx56psDQGGFR0XxEblyMT8zu+RC/IKX//jPvHGpPahSMuDCSz4AM7VdW0LMPmV+LWnO37oqjhRr6Crpux1h631LZCx1qvqL5ztw y1OGO85KQwGWNUsigQ9c0apMC4Rw3Cl04lJpY5qb9CZdh9JWbP0NYUofDubRmxkIdb1+HVTguhqfr213DO+VX/BaA3WFoenVaEoITUB6MGuU9RVkdaNdZ8eH PNOJg/b/206Tg1kjzkNwmeSFjMk7iVDU3IMSHBXmiCOEWPtAqXrtP62U+Gedk75/PIWjCxVrm6w6abP9bgudCw== X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 16 Apr 2017 03:34:42 -0000 In message , Conrad Meyer writes: > On Sat, Apr 15, 2017 at 6:13 PM, Cy Schubert wrote: > > Author: cy > > Date: Sun Apr 16 01:13:47 2017 > > New Revision: 316993 > > URL: https://svnweb.freebsd.org/changeset/base/316993 > > > > Log: > > Fix CID 1372601, possible NULL pointer dereference should > > reallocarray() fail. > > > > Reported by: Coverity CID 1372601 > > MFC after: 1 week > > > > Modified: > > head/contrib/ipfilter/lib/parsefields.c > > > > Modified: head/contrib/ipfilter/lib/parsefields.c > > =========================================================================== > === > > --- head/contrib/ipfilter/lib/parsefields.c Sat Apr 15 23:35:57 2017 > (r316992) > > +++ head/contrib/ipfilter/lib/parsefields.c Sun Apr 16 01:13:47 2017 > (r316993) > > @@ -32,6 +32,10 @@ wordtab_t *parsefields(table, arg) > > fields = malloc(2 * sizeof(*fields)); > > } else { > > fields = reallocarray(fields, num + 1, sizeof(*fiel > ds)); > > + if (fields == NULL) { > > + perror("memory allocation error at __LINE__ > in __FUNCTIOIN__ in __FILE__"); > > Hey Cy, > > Does this actually work? I was under the impression it wouldn't work. > Instead, maybe warnx("... error at %d in %s in %s", __LINE__, > __func__, __FILE__)? You are indeed correct Conrad. My mistake. I'll fix it right away. Thanks for pointing this out. -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-head@freebsd.org Sun Apr 16 03:49:15 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A713CD40E39; Sun, 16 Apr 2017 03:49:15 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5F276C29; Sun, 16 Apr 2017 03:49:15 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3G3nEKj091375; Sun, 16 Apr 2017 03:49:14 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3G3nEgi091374; Sun, 16 Apr 2017 03:49:14 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201704160349.v3G3nEgi091374@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 16 Apr 2017 03:49:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316996 - head/sys/dev/ffec X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 16 Apr 2017 03:49:15 -0000 Author: ian Date: Sun Apr 16 03:49:14 2017 New Revision: 316996 URL: https://svnweb.freebsd.org/changeset/base/316996 Log: Add imx6ul SoC support, and get the PHY number from the FDT data. If there is no phy-handle property, fall back to using MII_PHY_ANY. This still doesn't support an mdio bus with multiple PHYs on it, or the possibility that the PHY being used by this instance of ffec is on the mdio bus of some other instance (which is now a possibility with imx6ul). Adding that support will require changes in fdt_get_phyaddr(), which is currently making some assumptions that don't work with modern fdt data. Modified: head/sys/dev/ffec/if_ffec.c Modified: head/sys/dev/ffec/if_ffec.c ============================================================================== --- head/sys/dev/ffec/if_ffec.c Sun Apr 16 01:40:17 2017 (r316995) +++ head/sys/dev/ffec/if_ffec.c Sun Apr 16 03:49:14 2017 (r316996) @@ -78,6 +78,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -113,6 +114,7 @@ static struct ofw_compat_data compat_dat {"fsl,imx51-fec", FECTYPE_GENERIC}, {"fsl,imx53-fec", FECTYPE_IMX53}, {"fsl,imx6q-fec", FECTYPE_IMX6 | FECFLAG_GBE}, + {"fsl,imx6ul-fec", FECTYPE_IMX6}, {"fsl,mvf600-fec", FECTYPE_MVF}, {"fsl,mvf-fec", FECTYPE_MVF}, {NULL, FECTYPE_NONE}, @@ -1424,8 +1426,9 @@ ffec_attach(device_t dev) struct ffec_softc *sc; struct ifnet *ifp = NULL; struct mbuf *m; + void *dummy; phandle_t ofw_node; - int error, rid; + int error, phynum, rid; uint8_t eaddr[ETHER_ADDR_LEN]; char phy_conn_name[32]; uint32_t idx, mscr; @@ -1695,8 +1698,11 @@ ffec_attach(device_t dev) ffec_miigasket_setup(sc); /* Attach the mii driver. */ + if (fdt_get_phyaddr(ofw_node, dev, &phynum, &dummy) != 0) { + phynum = MII_PHY_ANY; + } error = mii_attach(dev, &sc->miibus, ifp, ffec_media_change, - ffec_media_status, BMSR_DEFCAPMASK, MII_PHY_ANY, MII_OFFSET_ANY, + ffec_media_status, BMSR_DEFCAPMASK, phynum, MII_OFFSET_ANY, (sc->fectype & FECTYPE_MVF) ? MIIF_FORCEANEG : 0); if (error != 0) { device_printf(dev, "PHY attach failed\n"); From owner-svn-src-head@freebsd.org Sun Apr 16 04:36:23 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 60E8AD40EC2; Sun, 16 Apr 2017 04:36:23 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 279D5355; Sun, 16 Apr 2017 04:36:23 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3G4aM3S011471; Sun, 16 Apr 2017 04:36:22 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3G4aMtX011469; Sun, 16 Apr 2017 04:36:22 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201704160436.v3G4aMtX011469@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sun, 16 Apr 2017 04:36:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316997 - in head/contrib/ipfilter: lib tools X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 16 Apr 2017 04:36:23 -0000 Author: cy Date: Sun Apr 16 04:36:22 2017 New Revision: 316997 URL: https://svnweb.freebsd.org/changeset/base/316997 Log: Use warnx() to issue error message. Reported by: cem MFC after: 1 week X-MFC with: r316993, r316994 Modified: head/contrib/ipfilter/lib/parsefields.c head/contrib/ipfilter/tools/ipf_y.y Modified: head/contrib/ipfilter/lib/parsefields.c ============================================================================== --- head/contrib/ipfilter/lib/parsefields.c Sun Apr 16 03:49:14 2017 (r316996) +++ head/contrib/ipfilter/lib/parsefields.c Sun Apr 16 04:36:22 2017 (r316997) @@ -1,4 +1,5 @@ #include "ipf.h" +#include extern int nohdrfields; @@ -33,7 +34,7 @@ wordtab_t *parsefields(table, arg) } else { fields = reallocarray(fields, num + 1, sizeof(*fields)); if (fields == NULL) { - perror("memory allocation error at __LINE__ in __FUNCTIOIN__ in __FILE__"); + warnx("memory allocation error at %d in %s in %s", __LINE__, __FUNCTION__, __FILE__); abort(); } } Modified: head/contrib/ipfilter/tools/ipf_y.y ============================================================================== --- head/contrib/ipfilter/tools/ipf_y.y Sun Apr 16 03:49:14 2017 (r316996) +++ head/contrib/ipfilter/tools/ipf_y.y Sun Apr 16 04:36:22 2017 (r316997) @@ -9,6 +9,7 @@ #include "ipf.h" #include #include +#include #ifdef IPFILTER_BPF # include #endif @@ -2196,7 +2197,7 @@ char *phrase; s = strtok(NULL, " \r\n\t"), i++) { fb = reallocarray(fb, i / 4 + 1, sizeof(*fb)); if (fb == NULL) { - perror("memory allocation error at __LINE__ in __FUNCTION__ in __FILE"); + warnx("memory allocation error at %d in %s in %s", __LINE__, __FUNCTION__, __FILE__); abort(); } l = (u_32_t)strtol(s, NULL, 0); From owner-svn-src-head@freebsd.org Sun Apr 16 05:55:57 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E8C80D401DB; Sun, 16 Apr 2017 05:55:57 +0000 (UTC) (envelope-from ohartmann@walstatt.org) Received: from mout.gmx.net (mout.gmx.net [212.227.17.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "mout.gmx.net", Issuer "TeleSec ServerPass DE-2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 567A5971; Sun, 16 Apr 2017 05:55:56 +0000 (UTC) (envelope-from ohartmann@walstatt.org) Received: from thor.intern.walstatt.dynvpn.de ([85.179.171.81]) by mail.gmx.com (mrgmx101 [212.227.17.168]) with ESMTPSA (Nemesis) id 0MeLKt-1cgC4a3V8B-00QDYi; Sun, 16 Apr 2017 07:55:48 +0200 Date: Sun, 16 Apr 2017 07:55:42 +0200 From: "O. Hartmann" To: Conrad Meyer Cc: "O. Hartmann" , FreeBSD CURRENT , svn-src-head@freebsd.org Subject: Re: svn commit: r316977 - head/sys/dev/syscons Message-ID: <20170416075542.022a6902@thor.intern.walstatt.dynvpn.de> In-Reply-To: References: <201704152003.v3FK3o3w002356@repo.freebsd.org> <20170415222136.6c58a00d@thor.intern.walstatt.dynvpn.de> Organization: WALSTATT User-Agent: OutScare 3.1415926 X-Operating-System: ImNotAnOperatingSystem 3.141592527 MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; boundary="Sig_/WSu=GdvWPS08CKy1jY_SEBF"; protocol="application/pgp-signature" X-Provags-ID: V03:K0:/xKb95J8zaMlATHKzDcJfzrLgWt8cvFNATXXybNDl7WwsMqKzap XCjgUv8H5eiAhWVS+C/XctsoAY7JtYEw8n4nhf98jO1kqfyYg3s1TgAOYlFa9/KwAAs7yVl LgGxmE3mrUEUrn086n9paorLZ/Jp0Lp4Zfx320+TK8KAnq9KN+CMuoX+0B58wdQVCyiLQgW slbESA/TyHzRfpZ6wrtiA== X-UI-Out-Filterresults: notjunk:1;V01:K0:BcKZepVaSSc=:AwNOHkU9TCBexfZGopXSen 5SZSrePG39j6kmwKCLdHcem8QSwG9Sqmlx5w6DlfuOVH2cyTH2k7HCIWfBngN+FQFRSZMMHGl EwkebrFjD5ZRzqZkdXipfy3LSwWMQwKYeZfzQ2kiqTNzTCCB3ujkbd5a0L4881nMBTl1yMy6v T+8DwFjUqgek31+WckqTaHmzdXL1jYyI3jgq8+uYS66RannlMA7hIedMcZ3IP5e3fLT0CJXWe 2M20fqieQ7kLGm38lvY5h5VW//x99nRBhS03qFGxH+DDzlDjn+MYiqE5RIIJSgTN9jn0DmjzN XPcQ0kFbXcPo1l7Z5IdJhaABRc8U6NsfKR7MO6WvmYioTYTXV/Kg5Mh3gDZ4dzk3IfJpu0jnx aPxuSUPWash1OYH2Sv8ZH6l8dgz86ByxcakCRNLyUlyiK8EQ8jRvk/4kQz7MVNLfRNNn42U+d i+cIK94qcm8f9xV7akUpqf4KV+u2/jiL7KErc8Y3zNZMh045IP3IbVDbyLWPUD+tbU+NiDiKb pGs6JVQIwoey2hTIGrD9LiB6n5k4kVIRJDGf3+RdNok86sePt3xxOV6r+rVUGn0y0cdx2PhAy A3VchctW4oyjMrP6+PPkXX75etQPktfAfDKsLWFZ0APftOynb3e55RCI7dVxWMgl1eIFe8mnj 0Z4zfp4k6FWLNbF0Mu31VWN064617JcyxOS3fdV41/aTkUOLRF704DGiE+B4JslV0LHo7/Y5W rbLAfcFdFydn0uvUzXsxLSCT/mTF2dr75hpILIoiBwAINufMNraq/BXzEjY= X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 16 Apr 2017 05:55:58 -0000 --Sig_/WSu=GdvWPS08CKy1jY_SEBF Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Am Sat, 15 Apr 2017 18:00:18 -0700 Conrad Meyer schrieb: > On Sat, Apr 15, 2017 at 1:21 PM, O. Hartmann wro= te: > > Am Sat, 15 Apr 2017 20:03:50 +0000 (UTC) > > Bruce Evans schrieb: > > =20 > >> Author: bde > >> Date: Sat Apr 15 20:03:50 2017 > >> New Revision: 316977 > >> URL: https://svnweb.freebsd.org/changeset/base/316977 =20 > > > > There is a lot of development going on theses days for syscons. What's = about vt()? > > vt() is considered broken for x11/nvidia-driver and vt() is considered = a requirement > > when UEFI is boot scheme, isn't it? > > > > I'm just curious. =20 >=20 > Hi O., >=20 > Bruce uses syscons and cares enough to improve it. He likely does not > care about UEFI and definitely does not care about vt. I don't think > there's anything wrong with that. We can't force volunteers to work > on things they are not interested in. >=20 > Best, > Conrad Hello Conrad, happy easter. There is and was never intention to apply "force", it is a question as I'm = curious about what's going on with vt() - no personally bound to B. Evans or anybody else= - I just took the chance to comment/ask on that subject when I saw postings. Maybe not the right place to spread some thinkings. Regards, Oliver Hartmann --=20 O. Hartmann Ich widerspreche der Nutzung oder =C3=9Cbermittlung meiner Daten f=C3=BCr Werbezwecke oder f=C3=BCr die Markt- oder Meinungsforschung (=C2=A7 28 Abs.= 4 BDSG). --Sig_/WSu=GdvWPS08CKy1jY_SEBF Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iLUEARMKAB0WIQQZVZMzAtwC2T/86TrS528fyFhYlAUCWPMHXgAKCRDS528fyFhY lFexAf9TvyZUso000fxuZ8DWTzm+BscvcKdYNl4+Qnb9LUcga8hCqfcUahXDCjtY mGUY+hGpEZZ2KbS73npGi+t0zQF6AgCeMCEa4p96aESdZiJJR22SNPzAKULw9kh4 EuDVDv/cVpO+bEsuK6M03gRZkzv7qzGodsqhLLHu8WX9DExEVNus =TmDr -----END PGP SIGNATURE----- --Sig_/WSu=GdvWPS08CKy1jY_SEBF-- From owner-svn-src-head@freebsd.org Sun Apr 16 06:47:21 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 37500D40287; Sun, 16 Apr 2017 06:47:21 +0000 (UTC) (envelope-from kob6558@gmail.com) Received: from mail-pf0-x236.google.com (mail-pf0-x236.google.com [IPv6:2607:f8b0:400e:c00::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 07C8EBFC; Sun, 16 Apr 2017 06:47:21 +0000 (UTC) (envelope-from kob6558@gmail.com) Received: by mail-pf0-x236.google.com with SMTP id c198so54623528pfc.1; Sat, 15 Apr 2017 23:47:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=GY0BOWWl7Pie0xv8lYNGwWTvp9YgO+sJUabxJAEK4jI=; b=N9V51k7qCKiLJaawwn+3yxlJ+kWOeil1t4fLXtIgbk/BmXDpsqAPBPIpprbfbOAN37 GJ0ouo8h0PZ1KEK1OScyxk4WhkZKPTHle+BETEUDWFCIHibRAdD7RhswcdvK+IgvX+SR 6O9h9iJlzfkrarhHT/jF3K9b4CVdKdZnvHj4YrNPIgeURACgZMQNQgptXuUbYJDcR+1c OeGD5v0eRivntkOgsffNHPK7kOCg02CDuZRNUtB4vSxD4FiBMgqQOQSqGIsjogfGctvB Fhxa9h8qWg/8Nrr48cK1xF4q5M4pEi+V38mbKBOSyv7YMIPNg2sCl+xtgIST3Yr1sZr+ dMbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=GY0BOWWl7Pie0xv8lYNGwWTvp9YgO+sJUabxJAEK4jI=; b=IhHIWhFtmn3mwuF4mY+CE+OUU2ewlYlF987amplm0641ZeWaALZIQEuMC7FgBhBXGs 2CenNR4MMsRbSPWUWPaTP4toPuhsye/mOTi5jqeyIn11XgnWj8hs1kOyo4ji4XGDKwt6 SAF3svLkAfHlXx/ku/brD+w523awVqnqcLgfGqNqgQpz05MK/RbYgsF5k5JjNCOpOudx u1M8jS5xG0QASxE6SsSKURSVrY+TJQhQaLUYUEVv1C/XDxFOVwBKscuS2OACuv0fgDoL dCXF/M7NTeJ/D5QnCezwIZjc4nNce54Ywc+nSQr2gGaJRAY3mtlggv4uY/VphB/sQYXn Pi4Q== X-Gm-Message-State: AN3rC/5wHFAC70hG4vMJcNAwfty+btLLNFNpUEUd+Ed2kpaqnQmE5T/k iw4R5TYDCmbnaVAnyQveSNKMmWs6f5NwGRs= X-Received: by 10.84.175.67 with SMTP id s61mr7681394plb.126.1492325240586; Sat, 15 Apr 2017 23:47:20 -0700 (PDT) MIME-Version: 1.0 Sender: kob6558@gmail.com Received: by 10.100.138.15 with HTTP; Sat, 15 Apr 2017 23:47:19 -0700 (PDT) In-Reply-To: <20170416075542.022a6902@thor.intern.walstatt.dynvpn.de> References: <201704152003.v3FK3o3w002356@repo.freebsd.org> <20170415222136.6c58a00d@thor.intern.walstatt.dynvpn.de> <20170416075542.022a6902@thor.intern.walstatt.dynvpn.de> From: Kevin Oberman Date: Sat, 15 Apr 2017 23:47:19 -0700 X-Google-Sender-Auth: RCRAKx3Jwd14RMnvRraj9LV7cFg Message-ID: Subject: Re: svn commit: r316977 - head/sys/dev/syscons To: "O. Hartmann" Cc: Conrad Meyer , FreeBSD CURRENT , svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 16 Apr 2017 06:47:21 -0000 On Sat, Apr 15, 2017 at 10:55 PM, O. Hartmann wrote: > Am Sat, 15 Apr 2017 18:00:18 -0700 > Conrad Meyer schrieb: > > > On Sat, Apr 15, 2017 at 1:21 PM, O. Hartmann > wrote: > > > Am Sat, 15 Apr 2017 20:03:50 +0000 (UTC) > > > Bruce Evans schrieb: > > > > > >> Author: bde > > >> Date: Sat Apr 15 20:03:50 2017 > > >> New Revision: 316977 > > >> URL: https://svnweb.freebsd.org/changeset/base/316977 > > > > > > There is a lot of development going on theses days for syscons. What's > about vt()? > > > vt() is considered broken for x11/nvidia-driver and vt() is considered > a requirement > > > when UEFI is boot scheme, isn't it? > > > > > > I'm just curious. > > > > Hi O., > > > > Bruce uses syscons and cares enough to improve it. He likely does not > > care about UEFI and definitely does not care about vt. I don't think > > there's anything wrong with that. We can't force volunteers to work > > on things they are not interested in. > > > > Best, > > Conrad > > Hello Conrad, happy easter. > > There is and was never intention to apply "force", it is a question as I'm > curious about > what's going on with vt() - no personally bound to B. Evans or anybody > else - I just took > the chance to comment/ask on that subject when I saw postings. > > Maybe not the right place to spread some thinkings. > > Regards, > > Oliver Hartmann > vt(4) is not a pleasant thing to look at. I am not implying that it is bad code or badly done. I am just saying that it is pretty gnarly and is not the sort of thing most enjoy dealing with. I got the distinct feeling that ray@ found the job much uglier than he anticipated when he took the Foundation commission to write it. Since then it has been widely disparaged for the things that it does not do, but I am not aware that anyone has gotten further than looking at what is needed and then running far away.Some day someone (or some company) will get sufficiently inspired to either re-write if or add the missing features. I have no idea when that might happen, though. -- Kevin Oberman, Part time kid herder and retired Network Engineer E-mail: rkoberman@gmail.com PGP Fingerprint: D03FB98AFA78E3B78C1694B318AB39EF1B055683 From owner-svn-src-head@freebsd.org Sun Apr 16 07:07:59 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EFEAFD4078F; Sun, 16 Apr 2017 07:07:59 +0000 (UTC) (envelope-from ohartmann@walstatt.org) Received: from mout.gmx.net (mout.gmx.net [212.227.17.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "mout.gmx.net", Issuer "TeleSec ServerPass DE-2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5BCE57C1; Sun, 16 Apr 2017 07:07:58 +0000 (UTC) (envelope-from ohartmann@walstatt.org) Received: from thor.intern.walstatt.dynvpn.de ([85.179.169.106]) by mail.gmx.com (mrgmx103 [212.227.17.168]) with ESMTPSA (Nemesis) id 0MV6PJ-1cXxTD2B1Z-00YVGe; Sun, 16 Apr 2017 09:07:54 +0200 Date: Sun, 16 Apr 2017 09:07:47 +0200 From: "O. Hartmann" To: Kevin Oberman Cc: "O. Hartmann" , Conrad Meyer , FreeBSD CURRENT , svn-src-head@freebsd.org Subject: Re: svn commit: r316977 - head/sys/dev/syscons Message-ID: <20170416090747.5154d7a5@thor.intern.walstatt.dynvpn.de> In-Reply-To: References: <201704152003.v3FK3o3w002356@repo.freebsd.org> <20170415222136.6c58a00d@thor.intern.walstatt.dynvpn.de> <20170416075542.022a6902@thor.intern.walstatt.dynvpn.de> Organization: WALSTATT User-Agent: OutScare 3.1415926 X-Operating-System: ImNotAnOperatingSystem 3.141592527 MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; boundary="Sig_/EjWsezWUoSFHAzLKiVkrOOq"; protocol="application/pgp-signature" X-Provags-ID: V03:K0:dbkRiTqNn/7a0xGwaMsZMSWTkQRFoLxL0bQBn3PSNTu3jpnkq3T AH0DFJKhIKp8mAG1VVkFggkut9YFpcpNpspx4zjuMk9MP6VZgJbR5qt2Z/0KS1G5RbeNFj6 g42koQHCTinIAgsjs+8fZirQm9i4azyg15omVRwgTlwb6aH2mUA9hQx5Md+EuyGMtduid5f eovjO6gMWgvY9NAVtHh9Q== X-UI-Out-Filterresults: notjunk:1;V01:K0:aZcPHcpEwbE=:PmVUA34MKbDTXIt7GuQo32 zSLpzJ9u3yunbXUh7reECcaYrMIXVAKbRG37w2+NqdT/h0zOxOA96zQypNY8caz9tKs7ZgK1L DBReb+9DyRx0th/c5raUeTJMdlLLuRAUauosVZaUd8kRXnL2lDMoq2+9Sd0ubM/PGpU2txED8 MLmq48o1uEDzHkXDu2oBxITZUeW+GIbmBE2Lu9Y5ghFT5p5A9SN27ZK0Up8PYeYgwvrUt31SD 4PNPigXZVPP386YA+6t2kTh56aFCxQEtFMReWtU3ws3PMF6WZhgtW874dhdP2TWzGTw7pGu/9 tMC85ndW3KRU3ix9ZFGtrBhEM0O2VJzm0ucPAiE0+UnJRfLc4ocRLtPxBiHBBQlyrHz42rjLs Dx1UxRtXkxihTRM/mVdDLejv4bTU77T8TOHoEsFpX8Sj7uNoGetR8P+6cJB77VYKpZunl2+6B Wq3SI9RpaSqvYcbm62JEdM4gsEg7JY/IvX6YsBmI+f3yJH9Rap6v77Q31e88BPlzOHeBBcK2F bv/it2gYRtnsx94Ac0Y+u8yzyHWDhAGh7Y56pXLNUbq2JdCWEx2H0r3fdO21Y0S8JrAwWLMiS bVMGZVFyihADhaCc6hEz2fufI6CTlUyMoxRJ5riMPt18j1sHdeUN4lIsLV4DfVNe5yhOOTdQA /bLcNw8DrwQQ132uI9uUsDIj/i6YiY5ZDcPi1fN3OtGkesUhcu9GTUfMzFfIvJbwC85IpOFyG jxPa3ONs/KAI3DxWmwooE5/wqO/IXTiqx4E/Iro2CPqN09ka64scJeWaSm4= X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 16 Apr 2017 07:08:00 -0000 --Sig_/EjWsezWUoSFHAzLKiVkrOOq Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Am Sat, 15 Apr 2017 23:47:19 -0700 Kevin Oberman schrieb: > On Sat, Apr 15, 2017 at 10:55 PM, O. Hartmann > wrote: >=20 > > Am Sat, 15 Apr 2017 18:00:18 -0700 > > Conrad Meyer schrieb: > > =20 > > > On Sat, Apr 15, 2017 at 1:21 PM, O. Hartmann = =20 > > wrote: =20 > > > > Am Sat, 15 Apr 2017 20:03:50 +0000 (UTC) > > > > Bruce Evans schrieb: > > > > =20 > > > >> Author: bde > > > >> Date: Sat Apr 15 20:03:50 2017 > > > >> New Revision: 316977 > > > >> URL: https://svnweb.freebsd.org/changeset/base/316977 =20 > > > > > > > > There is a lot of development going on theses days for syscons. Wha= t's =20 > > about vt()? =20 > > > > vt() is considered broken for x11/nvidia-driver and vt() is conside= red =20 > > a requirement =20 > > > > when UEFI is boot scheme, isn't it? > > > > > > > > I'm just curious. =20 > > > > > > Hi O., > > > > > > Bruce uses syscons and cares enough to improve it. He likely does not > > > care about UEFI and definitely does not care about vt. I don't think > > > there's anything wrong with that. We can't force volunteers to work > > > on things they are not interested in. > > > > > > Best, > > > Conrad =20 > > > > Hello Conrad, happy easter. > > > > There is and was never intention to apply "force", it is a question as = I'm > > curious about > > what's going on with vt() - no personally bound to B. Evans or anybody > > else - I just took > > the chance to comment/ask on that subject when I saw postings. > > > > Maybe not the right place to spread some thinkings. > > > > Regards, > > > > Oliver Hartmann > > =20 >=20 > vt(4) is not a pleasant thing to look at. I am not implying that it is bad > code or badly done. I am just saying that it is pretty gnarly and is not > the sort of thing most enjoy dealing with. I got the distinct feeling that > ray@ found the job much uglier than he anticipated when he took the > Foundation commission to write it. Since then it has been widely disparag= ed > for the things that it does not do, but I am not aware that anyone has > gotten further than looking at what is needed and then running far > away.Some day someone (or some company) will get sufficiently inspired to > either re-write if or add the missing features. I have no idea when that > might happen, though. > -- > Kevin Oberman, Part time kid herder and retired Network Engineer > E-mail: rkoberman@gmail.com > PGP Fingerprint: D03FB98AFA78E3B78C1694B318AB39EF1B055683 Hello Kevin. So, what you say is: vt(4) is a kind of unwanted child, not to say: "part t= ime orphaned"? As far as I know, vt(4) is a requirement for UEFI/EFI booting. We do so wer= e we can and so we rely on vt(4). Please correct me if I'm wrong. We also use vt(4) with pleasure for most of our servers's consoles - due to= the great improvements due to the higher resolution which makes it very easy to edit = files/issue commands/get results on the console. Especially in an experimental environm= ent for science, where a sophisticated infrastructure isn't available like graphica= l terminals and so on. Personally, I use FreeBSD even as workstation, apart from others, equipted = with the only-left working GPU vendor, nVidia, for high-performance graphics (Intel = iGPU is fine for laptops, but ... ), and here we run into a serious problem: on all nVid= ia driven systems, with the newer drivers the console is garbage (on non-vt) when usi= ng sc(4) on legacy booting boxes, with UEFI, vt(4) and nvidia produce a blank console.= =20 I've already written a message to nVidia, but with no response until now for more than h= alf a year and the issue is present more than a year(!!!). As long as the nvidia kernel mo= dule is loaded, the console is unusable and the nvidia module somehow blocks rebooting some= of our Fujitsu Celsius workstations. On a test box, I run 381.09 - the same proble= ms. By definition, vt(4) and nVidia driver has to be considered broken and this= should be reflected then in some message from the driver - but this isn't a subject f= or this list. Thanks for your patience to read and answer. Happy Easter, Oliver Hartmann --=20 O. Hartmann Ich widerspreche der Nutzung oder =C3=9Cbermittlung meiner Daten f=C3=BCr Werbezwecke oder f=C3=BCr die Markt- oder Meinungsforschung (=C2=A7 28 Abs.= 4 BDSG). --Sig_/EjWsezWUoSFHAzLKiVkrOOq Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iLUEARMKAB0WIQQZVZMzAtwC2T/86TrS528fyFhYlAUCWPMYQwAKCRDS528fyFhY lLGkAfwJS9bfXMUsXbph0PbOcCOdEcMOuPQdtrZ0AycE34GXgHywycHmbIjD22G4 9E8dkVsOZ3znS5ENnFu4MA5NKO2HAf449rp2rVf3ANte2cTCbSo25+luKbQjFsDT kQdp5MdozsrxJEUDS8HdEWSS9TtHGh7oZFyBhILTK7QNjHFpByQ1 =GcB2 -----END PGP SIGNATURE----- --Sig_/EjWsezWUoSFHAzLKiVkrOOq-- From owner-svn-src-head@freebsd.org Sun Apr 16 07:35:52 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D3B75D40F59; Sun, 16 Apr 2017 07:35:52 +0000 (UTC) (envelope-from bapt@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B344F15FA; Sun, 16 Apr 2017 07:35:52 +0000 (UTC) (envelope-from bapt@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1235) id D9638663F; Sun, 16 Apr 2017 07:35:51 +0000 (UTC) Date: Sun, 16 Apr 2017 09:35:51 +0200 From: Baptiste Daroussin To: rgrimes@freebsd.org Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r316978 - in head: contrib/zstd etc/mtree lib lib/libzstd share/mk usr.bin usr.bin/zstd Message-ID: <20170416073551.557czdcksdmmuz24@ivaldir.net> References: <201704152005.v3FK5M2j002459@repo.freebsd.org> <201704152337.v3FNb2m1014053@pdx.rh.CN85.dnsmgr.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="z6jkgyiag243hzob" Content-Disposition: inline In-Reply-To: <201704152337.v3FNb2m1014053@pdx.rh.CN85.dnsmgr.net> User-Agent: NeoMutt/20170306 (1.8.0) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 16 Apr 2017 07:35:52 -0000 --z6jkgyiag243hzob Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Apr 15, 2017 at 04:37:02PM -0700, Rodney W. Grimes wrote: > And we need this in base for what great purpose??? >=20 zstandard is the successor to lz4, there are attempts to integrate zstandar= d in ZFS, Allan Jude is working on that, I am working on integrating in libstand= to allow to boot a kernel compressed with zstandard or a mfsroot with zstandar= d, which would benefit lots of pxe users. I have also added it to newsyslog(8) so users can benefit zstandard compres= sion for the log files, which will consume less CPUs for greater compression that bzip2. On low ended boxes with low storage this is actually very useful as = well. I haven't checked yet the performances on my armv6 boxes, but on the low en= ded recent atom laptops I can tell this is already very useful. Bapt --z6jkgyiag243hzob Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEgOTj3suS2urGXVU3Y4mL3PG3PloFAljzHtAACgkQY4mL3PG3 Plo1xBAAuZ6z6kVMXL1fLmonHGgEfXRmBL0yrBtdG++18BXJ1DstY7Mogijygnyr 8qiBIx/SoBFLRK5MQ43anDLZydlZ4nM+2zwLjx21SjUnGzqqvixZEaB61WRNPms3 ZIN8QMVAWirSRyjaLx1Tgf9NWeYOzkpN53qHCGI8fY8NxC7fN+3y27IFkD66EjJH rYtOlrXPqCNqUaFGD4WJkSpuLuH13mWwa72N/IQry1J64FpJQdOawSsM5MxS68HY l/+wZ/tWBsoNZBhvRi+Shi2X9xyEPMBBxuFJDC42mxw6LHtlrB2dAD+0JfSeVz2i bo5eteUJkSL7yTzjJXLHke3dC8sDbl0HkGtA/oMhVN0j7WD5BAx6s5HxUzfany+0 m+VhPLy6nICQ3FlA06Yq2QEw3i4qPgB3oRx3dVih4UowI176fnkwQgjiIF24uHW+ nZkYgvKgaersGqbHzP4BvSw8hpZDeRTe6R11TzVsY98BFo87uhmj0nQeluiGag9n l1k6VJFDU2m6AwX1+L4ilufJFReTxjHKLuz5Fj0XVaAENLmnHwCEIK9YszMmaKZH 0jc3M8MG3a7FEu40v6rt7YUJJoOX+1RajZnKxJIKAhO4w20iMkB5zZUJWV6YUMw2 Lmk+goq43WHAt05F4CG3piuwcKFK9SBHNXHObPdQxEayX1PrVkw= =WUd3 -----END PGP SIGNATURE----- --z6jkgyiag243hzob-- From owner-svn-src-head@freebsd.org Sun Apr 16 08:43:03 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 06467D3EB5B; Sun, 16 Apr 2017 08:43:03 +0000 (UTC) (envelope-from mark@grondar.org) Received: from gromit.grondar.org (grandfather.grondar.org [IPv6:2a01:348:0:15:5d59:5c20:0:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C981D6C2; Sun, 16 Apr 2017 08:43:02 +0000 (UTC) (envelope-from mark@grondar.org) Received: from graveyard.grondar.org ([88.96.155.33] helo=gronkulator.grondar.org) by gromit.grondar.org with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.88 (FreeBSD)) (envelope-from ) id 1czflr-000PqI-HA; Sun, 16 Apr 2017 09:42:59 +0100 Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: svn commit: r316982 - in head/sys: conf crypto/chacha20 modules modules/chacha20 From: Mark R V Murray In-Reply-To: <201704152051.v3FKpr38020502@repo.freebsd.org> Date: Sun, 16 Apr 2017 09:42:57 +0100 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <144B63D2-039E-46A2-B2A1-EFB7BD9589A4@grondar.org> References: <201704152051.v3FKpr38020502@repo.freebsd.org> To: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= X-Mailer: Apple Mail (2.3273) X-SA-Score: -1.0 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 16 Apr 2017 08:43:03 -0000 > On 15 Apr 2017, at 21:51, Dag-Erling Sm=C3=B8rgrav = wrote: >=20 > Author: des > Date: Sat Apr 15 20:51:53 2017 > New Revision: 316982 > URL: https://svnweb.freebsd.org/changeset/base/316982 >=20 > Log: > 3BSD-licensed implementation of the chacha20 stream cipher, intended = for > use by the upcoming arc4random replacement. >=20 > Added: > head/sys/crypto/chacha20/ > head/sys/crypto/chacha20/chacha20.c (contents, props changed) > head/sys/crypto/chacha20/chacha20.h (contents, props changed) > head/sys/modules/chacha20/ > head/sys/modules/chacha20/Makefile (contents, props changed) > Modified: > head/sys/conf/files > head/sys/modules/Makefile This is a loadable module, unlike the RC4 code which it needs to = replace, and which is standard. Making it loadable makes no sense in the context of arc4random(9). Do you mind if I strip out the module bits in order to get my = arc4random(9) commit completed? M --=20 Mark R V Murray From owner-svn-src-head@freebsd.org Sun Apr 16 09:11:04 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D9FA7D40794; Sun, 16 Apr 2017 09:11:04 +0000 (UTC) (envelope-from markm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AAD4A1596; Sun, 16 Apr 2017 09:11:04 +0000 (UTC) (envelope-from markm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3G9B38L023105; Sun, 16 Apr 2017 09:11:03 GMT (envelope-from markm@FreeBSD.org) Received: (from markm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3G9B3df023095; Sun, 16 Apr 2017 09:11:03 GMT (envelope-from markm@FreeBSD.org) Message-Id: <201704160911.v3G9B3df023095@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markm set sender to markm@FreeBSD.org using -f From: Mark Murray Date: Sun, 16 Apr 2017 09:11:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317015 - in head/sys: boot/forth conf crypto/chacha20 dev/random libkern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 16 Apr 2017 09:11:05 -0000 Author: markm Date: Sun Apr 16 09:11:02 2017 New Revision: 317015 URL: https://svnweb.freebsd.org/changeset/base/317015 Log: Replace the RC4 algorithm for generating in-kernel secure random numbers with Chacha20. Keep the API, though, as that is what the other *BSD's have done. Use the boot-time entropy stash (if present) to bootstrap the in-kernel entropy source. Reviewed by: delphij,rwatson Approved by: so(delphij) MFC after: 2 months Relnotes: yes Differential Revision: https://reviews.freebsd.org/D10048 --This line, and those below, will be ignored-- > Description of fields to fill in above: 76 columns --| > PR: If and which Problem Report is related. > Submitted by: If someone else sent in the change. > Reported by: If someone else reported the issue. > Reviewed by: If someone else reviewed your modification. > Approved by: If you needed approval for this commit. > Obtained from: If the change is from a third party. > MFC after: N [day[s]|week[s]|month[s]]. Request a reminder email. > MFH: Ports tree branch name. Request approval for merge. > Relnotes: Set to 'yes' for mention in release notes. > Security: Vulnerability reference (one per line) or description. > Sponsored by: If the change was sponsored by an organization. > Differential Revision: https://reviews.freebsd.org/D### (*full* phabric URL needed). > Empty fields above will be automatically removed. Added: head/sys/crypto/chacha20/chacha.c (contents, props changed) head/sys/crypto/chacha20/chacha.h (contents, props changed) Modified: head/sys/boot/forth/loader.conf head/sys/conf/files head/sys/dev/random/random_harvestq.c head/sys/dev/random/random_harvestq.h head/sys/libkern/arc4random.c head/sys/sys/libkern.h head/sys/sys/random.h Modified: head/sys/boot/forth/loader.conf ============================================================================== --- head/sys/boot/forth/loader.conf Sun Apr 16 09:00:10 2017 (r317014) +++ head/sys/boot/forth/loader.conf Sun Apr 16 09:11:02 2017 (r317015) @@ -48,7 +48,7 @@ bitmap_type="splash_image_data" # and pl entropy_cache_load="YES" # Set this to NO to disable loading # entropy at boot time entropy_cache_name="/boot/entropy" # Set this to the name of the file -entropy_cache_type="/boot/entropy" # Required for the kernel to find +entropy_cache_type="boot_entropy_cache" # Required for the kernel to find # the boot-time entropy cache. This # must not change value even if the # _name above does change! Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sun Apr 16 09:00:10 2017 (r317014) +++ head/sys/conf/files Sun Apr 16 09:11:02 2017 (r317015) @@ -3810,6 +3810,7 @@ kgssapi/gsstest.c optional kgssapi_debu # the file should be moved to conf/files. from here. # libkern/arc4random.c standard +crypto/chacha20/chacha.c standard libkern/asprintf.c standard libkern/bcd.c standard libkern/bsearch.c standard Added: head/sys/crypto/chacha20/chacha.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/crypto/chacha20/chacha.c Sun Apr 16 09:11:02 2017 (r317015) @@ -0,0 +1,224 @@ +/* +chacha-merged.c version 20080118 +D. J. Bernstein +Public domain. +*/ + +/* $OpenBSD: chacha.c,v 1.1 2013/11/21 00:45:44 djm Exp $ */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include + +#include + + +typedef uint8_t u8; +typedef uint32_t u32; + +typedef struct chacha_ctx chacha_ctx; + +#define U8C(v) (v##U) +#define U32C(v) (v##U) + +#define U8V(v) ((u8)(v) & U8C(0xFF)) +#define U32V(v) ((u32)(v) & U32C(0xFFFFFFFF)) + +#define ROTL32(v, n) \ + (U32V((v) << (n)) | ((v) >> (32 - (n)))) + +#define U8TO32_LITTLE(p) \ + (((u32)((p)[0]) ) | \ + ((u32)((p)[1]) << 8) | \ + ((u32)((p)[2]) << 16) | \ + ((u32)((p)[3]) << 24)) + +#define U32TO8_LITTLE(p, v) \ + do { \ + (p)[0] = U8V((v) ); \ + (p)[1] = U8V((v) >> 8); \ + (p)[2] = U8V((v) >> 16); \ + (p)[3] = U8V((v) >> 24); \ + } while (0) + +#define ROTATE(v,c) (ROTL32(v,c)) +#define XOR(v,w) ((v) ^ (w)) +#define PLUS(v,w) (U32V((v) + (w))) +#define PLUSONE(v) (PLUS((v),1)) + +#define QUARTERROUND(a,b,c,d) \ + a = PLUS(a,b); d = ROTATE(XOR(d,a),16); \ + c = PLUS(c,d); b = ROTATE(XOR(b,c),12); \ + a = PLUS(a,b); d = ROTATE(XOR(d,a), 8); \ + c = PLUS(c,d); b = ROTATE(XOR(b,c), 7); + +static const char sigma[16] = "expand 32-byte k"; +static const char tau[16] = "expand 16-byte k"; + +void +chacha_keysetup(chacha_ctx *x,const u8 *k,u32 kbits) +{ + const char *constants; + + x->input[4] = U8TO32_LITTLE(k + 0); + x->input[5] = U8TO32_LITTLE(k + 4); + x->input[6] = U8TO32_LITTLE(k + 8); + x->input[7] = U8TO32_LITTLE(k + 12); + if (kbits == 256) { /* recommended */ + k += 16; + constants = sigma; + } else { /* kbits == 128 */ + constants = tau; + } + x->input[8] = U8TO32_LITTLE(k + 0); + x->input[9] = U8TO32_LITTLE(k + 4); + x->input[10] = U8TO32_LITTLE(k + 8); + x->input[11] = U8TO32_LITTLE(k + 12); + x->input[0] = U8TO32_LITTLE(constants + 0); + x->input[1] = U8TO32_LITTLE(constants + 4); + x->input[2] = U8TO32_LITTLE(constants + 8); + x->input[3] = U8TO32_LITTLE(constants + 12); +} + +void +chacha_ivsetup(chacha_ctx *x, const u8 *iv, const u8 *counter) +{ + x->input[12] = counter == NULL ? 0 : U8TO32_LITTLE(counter + 0); + x->input[13] = counter == NULL ? 0 : U8TO32_LITTLE(counter + 4); + x->input[14] = U8TO32_LITTLE(iv + 0); + x->input[15] = U8TO32_LITTLE(iv + 4); +} + +void +chacha_encrypt_bytes(chacha_ctx *x,const u8 *m,u8 *c,u32 bytes) +{ + u32 x0, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15; + u32 j0, j1, j2, j3, j4, j5, j6, j7, j8, j9, j10, j11, j12, j13, j14, j15; + u8 *ctarget = NULL; + u8 tmp[64]; + u_int i; + + if (!bytes) return; + + j0 = x->input[0]; + j1 = x->input[1]; + j2 = x->input[2]; + j3 = x->input[3]; + j4 = x->input[4]; + j5 = x->input[5]; + j6 = x->input[6]; + j7 = x->input[7]; + j8 = x->input[8]; + j9 = x->input[9]; + j10 = x->input[10]; + j11 = x->input[11]; + j12 = x->input[12]; + j13 = x->input[13]; + j14 = x->input[14]; + j15 = x->input[15]; + + for (;;) { + if (bytes < 64) { + for (i = 0;i < bytes;++i) tmp[i] = m[i]; + m = tmp; + ctarget = c; + c = tmp; + } + x0 = j0; + x1 = j1; + x2 = j2; + x3 = j3; + x4 = j4; + x5 = j5; + x6 = j6; + x7 = j7; + x8 = j8; + x9 = j9; + x10 = j10; + x11 = j11; + x12 = j12; + x13 = j13; + x14 = j14; + x15 = j15; + for (i = 20;i > 0;i -= 2) { + QUARTERROUND( x0, x4, x8,x12) + QUARTERROUND( x1, x5, x9,x13) + QUARTERROUND( x2, x6,x10,x14) + QUARTERROUND( x3, x7,x11,x15) + QUARTERROUND( x0, x5,x10,x15) + QUARTERROUND( x1, x6,x11,x12) + QUARTERROUND( x2, x7, x8,x13) + QUARTERROUND( x3, x4, x9,x14) + } + x0 = PLUS(x0,j0); + x1 = PLUS(x1,j1); + x2 = PLUS(x2,j2); + x3 = PLUS(x3,j3); + x4 = PLUS(x4,j4); + x5 = PLUS(x5,j5); + x6 = PLUS(x6,j6); + x7 = PLUS(x7,j7); + x8 = PLUS(x8,j8); + x9 = PLUS(x9,j9); + x10 = PLUS(x10,j10); + x11 = PLUS(x11,j11); + x12 = PLUS(x12,j12); + x13 = PLUS(x13,j13); + x14 = PLUS(x14,j14); + x15 = PLUS(x15,j15); + + x0 = XOR(x0,U8TO32_LITTLE(m + 0)); + x1 = XOR(x1,U8TO32_LITTLE(m + 4)); + x2 = XOR(x2,U8TO32_LITTLE(m + 8)); + x3 = XOR(x3,U8TO32_LITTLE(m + 12)); + x4 = XOR(x4,U8TO32_LITTLE(m + 16)); + x5 = XOR(x5,U8TO32_LITTLE(m + 20)); + x6 = XOR(x6,U8TO32_LITTLE(m + 24)); + x7 = XOR(x7,U8TO32_LITTLE(m + 28)); + x8 = XOR(x8,U8TO32_LITTLE(m + 32)); + x9 = XOR(x9,U8TO32_LITTLE(m + 36)); + x10 = XOR(x10,U8TO32_LITTLE(m + 40)); + x11 = XOR(x11,U8TO32_LITTLE(m + 44)); + x12 = XOR(x12,U8TO32_LITTLE(m + 48)); + x13 = XOR(x13,U8TO32_LITTLE(m + 52)); + x14 = XOR(x14,U8TO32_LITTLE(m + 56)); + x15 = XOR(x15,U8TO32_LITTLE(m + 60)); + + j12 = PLUSONE(j12); + if (!j12) { + j13 = PLUSONE(j13); + /* stopping at 2^70 bytes per nonce is user's responsibility */ + } + + U32TO8_LITTLE(c + 0,x0); + U32TO8_LITTLE(c + 4,x1); + U32TO8_LITTLE(c + 8,x2); + U32TO8_LITTLE(c + 12,x3); + U32TO8_LITTLE(c + 16,x4); + U32TO8_LITTLE(c + 20,x5); + U32TO8_LITTLE(c + 24,x6); + U32TO8_LITTLE(c + 28,x7); + U32TO8_LITTLE(c + 32,x8); + U32TO8_LITTLE(c + 36,x9); + U32TO8_LITTLE(c + 40,x10); + U32TO8_LITTLE(c + 44,x11); + U32TO8_LITTLE(c + 48,x12); + U32TO8_LITTLE(c + 52,x13); + U32TO8_LITTLE(c + 56,x14); + U32TO8_LITTLE(c + 60,x15); + + if (bytes <= 64) { + if (bytes < 64) { + for (i = 0;i < bytes;++i) ctarget[i] = c[i]; + } + x->input[12] = j12; + x->input[13] = j13; + return; + } + bytes -= 64; + c += 64; + m += 64; + } +} Added: head/sys/crypto/chacha20/chacha.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/crypto/chacha20/chacha.h Sun Apr 16 09:11:02 2017 (r317015) @@ -0,0 +1,32 @@ +/* $OpenBSD: chacha.h,v 1.4 2016/08/27 04:04:56 guenther Exp $ */ + +/* +chacha-merged.c version 20080118 +D. J. Bernstein +Public domain. + + $FreeBSD$ +*/ + +#ifndef CHACHA_H +#define CHACHA_H + +#include + +struct chacha_ctx { + u_int input[16]; +}; + +#define CHACHA_MINKEYLEN 16 +#define CHACHA_NONCELEN 8 +#define CHACHA_CTRLEN 8 +#define CHACHA_STATELEN (CHACHA_NONCELEN+CHACHA_CTRLEN) +#define CHACHA_BLOCKLEN 64 + +void chacha_keysetup(struct chacha_ctx *x, const u_char *k, u_int kbits); +void chacha_ivsetup(struct chacha_ctx *x, const u_char *iv, const u_char *ctr); +void chacha_encrypt_bytes(struct chacha_ctx *x, const u_char *m, + u_char *c, u_int bytes); + +#endif /* CHACHA_H */ + Modified: head/sys/dev/random/random_harvestq.c ============================================================================== --- head/sys/dev/random/random_harvestq.c Sun Apr 16 09:00:10 2017 (r317014) +++ head/sys/dev/random/random_harvestq.c Sun Apr 16 09:11:02 2017 (r317015) @@ -352,10 +352,19 @@ random_harvestq_prime(void *unused __unu * Get entropy that may have been preloaded by loader(8) * and use it to pre-charge the entropy harvest queue. */ - keyfile = preload_search_by_type(RANDOM_HARVESTQ_BOOT_ENTROPY_FILE); + keyfile = preload_search_by_type(RANDOM_CACHED_BOOT_ENTROPY_MODULE); +#ifndef NO_BACKWARD_COMPATIBILITY + if (keyfile == NULL) + keyfile = preload_search_by_type(RANDOM_LEGACY_BOOT_ENTROPY_MODULE); +#endif if (keyfile != NULL) { data = preload_fetch_addr(keyfile); size = preload_fetch_size(keyfile); + /* skip the first bit of the stash so others like arc4 can also have some. */ + if (size > RANDOM_CACHED_SKIP_START) { + data += RANDOM_CACHED_SKIP_START; + size -= RANDOM_CACHED_SKIP_START; + } /* Trim the size. If the admin has a file with a funny size, we lose some. Tough. */ size -= (size % sizeof(event.he_entropy)); if (data != NULL && size != 0) { Modified: head/sys/dev/random/random_harvestq.h ============================================================================== --- head/sys/dev/random/random_harvestq.h Sun Apr 16 09:00:10 2017 (r317014) +++ head/sys/dev/random/random_harvestq.h Sun Apr 16 09:11:02 2017 (r317015) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013-2015 Mark R V Murray + * Copyright (c) 2013-2015, 2017 Mark R V Murray * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -45,8 +45,6 @@ struct harvest_event { void read_rate_increment(u_int); -#define RANDOM_HARVESTQ_BOOT_ENTROPY_FILE "/boot/entropy" - #define RANDOM_HARVEST_INIT_LOCK(x) mtx_init(&harvest_context.hc_mtx, "entropy harvest mutex", NULL, MTX_SPIN) #define RANDOM_HARVEST_LOCK(x) mtx_lock_spin(&harvest_context.hc_mtx) #define RANDOM_HARVEST_UNLOCK(x) mtx_unlock_spin(&harvest_context.hc_mtx) Modified: head/sys/libkern/arc4random.c ============================================================================== --- head/sys/libkern/arc4random.c Sun Apr 16 09:00:10 2017 (r317014) +++ head/sys/libkern/arc4random.c Sun Apr 16 09:11:02 2017 (r317015) @@ -1,11 +1,28 @@ /*- - * THE BEER-WARE LICENSE + * Copyright (c) 2017 The FreeBSD Foundation + * All rights reserved. * - * wrote this file. As long as you retain this notice you - * can do whatever you want with this stuff. If we meet some day, and you - * think this stuff is worth it, you can buy me a beer in return. + * 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 + * in this position and unchanged. + * 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. * - * Dan Moschuk */ #include @@ -14,144 +31,122 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include +#include #include +#include #include -#include +#include #include -#include +#include + +#include -#define ARC4_RESEED_BYTES 65536 -#define ARC4_RESEED_SECONDS 300 -#define ARC4_KEYBYTES 256 +#define CHACHA20_RESEED_BYTES 65536 +#define CHACHA20_RESEED_SECONDS 300 +#define CHACHA20_KEYBYTES 32 +#define CHACHA20_BUFFER_SIZE 64 + +CTASSERT(CHACHA20_KEYBYTES*8 >= CHACHA_MINKEYLEN); int arc4rand_iniseed_state = ARC4_ENTR_NONE; -MALLOC_DEFINE(M_ARC4RANDOM, "arc4random", "arc4random structures"); +MALLOC_DEFINE(M_CHACHA20RANDOM, "chacha20random", "chacha20random structures"); -struct arc4_s { +struct chacha20_s { struct mtx mtx; - u_int8_t i, j; - int numruns; - u_int8_t sbox[256]; + int numbytes; + int first_time_done; time_t t_reseed; - + u_int8_t m_buffer[CHACHA20_BUFFER_SIZE]; + struct chacha_ctx ctx; } __aligned(CACHE_LINE_SIZE); -static struct arc4_s *arc4inst = NULL; +static struct chacha20_s *chacha20inst = NULL; -#define ARC4_FOREACH(_arc4) \ - for (_arc4 = &arc4inst[0]; _arc4 <= &arc4inst[mp_maxid]; _arc4++) - -static u_int8_t arc4_randbyte(struct arc4_s *arc4); - -static __inline void -arc4_swap(u_int8_t *a, u_int8_t *b) -{ - u_int8_t c; - - c = *a; - *a = *b; - *b = c; -} +#define CHACHA20_FOREACH(_chacha20) \ + for (_chacha20 = &chacha20inst[0]; \ + _chacha20 <= &chacha20inst[mp_maxid]; \ + _chacha20++) /* - * Stir our S-box. + * Mix up the current context. */ static void -arc4_randomstir(struct arc4_s* arc4) +chacha20_randomstir(struct chacha20_s* chacha20) { - u_int8_t key[ARC4_KEYBYTES]; - int n; struct timeval tv_now; + size_t n, size; + u_int8_t key[CHACHA20_KEYBYTES], *data; + caddr_t keyfile; /* - * XXX: FIX!! This isn't brilliant. Need more confidence. - * This returns zero entropy before random(4) is seeded. + * This is making the best of what may be an insecure + * Situation. If the loader(8) did not have an entropy + * stash from the previous shutdown to load, then we will + * be improperly seeded. The answer is to make sure there + * is an entropy stash at shutdown time. */ - (void)read_random(key, ARC4_KEYBYTES); - getmicrouptime(&tv_now); - mtx_lock(&arc4->mtx); - for (n = 0; n < 256; n++) { - arc4->j = (arc4->j + arc4->sbox[n] + key[n]) % 256; - arc4_swap(&arc4->sbox[n], &arc4->sbox[arc4->j]); + (void)read_random(key, CHACHA20_KEYBYTES); + if (!chacha20->first_time_done) { + keyfile = preload_search_by_type(RANDOM_CACHED_BOOT_ENTROPY_MODULE); + if (keyfile != NULL) { + data = preload_fetch_addr(keyfile); + size = MIN(preload_fetch_size(keyfile), CHACHA20_KEYBYTES); + for (n = 0; n < size; n++) + key[n] ^= data[n]; + explicit_bzero(data, size); + if (bootverbose) + printf("arc4random: read %zu bytes from preloaded cache\n", size); + } else + printf("arc4random: no preloaded entropy cache\n"); + chacha20->first_time_done = 1; } - arc4->i = arc4->j = 0; + getmicrouptime(&tv_now); + mtx_lock(&chacha20->mtx); + chacha_keysetup(&chacha20->ctx, key, CHACHA20_KEYBYTES*8); + chacha_ivsetup(&chacha20->ctx, (u_char *)&tv_now.tv_sec, (u_char *)&tv_now.tv_usec); /* Reset for next reseed cycle. */ - arc4->t_reseed = tv_now.tv_sec + ARC4_RESEED_SECONDS; - arc4->numruns = 0; - /* - * Throw away the first N words of output, as suggested in the - * paper "Weaknesses in the Key Scheduling Algorithm of RC4" - * by Fluher, Mantin, and Shamir. (N = 768 in our case.) - * - * http://dl.acm.org/citation.cfm?id=646557.694759 - */ - for (n = 0; n < 768*4; n++) - arc4_randbyte(arc4); - - mtx_unlock(&arc4->mtx); + chacha20->t_reseed = tv_now.tv_sec + CHACHA20_RESEED_SECONDS; + chacha20->numbytes = 0; + mtx_unlock(&chacha20->mtx); } /* - * Initialize our S-box to its beginning defaults. + * Initialize the contexts. */ static void -arc4_init(void) +chacha20_init(void) { - struct arc4_s *arc4; - int n; - - arc4inst = malloc((mp_maxid + 1) * sizeof(struct arc4_s), - M_ARC4RANDOM, M_NOWAIT | M_ZERO); - KASSERT(arc4inst != NULL, ("arc4_init: memory allocation error")); + struct chacha20_s *chacha20; - ARC4_FOREACH(arc4) { - mtx_init(&arc4->mtx, "arc4_mtx", NULL, MTX_DEF); - - arc4->i = arc4->j = 0; - for (n = 0; n < 256; n++) - arc4->sbox[n] = (u_int8_t) n; - - arc4->t_reseed = -1; - arc4->numruns = 0; + chacha20inst = malloc((mp_maxid + 1) * sizeof(struct chacha20_s), + M_CHACHA20RANDOM, M_NOWAIT | M_ZERO); + KASSERT(chacha20inst != NULL, ("chacha20_init: memory allocation error")); + + CHACHA20_FOREACH(chacha20) { + mtx_init(&chacha20->mtx, "chacha20_mtx", NULL, MTX_DEF); + chacha20->t_reseed = -1; + chacha20->numbytes = 0; + chacha20->first_time_done = 0; + explicit_bzero(chacha20->m_buffer, CHACHA20_BUFFER_SIZE); + explicit_bzero(&chacha20->ctx, sizeof(chacha20->ctx)); } } -SYSINIT(arc4, SI_SUB_LOCK, SI_ORDER_ANY, arc4_init, NULL); +SYSINIT(chacha20, SI_SUB_LOCK, SI_ORDER_ANY, chacha20_init, NULL); static void -arc4_uninit(void) +chacha20_uninit(void) { - struct arc4_s *arc4; + struct chacha20_s *chacha20; - ARC4_FOREACH(arc4) { - mtx_destroy(&arc4->mtx); - } - - free(arc4inst, M_ARC4RANDOM); + CHACHA20_FOREACH(chacha20) + mtx_destroy(&chacha20->mtx); + free(chacha20inst, M_CHACHA20RANDOM); } +SYSUNINIT(chacha20, SI_SUB_LOCK, SI_ORDER_ANY, chacha20_uninit, NULL); -SYSUNINIT(arc4, SI_SUB_LOCK, SI_ORDER_ANY, arc4_uninit, NULL); - - -/* - * Generate a random byte. - */ -static u_int8_t -arc4_randbyte(struct arc4_s *arc4) -{ - u_int8_t arc4_t; - - arc4->i = (arc4->i + 1) % 256; - arc4->j = (arc4->j + arc4->sbox[arc4->i]) % 256; - - arc4_swap(&arc4->sbox[arc4->i], &arc4->sbox[arc4->j]); - - arc4_t = (arc4->sbox[arc4->i] + arc4->sbox[arc4->j]) % 256; - return arc4->sbox[arc4_t]; -} /* * MPSAFE @@ -159,28 +154,36 @@ arc4_randbyte(struct arc4_s *arc4) void arc4rand(void *ptr, u_int len, int reseed) { - u_char *p; + struct chacha20_s *chacha20; struct timeval tv; - struct arc4_s *arc4; + u_int length; + u_int8_t *p; - if (reseed || atomic_cmpset_int(&arc4rand_iniseed_state, - ARC4_ENTR_HAVE, ARC4_ENTR_SEED)) { - ARC4_FOREACH(arc4) - arc4_randomstir(arc4); - } + if (reseed || atomic_cmpset_int(&arc4rand_iniseed_state, ARC4_ENTR_HAVE, ARC4_ENTR_SEED)) + CHACHA20_FOREACH(chacha20) + chacha20_randomstir(chacha20); - arc4 = &arc4inst[curcpu]; + chacha20 = &chacha20inst[curcpu]; getmicrouptime(&tv); - if ((arc4->numruns > ARC4_RESEED_BYTES) || - (tv.tv_sec > arc4->t_reseed)) - arc4_randomstir(arc4); + /* We may get unlucky and be migrated off this CPU, but that is expected to be infrequent */ + if ((chacha20->numbytes > CHACHA20_RESEED_BYTES) || (tv.tv_sec > chacha20->t_reseed)) + chacha20_randomstir(chacha20); - mtx_lock(&arc4->mtx); - arc4->numruns += len; + mtx_lock(&chacha20->mtx); p = ptr; - while (len--) - *p++ = arc4_randbyte(arc4); - mtx_unlock(&arc4->mtx); + while (len) { + length = MIN(CHACHA20_BUFFER_SIZE, len); + chacha_encrypt_bytes(&chacha20->ctx, chacha20->m_buffer, p, length); + p += length; + len -= length; + chacha20->numbytes += length; + if (chacha20->numbytes > CHACHA20_RESEED_BYTES) { + mtx_unlock(&chacha20->mtx); + chacha20_randomstir(chacha20); + mtx_lock(&chacha20->mtx); + } + } + mtx_unlock(&chacha20->mtx); } uint32_t @@ -188,6 +191,13 @@ arc4random(void) { uint32_t ret; - arc4rand(&ret, sizeof ret, 0); + arc4rand(&ret, sizeof(ret), 0); return ret; } + +void +arc4random_buf(void *ptr, size_t len) +{ + + arc4rand(ptr, len, 0); +} Modified: head/sys/sys/libkern.h ============================================================================== --- head/sys/sys/libkern.h Sun Apr 16 09:00:10 2017 (r317014) +++ head/sys/sys/libkern.h Sun Apr 16 09:11:02 2017 (r317015) @@ -117,7 +117,8 @@ extern int arc4rand_iniseed_state; /* Prototypes for non-quad routines. */ struct malloc_type; uint32_t arc4random(void); -void arc4rand(void *ptr, u_int len, int reseed); +void arc4random_buf(void *, size_t); +void arc4rand(void *, u_int, int); int bcmp(const void *, const void *, size_t); int timingsafe_bcmp(const void *, const void *, size_t); void *bsearch(const void *, const void *, size_t, Modified: head/sys/sys/random.h ============================================================================== --- head/sys/sys/random.h Sun Apr 16 09:00:10 2017 (r317014) +++ head/sys/sys/random.h Sun Apr 16 09:11:02 2017 (r317015) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2000-2015 Mark R. V. Murray + * Copyright (c) 2000-2015, 2017 Mark R. V. Murray * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -96,6 +96,10 @@ enum random_entropy_source { #define RANDOM_HARVEST_EVERYTHING_MASK ((1 << (RANDOM_ENVIRONMENTAL_END + 1)) - 1) +#define RANDOM_LEGACY_BOOT_ENTROPY_MODULE "/boot/entropy" +#define RANDOM_CACHED_BOOT_ENTROPY_MODULE "boot_entropy_cache" +#define RANDOM_CACHED_SKIP_START 256 + #if defined(DEV_RANDOM) void random_harvest_queue(const void *, u_int, u_int, enum random_entropy_source); void random_harvest_fast(const void *, u_int, u_int, enum random_entropy_source); From owner-svn-src-head@freebsd.org Sun Apr 16 09:19:45 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 22FF9D40AC4; Sun, 16 Apr 2017 09:19:45 +0000 (UTC) (envelope-from markm@FreeBSD.org) Received: from gromit.grondar.org (grandfather.grondar.org [IPv6:2a01:348:0:15:5d59:5c20:0:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D0A2A19F3; Sun, 16 Apr 2017 09:19:44 +0000 (UTC) (envelope-from markm@FreeBSD.org) Received: from graveyard.grondar.org ([88.96.155.33] helo=gronkulator.grondar.org) by gromit.grondar.org with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.88 (FreeBSD)) (envelope-from ) id 1czgLM-000Pss-5E; Sun, 16 Apr 2017 10:19:43 +0100 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: svn commit: r317015 - in head/sys: boot/forth conf crypto/chacha20 dev/random libkern sys From: Mark R V Murray In-Reply-To: <201704160911.v3G9B3df023095@repo.freebsd.org> Date: Sun, 16 Apr 2017 10:19:39 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201704160911.v3G9B3df023095@repo.freebsd.org> To: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Mailer: Apple Mail (2.3273) X-SA-Score: -1.0 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 16 Apr 2017 09:19:45 -0000 This does not use DES' Chacha20 commit, as I had already completed the testing for it, and received SO@ approval. DES's commit made Chaha20 a module. This is of no use to arc4random(9), which needs the code to be standard. Also his API is different. I have no objection to reworking the arc4random/Chacha below to use DES' version of Chacha, but his code needs to be standard library code, not an optional module. Any objections to me doing this? M > On 16 Apr 2017, at 10:11, Mark Murray wrote: >=20 > Author: markm > Date: Sun Apr 16 09:11:02 2017 > New Revision: 317015 > URL: https://svnweb.freebsd.org/changeset/base/317015 >=20 > Log: > Replace the RC4 algorithm for generating in-kernel secure random > numbers with Chacha20. Keep the API, though, as that is what the > other *BSD's have done. >=20 > Use the boot-time entropy stash (if present) to bootstrap the > in-kernel entropy source. >=20 > Reviewed by: delphij,rwatson > Approved by: so(delphij) > MFC after: 2 months > Relnotes: yes > Differential Revision: https://reviews.freebsd.org/D10048 > --This line, and those below, will be ignored-- >> Description of fields to fill in above: 76 = columns --| >> PR: If and which Problem Report is related. >> Submitted by: If someone else sent in the change. >> Reported by: If someone else reported the issue. >> Reviewed by: If someone else reviewed your modification. >> Approved by: If you needed approval for this commit. >> Obtained from: If the change is from a third party. >> MFC after: N [day[s]|week[s]|month[s]]. Request a = reminder email. >> MFH: Ports tree branch name. Request approval = for merge. >> Relnotes: Set to 'yes' for mention in release notes. >> Security: Vulnerability reference (one per line) or = description. >> Sponsored by: If the change was sponsored by an = organization. >> Differential Revision: https://reviews.freebsd.org/D### (*full* = phabric URL needed). >> Empty fields above will be automatically removed. >=20 > Added: > head/sys/crypto/chacha20/chacha.c (contents, props changed) > head/sys/crypto/chacha20/chacha.h (contents, props changed) > Modified: > head/sys/boot/forth/loader.conf > head/sys/conf/files > head/sys/dev/random/random_harvestq.c > head/sys/dev/random/random_harvestq.h > head/sys/libkern/arc4random.c > head/sys/sys/libkern.h > head/sys/sys/random.h >=20 > Modified: head/sys/boot/forth/loader.conf > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=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/boot/forth/loader.conf Sun Apr 16 09:00:10 2017 = (r317014) > +++ head/sys/boot/forth/loader.conf Sun Apr 16 09:11:02 2017 = (r317015) > @@ -48,7 +48,7 @@ bitmap_type=3D"splash_image_data" # and pl > entropy_cache_load=3D"YES" # Set this to NO to disable = loading > # entropy at boot time > entropy_cache_name=3D"/boot/entropy" # Set this to the name of the = file > -entropy_cache_type=3D"/boot/entropy" # Required for the kernel to = find > +entropy_cache_type=3D"boot_entropy_cache" # Required for the = kernel to find > # the boot-time entropy cache. = This > # must not change value even if = the > # _name above does change! >=20 > Modified: head/sys/conf/files > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=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/conf/files Sun Apr 16 09:00:10 2017 = (r317014) > +++ head/sys/conf/files Sun Apr 16 09:11:02 2017 = (r317015) > @@ -3810,6 +3810,7 @@ kgssapi/gsstest.c optional = kgssapi_debu > # the file should be moved to conf/files. from here. > # > libkern/arc4random.c standard > +crypto/chacha20/chacha.c standard > libkern/asprintf.c standard > libkern/bcd.c standard > libkern/bsearch.c standard >=20 > Added: head/sys/crypto/chacha20/chacha.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 > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/sys/crypto/chacha20/chacha.c Sun Apr 16 09:11:02 2017 = (r317015) > @@ -0,0 +1,224 @@ > +/* > +chacha-merged.c version 20080118 > +D. J. Bernstein > +Public domain. > +*/ > + > +/* $OpenBSD: chacha.c,v 1.1 2013/11/21 00:45:44 djm Exp $ */ > + > +#include > +__FBSDID("$FreeBSD$"); > + > +#include > +#include > + > +#include > + > + > +typedef uint8_t u8; > +typedef uint32_t u32; > + > +typedef struct chacha_ctx chacha_ctx; > + > +#define U8C(v) (v##U) > +#define U32C(v) (v##U) > + > +#define U8V(v) ((u8)(v) & U8C(0xFF)) > +#define U32V(v) ((u32)(v) & U32C(0xFFFFFFFF)) > + > +#define ROTL32(v, n) \ > + (U32V((v) << (n)) | ((v) >> (32 - (n)))) > + > +#define U8TO32_LITTLE(p) \ > + (((u32)((p)[0]) ) | \ > + ((u32)((p)[1]) << 8) | \ > + ((u32)((p)[2]) << 16) | \ > + ((u32)((p)[3]) << 24)) > + > +#define U32TO8_LITTLE(p, v) \ > + do { \ > + (p)[0] =3D U8V((v) ); \ > + (p)[1] =3D U8V((v) >> 8); \ > + (p)[2] =3D U8V((v) >> 16); \ > + (p)[3] =3D U8V((v) >> 24); \ > + } while (0) > + > +#define ROTATE(v,c) (ROTL32(v,c)) > +#define XOR(v,w) ((v) ^ (w)) > +#define PLUS(v,w) (U32V((v) + (w))) > +#define PLUSONE(v) (PLUS((v),1)) > + > +#define QUARTERROUND(a,b,c,d) \ > + a =3D PLUS(a,b); d =3D ROTATE(XOR(d,a),16); \ > + c =3D PLUS(c,d); b =3D ROTATE(XOR(b,c),12); \ > + a =3D PLUS(a,b); d =3D ROTATE(XOR(d,a), 8); \ > + c =3D PLUS(c,d); b =3D ROTATE(XOR(b,c), 7); > + > +static const char sigma[16] =3D "expand 32-byte k"; > +static const char tau[16] =3D "expand 16-byte k"; > + > +void > +chacha_keysetup(chacha_ctx *x,const u8 *k,u32 kbits) > +{ > + const char *constants; > + > + x->input[4] =3D U8TO32_LITTLE(k + 0); > + x->input[5] =3D U8TO32_LITTLE(k + 4); > + x->input[6] =3D U8TO32_LITTLE(k + 8); > + x->input[7] =3D U8TO32_LITTLE(k + 12); > + if (kbits =3D=3D 256) { /* recommended */ > + k +=3D 16; > + constants =3D sigma; > + } else { /* kbits =3D=3D 128 */ > + constants =3D tau; > + } > + x->input[8] =3D U8TO32_LITTLE(k + 0); > + x->input[9] =3D U8TO32_LITTLE(k + 4); > + x->input[10] =3D U8TO32_LITTLE(k + 8); > + x->input[11] =3D U8TO32_LITTLE(k + 12); > + x->input[0] =3D U8TO32_LITTLE(constants + 0); > + x->input[1] =3D U8TO32_LITTLE(constants + 4); > + x->input[2] =3D U8TO32_LITTLE(constants + 8); > + x->input[3] =3D U8TO32_LITTLE(constants + 12); > +} > + > +void > +chacha_ivsetup(chacha_ctx *x, const u8 *iv, const u8 *counter) > +{ > + x->input[12] =3D counter =3D=3D NULL ? 0 : U8TO32_LITTLE(counter + = 0); > + x->input[13] =3D counter =3D=3D NULL ? 0 : U8TO32_LITTLE(counter + = 4); > + x->input[14] =3D U8TO32_LITTLE(iv + 0); > + x->input[15] =3D U8TO32_LITTLE(iv + 4); > +} > + > +void > +chacha_encrypt_bytes(chacha_ctx *x,const u8 *m,u8 *c,u32 bytes) > +{ > + u32 x0, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, = x14, x15; > + u32 j0, j1, j2, j3, j4, j5, j6, j7, j8, j9, j10, j11, j12, j13, = j14, j15; > + u8 *ctarget =3D NULL; > + u8 tmp[64]; > + u_int i; > + > + if (!bytes) return; > + > + j0 =3D x->input[0]; > + j1 =3D x->input[1]; > + j2 =3D x->input[2]; > + j3 =3D x->input[3]; > + j4 =3D x->input[4]; > + j5 =3D x->input[5]; > + j6 =3D x->input[6]; > + j7 =3D x->input[7]; > + j8 =3D x->input[8]; > + j9 =3D x->input[9]; > + j10 =3D x->input[10]; > + j11 =3D x->input[11]; > + j12 =3D x->input[12]; > + j13 =3D x->input[13]; > + j14 =3D x->input[14]; > + j15 =3D x->input[15]; > + > + for (;;) { > + if (bytes < 64) { > + for (i =3D 0;i < bytes;++i) tmp[i] =3D m[i]; > + m =3D tmp; > + ctarget =3D c; > + c =3D tmp; > + } > + x0 =3D j0; > + x1 =3D j1; > + x2 =3D j2; > + x3 =3D j3; > + x4 =3D j4; > + x5 =3D j5; > + x6 =3D j6; > + x7 =3D j7; > + x8 =3D j8; > + x9 =3D j9; > + x10 =3D j10; > + x11 =3D j11; > + x12 =3D j12; > + x13 =3D j13; > + x14 =3D j14; > + x15 =3D j15; > + for (i =3D 20;i > 0;i -=3D 2) { > + QUARTERROUND( x0, x4, x8,x12) > + QUARTERROUND( x1, x5, x9,x13) > + QUARTERROUND( x2, x6,x10,x14) > + QUARTERROUND( x3, x7,x11,x15) > + QUARTERROUND( x0, x5,x10,x15) > + QUARTERROUND( x1, x6,x11,x12) > + QUARTERROUND( x2, x7, x8,x13) > + QUARTERROUND( x3, x4, x9,x14) > + } > + x0 =3D PLUS(x0,j0); > + x1 =3D PLUS(x1,j1); > + x2 =3D PLUS(x2,j2); > + x3 =3D PLUS(x3,j3); > + x4 =3D PLUS(x4,j4); > + x5 =3D PLUS(x5,j5); > + x6 =3D PLUS(x6,j6); > + x7 =3D PLUS(x7,j7); > + x8 =3D PLUS(x8,j8); > + x9 =3D PLUS(x9,j9); > + x10 =3D PLUS(x10,j10); > + x11 =3D PLUS(x11,j11); > + x12 =3D PLUS(x12,j12); > + x13 =3D PLUS(x13,j13); > + x14 =3D PLUS(x14,j14); > + x15 =3D PLUS(x15,j15); > + > + x0 =3D XOR(x0,U8TO32_LITTLE(m + 0)); > + x1 =3D XOR(x1,U8TO32_LITTLE(m + 4)); > + x2 =3D XOR(x2,U8TO32_LITTLE(m + 8)); > + x3 =3D XOR(x3,U8TO32_LITTLE(m + 12)); > + x4 =3D XOR(x4,U8TO32_LITTLE(m + 16)); > + x5 =3D XOR(x5,U8TO32_LITTLE(m + 20)); > + x6 =3D XOR(x6,U8TO32_LITTLE(m + 24)); > + x7 =3D XOR(x7,U8TO32_LITTLE(m + 28)); > + x8 =3D XOR(x8,U8TO32_LITTLE(m + 32)); > + x9 =3D XOR(x9,U8TO32_LITTLE(m + 36)); > + x10 =3D XOR(x10,U8TO32_LITTLE(m + 40)); > + x11 =3D XOR(x11,U8TO32_LITTLE(m + 44)); > + x12 =3D XOR(x12,U8TO32_LITTLE(m + 48)); > + x13 =3D XOR(x13,U8TO32_LITTLE(m + 52)); > + x14 =3D XOR(x14,U8TO32_LITTLE(m + 56)); > + x15 =3D XOR(x15,U8TO32_LITTLE(m + 60)); > + > + j12 =3D PLUSONE(j12); > + if (!j12) { > + j13 =3D PLUSONE(j13); > + /* stopping at 2^70 bytes per nonce is user's responsibility */ > + } > + > + U32TO8_LITTLE(c + 0,x0); > + U32TO8_LITTLE(c + 4,x1); > + U32TO8_LITTLE(c + 8,x2); > + U32TO8_LITTLE(c + 12,x3); > + U32TO8_LITTLE(c + 16,x4); > + U32TO8_LITTLE(c + 20,x5); > + U32TO8_LITTLE(c + 24,x6); > + U32TO8_LITTLE(c + 28,x7); > + U32TO8_LITTLE(c + 32,x8); > + U32TO8_LITTLE(c + 36,x9); > + U32TO8_LITTLE(c + 40,x10); > + U32TO8_LITTLE(c + 44,x11); > + U32TO8_LITTLE(c + 48,x12); > + U32TO8_LITTLE(c + 52,x13); > + U32TO8_LITTLE(c + 56,x14); > + U32TO8_LITTLE(c + 60,x15); > + > + if (bytes <=3D 64) { > + if (bytes < 64) { > + for (i =3D 0;i < bytes;++i) ctarget[i] =3D c[i]; > + } > + x->input[12] =3D j12; > + x->input[13] =3D j13; > + return; > + } > + bytes -=3D 64; > + c +=3D 64; > + m +=3D 64; > + } > +} >=20 > Added: head/sys/crypto/chacha20/chacha.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 > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/sys/crypto/chacha20/chacha.h Sun Apr 16 09:11:02 2017 = (r317015) > @@ -0,0 +1,32 @@ > +/* $OpenBSD: chacha.h,v 1.4 2016/08/27 04:04:56 guenther Exp $ */ > + > +/* > +chacha-merged.c version 20080118 > +D. J. Bernstein > +Public domain. > + > + $FreeBSD$ > +*/ > + > +#ifndef CHACHA_H > +#define CHACHA_H > + > +#include > + > +struct chacha_ctx { > + u_int input[16]; > +}; > + > +#define CHACHA_MINKEYLEN 16 > +#define CHACHA_NONCELEN 8 > +#define CHACHA_CTRLEN 8 > +#define CHACHA_STATELEN (CHACHA_NONCELEN+CHACHA_CTRLEN) > +#define CHACHA_BLOCKLEN 64 > + > +void chacha_keysetup(struct chacha_ctx *x, const u_char *k, u_int = kbits); > +void chacha_ivsetup(struct chacha_ctx *x, const u_char *iv, const = u_char *ctr); > +void chacha_encrypt_bytes(struct chacha_ctx *x, const u_char *m, > + u_char *c, u_int bytes); > + > +#endif /* CHACHA_H */ > + >=20 > Modified: head/sys/dev/random/random_harvestq.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/dev/random/random_harvestq.c Sun Apr 16 09:00:10 2017 = (r317014) > +++ head/sys/dev/random/random_harvestq.c Sun Apr 16 09:11:02 2017 = (r317015) > @@ -352,10 +352,19 @@ random_harvestq_prime(void *unused __unu > * Get entropy that may have been preloaded by loader(8) > * and use it to pre-charge the entropy harvest queue. > */ > - keyfile =3D = preload_search_by_type(RANDOM_HARVESTQ_BOOT_ENTROPY_FILE); > + keyfile =3D = preload_search_by_type(RANDOM_CACHED_BOOT_ENTROPY_MODULE); > +#ifndef NO_BACKWARD_COMPATIBILITY > + if (keyfile =3D=3D NULL) > + keyfile =3D = preload_search_by_type(RANDOM_LEGACY_BOOT_ENTROPY_MODULE); > +#endif > if (keyfile !=3D NULL) { > data =3D preload_fetch_addr(keyfile); > size =3D preload_fetch_size(keyfile); > + /* skip the first bit of the stash so others like arc4 = can also have some. */ > + if (size > RANDOM_CACHED_SKIP_START) { > + data +=3D RANDOM_CACHED_SKIP_START; > + size -=3D RANDOM_CACHED_SKIP_START; > + } > /* Trim the size. If the admin has a file with a funny = size, we lose some. Tough. */ > size -=3D (size % sizeof(event.he_entropy)); > if (data !=3D NULL && size !=3D 0) { >=20 > Modified: head/sys/dev/random/random_harvestq.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/dev/random/random_harvestq.h Sun Apr 16 09:00:10 2017 = (r317014) > +++ head/sys/dev/random/random_harvestq.h Sun Apr 16 09:11:02 2017 = (r317015) > @@ -1,5 +1,5 @@ > /*- > - * Copyright (c) 2013-2015 Mark R V Murray > + * Copyright (c) 2013-2015, 2017 Mark R V Murray > * All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > @@ -45,8 +45,6 @@ struct harvest_event { >=20 > void read_rate_increment(u_int); >=20 > -#define RANDOM_HARVESTQ_BOOT_ENTROPY_FILE "/boot/entropy" > - > #define RANDOM_HARVEST_INIT_LOCK(x) = mtx_init(&harvest_context.hc_mtx, "entropy harvest mutex", NULL, = MTX_SPIN) > #define RANDOM_HARVEST_LOCK(x) = mtx_lock_spin(&harvest_context.hc_mtx) > #define RANDOM_HARVEST_UNLOCK(x) = mtx_unlock_spin(&harvest_context.hc_mtx) >=20 > Modified: head/sys/libkern/arc4random.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/libkern/arc4random.c Sun Apr 16 09:00:10 2017 = (r317014) > +++ head/sys/libkern/arc4random.c Sun Apr 16 09:11:02 2017 = (r317015) > @@ -1,11 +1,28 @@ > /*- > - * THE BEER-WARE LICENSE > + * Copyright (c) 2017 The FreeBSD Foundation > + * All rights reserved. > * > - * wrote this file. As long as you retain this = notice you > - * can do whatever you want with this stuff. If we meet some day, = and you > - * think this stuff is worth it, you can buy me a beer in return. > + * 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 > + * in this position and unchanged. > + * 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. > * > - * Dan Moschuk > */ >=20 > #include > @@ -14,144 +31,122 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > -#include > #include > +#include > #include > +#include > #include > -#include > +#include > #include > -#include > +#include > + > +#include >=20 > -#define ARC4_RESEED_BYTES 65536 > -#define ARC4_RESEED_SECONDS 300 > -#define ARC4_KEYBYTES 256 > +#define CHACHA20_RESEED_BYTES 65536 > +#define CHACHA20_RESEED_SECONDS 300 > +#define CHACHA20_KEYBYTES 32 > +#define CHACHA20_BUFFER_SIZE 64 > + > +CTASSERT(CHACHA20_KEYBYTES*8 >=3D CHACHA_MINKEYLEN); >=20 > int arc4rand_iniseed_state =3D ARC4_ENTR_NONE; >=20 > -MALLOC_DEFINE(M_ARC4RANDOM, "arc4random", "arc4random structures"); > +MALLOC_DEFINE(M_CHACHA20RANDOM, "chacha20random", "chacha20random = structures"); >=20 > -struct arc4_s { > +struct chacha20_s { > struct mtx mtx; > - u_int8_t i, j; > - int numruns; > - u_int8_t sbox[256]; > + int numbytes; > + int first_time_done; > time_t t_reseed; > - > + u_int8_t m_buffer[CHACHA20_BUFFER_SIZE]; > + struct chacha_ctx ctx; > } __aligned(CACHE_LINE_SIZE); >=20 > -static struct arc4_s *arc4inst =3D NULL; > +static struct chacha20_s *chacha20inst =3D NULL; >=20 > -#define ARC4_FOREACH(_arc4) \ > - for (_arc4 =3D &arc4inst[0]; _arc4 <=3D &arc4inst[mp_maxid]; = _arc4++) > - > -static u_int8_t arc4_randbyte(struct arc4_s *arc4); > - > -static __inline void > -arc4_swap(u_int8_t *a, u_int8_t *b) > -{ > - u_int8_t c; > - > - c =3D *a; > - *a =3D *b; > - *b =3D c; > -}=09 > +#define CHACHA20_FOREACH(_chacha20) \ > + for (_chacha20 =3D &chacha20inst[0]; \ > + _chacha20 <=3D &chacha20inst[mp_maxid]; \ > + _chacha20++) >=20 > /* > - * Stir our S-box. > + * Mix up the current context. > */ > static void > -arc4_randomstir(struct arc4_s* arc4) > +chacha20_randomstir(struct chacha20_s* chacha20) > { > - u_int8_t key[ARC4_KEYBYTES]; > - int n; > struct timeval tv_now; > + size_t n, size; > + u_int8_t key[CHACHA20_KEYBYTES], *data; > + caddr_t keyfile; >=20 > /* > - * XXX: FIX!! This isn't brilliant. Need more confidence. > - * This returns zero entropy before random(4) is seeded. > + * This is making the best of what may be an insecure > + * Situation. If the loader(8) did not have an entropy > + * stash from the previous shutdown to load, then we will > + * be improperly seeded. The answer is to make sure there > + * is an entropy stash at shutdown time. > */ > - (void)read_random(key, ARC4_KEYBYTES); > - getmicrouptime(&tv_now); > - mtx_lock(&arc4->mtx); > - for (n =3D 0; n < 256; n++) { > - arc4->j =3D (arc4->j + arc4->sbox[n] + key[n]) % 256; > - arc4_swap(&arc4->sbox[n], &arc4->sbox[arc4->j]); > + (void)read_random(key, CHACHA20_KEYBYTES); > + if (!chacha20->first_time_done) { > + keyfile =3D = preload_search_by_type(RANDOM_CACHED_BOOT_ENTROPY_MODULE); > + if (keyfile !=3D NULL) { > + data =3D preload_fetch_addr(keyfile); > + size =3D MIN(preload_fetch_size(keyfile), = CHACHA20_KEYBYTES); > + for (n =3D 0; n < size; n++) > + key[n] ^=3D data[n]; > + explicit_bzero(data, size); > + if (bootverbose) > + printf("arc4random: read %zu bytes from = preloaded cache\n", size); > + } else > + printf("arc4random: no preloaded entropy = cache\n"); > + chacha20->first_time_done =3D 1; > } > - arc4->i =3D arc4->j =3D 0; > + getmicrouptime(&tv_now); > + mtx_lock(&chacha20->mtx); > + chacha_keysetup(&chacha20->ctx, key, CHACHA20_KEYBYTES*8); > + chacha_ivsetup(&chacha20->ctx, (u_char *)&tv_now.tv_sec, (u_char = *)&tv_now.tv_usec); > /* Reset for next reseed cycle. */ > - arc4->t_reseed =3D tv_now.tv_sec + ARC4_RESEED_SECONDS; > - arc4->numruns =3D 0; > - /* > - * Throw away the first N words of output, as suggested in the > - * paper "Weaknesses in the Key Scheduling Algorithm of RC4" > - * by Fluher, Mantin, and Shamir. (N =3D 768 in our case.) > - * > - * http://dl.acm.org/citation.cfm?id=3D646557.694759 > - */ > - for (n =3D 0; n < 768*4; n++) > - arc4_randbyte(arc4); > - > - mtx_unlock(&arc4->mtx); > + chacha20->t_reseed =3D tv_now.tv_sec + CHACHA20_RESEED_SECONDS; > + chacha20->numbytes =3D 0; > + mtx_unlock(&chacha20->mtx); > } >=20 > /* > - * Initialize our S-box to its beginning defaults. > + * Initialize the contexts. > */ > static void > -arc4_init(void) > +chacha20_init(void) > { > - struct arc4_s *arc4; > - int n; > - > - arc4inst =3D malloc((mp_maxid + 1) * sizeof(struct arc4_s), > - M_ARC4RANDOM, M_NOWAIT | M_ZERO); > - KASSERT(arc4inst !=3D NULL, ("arc4_init: memory allocation = error")); > + struct chacha20_s *chacha20; >=20 > - ARC4_FOREACH(arc4) { > - mtx_init(&arc4->mtx, "arc4_mtx", NULL, MTX_DEF); > - > - arc4->i =3D arc4->j =3D 0; > - for (n =3D 0; n < 256; n++) > - arc4->sbox[n] =3D (u_int8_t) n; > - > - arc4->t_reseed =3D -1; > - arc4->numruns =3D 0; > + chacha20inst =3D malloc((mp_maxid + 1) * sizeof(struct = chacha20_s), > + M_CHACHA20RANDOM, M_NOWAIT | M_ZERO); > + KASSERT(chacha20inst !=3D NULL, ("chacha20_init: memory = allocation error")); > + > + CHACHA20_FOREACH(chacha20) { > + mtx_init(&chacha20->mtx, "chacha20_mtx", NULL, MTX_DEF); > + chacha20->t_reseed =3D -1; > + chacha20->numbytes =3D 0; > + chacha20->first_time_done =3D 0; > + explicit_bzero(chacha20->m_buffer, = CHACHA20_BUFFER_SIZE); > + explicit_bzero(&chacha20->ctx, sizeof(chacha20->ctx)); > } > } > -SYSINIT(arc4, SI_SUB_LOCK, SI_ORDER_ANY, arc4_init, NULL); > +SYSINIT(chacha20, SI_SUB_LOCK, SI_ORDER_ANY, chacha20_init, NULL); >=20 >=20 > static void > -arc4_uninit(void) > +chacha20_uninit(void) > { > - struct arc4_s *arc4; > + struct chacha20_s *chacha20; >=20 > - ARC4_FOREACH(arc4) { > - mtx_destroy(&arc4->mtx); > - } > - > - free(arc4inst, M_ARC4RANDOM); > + CHACHA20_FOREACH(chacha20) > + mtx_destroy(&chacha20->mtx); > + free(chacha20inst, M_CHACHA20RANDOM); > } > +SYSUNINIT(chacha20, SI_SUB_LOCK, SI_ORDER_ANY, chacha20_uninit, = NULL); >=20 > -SYSUNINIT(arc4, SI_SUB_LOCK, SI_ORDER_ANY, arc4_uninit, NULL); > - > - > -/* > - * Generate a random byte. > - */ > -static u_int8_t > -arc4_randbyte(struct arc4_s *arc4) > -{ > - u_int8_t arc4_t; > - > - arc4->i =3D (arc4->i + 1) % 256; > - arc4->j =3D (arc4->j + arc4->sbox[arc4->i]) % 256; > - > - arc4_swap(&arc4->sbox[arc4->i], &arc4->sbox[arc4->j]); > - > - arc4_t =3D (arc4->sbox[arc4->i] + arc4->sbox[arc4->j]) % 256; > - return arc4->sbox[arc4_t]; > -} >=20 > /* > * MPSAFE > @@ -159,28 +154,36 @@ arc4_randbyte(struct arc4_s *arc4) > void > arc4rand(void *ptr, u_int len, int reseed) > { > - u_char *p; > + struct chacha20_s *chacha20; > struct timeval tv; > - struct arc4_s *arc4; > + u_int length; > + u_int8_t *p; >=20 > - if (reseed || atomic_cmpset_int(&arc4rand_iniseed_state, > - ARC4_ENTR_HAVE, ARC4_ENTR_SEED)) { > - ARC4_FOREACH(arc4) > - arc4_randomstir(arc4); > - } > + if (reseed || atomic_cmpset_int(&arc4rand_iniseed_state, = ARC4_ENTR_HAVE, ARC4_ENTR_SEED)) > + CHACHA20_FOREACH(chacha20) > + chacha20_randomstir(chacha20); >=20 > - arc4 =3D &arc4inst[curcpu]; > + chacha20 =3D &chacha20inst[curcpu]; > getmicrouptime(&tv); > - if ((arc4->numruns > ARC4_RESEED_BYTES) || > - (tv.tv_sec > arc4->t_reseed)) > - arc4_randomstir(arc4); > + /* We may get unlucky and be migrated off this CPU, but that is = expected to be infrequent */ > + if ((chacha20->numbytes > CHACHA20_RESEED_BYTES) || (tv.tv_sec > = chacha20->t_reseed)) > + chacha20_randomstir(chacha20); >=20 > - mtx_lock(&arc4->mtx); > - arc4->numruns +=3D len; > + mtx_lock(&chacha20->mtx); > p =3D ptr; > - while (len--) > - *p++ =3D arc4_randbyte(arc4); > - mtx_unlock(&arc4->mtx); > + while (len) { > + length =3D MIN(CHACHA20_BUFFER_SIZE, len); > + chacha_encrypt_bytes(&chacha20->ctx, chacha20->m_buffer, = p, length); > + p +=3D length; > + len -=3D length; > + chacha20->numbytes +=3D length; > + if (chacha20->numbytes > CHACHA20_RESEED_BYTES) { > + mtx_unlock(&chacha20->mtx); > + chacha20_randomstir(chacha20); > + mtx_lock(&chacha20->mtx); > + } > + } > + mtx_unlock(&chacha20->mtx); > } >=20 > uint32_t > @@ -188,6 +191,13 @@ arc4random(void) > { > uint32_t ret; >=20 > - arc4rand(&ret, sizeof ret, 0); > + arc4rand(&ret, sizeof(ret), 0); > return ret; > } > + > +void > +arc4random_buf(void *ptr, size_t len) > +{ > + > + arc4rand(ptr, len, 0); > +} >=20 > Modified: head/sys/sys/libkern.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/sys/libkern.h Sun Apr 16 09:00:10 2017 = (r317014) > +++ head/sys/sys/libkern.h Sun Apr 16 09:11:02 2017 = (r317015) > @@ -117,7 +117,8 @@ extern int arc4rand_iniseed_state; > /* Prototypes for non-quad routines. */ > struct malloc_type; > uint32_t arc4random(void); > -void arc4rand(void *ptr, u_int len, int reseed); > +void arc4random_buf(void *, size_t); > +void arc4rand(void *, u_int, int); > int bcmp(const void *, const void *, size_t); > int timingsafe_bcmp(const void *, const void *, size_t); > void *bsearch(const void *, const void *, size_t, >=20 > Modified: head/sys/sys/random.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/sys/random.h Sun Apr 16 09:00:10 2017 = (r317014) > +++ head/sys/sys/random.h Sun Apr 16 09:11:02 2017 = (r317015) > @@ -1,5 +1,5 @@ > /*- > - * Copyright (c) 2000-2015 Mark R. V. Murray > + * Copyright (c) 2000-2015, 2017 Mark R. V. Murray > * All rights reserved. > * > * Redistribution and use in source and binary forms, with or without > @@ -96,6 +96,10 @@ enum random_entropy_source { >=20 > #define RANDOM_HARVEST_EVERYTHING_MASK ((1 << = (RANDOM_ENVIRONMENTAL_END + 1)) - 1) >=20 > +#define RANDOM_LEGACY_BOOT_ENTROPY_MODULE "/boot/entropy" > +#define RANDOM_CACHED_BOOT_ENTROPY_MODULE "boot_entropy_cache" > +#define RANDOM_CACHED_SKIP_START 256 > + > #if defined(DEV_RANDOM) > void random_harvest_queue(const void *, u_int, u_int, enum = random_entropy_source); > void random_harvest_fast(const void *, u_int, u_int, enum = random_entropy_source); >=20 --=20 Mark R V Murray From owner-svn-src-head@freebsd.org Sun Apr 16 11:50:54 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 760BED41077; Sun, 16 Apr 2017 11:50:54 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 540651606; Sun, 16 Apr 2017 11:50:53 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id v3GBojYq016404; Sun, 16 Apr 2017 04:50:45 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id v3GBohYF016403; Sun, 16 Apr 2017 04:50:43 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201704161150.v3GBohYF016403@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r317015 - in head/sys: boot/forth conf crypto/chacha20 dev/random libkern sys In-Reply-To: To: Mark R V Murray Date: Sun, 16 Apr 2017 04:50:43 -0700 (PDT) CC: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 16 Apr 2017 11:50:54 -0000 > This does not use DES' Chacha20 commit, as I had already completed the > testing for it, and received SO@ approval. > > DES's commit made Chaha20 a module. This is of no use to arc4random(9), > which needs the code to be standard. Also his API is different. > > I have no objection to reworking the arc4random/Chacha below to use DES' > version of Chacha, but his code needs to be standard library code, > not an optional module. > > Any objections to me doing this? Yes We need to move towards more modules, not less. Having this standard does not even allow one to compile a kernel without it. I should be able to compile a kernel without arc4random(9) and without chacha if I so desire. And I should be able to load and unload these if I so desire. This later feature is VERY usefull for developement and debug cycles. I am sure with careful though we can find a way to allow arc4random to use a pointer that knows if the chacha code is avaliable, and use it if so, and if not fall back to something else, or punt with an error return. I have done this with minidumps, if my module is not loaded and the kernel panics, and is set to attempt a minidump it just logs another error when it finds the NULL pointer and continues on its way to panic. > M > > > On 16 Apr 2017, at 10:11, Mark Murray wrote: > > > > Author: markm > > Date: Sun Apr 16 09:11:02 2017 > > New Revision: 317015 > > URL: https://svnweb.freebsd.org/changeset/base/317015 > > > > Log: > > Replace the RC4 algorithm for generating in-kernel secure random > > numbers with Chacha20. Keep the API, though, as that is what the > > other *BSD's have done. > > > > Use the boot-time entropy stash (if present) to bootstrap the > > in-kernel entropy source. > > > > Reviewed by: delphij,rwatson > > Approved by: so(delphij) > > MFC after: 2 months > > Relnotes: yes > > Differential Revision: https://reviews.freebsd.org/D10048 > > --This line, and those below, will be ignored-- > >> Description of fields to fill in above: 76 columns --| > >> PR: If and which Problem Report is related. > >> Submitted by: If someone else sent in the change. > >> Reported by: If someone else reported the issue. > >> Reviewed by: If someone else reviewed your modification. > >> Approved by: If you needed approval for this commit. > >> Obtained from: If the change is from a third party. > >> MFC after: N [day[s]|week[s]|month[s]]. Request a reminder email. > >> MFH: Ports tree branch name. Request approval for merge. > >> Relnotes: Set to 'yes' for mention in release notes. > >> Security: Vulnerability reference (one per line) or description. > >> Sponsored by: If the change was sponsored by an organization. > >> Differential Revision: https://reviews.freebsd.org/D### (*full* phabric URL needed). > >> Empty fields above will be automatically removed. > > > > Added: > > head/sys/crypto/chacha20/chacha.c (contents, props changed) > > head/sys/crypto/chacha20/chacha.h (contents, props changed) > > Modified: > > head/sys/boot/forth/loader.conf > > head/sys/conf/files > > head/sys/dev/random/random_harvestq.c > > head/sys/dev/random/random_harvestq.h > > head/sys/libkern/arc4random.c > > head/sys/sys/libkern.h > > head/sys/sys/random.h > > > > Modified: head/sys/boot/forth/loader.conf > > ============================================================================== > > --- head/sys/boot/forth/loader.conf Sun Apr 16 09:00:10 2017 (r317014) > > +++ head/sys/boot/forth/loader.conf Sun Apr 16 09:11:02 2017 (r317015) > > @@ -48,7 +48,7 @@ bitmap_type="splash_image_data" # and pl > > entropy_cache_load="YES" # Set this to NO to disable loading > > # entropy at boot time > > entropy_cache_name="/boot/entropy" # Set this to the name of the file > > -entropy_cache_type="/boot/entropy" # Required for the kernel to find > > +entropy_cache_type="boot_entropy_cache" # Required for the kernel to find > > # the boot-time entropy cache. This > > # must not change value even if the > > # _name above does change! > > > > Modified: head/sys/conf/files > > ============================================================================== > > --- head/sys/conf/files Sun Apr 16 09:00:10 2017 (r317014) > > +++ head/sys/conf/files Sun Apr 16 09:11:02 2017 (r317015) > > @@ -3810,6 +3810,7 @@ kgssapi/gsstest.c optional kgssapi_debu > > # the file should be moved to conf/files. from here. > > # > > libkern/arc4random.c standard > > +crypto/chacha20/chacha.c standard > > libkern/asprintf.c standard > > libkern/bcd.c standard > > libkern/bsearch.c standard > > > > Added: head/sys/crypto/chacha20/chacha.c > > ============================================================================== > > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > > +++ head/sys/crypto/chacha20/chacha.c Sun Apr 16 09:11:02 2017 (r317015) > > @@ -0,0 +1,224 @@ > > +/* > > +chacha-merged.c version 20080118 > > +D. J. Bernstein > > +Public domain. > > +*/ > > + > > +/* $OpenBSD: chacha.c,v 1.1 2013/11/21 00:45:44 djm Exp $ */ > > + > > +#include > > +__FBSDID("$FreeBSD$"); > > + > > +#include > > +#include > > + > > +#include > > + > > + > > +typedef uint8_t u8; > > +typedef uint32_t u32; > > + > > +typedef struct chacha_ctx chacha_ctx; > > + > > +#define U8C(v) (v##U) > > +#define U32C(v) (v##U) > > + > > +#define U8V(v) ((u8)(v) & U8C(0xFF)) > > +#define U32V(v) ((u32)(v) & U32C(0xFFFFFFFF)) > > + > > +#define ROTL32(v, n) \ > > + (U32V((v) << (n)) | ((v) >> (32 - (n)))) > > + > > +#define U8TO32_LITTLE(p) \ > > + (((u32)((p)[0]) ) | \ > > + ((u32)((p)[1]) << 8) | \ > > + ((u32)((p)[2]) << 16) | \ > > + ((u32)((p)[3]) << 24)) > > + > > +#define U32TO8_LITTLE(p, v) \ > > + do { \ > > + (p)[0] = U8V((v) ); \ > > + (p)[1] = U8V((v) >> 8); \ > > + (p)[2] = U8V((v) >> 16); \ > > + (p)[3] = U8V((v) >> 24); \ > > + } while (0) > > + > > +#define ROTATE(v,c) (ROTL32(v,c)) > > +#define XOR(v,w) ((v) ^ (w)) > > +#define PLUS(v,w) (U32V((v) + (w))) > > +#define PLUSONE(v) (PLUS((v),1)) > > + > > +#define QUARTERROUND(a,b,c,d) \ > > + a = PLUS(a,b); d = ROTATE(XOR(d,a),16); \ > > + c = PLUS(c,d); b = ROTATE(XOR(b,c),12); \ > > + a = PLUS(a,b); d = ROTATE(XOR(d,a), 8); \ > > + c = PLUS(c,d); b = ROTATE(XOR(b,c), 7); > > + > > +static const char sigma[16] = "expand 32-byte k"; > > +static const char tau[16] = "expand 16-byte k"; > > + > > +void > > +chacha_keysetup(chacha_ctx *x,const u8 *k,u32 kbits) > > +{ > > + const char *constants; > > + > > + x->input[4] = U8TO32_LITTLE(k + 0); > > + x->input[5] = U8TO32_LITTLE(k + 4); > > + x->input[6] = U8TO32_LITTLE(k + 8); > > + x->input[7] = U8TO32_LITTLE(k + 12); > > + if (kbits == 256) { /* recommended */ > > + k += 16; > > + constants = sigma; > > + } else { /* kbits == 128 */ > > + constants = tau; > > + } > > + x->input[8] = U8TO32_LITTLE(k + 0); > > + x->input[9] = U8TO32_LITTLE(k + 4); > > + x->input[10] = U8TO32_LITTLE(k + 8); > > + x->input[11] = U8TO32_LITTLE(k + 12); > > + x->input[0] = U8TO32_LITTLE(constants + 0); > > + x->input[1] = U8TO32_LITTLE(constants + 4); > > + x->input[2] = U8TO32_LITTLE(constants + 8); > > + x->input[3] = U8TO32_LITTLE(constants + 12); > > +} > > + > > +void > > +chacha_ivsetup(chacha_ctx *x, const u8 *iv, const u8 *counter) > > +{ > > + x->input[12] = counter == NULL ? 0 : U8TO32_LITTLE(counter + 0); > > + x->input[13] = counter == NULL ? 0 : U8TO32_LITTLE(counter + 4); > > + x->input[14] = U8TO32_LITTLE(iv + 0); > > + x->input[15] = U8TO32_LITTLE(iv + 4); > > +} > > + > > +void > > +chacha_encrypt_bytes(chacha_ctx *x,const u8 *m,u8 *c,u32 bytes) > > +{ > > + u32 x0, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15; > > + u32 j0, j1, j2, j3, j4, j5, j6, j7, j8, j9, j10, j11, j12, j13, j14, j15; > > + u8 *ctarget = NULL; > > + u8 tmp[64]; > > + u_int i; > > + > > + if (!bytes) return; > > + > > + j0 = x->input[0]; > > + j1 = x->input[1]; > > + j2 = x->input[2]; > > + j3 = x->input[3]; > > + j4 = x->input[4]; > > + j5 = x->input[5]; > > + j6 = x->input[6]; > > + j7 = x->input[7]; > > + j8 = x->input[8]; > > + j9 = x->input[9]; > > + j10 = x->input[10]; > > + j11 = x->input[11]; > > + j12 = x->input[12]; > > + j13 = x->input[13]; > > + j14 = x->input[14]; > > + j15 = x->input[15]; > > + > > + for (;;) { > > + if (bytes < 64) { > > + for (i = 0;i < bytes;++i) tmp[i] = m[i]; > > + m = tmp; > > + ctarget = c; > > + c = tmp; > > + } > > + x0 = j0; > > + x1 = j1; > > + x2 = j2; > > + x3 = j3; > > + x4 = j4; > > + x5 = j5; > > + x6 = j6; > > + x7 = j7; > > + x8 = j8; > > + x9 = j9; > > + x10 = j10; > > + x11 = j11; > > + x12 = j12; > > + x13 = j13; > > + x14 = j14; > > + x15 = j15; > > + for (i = 20;i > 0;i -= 2) { > > + QUARTERROUND( x0, x4, x8,x12) > > + QUARTERROUND( x1, x5, x9,x13) > > + QUARTERROUND( x2, x6,x10,x14) > > + QUARTERROUND( x3, x7,x11,x15) > > + QUARTERROUND( x0, x5,x10,x15) > > + QUARTERROUND( x1, x6,x11,x12) > > + QUARTERROUND( x2, x7, x8,x13) > > + QUARTERROUND( x3, x4, x9,x14) > > + } > > + x0 = PLUS(x0,j0); > > + x1 = PLUS(x1,j1); > > + x2 = PLUS(x2,j2); > > + x3 = PLUS(x3,j3); > > + x4 = PLUS(x4,j4); > > + x5 = PLUS(x5,j5); > > + x6 = PLUS(x6,j6); > > + x7 = PLUS(x7,j7); > > + x8 = PLUS(x8,j8); > > + x9 = PLUS(x9,j9); > > + x10 = PLUS(x10,j10); > > + x11 = PLUS(x11,j11); > > + x12 = PLUS(x12,j12); > > + x13 = PLUS(x13,j13); > > + x14 = PLUS(x14,j14); > > + x15 = PLUS(x15,j15); > > + > > + x0 = XOR(x0,U8TO32_LITTLE(m + 0)); > > + x1 = XOR(x1,U8TO32_LITTLE(m + 4)); > > + x2 = XOR(x2,U8TO32_LITTLE(m + 8)); > > + x3 = XOR(x3,U8TO32_LITTLE(m + 12)); > > + x4 = XOR(x4,U8TO32_LITTLE(m + 16)); > > + x5 = XOR(x5,U8TO32_LITTLE(m + 20)); > > + x6 = XOR(x6,U8TO32_LITTLE(m + 24)); > > + x7 = XOR(x7,U8TO32_LITTLE(m + 28)); > > + x8 = XOR(x8,U8TO32_LITTLE(m + 32)); > > + x9 = XOR(x9,U8TO32_LITTLE(m + 36)); > > + x10 = XOR(x10,U8TO32_LITTLE(m + 40)); > > + x11 = XOR(x11,U8TO32_LITTLE(m + 44)); > > + x12 = XOR(x12,U8TO32_LITTLE(m + 48)); > > + x13 = XOR(x13,U8TO32_LITTLE(m + 52)); > > + x14 = XOR(x14,U8TO32_LITTLE(m + 56)); > > + x15 = XOR(x15,U8TO32_LITTLE(m + 60)); > > + > > + j12 = PLUSONE(j12); > > + if (!j12) { > > + j13 = PLUSONE(j13); > > + /* stopping at 2^70 bytes per nonce is user's responsibility */ > > + } > > + > > + U32TO8_LITTLE(c + 0,x0); > > + U32TO8_LITTLE(c + 4,x1); > > + U32TO8_LITTLE(c + 8,x2); > > + U32TO8_LITTLE(c + 12,x3); > > + U32TO8_LITTLE(c + 16,x4); > > + U32TO8_LITTLE(c + 20,x5); > > + U32TO8_LITTLE(c + 24,x6); > > + U32TO8_LITTLE(c + 28,x7); > > + U32TO8_LITTLE(c + 32,x8); > > + U32TO8_LITTLE(c + 36,x9); > > + U32TO8_LITTLE(c + 40,x10); > > + U32TO8_LITTLE(c + 44,x11); > > + U32TO8_LITTLE(c + 48,x12); > > + U32TO8_LITTLE(c + 52,x13); > > + U32TO8_LITTLE(c + 56,x14); > > + U32TO8_LITTLE(c + 60,x15); > > + > > + if (bytes <= 64) { > > + if (bytes < 64) { > > + for (i = 0;i < bytes;++i) ctarget[i] = c[i]; > > + } > > + x->input[12] = j12; > > + x->input[13] = j13; > > + return; > > + } > > + bytes -= 64; > > + c += 64; > > + m += 64; > > + } > > +} > > > > Added: head/sys/crypto/chacha20/chacha.h > > ============================================================================== > > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > > +++ head/sys/crypto/chacha20/chacha.h Sun Apr 16 09:11:02 2017 (r317015) > > @@ -0,0 +1,32 @@ > > +/* $OpenBSD: chacha.h,v 1.4 2016/08/27 04:04:56 guenther Exp $ */ > > + > > +/* > > +chacha-merged.c version 20080118 > > +D. J. Bernstein > > +Public domain. > > + > > + $FreeBSD$ > > +*/ > > + > > +#ifndef CHACHA_H > > +#define CHACHA_H > > + > > +#include > > + > > +struct chacha_ctx { > > + u_int input[16]; > > +}; > > + > > +#define CHACHA_MINKEYLEN 16 > > +#define CHACHA_NONCELEN 8 > > +#define CHACHA_CTRLEN 8 > > +#define CHACHA_STATELEN (CHACHA_NONCELEN+CHACHA_CTRLEN) > > +#define CHACHA_BLOCKLEN 64 > > + > > +void chacha_keysetup(struct chacha_ctx *x, const u_char *k, u_int kbits); > > +void chacha_ivsetup(struct chacha_ctx *x, const u_char *iv, const u_char *ctr); > > +void chacha_encrypt_bytes(struct chacha_ctx *x, const u_char *m, > > + u_char *c, u_int bytes); > > + > > +#endif /* CHACHA_H */ > > + > > > > Modified: head/sys/dev/random/random_harvestq.c > > ============================================================================== > > --- head/sys/dev/random/random_harvestq.c Sun Apr 16 09:00:10 2017 (r317014) > > +++ head/sys/dev/random/random_harvestq.c Sun Apr 16 09:11:02 2017 (r317015) > > @@ -352,10 +352,19 @@ random_harvestq_prime(void *unused __unu > > * Get entropy that may have been preloaded by loader(8) > > * and use it to pre-charge the entropy harvest queue. > > */ > > - keyfile = preload_search_by_type(RANDOM_HARVESTQ_BOOT_ENTROPY_FILE); > > + keyfile = preload_search_by_type(RANDOM_CACHED_BOOT_ENTROPY_MODULE); > > +#ifndef NO_BACKWARD_COMPATIBILITY > > + if (keyfile == NULL) > > + keyfile = preload_search_by_type(RANDOM_LEGACY_BOOT_ENTROPY_MODULE); > > +#endif > > if (keyfile != NULL) { > > data = preload_fetch_addr(keyfile); > > size = preload_fetch_size(keyfile); > > + /* skip the first bit of the stash so others like arc4 can also have some. */ > > + if (size > RANDOM_CACHED_SKIP_START) { > > + data += RANDOM_CACHED_SKIP_START; > > + size -= RANDOM_CACHED_SKIP_START; > > + } > > /* Trim the size. If the admin has a file with a funny size, we lose some. Tough. */ > > size -= (size % sizeof(event.he_entropy)); > > if (data != NULL && size != 0) { > > > > Modified: head/sys/dev/random/random_harvestq.h > > ============================================================================== > > --- head/sys/dev/random/random_harvestq.h Sun Apr 16 09:00:10 2017 (r317014) > > +++ head/sys/dev/random/random_harvestq.h Sun Apr 16 09:11:02 2017 (r317015) > > @@ -1,5 +1,5 @@ > > /*- > > - * Copyright (c) 2013-2015 Mark R V Murray > > + * Copyright (c) 2013-2015, 2017 Mark R V Murray > > * All rights reserved. > > * > > * Redistribution and use in source and binary forms, with or without > > @@ -45,8 +45,6 @@ struct harvest_event { > > > > void read_rate_increment(u_int); > > > > -#define RANDOM_HARVESTQ_BOOT_ENTROPY_FILE "/boot/entropy" > > - > > #define RANDOM_HARVEST_INIT_LOCK(x) mtx_init(&harvest_context.hc_mtx, "entropy harvest mutex", NULL, MTX_SPIN) > > #define RANDOM_HARVEST_LOCK(x) mtx_lock_spin(&harvest_context.hc_mtx) > > #define RANDOM_HARVEST_UNLOCK(x) mtx_unlock_spin(&harvest_context.hc_mtx) > > > > Modified: head/sys/libkern/arc4random.c > > ============================================================================== > > --- head/sys/libkern/arc4random.c Sun Apr 16 09:00:10 2017 (r317014) > > +++ head/sys/libkern/arc4random.c Sun Apr 16 09:11:02 2017 (r317015) > > @@ -1,11 +1,28 @@ > > /*- > > - * THE BEER-WARE LICENSE > > + * Copyright (c) 2017 The FreeBSD Foundation > > + * All rights reserved. > > * > > - * wrote this file. As long as you retain this notice you > > - * can do whatever you want with this stuff. If we meet some day, and you > > - * think this stuff is worth it, you can buy me a beer in return. > > + * 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 > > + * in this position and unchanged. > > + * 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. > > * > > - * Dan Moschuk > > */ > > > > #include > > @@ -14,144 +31,122 @@ __FBSDID("$FreeBSD$"); > > #include > > #include > > #include > > -#include > > #include > > +#include > > #include > > +#include > > #include > > -#include > > +#include > > #include > > -#include > > +#include > > + > > +#include > > > > -#define ARC4_RESEED_BYTES 65536 > > -#define ARC4_RESEED_SECONDS 300 > > -#define ARC4_KEYBYTES 256 > > +#define CHACHA20_RESEED_BYTES 65536 > > +#define CHACHA20_RESEED_SECONDS 300 > > +#define CHACHA20_KEYBYTES 32 > > +#define CHACHA20_BUFFER_SIZE 64 > > + > > +CTASSERT(CHACHA20_KEYBYTES*8 >= CHACHA_MINKEYLEN); > > > > int arc4rand_iniseed_state = ARC4_ENTR_NONE; > > > > -MALLOC_DEFINE(M_ARC4RANDOM, "arc4random", "arc4random structures"); > > +MALLOC_DEFINE(M_CHACHA20RANDOM, "chacha20random", "chacha20random structures"); > > > > -struct arc4_s { > > +struct chacha20_s { > > struct mtx mtx; > > - u_int8_t i, j; > > - int numruns; > > - u_int8_t sbox[256]; > > + int numbytes; > > + int first_time_done; > > time_t t_reseed; > > - > > + u_int8_t m_buffer[CHACHA20_BUFFER_SIZE]; > > + struct chacha_ctx ctx; > > } __aligned(CACHE_LINE_SIZE); > > > > -static struct arc4_s *arc4inst = NULL; > > +static struct chacha20_s *chacha20inst = NULL; > > > > -#define ARC4_FOREACH(_arc4) \ > > - for (_arc4 = &arc4inst[0]; _arc4 <= &arc4inst[mp_maxid]; _arc4++) > > - > > -static u_int8_t arc4_randbyte(struct arc4_s *arc4); > > - > > -static __inline void > > -arc4_swap(u_int8_t *a, u_int8_t *b) > > -{ > > - u_int8_t c; > > - > > - c = *a; > > - *a = *b; > > - *b = c; > > -} > > +#define CHACHA20_FOREACH(_chacha20) \ > > + for (_chacha20 = &chacha20inst[0]; \ > > + _chacha20 <= &chacha20inst[mp_maxid]; \ > > + _chacha20++) > > > > /* > > - * Stir our S-box. > > + * Mix up the current context. > > */ > > static void > > -arc4_randomstir(struct arc4_s* arc4) > > +chacha20_randomstir(struct chacha20_s* chacha20) > > { > > - u_int8_t key[ARC4_KEYBYTES]; > > - int n; > > struct timeval tv_now; > > + size_t n, size; > > + u_int8_t key[CHACHA20_KEYBYTES], *data; > > + caddr_t keyfile; > > > > /* > > - * XXX: FIX!! This isn't brilliant. Need more confidence. > > - * This returns zero entropy before random(4) is seeded. > > + * This is making the best of what may be an insecure > > + * Situation. If the loader(8) did not have an entropy > > + * stash from the previous shutdown to load, then we will > > + * be improperly seeded. The answer is to make sure there > > + * is an entropy stash at shutdown time. > > */ > > - (void)read_random(key, ARC4_KEYBYTES); > > - getmicrouptime(&tv_now); > > - mtx_lock(&arc4->mtx); > > - for (n = 0; n < 256; n++) { > > - arc4->j = (arc4->j + arc4->sbox[n] + key[n]) % 256; > > - arc4_swap(&arc4->sbox[n], &arc4->sbox[arc4->j]); > > + (void)read_random(key, CHACHA20_KEYBYTES); > > + if (!chacha20->first_time_done) { > > + keyfile = preload_search_by_type(RANDOM_CACHED_BOOT_ENTROPY_MODULE); > > + if (keyfile != NULL) { > > + data = preload_fetch_addr(keyfile); > > + size = MIN(preload_fetch_size(keyfile), CHACHA20_KEYBYTES); > > + for (n = 0; n < size; n++) > > + key[n] ^= data[n]; > > + explicit_bzero(data, size); > > + if (bootverbose) > > + printf("arc4random: read %zu bytes from preloaded cache\n", size); > > + } else > > + printf("arc4random: no preloaded entropy cache\n"); > > + chacha20->first_time_done = 1; > > } > > - arc4->i = arc4->j = 0; > > + getmicrouptime(&tv_now); > > + mtx_lock(&chacha20->mtx); > > + chacha_keysetup(&chacha20->ctx, key, CHACHA20_KEYBYTES*8); > > + chacha_ivsetup(&chacha20->ctx, (u_char *)&tv_now.tv_sec, (u_char *)&tv_now.tv_usec); > > /* Reset for next reseed cycle. */ > > - arc4->t_reseed = tv_now.tv_sec + ARC4_RESEED_SECONDS; > > - arc4->numruns = 0; > > - /* > > - * Throw away the first N words of output, as suggested in the > > - * paper "Weaknesses in the Key Scheduling Algorithm of RC4" > > - * by Fluher, Mantin, and Shamir. (N = 768 in our case.) > > - * > > - * http://dl.acm.org/citation.cfm?id=646557.694759 > > - */ > > - for (n = 0; n < 768*4; n++) > > - arc4_randbyte(arc4); > > - > > - mtx_unlock(&arc4->mtx); > > + chacha20->t_reseed = tv_now.tv_sec + CHACHA20_RESEED_SECONDS; > > + chacha20->numbytes = 0; > > + mtx_unlock(&chacha20->mtx); > > } > > > > /* > > - * Initialize our S-box to its beginning defaults. > > + * Initialize the contexts. > > */ > > static void > > -arc4_init(void) > > +chacha20_init(void) > > { > > - struct arc4_s *arc4; > > - int n; > > - > > - arc4inst = malloc((mp_maxid + 1) * sizeof(struct arc4_s), > > - M_ARC4RANDOM, M_NOWAIT | M_ZERO); > > - KASSERT(arc4inst != NULL, ("arc4_init: memory allocation error")); > > + struct chacha20_s *chacha20; > > > > - ARC4_FOREACH(arc4) { > > - mtx_init(&arc4->mtx, "arc4_mtx", NULL, MTX_DEF); > > - > > - arc4->i = arc4->j = 0; > > - for (n = 0; n < 256; n++) > > - arc4->sbox[n] = (u_int8_t) n; > > - > > - arc4->t_reseed = -1; > > - arc4->numruns = 0; > > + chacha20inst = malloc((mp_maxid + 1) * sizeof(struct chacha20_s), > > + M_CHACHA20RANDOM, M_NOWAIT | M_ZERO); > > + KASSERT(chacha20inst != NULL, ("chacha20_init: memory allocation error")); > > + > > + CHACHA20_FOREACH(chacha20) { > > + mtx_init(&chacha20->mtx, "chacha20_mtx", NULL, MTX_DEF); > > + chacha20->t_reseed = -1; > > + chacha20->numbytes = 0; > > + chacha20->first_time_done = 0; > > + explicit_bzero(chacha20->m_buffer, CHACHA20_BUFFER_SIZE); > > + explicit_bzero(&chacha20->ctx, sizeof(chacha20->ctx)); > > } > > } > > -SYSINIT(arc4, SI_SUB_LOCK, SI_ORDER_ANY, arc4_init, NULL); > > +SYSINIT(chacha20, SI_SUB_LOCK, SI_ORDER_ANY, chacha20_init, NULL); > > > > > > static void > > -arc4_uninit(void) > > +chacha20_uninit(void) > > { > > - struct arc4_s *arc4; > > + struct chacha20_s *chacha20; > > > > - ARC4_FOREACH(arc4) { > > - mtx_destroy(&arc4->mtx); > > - } > > - > > - free(arc4inst, M_ARC4RANDOM); > > + CHACHA20_FOREACH(chacha20) > > + mtx_destroy(&chacha20->mtx); > > + free(chacha20inst, M_CHACHA20RANDOM); > > } > > +SYSUNINIT(chacha20, SI_SUB_LOCK, SI_ORDER_ANY, chacha20_uninit, NULL); > > > > -SYSUNINIT(arc4, SI_SUB_LOCK, SI_ORDER_ANY, arc4_uninit, NULL); > > - > > - > > -/* > > - * Generate a random byte. > > - */ > > -static u_int8_t > > -arc4_randbyte(struct arc4_s *arc4) > > -{ > > - u_int8_t arc4_t; > > - > > - arc4->i = (arc4->i + 1) % 256; > > - arc4->j = (arc4->j + arc4->sbox[arc4->i]) % 256; > > - > > - arc4_swap(&arc4->sbox[arc4->i], &arc4->sbox[arc4->j]); > > - > > - arc4_t = (arc4->sbox[arc4->i] + arc4->sbox[arc4->j]) % 256; > > - return arc4->sbox[arc4_t]; > > -} > > > > /* > > * MPSAFE > > @@ -159,28 +154,36 @@ arc4_randbyte(struct arc4_s *arc4) > > void > > arc4rand(void *ptr, u_int len, int reseed) > > { > > - u_char *p; > > + struct chacha20_s *chacha20; > > struct timeval tv; > > - struct arc4_s *arc4; > > + u_int length; > > + u_int8_t *p; > > > > - if (reseed || atomic_cmpset_int(&arc4rand_iniseed_state, > > - ARC4_ENTR_HAVE, ARC4_ENTR_SEED)) { > > - ARC4_FOREACH(arc4) > > - arc4_randomstir(arc4); > > - } > > + if (reseed || atomic_cmpset_int(&arc4rand_iniseed_state, ARC4_ENTR_HAVE, ARC4_ENTR_SEED)) > > + CHACHA20_FOREACH(chacha20) > > + chacha20_randomstir(chacha20); > > > > - arc4 = &arc4inst[curcpu]; > > + chacha20 = &chacha20inst[curcpu]; > > getmicrouptime(&tv); > > - if ((arc4->numruns > ARC4_RESEED_BYTES) || > > - (tv.tv_sec > arc4->t_reseed)) > > - arc4_randomstir(arc4); > > + /* We may get unlucky and be migrated off this CPU, but that is expected to be infrequent */ > > + if ((chacha20->numbytes > CHACHA20_RESEED_BYTES) || (tv.tv_sec > chacha20->t_reseed)) > > + chacha20_randomstir(chacha20); > > > > - mtx_lock(&arc4->mtx); > > - arc4->numruns += len; > > + mtx_lock(&chacha20->mtx); > > p = ptr; > > - while (len--) > > - *p++ = arc4_randbyte(arc4); > > - mtx_unlock(&arc4->mtx); > > + while (len) { > > + length = MIN(CHACHA20_BUFFER_SIZE, len); > > + chacha_encrypt_bytes(&chacha20->ctx, chacha20->m_buffer, p, length); > > + p += length; > > + len -= length; > > + chacha20->numbytes += length; > > + if (chacha20->numbytes > CHACHA20_RESEED_BYTES) { > > + mtx_unlock(&chacha20->mtx); > > + chacha20_randomstir(chacha20); > > + mtx_lock(&chacha20->mtx); > > + } > > + } > > + mtx_unlock(&chacha20->mtx); > > } > > > > uint32_t > > @@ -188,6 +191,13 @@ arc4random(void) > > { > > uint32_t ret; > > > > - arc4rand(&ret, sizeof ret, 0); > > + arc4rand(&ret, sizeof(ret), 0); > > return ret; > > } > > + > > +void > > +arc4random_buf(void *ptr, size_t len) > > +{ > > + > > + arc4rand(ptr, len, 0); > > +} > > > > Modified: head/sys/sys/libkern.h > > ============================================================================== > > --- head/sys/sys/libkern.h Sun Apr 16 09:00:10 2017 (r317014) > > +++ head/sys/sys/libkern.h Sun Apr 16 09:11:02 2017 (r317015) > > @@ -117,7 +117,8 @@ extern int arc4rand_iniseed_state; > > /* Prototypes for non-quad routines. */ > > struct malloc_type; > > uint32_t arc4random(void); > > -void arc4rand(void *ptr, u_int len, int reseed); > > +void arc4random_buf(void *, size_t); > > +void arc4rand(void *, u_int, int); > > int bcmp(const void *, const void *, size_t); > > int timingsafe_bcmp(const void *, const void *, size_t); > > void *bsearch(const void *, const void *, size_t, > > > > Modified: head/sys/sys/random.h > > ============================================================================== > > --- head/sys/sys/random.h Sun Apr 16 09:00:10 2017 (r317014) > > +++ head/sys/sys/random.h Sun Apr 16 09:11:02 2017 (r317015) > > @@ -1,5 +1,5 @@ > > /*- > > - * Copyright (c) 2000-2015 Mark R. V. Murray > > + * Copyright (c) 2000-2015, 2017 Mark R. V. Murray > > * All rights reserved. > > * > > * Redistribution and use in source and binary forms, with or without > > @@ -96,6 +96,10 @@ enum random_entropy_source { > > > > #define RANDOM_HARVEST_EVERYTHING_MASK ((1 << (RANDOM_ENVIRONMENTAL_END + 1)) - 1) > > > > +#define RANDOM_LEGACY_BOOT_ENTROPY_MODULE "/boot/entropy" > > +#define RANDOM_CACHED_BOOT_ENTROPY_MODULE "boot_entropy_cache" > > +#define RANDOM_CACHED_SKIP_START 256 > > + > > #if defined(DEV_RANDOM) > > void random_harvest_queue(const void *, u_int, u_int, enum random_entropy_source); > > void random_harvest_fast(const void *, u_int, u_int, enum random_entropy_source); > > > > -- > Mark R V Murray > > > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Sun Apr 16 11:58:54 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 741EDD411EE; Sun, 16 Apr 2017 11:58:54 +0000 (UTC) (envelope-from markm@FreeBSD.org) Received: from gromit.grondar.org (grandfather.grondar.org [IPv6:2a01:348:0:15:5d59:5c20:0:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 441F71A4C; Sun, 16 Apr 2017 11:58:54 +0000 (UTC) (envelope-from markm@FreeBSD.org) Received: from graveyard.grondar.org ([88.96.155.33] helo=gronkulator.grondar.org) by gromit.grondar.org with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.88 (FreeBSD)) (envelope-from ) id 1czipN-000Pzb-RD; Sun, 16 Apr 2017 12:58:51 +0100 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: svn commit: r317015 - in head/sys: boot/forth conf crypto/chacha20 dev/random libkern sys From: Mark R V Murray In-Reply-To: <201704161150.v3GBohYF016403@pdx.rh.CN85.dnsmgr.net> Date: Sun, 16 Apr 2017 12:58:49 +0100 Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <8814F883-F255-45E4-8FFE-254359B51B38@FreeBSD.org> References: <201704161150.v3GBohYF016403@pdx.rh.CN85.dnsmgr.net> To: rgrimes@freebsd.org X-Mailer: Apple Mail (2.3273) X-SA-Score: -1.0 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 16 Apr 2017 11:58:54 -0000 > On 16 Apr 2017, at 12:50, Rodney W. Grimes = wrote: >=20 >> This does not use DES' Chacha20 commit, as I had already completed = the >> testing for it, and received SO@ approval. >>=20 >> DES's commit made Chaha20 a module. This is of no use to = arc4random(9), >> which needs the code to be standard. Also his API is different. >>=20 >> I have no objection to reworking the arc4random/Chacha below to use = DES' >> version of Chacha, but his code needs to be standard library code, >> not an optional module. >>=20 >> Any objections to me doing this? >=20 > Yes >=20 > We need to move towards more modules, not less. Having this standard > does not even allow one to compile a kernel without it. I should be > able to compile a kernel without arc4random(9) and without chacha if > I so desire. And I should be able to load and unload these if I so > desire. This later feature is VERY usefull for developement and > debug cycles. =46rom replacing the rc4 algorithm with chacha20, this chalice has now become poisoned with the job of redesigning the entire structure of kernel random-number generation. This may take a while, and I'm already behind on RNG jobs. > I am sure with careful though we can find a way to allow arc4random > to use a pointer that knows if the chacha code is avaliable, and use > it if so, and if not fall back to something else, or punt with an > error return. Error return is out of the question; arc4random() is pretty fundamental. The alternative is to return no or fake random numbers, which rather misses the point of what this is for. But it can be done. M --=20 Mark R V Murray From owner-svn-src-head@freebsd.org Sun Apr 16 12:07:37 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D692BD41A6E; Sun, 16 Apr 2017 12:07:37 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A1E80329; Sun, 16 Apr 2017 12:07:37 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id v3GC7aqW016486; Sun, 16 Apr 2017 05:07:36 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id v3GC7adp016485; Sun, 16 Apr 2017 05:07:36 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201704161207.v3GC7adp016485@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r317015 - in head/sys: boot/forth conf crypto/chacha20 dev/random libkern sys In-Reply-To: <8814F883-F255-45E4-8FFE-254359B51B38@FreeBSD.org> To: Mark R V Murray Date: Sun, 16 Apr 2017 05:07:36 -0700 (PDT) CC: rgrimes@FreeBSD.org, src-committers , svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org Reply-To: rgrimes@FreeBSD.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 16 Apr 2017 12:07:37 -0000 > > > On 16 Apr 2017, at 12:50, Rodney W. Grimes wrote: > > > >> This does not use DES' Chacha20 commit, as I had already completed the > >> testing for it, and received SO@ approval. > >> > >> DES's commit made Chaha20 a module. This is of no use to arc4random(9), > >> which needs the code to be standard. Also his API is different. > >> > >> I have no objection to reworking the arc4random/Chacha below to use DES' > >> version of Chacha, but his code needs to be standard library code, > >> not an optional module. > >> > >> Any objections to me doing this? > > > > Yes > > > > We need to move towards more modules, not less. Having this standard > > does not even allow one to compile a kernel without it. I should be > > able to compile a kernel without arc4random(9) and without chacha if > > I so desire. And I should be able to load and unload these if I so > > desire. This later feature is VERY usefull for developement and > > debug cycles. > > >From replacing the rc4 algorithm with chacha20, this chalice has now > become poisoned with the job of redesigning the entire structure of > kernel random-number generation. > > This may take a while, and I'm already behind on RNG jobs. I do not see how this is a complete redesign of RNG, and if it is such a heart ache to change algorithms in this code then it probably should be redesigned? Also you can always compile in a module, you can not compile out a 'standard' file. For now could you just add options chacha #Required by arc4random, do not remove to your kernel and move on? For me this would be an acceptable developement, even releasable, way to proceed while the more complex issue of how to make the kernel RNG use plagable lkm lower layers. > > I am sure with careful though we can find a way to allow arc4random > > to use a pointer that knows if the chacha code is avaliable, and use > > it if so, and if not fall back to something else, or punt with an > > error return. > > Error return is out of the question; arc4random() is pretty fundamental. > The alternative is to return no or fake random numbers, which rather > misses the point of what this is for. But it can be done. Arc4random works today without chacha, why would adding support for chache as an optional loadable function break that? *truely confused* -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Sun Apr 16 12:13:25 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A52ACD41C7D; Sun, 16 Apr 2017 12:13:25 +0000 (UTC) (envelope-from markm@FreeBSD.org) Received: from gromit.grondar.org (grandfather.grondar.org [IPv6:2a01:348:0:15:5d59:5c20:0:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 753FA9F3; Sun, 16 Apr 2017 12:13:25 +0000 (UTC) (envelope-from markm@FreeBSD.org) Received: from graveyard.grondar.org ([88.96.155.33] helo=gronkulator.grondar.org) by gromit.grondar.org with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.88 (FreeBSD)) (envelope-from ) id 1czj3S-000Q0o-Nf; Sun, 16 Apr 2017 13:13:24 +0100 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: svn commit: r317015 - in head/sys: boot/forth conf crypto/chacha20 dev/random libkern sys From: Mark R V Murray In-Reply-To: <201704161207.v3GC7adp016485@pdx.rh.CN85.dnsmgr.net> Date: Sun, 16 Apr 2017 13:13:22 +0100 Cc: src-committers , svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org Content-Transfer-Encoding: quoted-printable Message-Id: <60A59E27-47CD-4552-8265-0E60C09E1966@FreeBSD.org> References: <201704161207.v3GC7adp016485@pdx.rh.CN85.dnsmgr.net> To: rgrimes@FreeBSD.org X-Mailer: Apple Mail (2.3273) X-SA-Score: -1.0 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 16 Apr 2017 12:13:25 -0000 > On 16 Apr 2017, at 13:07, Rodney W. Grimes = wrote: >=20 >>> =46rom replacing the rc4 algorithm with chacha20, this chalice has = now >> become poisoned with the job of redesigning the entire structure of >> kernel random-number generation. >>=20 >> This may take a while, and I'm already behind on RNG jobs. >=20 > I do not see how this is a complete redesign of RNG, and if it is > such a heart ache to change algorithms in this code then it probably > should be redesigned? The RC4 algorithm is standard. Making the alogorithm pluggable means = more code, more testing and more time (time which I am rather short of). > Also you can always compile in a module, you can not compile out > a 'standard' file. >=20 > For now could you just add > options chacha #Required by arc4random, do not remove > to your kernel and move on? For me this would be an acceptable > developement, even releasable, way to proceed while the more > complex issue of how to make the kernel RNG use plagable lkm > lower layers. It would have to be unconditionally added to *all* kernels. Could be done, I guess. RC4 has been standard for many years. >>> I am sure with careful though we can find a way to allow arc4random >>> to use a pointer that knows if the chacha code is avaliable, and use >>> it if so, and if not fall back to something else, or punt with an >>> error return. >>=20 >> Error return is out of the question; arc4random() is pretty = fundamental. >> The alternative is to return no or fake random numbers, which rather >> misses the point of what this is for. But it can be done. >=20 > Arc4random works today without chacha, why would adding support for = chache > as an optional loadable function break that? *truely confused* Up until now, arc4random worked with unconditional RC4. M --=20 Mark R V Murray From owner-svn-src-head@freebsd.org Sun Apr 16 06:04:36 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E0EF3D40566; Sun, 16 Apr 2017 06:04:36 +0000 (UTC) (envelope-from ohartmann@walstatt.org) Received: from mout.gmx.net (mout.gmx.net [212.227.17.21]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "mout.gmx.net", Issuer "TeleSec ServerPass DE-2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 30A5179; Sun, 16 Apr 2017 06:04:35 +0000 (UTC) (envelope-from ohartmann@walstatt.org) Received: from thor.intern.walstatt.dynvpn.de ([85.179.171.81]) by mail.gmx.com (mrgmx103 [212.227.17.168]) with ESMTPSA (Nemesis) id 0MgKoE-1ceH8O3FPa-00NjfY; Sun, 16 Apr 2017 07:58:50 +0200 Date: Sun, 16 Apr 2017 07:58:48 +0200 From: "O. Hartmann" To: Larry Rosenman Cc: Maxim Sobolev , "O. Hartmann" , Peter Wemm , src-committers , , Hiroki Sato , Hiren Panchasara , , "Ngie Cooper (yaneurabeya)" Subject: Re: svn commit: r316874 - head/sys/kern Message-ID: <20170416075848.1e8276d9@thor.intern.walstatt.dynvpn.de> In-Reply-To: <04DD11C2-A001-49C8-A91F-7B4119CAD16A@lerctr.org> References: <201704141723.v3EHNS3B043902@repo.freebsd.org> <2109294.KVn8xeR1jZ@overcee.wemm.org> <11221477.gRA6BXfcIE@overcee.wemm.org> <5B7F917E-EA2A-4DB4-B032-48BBBEDD7556@lerctr.org> <20170415174533.3dd6349a@thor.intern.walstatt.dynvpn.de> <04DD11C2-A001-49C8-A91F-7B4119CAD16A@lerctr.org> Organization: WALSTATT User-Agent: OutScare 3.1415926 X-Operating-System: ImNotAnOperatingSystem 3.141592527 MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; boundary="Sig_/hifUn5PV7VuBmUo6+jSG6a3"; protocol="application/pgp-signature" X-Provags-ID: V03:K0:tpQar7Wja/ZLNCFF154DenzT9fVitMlp5SkVsV2PDe9iE9YvrnB H74yAdfUZChALClHQwn24XzIy2WyicfYFwKz2h/RFmhXc2XMXOdCKQFrmAq4GFHwYfw7BQu dBPK67y+SViukVIZNkotcJVvkdIAo+23OQgBQKg9WpQeKWeCiuJGn6LE2cKa7uDxTC3PkMU lPoOnefCWp2JO1dnOuciQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:Pk5dAYR+OnI=:tG3EgutISmyfo7ZLxCEiK8 wpjWovvhMs4KYz9sYrPinlcJ5gfbFjAvrPiX02vUFiaC+PScMRNCEBxxUIkbtyjGnA9LGv57r fS0V8lgrF3pCmu3nmiH9Fo+D3ULc5avKDDer04obP8m1oSD4XPg6PQr0EasXXZfF0QsO489V5 XuyRrDu74IXYbBpk3l+GOyf4mFeyQn5WXyRxw4jdMezkNAP9JvWuM5d+pAsnt969raBnU/nZY caI+nprjH0NCtxZj67fzirt2olGom52slu6lvsLkxQx0e2HnYLjdvWOawwAkIdH2UZLkzEgfj d+ucoDwWAmOUbv/KBp+A+nglemiQ+FOnZjUBQiJ0ZprMVFRAFlDWuU1gsY7qUh0Eb2Gos7+9Z f1YIEcp104Vdcu2NMf1qukw9Wm8Zq+SbbFOHCDlI7+YDsSCBeTlmDHIVVvbsRAvNn7xDNUbfr H/ThXWeiggf6Acq4qWleIWBrLC3MQmYAtTf2CTQPHYl9zEe6nf+8SkItX4rRF6lypWbK3qAwR Qe3fTXX8JnmiYjoFHjVAvjPOJpLoHekXRKG4TvlUEQfnlOuUyV2wJLju0lYBBz10TcVdYwWKZ /fSJ/8WJkM9tiOgQO1YPl+CyeIUKvL6mYUlQ/nGCryAu7/XFKg+XarUICEpxQ0WgzlZZN3ju1 ZzYQWct6ujfyo9mXX2MiA7JhF3PVWTs7RKCCfpW9XT1i8zvQI8mfdZa3PmZ+NDw9pAt0qzSUY KAtSyQjEKXvD2zy1p9EwVERkMPv9Q06qldSq+vM4bU8aWiON8EsHhX0FJoc= X-Mailman-Approved-At: Sun, 16 Apr 2017 12:18:29 +0000 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 16 Apr 2017 06:04:37 -0000 --Sig_/hifUn5PV7VuBmUo6+jSG6a3 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Am Sat, 15 Apr 2017 14:22:57 -0500 Larry Rosenman schrieb: > This looks MUCH better, startup was it=E2=80=99s usual speedy self. >=20 > =20 >=20 > =20 >=20 ... same here with FreeBSD 12.0-CURRENT #23 r316999: Sun Apr 16 07:28:14 CE= ST 2017 amd64. Systems boot as usual again - speedy and reliable. Regards, Oliver --=20 O. Hartmann Ich widerspreche der Nutzung oder =C3=9Cbermittlung meiner Daten f=C3=BCr Werbezwecke oder f=C3=BCr die Markt- oder Meinungsforschung (=C2=A7 28 Abs.= 4 BDSG). --Sig_/hifUn5PV7VuBmUo6+jSG6a3 Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iLUEARMKAB0WIQQZVZMzAtwC2T/86TrS528fyFhYlAUCWPMIGAAKCRDS528fyFhY lBW1AgCJ3Zdzu4EV2U96VC9AjEjQLSQhSmh0BW7yhasPMxs0xrx3VndBQeNeGljO TXZzge8Tz7Je25br9NhcrZBBbdNsAf0T+iU5M6WlP177yiN7eelHS/phLKghdi0J F6+QW9V9D5b1tOezJOFFx8p6LqRd9TftEdDmD/vwZDHe98kKjugO =49hn -----END PGP SIGNATURE----- --Sig_/hifUn5PV7VuBmUo6+jSG6a3-- From owner-svn-src-head@freebsd.org Sun Apr 16 12:30:58 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 39FEAD3F148; Sun, 16 Apr 2017 12:30:58 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E176F10A7; Sun, 16 Apr 2017 12:30:57 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id v3GCUulQ016579; Sun, 16 Apr 2017 05:30:56 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id v3GCUujl016578; Sun, 16 Apr 2017 05:30:56 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201704161230.v3GCUujl016578@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r317015 - in head/sys: boot/forth conf crypto/chacha20 dev/random libkern sys In-Reply-To: <60A59E27-47CD-4552-8265-0E60C09E1966@FreeBSD.org> To: Mark R V Murray Date: Sun, 16 Apr 2017 05:30:56 -0700 (PDT) CC: rgrimes@freebsd.org, src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 16 Apr 2017 12:30:58 -0000 > > > On 16 Apr 2017, at 13:07, Rodney W. Grimes wrote: > > > >>> From replacing the rc4 algorithm with chacha20, this chalice has now > >> become poisoned with the job of redesigning the entire structure of > >> kernel random-number generation. > >> > >> This may take a while, and I'm already behind on RNG jobs. > > > > I do not see how this is a complete redesign of RNG, and if it is > > such a heart ache to change algorithms in this code then it probably > > should be redesigned? > > The RC4 algorithm is standard. Making the alogorithm pluggable means more > code, more testing and more time (time which I am rather short of). I would rather see a proper implementation later, than a poor design decision today. > > Also you can always compile in a module, you can not compile out > > a 'standard' file. > > > > For now could you just add > > options chacha #Required by arc4random, do not remove > > to your kernel and move on? For me this would be an acceptable > > developement, even releasable, way to proceed while the more > > complex issue of how to make the kernel RNG use plagable lkm > > lower layers. > > It would have to be unconditionally added to *all* kernels. Could be > done, I guess. We dont have that many in base kernel configs do we? > RC4 has been standard for many years. Probably another rapid mode of design rather than a thoughful mode, we have a chance to correct this here, and imho, should. > >>> I am sure with careful though we can find a way to allow arc4random > >>> to use a pointer that knows if the chacha code is avaliable, and use > >>> it if so, and if not fall back to something else, or punt with an > >>> error return. > >> > >> Error return is out of the question; arc4random() is pretty fundamental. > >> The alternative is to return no or fake random numbers, which rather > >> misses the point of what this is for. But it can be done. > > > > Arc4random works today without chacha, why would adding support for chache > > as an optional loadable function break that? *truely confused* > > Up until now, arc4random worked with unconditional RC4. And your wanting to just replace unconditional RC4 for unconditional chacha? Or actuall, aleady did? -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Sun Apr 16 12:45:56 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6AE1BD3F5A3; Sun, 16 Apr 2017 12:45:56 +0000 (UTC) (envelope-from markm@FreeBSD.org) Received: from gromit.grondar.org (grandfather.grondar.org [IPv6:2a01:348:0:15:5d59:5c20:0:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3A61E1994; Sun, 16 Apr 2017 12:45:56 +0000 (UTC) (envelope-from markm@FreeBSD.org) Received: from graveyard.grondar.org ([88.96.155.33] helo=gronkulator.grondar.org) by gromit.grondar.org with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.88 (FreeBSD)) (envelope-from ) id 1czjYv-00003H-98; Sun, 16 Apr 2017 13:45:54 +0100 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: svn commit: r317015 - in head/sys: boot/forth conf crypto/chacha20 dev/random libkern sys From: Mark R V Murray In-Reply-To: <201704161230.v3GCUujl016578@pdx.rh.CN85.dnsmgr.net> Date: Sun, 16 Apr 2017 13:45:52 +0100 Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <201704161230.v3GCUujl016578@pdx.rh.CN85.dnsmgr.net> To: rgrimes@freebsd.org X-Mailer: Apple Mail (2.3273) X-SA-Score: -1.0 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 16 Apr 2017 12:45:56 -0000 > On 16 Apr 2017, at 13:30, Rodney W. Grimes = wrote: >=20 >> The RC4 algorithm is standard. Making the alogorithm pluggable means = more >> code, more testing and more time (time which I am rather short of). >=20 > I would rather see a proper implementation later, than a poor design > decision today. I would love to see a perfect solution too. As I don't have the time for = it, I took the time to get a working solution reviewed and pretty heavily = tested. Reviewed by SO@, that is. >>> Also you can always compile in a module, you can not compile out >>> a 'standard' file. >>>=20 >>> For now could you just add >>> options chacha #Required by arc4random, do not remove >>> to your kernel and move on? For me this would be an acceptable >>> developement, even releasable, way to proceed while the more >>> complex issue of how to make the kernel RNG use plagable lkm >>> lower layers. >>=20 >> It would have to be unconditionally added to *all* kernels. Could be >> done, I guess. >=20 > We dont have that many in base kernel configs do we? No. But what about folks' own configs that break all-of-a-sudden? I've been pretty angry n a few occasions when I'm trying to fix my own = problems and I had to waste time sorting out tangential, avoidable problems. What's the difference between making this 'standard' in sys/files/conf and adding a compulsory change to ALL kernel files (apart from the fact that we miss the users' kernel configs)? We can even keep the module stubs in the code. Later, when/if arc4random(9) becomes a = loadable module (I'd *LOVE* to see how we get that right without compromising the RNG early start), we can make it optional. That is a one line change to sys/conf/files. >> RC4 has been standard for many years. > Probably another rapid mode of design rather than a thoughful mode, we > have a chance to correct this here, and imho, should. Fix it, sure. What's wrong with doing that as a next step? Why does this change need to be held to ransom? >> Up until now, arc4random worked with unconditional RC4. >=20 > And your wanting to just replace unconditional RC4 for unconditional = chacha? > Or actuall, aleady did? Correct. Both counts. It was up on Phabricator for weeks, BTW. M --=20 Mark R V Murray From owner-svn-src-head@freebsd.org Sun Apr 16 14:21:48 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B9C0AD40471; Sun, 16 Apr 2017 14:21:48 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9D8C2BC6; Sun, 16 Apr 2017 14:21:48 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id v3GELkpj017001; Sun, 16 Apr 2017 07:21:46 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id v3GELk3U017000; Sun, 16 Apr 2017 07:21:46 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201704161421.v3GELk3U017000@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r317015 - in head/sys: boot/forth conf crypto/chacha20 dev/random libkern sys In-Reply-To: To: Mark R V Murray Date: Sun, 16 Apr 2017 07:21:46 -0700 (PDT) CC: rgrimes@FreeBSD.org, src-committers , svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org Reply-To: rgrimes@FreeBSD.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 16 Apr 2017 14:21:48 -0000 > > On 16 Apr 2017, at 13:30, Rodney W. Grimes wrote: > > > >> The RC4 algorithm is standard. Making the alogorithm pluggable means more > >> code, more testing and more time (time which I am rather short of). > > > > I would rather see a proper implementation later, than a poor design > > decision today. > > I would love to see a perfect solution too. As I don't have the time for it, > I took the time to get a working solution reviewed and pretty heavily tested. > Reviewed by SO@, that is. > > >>> Also you can always compile in a module, you can not compile out > >>> a 'standard' file. > >>> > >>> For now could you just add > >>> options chacha #Required by arc4random, do not remove > >>> to your kernel and move on? For me this would be an acceptable > >>> developement, even releasable, way to proceed while the more > >>> complex issue of how to make the kernel RNG use plagable lkm > >>> lower layers. > >> > >> It would have to be unconditionally added to *all* kernels. Could be > >> done, I guess. > > > > We dont have that many in base kernel configs do we? > > No. But what about folks' own configs that break all-of-a-sudden? I've > been pretty angry n a few occasions when I'm trying to fix my own problems > and I had to waste time sorting out tangential, avoidable problems. Fair point. I have spent the last 4 months dealing with what are the un portability of the human to a new version of FreeBSD due to breakage and changes in the new version, not to mention all the new features that broke old behavior in sometimes very subtle ways. > > What's the difference between making this 'standard' in sys/files/conf > and adding a compulsory change to ALL kernel files (apart from the fact > that we miss the users' kernel configs)? We can even keep the > module stubs in the code. Later, when/if arc4random(9) becomes a loadable > module (I'd *LOVE* to see how we get that right without compromising > the RNG early start), we can make it optional. That is a one line change > to sys/conf/files. Later never seems to happen.... thats why I am trying to push for stopping the later mode of operation and pushing the if we are going to change things we should be changing them in the right and for the better and stop rushing so we can only do it over again later. As far as getting things right at boot time, thats trivial, the module *can* be loaded by the loader afterall, this is not new science. We have similiar with ZFS, you have to load that with your kernel if you are booting with zfs root, correct? > >> RC4 has been standard for many years. > > Probably another rapid mode of design rather than a thoughful mode, we > > have a chance to correct this here, and imho, should. > > Fix it, sure. What's wrong with doing that as a next step? Why does this > change need to be held to ransom? Thats a fair point, let me counter, why do I want this change at all? Is it just the new kid on the block and everyone wants to play with the new toy, or does it bring the users some wonderful star bright feature that they just can not live without? Is arc4random(9) some how fundementaly broken without chacha? Your code in and working now? We just have 2 implementations of chacha, correct? One in your static compiled in kernel section, and one as an LKM? > >> Up until now, arc4random worked with unconditional RC4. > > > > And your wanting to just replace unconditional RC4 for unconditional chacha? > > Or actuall, aleady did? > > Correct. Both counts. It was up on Phabricator for weeks, BTW. We are having what I believe is a very serious disjoint in project communications caused by phabricator. How are the developers notified of new things going up in phabricator? I get bugzilla reports, but I get zip from phabriactor unless I go ask it for stuff. I get #network stuff cause I saw that in a commit that I would of liked to been aware of early and added into that project, but overall I think we need to work on this communcations too. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Sun Apr 16 14:26:50 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 23263D4057B; Sun, 16 Apr 2017 14:26:50 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-wr0-f173.google.com (mail-wr0-f173.google.com [209.85.128.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B594FF0D; Sun, 16 Apr 2017 14:26:49 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-wr0-f173.google.com with SMTP id l28so71895257wre.0; Sun, 16 Apr 2017 07:26:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=9Ksgs0OygMb9MAZWTbagFj2BzrQnVpA+xvHyOyzBviM=; b=NhYrMFc2+6XwwsXbpVzmcYL1mGKBlUfgIAS5qOQh9LRq7E7W6k1yZd2V96Nt6Rqc/N kNwEDYa6+vryIyS1cAZlGpHwuYy7U76Jb/4U8uDx17wKhEu/Z65+MQ7+yuhyNThge0ez /ytVFY1S/gTjxCb6ih02KnkaNC0Rn3CdyMSkpBdFUpLFXJI0w3xBZ3H6JW6YEb7G4xej Q0GSyE/iZZGNdbU1YzuGy88h7a6DkV/PiYO+v1FtdAL9UgbGSXogsf9+XIuNIZvipnWK 1/6dr9wUwIw+yoDbjwV3rjk9M8D4qIQKIAHuQcbqSoUfxQxKNPSkHfxyml09xqSbmh1d rxCA== X-Gm-Message-State: AN3rC/7fDa17tmSE4HJxwBkfttydgZXXtF+5zwTRqmByPe8fpOTwYyyA kb7K+f2lZu1zmPC3RsM= X-Received: by 10.223.153.18 with SMTP id x18mr14748368wrb.55.1492352802123; Sun, 16 Apr 2017 07:26:42 -0700 (PDT) Received: from mail-wm0-f52.google.com (mail-wm0-f52.google.com. [74.125.82.52]) by smtp.gmail.com with ESMTPSA id a10sm10480363wra.17.2017.04.16.07.26.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 16 Apr 2017 07:26:42 -0700 (PDT) Received: by mail-wm0-f52.google.com with SMTP id t189so19729795wmt.1; Sun, 16 Apr 2017 07:26:42 -0700 (PDT) X-Received: by 10.28.130.210 with SMTP id e201mr5558461wmd.128.1492352801866; Sun, 16 Apr 2017 07:26:41 -0700 (PDT) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.80.169.4 with HTTP; Sun, 16 Apr 2017 07:26:41 -0700 (PDT) In-Reply-To: References: <201704160911.v3G9B3df023095@repo.freebsd.org> From: Conrad Meyer Date: Sun, 16 Apr 2017 07:26:41 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r317015 - in head/sys: boot/forth conf crypto/chacha20 dev/random libkern sys To: Mark R V Murray Cc: src-committers , 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.23 Precedence: list List-Id: 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, 16 Apr 2017 14:26:50 -0000 On Sun, Apr 16, 2017 at 2:19 AM, Mark R V Murray wrote: > This does not use DES' Chacha20 commit, as I had already completed the > testing for it, and received SO@ approval. > > DES's commit made Chaha20 a module. This is of no use to arc4random(9), > which needs the code to be standard. Also his API is different. > > I have no objection to reworking the arc4random/Chacha below to use DES' > version of Chacha, but his code needs to be standard library code, > not an optional module. > > Any objections to me doing this? Hi Mark, I think you've taken the only sane approach possible here. arc4random cannot be loadable, and it needs a standard cipher. RC4 is undesirable because large parts of its early keystream are predictable and it is anticipated to have other weaknesses. I doubt Chacha comes out to much in the way of object code, and removing RC4 should subsidize even that number. From AMD64: chacha20.ko is 7 kB. Furthermore, I do not believe you should be harangued into rewriting how RNG use works in the kernel just to allow Chacha to be loadable. And if it is "loadable," so what? You can't boot without it; what good does a mandatory loadable module do? So: * I believe you've taken the right approach. But somehow your import of chacha should be reconciled with DES' import (i.e., keep only one copy in the tree). * I don't believe the chacha code being standard is an undue burden. Especially balanced by kicking out RC4. Thanks for doing this work. Best, Conrad From owner-svn-src-head@freebsd.org Sun Apr 16 14:35:07 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2D49ED4087F; Sun, 16 Apr 2017 14:35:07 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-wm0-f52.google.com (mail-wm0-f52.google.com [74.125.82.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C007613E1; Sun, 16 Apr 2017 14:35:06 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-wm0-f52.google.com with SMTP id t189so19795290wmt.1; Sun, 16 Apr 2017 07:35: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:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=B2TE4rt6LN4dYoBSUl675EsqCxU7JuDknvJagLNSqHg=; b=S5HJA1LrVEpQdubACbm4jT04F2X+/frCTSj6SHU288G3J63AYWaPwM5r0vKvzQoo81 QRhmYhBdFTPaUBYe02Xre8Kh1y/C4G0Q3kYDlE0K9kVptaYk7BWAvZ1x8aHMt5mv8NJu 7ZQVzKbSZhrf1V9g9k2b23KRRjVYvL7m50jDbX4nOcAjE0nLlSikjXzaUo4hYrHCp78T k8WunItSdmurzlzAEVHp9XmKYktNsuDlju3N6mt5jiGZEugzR+Gc2mDfFp2ilRmRVOHw Ra3P54/sXKRBLb++ileqQnhobo3O98jQ5e42B0ihxL5gYa0qCVukUmWyO7l0bE6NKpuF F6yw== X-Gm-Message-State: AN3rC/7COCLs9KwP6iQ3/DuMJDgsCJriFKtJsSKAdCXNqnGm3ffcjbWK m4WWaIEdnBbp18TSQqM= X-Received: by 10.28.181.69 with SMTP id e66mr5585659wmf.33.1492353298911; Sun, 16 Apr 2017 07:34:58 -0700 (PDT) Received: from mail-wr0-f171.google.com (mail-wr0-f171.google.com. [209.85.128.171]) by smtp.gmail.com with ESMTPSA id u206sm6644995wmg.20.2017.04.16.07.34.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 16 Apr 2017 07:34:58 -0700 (PDT) Received: by mail-wr0-f171.google.com with SMTP id z109so72052405wrb.1; Sun, 16 Apr 2017 07:34:58 -0700 (PDT) X-Received: by 10.223.181.132 with SMTP id c4mr7223758wre.178.1492353298651; Sun, 16 Apr 2017 07:34:58 -0700 (PDT) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.80.169.4 with HTTP; Sun, 16 Apr 2017 07:34:58 -0700 (PDT) In-Reply-To: References: <201704160911.v3G9B3df023095@repo.freebsd.org> From: Conrad Meyer Date: Sun, 16 Apr 2017 07:34:58 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r317015 - in head/sys: boot/forth conf crypto/chacha20 dev/random libkern sys To: Mark R V Murray Cc: src-committers , 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.23 Precedence: list List-Id: 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, 16 Apr 2017 14:35:07 -0000 Furthmore: chacha20.ko: 7 kB GENERIC w/out chacha20: 27095416 GENERIC w/ chacha20: 27097976 device chacha20 adds 2560 *bytes* to the kernel. That's +0.009%. Not worth bikeshedding about. Best, Conrad On Sun, Apr 16, 2017 at 7:26 AM, Conrad Meyer wrote: > On Sun, Apr 16, 2017 at 2:19 AM, Mark R V Murray wrote: >> This does not use DES' Chacha20 commit, as I had already completed the >> testing for it, and received SO@ approval. >> >> DES's commit made Chaha20 a module. This is of no use to arc4random(9), >> which needs the code to be standard. Also his API is different. >> >> I have no objection to reworking the arc4random/Chacha below to use DES' >> version of Chacha, but his code needs to be standard library code, >> not an optional module. >> >> Any objections to me doing this? > > Hi Mark, > > I think you've taken the only sane approach possible here. arc4random > cannot be loadable, and it needs a standard cipher. RC4 is > undesirable because large parts of its early keystream are predictable > and it is anticipated to have other weaknesses. > > I doubt Chacha comes out to much in the way of object code, and > removing RC4 should subsidize even that number. From AMD64: > chacha20.ko is 7 kB. > > Furthermore, I do not believe you should be harangued into rewriting > how RNG use works in the kernel just to allow Chacha to be loadable. > And if it is "loadable," so what? You can't boot without it; what > good does a mandatory loadable module do? > > So: > > * I believe you've taken the right approach. But somehow your import > of chacha should be reconciled with DES' import (i.e., keep only one > copy in the tree). > * I don't believe the chacha code being standard is an undue burden. > Especially balanced by kicking out RC4. > > Thanks for doing this work. > > Best, > Conrad From owner-svn-src-head@freebsd.org Sun Apr 16 14:36:37 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 31634D40945; Sun, 16 Apr 2017 14:36:37 +0000 (UTC) (envelope-from markm@FreeBSD.org) Received: from gromit.grondar.org (grandfather.grondar.org [IPv6:2a01:348:0:15:5d59:5c20:0:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0065F15B5; Sun, 16 Apr 2017 14:36:36 +0000 (UTC) (envelope-from markm@FreeBSD.org) Received: from graveyard.grondar.org ([88.96.155.33] helo=gronkulator.grondar.org) by gromit.grondar.org with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.88 (FreeBSD)) (envelope-from ) id 1czlHx-00008M-Br; Sun, 16 Apr 2017 15:36:34 +0100 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: svn commit: r317015 - in head/sys: boot/forth conf crypto/chacha20 dev/random libkern sys From: Mark R V Murray In-Reply-To: <201704161421.v3GELk3U017000@pdx.rh.CN85.dnsmgr.net> Date: Sun, 16 Apr 2017 15:36:28 +0100 Cc: src-committers , svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <201704161421.v3GELk3U017000@pdx.rh.CN85.dnsmgr.net> To: rgrimes@FreeBSD.org X-Mailer: Apple Mail (2.3273) X-SA-Score: -1.0 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 16 Apr 2017 14:36:37 -0000 > On 16 Apr 2017, at 15:21, Rodney W. Grimes = wrote: >>>> RC4 has been standard for many years. >>> Probably another rapid mode of design rather than a thoughful mode, = we >>> have a chance to correct this here, and imho, should. >>=20 >> Fix it, sure. What's wrong with doing that as a next step? Why does = this >> change need to be held to ransom? >=20 > Thats a fair point, let me counter, why do I want this change at all? RC4 is broken cryptographically. FreeBSD was lagging behind in still = using it. > Is it just the new kid on the block and everyone wants to play with = the > new toy, or does it bring the users some wonderful star bright feature > that they just can not live without? Is arc4random(9) some how = fundementaly > broken without chacha? Most folks won't notice a darn thing. Crap random numbers are very often hard to tell apart from good ones, and if you are not depending on them = in a relevant way you won't notice anything. The big deal is that the attack vector for folks counting on (broken) RC4 is now gone. For most FreeBSD users this is theoretical interest = only. > Your code in and working now?=20 Yes. > We just have 2 implementations of chacha, correct? Correct. > One in your static compiled in kernel section, and one as an LKM? Correct. The latter startled me when it arrived. >>>> Up until now, arc4random worked with unconditional RC4. >>>=20 >>> And your wanting to just replace unconditional RC4 for unconditional = chacha? >>> Or actuall, aleady did? >>=20 >> Correct. Both counts. It was up on Phabricator for weeks, BTW. >=20 > We are having what I believe is a very serious disjoint in project = communications > caused by phabricator. How are the developers notified of new things = going > up in phabricator? I get bugzilla reports, but I get zip from = phabriactor unless > I go ask it for stuff. I get #network stuff cause I saw that in a = commit that > I would of liked to been aware of early and added into that project, = but overall > I think we need to work on this communcations too. True. I promised SO@ that I would get all my CSPRNG stuff reviewed in = Phabricator before committing it. All the folks who in the past have cared about my = work now are on the relevant watch-list. Apart from spamming everyone, what do = you suggest? M --=20 Mark R V Murray= From owner-svn-src-head@freebsd.org Sun Apr 16 15:45:13 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B7B80D4195F for ; Sun, 16 Apr 2017 15:45:13 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from nm3-vm2.bullet.mail.ne1.yahoo.com (nm3-vm2.bullet.mail.ne1.yahoo.com [98.138.91.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 81D1D1718 for ; Sun, 16 Apr 2017 15:45:13 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1492357145; bh=X008d3r9vM8Ij5Jg8yGVpEnCd9r10cdj3yCVi0hOMl8=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From:Subject; b=O5sSkBeZcZ6Joa6RRTfiP0U8RqWGT/BSd8bKVr5qOSmksQA+CAMLVJXVc12C3xRLmlRWXOc2Jr6CiZEuYewij6jNN+ChE+Bz9FDmPsq7ealnowR9pSxc5YXMrGUzUggBFfmYH7+y2Qcm8MrYKGF5WTmprfs1zjC4K9G21QtzXJXfQoFBqm3gvsdWDVbOtgv3Azn/LIY6Xs2ocjwxDmmg/j63EO8chQqLHRBZXNk0O0zeCcTFTg9MxkDqKWk+1rxx68GF8xWwQgyJwC4T66deVQrNkH/BZgOkLWthgU23YqE2RawqLSMQmXAbie9+GO7e9ESig6lgV8gSt/ma+gC+gA== Received: from [98.138.100.118] by nm3.bullet.mail.ne1.yahoo.com with NNFMP; 16 Apr 2017 15:39:05 -0000 Received: from [98.138.226.58] by tm109.bullet.mail.ne1.yahoo.com with NNFMP; 16 Apr 2017 15:39:05 -0000 Received: from [127.0.0.1] by smtp209.mail.ne1.yahoo.com with NNFMP; 16 Apr 2017 15:39:05 -0000 X-Yahoo-Newman-Id: 509997.86581.bm@smtp209.mail.ne1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: 4o47AJwVM1kfsZUloGBLKQ92J2HC8OCyYsSQY8CE_nyQeoJ _erDlPWQtH_VLBe46CYilj25juTIe49_0bXIInAM.MZyQW20UAlzSx0LfoWz lvWwHGJex9C.mr7fnxVlKNzlyBzexymCt7cDFo7zpSYDKzEP1uRAjHQr2VDO qjhmkVf0gb7.aLiZNavYvnQzN5Wn.aJqAAa98ANp8wI1PeeAdayDSEQSSyMt dKqJ_Yp6m5tWq879ZU5d2_4K9q8yhCzEJ9QpE3zD6._itBr0Xccvfod1brFv TWN4p.4T.fyxLxvMO2bllWMU3tXIUaiUqdyOfkbI7ApKDh68e4YCeGEFglBb tiLktWcaiL82wZAAC4kFg8uOweFeCZA48UZYVAaZOYI5AHBF7PM4f1GitN4a HwK4fCZApIx8BXhtcELgDZv9exWKur7Vyx4fJHtPfMeeiHaCFvU5C1ViIcdY UNOPuOUjz68eLVI7eR45VDAQTxV9OsnbEyJcdPAyrlMeGpAEY6jX9BPYpMuu aMss9YfgIcjRqyQ3S6ONpvNhcDdCXh2i1RnAE2NtKF_yH X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Subject: Re: svn commit: r317015 - in head/sys: boot/forth conf crypto/chacha20 dev/random libkern sys To: cem@freebsd.org, Mark R V Murray Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201704160911.v3G9B3df023095@repo.freebsd.org> From: Pedro Giffuni Organization: FreeBSD Message-ID: Date: Sun, 16 Apr 2017 10:36:51 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 16 Apr 2017 15:45:13 -0000 On 04/16/17 09:26, Conrad Meyer wrote: > On Sun, Apr 16, 2017 at 2:19 AM, Mark R V Murray wrote: >> This does not use DES' Chacha20 commit, as I had already completed the >> testing for it, and received SO@ approval. >> >> DES's commit made Chaha20 a module. This is of no use to arc4random(9), >> which needs the code to be standard. Also his API is different. >> >> I have no objection to reworking the arc4random/Chacha below to use DES' >> version of Chacha, but his code needs to be standard library code, >> not an optional module. >> >> Any objections to me doing this? > Hi Mark, > > I think you've taken the only sane approach possible here. arc4random > cannot be loadable, and it needs a standard cipher. RC4 is > undesirable because large parts of its early keystream are predictable > and it is anticipated to have other weaknesses. > > I doubt Chacha comes out to much in the way of object code, and > removing RC4 should subsidize even that number. From AMD64: > chacha20.ko is 7 kB. > > Furthermore, I do not believe you should be harangued into rewriting > how RNG use works in the kernel just to allow Chacha to be loadable. > And if it is "loadable," so what? You can't boot without it; what > good does a mandatory loadable module do? FWIW, I would think the major advantage of making Chacha a module would be making us cipher-agnostic. The end user doesn't need to know what cypher is being used. It would still be mandatory to use *a* cypher and chacha20 would be the default. This said, I am fine with markm's approach and, not that it matters, in most "sane" jurisdictions Public Domain is less restricted than 3-Clause BSD. Pedro. From owner-svn-src-head@freebsd.org Sun Apr 16 16:04:40 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 11263D403B9; Sun, 16 Apr 2017 16:04:40 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E3313E62; Sun, 16 Apr 2017 16:04:39 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id v3GG4aJY017438; Sun, 16 Apr 2017 09:04:36 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id v3GG4aoq017437; Sun, 16 Apr 2017 09:04:36 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201704161604.v3GG4aoq017437@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r317015 - in head/sys: boot/forth conf crypto/chacha20 dev/random libkern sys In-Reply-To: To: Mark R V Murray Date: Sun, 16 Apr 2017 09:04:36 -0700 (PDT) CC: rgrimes@FreeBSD.org, src-committers , svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org Reply-To: rgrimes@FreeBSD.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 16 Apr 2017 16:04:40 -0000 > > > On 16 Apr 2017, at 15:21, Rodney W. Grimes wrote: > >>>> RC4 has been standard for many years. > >>> Probably another rapid mode of design rather than a thoughful mode, we > >>> have a chance to correct this here, and imho, should. > >> > >> Fix it, sure. What's wrong with doing that as a next step? Why does this > >> change need to be held to ransom? > > > > Thats a fair point, let me counter, why do I want this change at all? > > RC4 is broken cryptographically. FreeBSD was lagging behind in still using it. > > > Is it just the new kid on the block and everyone wants to play with the > > new toy, or does it bring the users some wonderful star bright feature > > that they just can not live without? Is arc4random(9) some how fundementaly > > broken without chacha? > > Most folks won't notice a darn thing. Crap random numbers are very often > hard to tell apart from good ones, and if you are not depending on them in a > relevant way you won't notice anything. > > The big deal is that the attack vector for folks counting on (broken) > RC4 is now gone. For most FreeBSD users this is theoretical interest only. > > > Your code in and working now? > > Yes. > > > We just have 2 implementations of chacha, correct? > > Correct. > > > One in your static compiled in kernel section, and one as an LKM? > > Correct. The latter startled me when it arrived. So you can understand me being started when any of this arrived? I am on several of the mailling list, and I think -security is probably one of them. > >>>> Up until now, arc4random worked with unconditional RC4. > >>> > >>> And your wanting to just replace unconditional RC4 for unconditional chacha? > >>> Or actuall, aleady did? > >> > >> Correct. Both counts. It was up on Phabricator for weeks, BTW. > > > > We are having what I believe is a very serious disjoint in project communications > > caused by phabricator. How are the developers notified of new things going > > up in phabricator? I get bugzilla reports, but I get zip from phabriactor unless > > I go ask it for stuff. I get #network stuff cause I saw that in a commit that > > I would of liked to been aware of early and added into that project, but overall > > I think we need to work on this communcations too. > > True. I promised SO@ that I would get all my CSPRNG stuff reviewed in Phabricator > before committing it. All the folks who in the past have cared about my work now > are on the relevant watch-list. Apart from spamming everyone, what do you suggest? Yellow paint? Allan Jude informs me I have used all the blue paint. I wish I had a simple answer for that, but from looking at reviews post commit I notice we are getting more feedback on the commit list than we are getting pre commit in the review process, this leads me to believe I need some more Yellow paint so we can build a bike shed around how do we attract pre commit review activity? What watch list is this? And do we have a watch list that is just "New Phabricator created" so we can make just that incident go to some mailling list so people stop getting caught off guard by commits that have been reviews that they wish they had even known there was a review? We just need a way for being allerted there is a new review that we *might* be interested, or care to participate in without being on all the watch lists. And to add my hidden Blue Paint, we need to stop fearing the bike shed, the project seems to have stifled the communications process to the point it is becoming a closed door shop with everyone working in secret then dumping a commit in once they are done. Yes, bike sheds are a bit time consuming, but so is duplicate work cause you had no idea someone else was working in the same area (your LKM suprize is an excellent example). We must stop working in vacuums and start to communicate, and if that means we have a few bike sheds... well.. paints on me (though I reserve the blue for personal use!) -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Sun Apr 16 16:16:11 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 90479D406F1; Sun, 16 Apr 2017 16:16:11 +0000 (UTC) (envelope-from markm@FreeBSD.org) Received: from gromit.grondar.org (grandfather.grondar.org [IPv6:2a01:348:0:15:5d59:5c20:0:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5F1731854; Sun, 16 Apr 2017 16:16:11 +0000 (UTC) (envelope-from markm@FreeBSD.org) Received: from graveyard.grondar.org ([88.96.155.33] helo=gronkulator.grondar.org) by gromit.grondar.org with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.88 (FreeBSD)) (envelope-from ) id 1czmqO-0000He-5R; Sun, 16 Apr 2017 17:16:08 +0100 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: svn commit: r317015 - in head/sys: boot/forth conf crypto/chacha20 dev/random libkern sys From: Mark R V Murray In-Reply-To: <201704161604.v3GG4aoq017437@pdx.rh.CN85.dnsmgr.net> Date: Sun, 16 Apr 2017 17:16:06 +0100 Cc: src-committers , svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org Content-Transfer-Encoding: quoted-printable Message-Id: <98247B49-8F7C-43D4-A187-54FD6E93DB05@FreeBSD.org> References: <201704161604.v3GG4aoq017437@pdx.rh.CN85.dnsmgr.net> To: rgrimes@FreeBSD.org X-Mailer: Apple Mail (2.3273) X-SA-Score: -1.0 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 16 Apr 2017 16:16:11 -0000 > On 16 Apr 2017, at 17:04, Rodney W. Grimes = wrote: > So you can understand me being started when any of this arrived? I am > on several of the mailling list, and I think -security is probably one > of them. I was thoroughly ignored last time I tried to use -security. It was, = however, a while back. I'll try again. > What watch list is this? And do we have a watch list that is just = "New Phabricator > created" so we can make just that incident go to some mailling list so = people stop > getting caught off guard by commits that have been reviews that they = wish they had > even known there was a review? We just need a way for being allerted = there is a > new review that we *might* be interested, or care to participate in = without being > on all the watch lists. There is 'secteam' on Phabricator. > And to add my hidden Blue Paint, we need to stop fearing the bike = shed, the project > seems to have stifled the communications process to the point it is = becoming a > closed door shop with everyone working in secret then dumping a commit = in once they > are done. Yes, bike sheds are a bit time consuming, but so is = duplicate work cause > you had no idea someone else was working in the same area (your LKM = suprize is > an excellent example). > We must stop working in vacuums and start to communicate, and if that = means we > have a few bike sheds... well.. paints on me (though I reserve the = blue for=20 > personal use!) Can't please everybody, but I'll add -security to the list next time. There is a fair bit of history that predates your return to the project; = me getting attention to folks prepared to do reviews is a sore point. I use = Phabricator because it works for me (I get reviews). I was largely ignored on the mailing = lists last time I had a big commit.=20 M --=20 Mark R V Murray From owner-svn-src-head@freebsd.org Sun Apr 16 16:17:49 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 69372D407B4; Sun, 16 Apr 2017 16:17:49 +0000 (UTC) (envelope-from markm@FreeBSD.org) Received: from gromit.grondar.org (grandfather.grondar.org [IPv6:2a01:348:0:15:5d59:5c20:0:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 37F1419DC; Sun, 16 Apr 2017 16:17:49 +0000 (UTC) (envelope-from markm@FreeBSD.org) Received: from graveyard.grondar.org ([88.96.155.33] helo=gronkulator.grondar.org) by gromit.grondar.org with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.88 (FreeBSD)) (envelope-from ) id 1czmrz-0000Hq-Im; Sun, 16 Apr 2017 17:17:47 +0100 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: svn commit: r317015 - in head/sys: boot/forth conf crypto/chacha20 dev/random libkern sys From: Mark R V Murray In-Reply-To: Date: Sun, 16 Apr 2017 17:17:47 +0100 Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: 7bit Message-Id: <87506759-98C6-443A-A61A-6BE0CF2D2B5F@FreeBSD.org> References: <201704160911.v3G9B3df023095@repo.freebsd.org> To: cem@freebsd.org X-Mailer: Apple Mail (2.3273) X-SA-Score: -1.0 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 16 Apr 2017 16:17:49 -0000 > On 16 Apr 2017, at 15:26, Conrad Meyer wrote: > * I believe you've taken the right approach. But somehow your import > of chacha should be reconciled with DES' import (i.e., keep only one > copy in the tree). > * I don't believe the chacha code being standard is an undue burden. > Especially balanced by kicking out RC4. This is the way I'd like to see things go. > Thanks for doing this work. You are most welcome! M -- Mark R V Murray From owner-svn-src-head@freebsd.org Sun Apr 16 16:36:03 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 83A6AD40C6E for ; Sun, 16 Apr 2017 16:36:03 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1b.ore.mailhop.org (outbound1b.ore.mailhop.org [54.200.247.200]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 685B264D for ; Sun, 16 Apr 2017 16:36:02 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: d0981127-22c2-11e7-bfb5-0d159cd3c324 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 73.78.92.27 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [73.78.92.27]) by outbound1.ore.mailhop.org (Halon) with ESMTPSA id d0981127-22c2-11e7-bfb5-0d159cd3c324; Sun, 16 Apr 2017 16:36:18 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id v3GGZxik004284; Sun, 16 Apr 2017 10:35:59 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1492360559.96207.1.camel@freebsd.org> Subject: Re: svn commit: r317015 - in head/sys: boot/forth conf crypto/chacha20 dev/random libkern sys From: Ian Lepore To: rgrimes@FreeBSD.org Cc: src-committers , svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org Date: Sun, 16 Apr 2017 10:35:59 -0600 In-Reply-To: <201704161604.v3GG4aoq017437@pdx.rh.CN85.dnsmgr.net> References: <201704161604.v3GG4aoq017437@pdx.rh.CN85.dnsmgr.net> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 16 Apr 2017 16:36:03 -0000 On Sun, 2017-04-16 at 09:04 -0700, Rodney W. Grimes wrote: > What watch list is this?  And do we have a watch list that is just "New Phabricator > created" so we can make just that incident go to some mailling list so people stop > getting caught off guard by commits that have been reviews that they wish they had > even known there was a review?  We just need a way for being allerted there is a > new review that we *might* be interested, or care to participate in without being > on all the watch lists. Sounds like you need to learn about the Herald feature of Phab and set yourself up some rules.  (The most basic rule would be "notify me about every new change put up for review", which seems like it would be a real spam generator, but at least one person uses such a rule.) -- Ian From owner-svn-src-head@freebsd.org Sun Apr 16 17:53:46 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 34D93D41517; Sun, 16 Apr 2017 17:53:46 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 04E90150E; Sun, 16 Apr 2017 17:53:45 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3GHrjrH042570; Sun, 16 Apr 2017 17:53:45 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3GHrj6v042569; Sun, 16 Apr 2017 17:53:45 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201704161753.v3GHrj6v042569@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 16 Apr 2017 17:53:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317033 - head/sys/arm/freescale/imx X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 16 Apr 2017 17:53:46 -0000 Author: ian Date: Sun Apr 16 17:53:44 2017 New Revision: 317033 URL: https://svnweb.freebsd.org/changeset/base/317033 Log: Convert probing to use an ofw_compat_data array, and add imx6ul to the list. Modified: head/sys/arm/freescale/imx/imx6_usbphy.c Modified: head/sys/arm/freescale/imx/imx6_usbphy.c ============================================================================== --- head/sys/arm/freescale/imx/imx6_usbphy.c Sun Apr 16 16:48:25 2017 (r317032) +++ head/sys/arm/freescale/imx/imx6_usbphy.c Sun Apr 16 17:53:44 2017 (r317033) @@ -68,6 +68,12 @@ struct usbphy_softc { u_int phy_num; }; +static struct ofw_compat_data compat_data[] = { + {"fsl,imx6q-usbphy", true}, + {"fsl,imx6ul-usbphy", true}, + {NULL, false} +}; + static int usbphy_detach(device_t dev) { @@ -167,7 +173,7 @@ usbphy_probe(device_t dev) if (!ofw_bus_status_okay(dev)) return (ENXIO); - if (ofw_bus_is_compatible(dev, "fsl,imx6q-usbphy") == 0) + if (!ofw_bus_search_compatible(dev, compat_data)->ocd_data) return (ENXIO); device_set_desc(dev, "Freescale i.MX6 USB PHY"); From owner-svn-src-head@freebsd.org Sun Apr 16 19:12:09 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 400EBD41918; Sun, 16 Apr 2017 19:12:09 +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 mx1.freebsd.org (Postfix) with ESMTPS id 133FC1A83; Sun, 16 Apr 2017 19:12:09 +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 v3GJC8Xi073931; Sun, 16 Apr 2017 19:12:08 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3GJC868073706; Sun, 16 Apr 2017 19:12:08 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201704161912.v3GJC868073706@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sun, 16 Apr 2017 19:12:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317034 - in head/lib/libc: string tests/string X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 16 Apr 2017 19:12:09 -0000 Author: bapt Date: Sun Apr 16 19:12:07 2017 New Revision: 317034 URL: https://svnweb.freebsd.org/changeset/base/317034 Log: Fix strcoll_l disagreeing with strxfrm by reworking the forward order case in wcscoll_l(). Illumos fixed this while grabbing back our patches: https://www.illumos.org/rb/r/402/ This does not 100% fix what postgresql folks reported as there is still a remaining issue: https://www.illumos.org/issues/7962, it improves the situation The initial issue was reported in postgresql mailing lists: https://www.postgresql.org/message-id/flat/111D0E27-A8F3-4A84-A4E0-B0FB703863DF@s24.com#111D0E27-A8F3-4A84-A4E0-B0FB703863DF@s24.com Submitted by: Yuri Pankov Obtained from: Illumos MFC after: 2 weeks Modified: head/lib/libc/string/wcscoll.c head/lib/libc/tests/string/wcscoll_test.c Modified: head/lib/libc/string/wcscoll.c ============================================================================== --- head/lib/libc/string/wcscoll.c Sun Apr 16 17:53:44 2017 (r317033) +++ head/lib/libc/string/wcscoll.c Sun Apr 16 19:12:07 2017 (r317034) @@ -1,5 +1,5 @@ /*- - * Copyright 2010 Nexenta Systems, Inc. All rights reserved. + * Copyright 2017 Nexenta Systems, Inc. * Copyright (c) 2002 Tim J. Robbins * All rights reserved. * @@ -42,22 +42,22 @@ __FBSDID("$FreeBSD$"); int wcscoll_l(const wchar_t *ws1, const wchar_t *ws2, locale_t locale) { - int len1, len2, pri1, pri2, ret; + int len1, len2, pri1, pri2; wchar_t *tr1 = NULL, *tr2 = NULL; int direc, pass; + int ret = wcscmp(ws1, ws2); FIX_LOCALE(locale); struct xlocale_collate *table = (struct xlocale_collate*)locale->components[XLC_COLLATE]; - if (table->__collate_load_error) - /* - * Locale has no special collating order or could not be - * loaded, do a fast binary comparison. - */ - return (wcscmp(ws1, ws2)); + if (table->__collate_load_error || ret == 0) + return (ret); - ret = 0; + if (*ws1 == 0 && *ws2 != 0) + return (-1); + if (*ws1 != 0 && *ws2 == 0) + return (1); /* * Once upon a time we had code to try to optimize this, but @@ -77,19 +77,19 @@ wcscoll_l(const wchar_t *ws1, const wcha const int32_t *st2 = NULL; const wchar_t *w1 = ws1; const wchar_t *w2 = ws2; - int check1, check2; /* special pass for UNDEFINED */ if (pass == table->info->directive_count) { - direc = DIRECTIVE_FORWARD | DIRECTIVE_UNDEFINED; + direc = DIRECTIVE_FORWARD; } else { direc = table->info->directive[pass]; } if (direc & DIRECTIVE_BACKWARD) { wchar_t *bp, *fp, c; + free(tr1); if ((tr1 = wcsdup(w1)) == NULL) - goto fail; + goto end; bp = tr1; fp = tr1 + wcslen(tr1) - 1; while (bp < fp) { @@ -97,8 +97,9 @@ wcscoll_l(const wchar_t *ws1, const wcha *bp++ = *fp; *fp-- = c; } + free(tr2); if ((tr2 = wcsdup(w2)) == NULL) - goto fail; + goto end; bp = tr2; fp = tr2 + wcslen(tr2) - 1; while (bp < fp) { @@ -111,6 +112,7 @@ wcscoll_l(const wchar_t *ws1, const wcha } if (direc & DIRECTIVE_POSITION) { + int check1, check2; while (*w1 && *w2) { pri1 = pri2 = 0; check1 = check2 = 1; @@ -120,7 +122,7 @@ wcscoll_l(const wchar_t *ws1, const wcha &pri1, pass, &st1); if (pri1 < 0) { errno = EINVAL; - goto fail; + goto end; } if (!pri1) { pri1 = COLLATE_MAX_PRIORITY; @@ -133,7 +135,7 @@ wcscoll_l(const wchar_t *ws1, const wcha &pri2, pass, &st2); if (pri2 < 0) { errno = EINVAL; - goto fail; + goto end; } if (!pri2) { pri2 = COLLATE_MAX_PRIORITY; @@ -149,58 +151,64 @@ wcscoll_l(const wchar_t *ws1, const wcha w1 += len1; w2 += len2; } + if (!*w1) { + if (*w2) { + ret = -(int)*w2; + goto end; + } + } else { + ret = *w1; + goto end; + } } else { - while (*w1 && *w2) { - pri1 = pri2 = 0; - check1 = check2 = 1; - while ((pri1 == pri2) && (check1 || check2)) { - while (check1 && *w1) { - _collate_lookup(table, w1, - &len1, &pri1, pass, &st1); - if (pri1 > 0) - break; - if (pri1 < 0) { - errno = EINVAL; - goto fail; - } - st1 = NULL; - w1 += 1; + int vpri1 = 0, vpri2 = 0; + while (*w1 || *w2 || st1 || st2) { + pri1 = 1; + while (*w1 || st1) { + _collate_lookup(table, w1, &len1, &pri1, + pass, &st1); + w1 += len1; + if (pri1 > 0) { + vpri1++; + break; } - check1 = (st1 != NULL); - while (check2 && *w2) { - _collate_lookup(table, w2, - &len2, &pri2, pass, &st2); - if (pri2 > 0) - break; - if (pri2 < 0) { - errno = EINVAL; - goto fail; - } - st2 = NULL; - w2 += 1; + + if (pri1 < 0) { + errno = EINVAL; + goto end; } - check2 = (st2 != NULL); - if (!pri1 || !pri2) + st1 = NULL; + } + pri2 = 1; + while (*w2 || st2) { + _collate_lookup(table, w2, &len2, &pri2, + pass, &st2); + w2 += len2; + if (pri2 > 0) { + vpri2++; break; + } + if (pri2 < 0) { + errno = EINVAL; + goto end; + } + st2 = NULL; } - if (!pri1 || !pri2) + if ((!pri1 || !pri2) && (vpri1 == vpri2)) break; if (pri1 != pri2) { ret = pri1 - pri2; goto end; } - w1 += len1; - w2 += len2; } - } - if (!*w1) { - if (*w2) { - ret = -(int)*w2; + if (vpri1 && !vpri2) { + ret = 1; + goto end; + } + if (!vpri1 && vpri2) { + ret = -1; goto end; } - } else { - ret = *w1; - goto end; } } ret = 0; @@ -210,10 +218,6 @@ end: free(tr2); return (ret); - -fail: - ret = wcscmp(ws1, ws2); - goto end; } int Modified: head/lib/libc/tests/string/wcscoll_test.c ============================================================================== --- head/lib/libc/tests/string/wcscoll_test.c Sun Apr 16 17:53:44 2017 (r317033) +++ head/lib/libc/tests/string/wcscoll_test.c Sun Apr 16 19:12:07 2017 (r317034) @@ -1,5 +1,7 @@ /*- * Copyright (c) 2016 Baptiste Daroussin + * Copyright 2016 Tom Lane + * Copyright 2017 Nexenta Systems, Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -30,6 +32,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include @@ -55,9 +59,98 @@ ATF_TC_BODY(russian_collation, tc) "Bad collation, expected: '%ls' got '%ls'", res, c); } +#define NSTRINGS 2000 +#define MAXSTRLEN 20 +#define MAXXFRMLEN (MAXSTRLEN * 20) + +typedef struct { + char sval[MAXSTRLEN]; + char xval[MAXXFRMLEN]; +} cstr; + +ATF_TC_WITHOUT_HEAD(strcoll_vs_strxfrm); +ATF_TC_BODY(strcoll_vs_strxfrm, tc) +{ + cstr data[NSTRINGS]; + char *curloc; + int i, j; + + curloc = setlocale(LC_ALL, "en_US.UTF-8"); + ATF_CHECK_MSG(curloc != NULL, "Fail to set locale"); + + /* Ensure new random() values on every run */ + srandom((unsigned int) time(NULL)); + + /* Generate random UTF8 strings of length less than MAXSTRLEN bytes */ + for (i = 0; i < NSTRINGS; i++) { + char *p; + int len; + +again: + p = data[i].sval; + len = 1 + (random() % (MAXSTRLEN - 1)); + while (len > 0) { + int c; + /* + * Generate random printable char in ISO8859-1 range. + * Bias towards producing a lot of spaces. + */ + + if ((random() % 16) < 3) { + c = ' '; + } else { + do { + c = random() & 0xFF; + } while (!((c >= ' ' && c <= 127) || + (c >= 0xA0 && c <= 0xFF))); + } + + if (c <= 127) { + *p++ = c; + len--; + } else { + if (len < 2) + break; + /* Poor man's utf8-ification */ + *p++ = 0xC0 + (c >> 6); + len--; + *p++ = 0x80 + (c & 0x3F); + len--; + } + } + *p = '\0'; + /* strxfrm() each string as we produce it */ + errno = 0; + ATF_CHECK_MSG(strxfrm(data[i].xval, data[i].sval, + MAXXFRMLEN) < MAXXFRMLEN, "strxfrm() result for %d-length " + " string exceeded %d bytes", (int)strlen(data[i].sval), + MAXXFRMLEN); + + /* + * Amend strxfrm() failing on certain characters to be fixed and + * test later + */ + if (errno != 0) + goto again; + } + + for (i = 0; i < NSTRINGS; i++) { + for (j = 0; j < NSTRINGS; j++) { + int sr = strcoll(data[i].sval, data[j].sval); + int sx = strcmp(data[i].xval, data[j].xval); + + ATF_CHECK_MSG(!((sr * sx < 0) || + (sr * sx == 0 && sr + sx != 0)), + "%s: diff for \"%s\" and \"%s\"", + curloc, data[i].sval, data[j].sval); + } + } +} + ATF_TP_ADD_TCS(tp) { ATF_TP_ADD_TC(tp, russian_collation); + ATF_TP_ADD_TC(tp, strcoll_vs_strxfrm); return (atf_no_error()); } From owner-svn-src-head@freebsd.org Sun Apr 16 19:17:12 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 55AA7D419CB; Sun, 16 Apr 2017 19:17:12 +0000 (UTC) (envelope-from pkelsey@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3127C1DFF; Sun, 16 Apr 2017 19:17:12 +0000 (UTC) (envelope-from pkelsey@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3GJHB8C074769; Sun, 16 Apr 2017 19:17:11 GMT (envelope-from pkelsey@FreeBSD.org) Received: (from pkelsey@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3GJHAD9074759; Sun, 16 Apr 2017 19:17:10 GMT (envelope-from pkelsey@FreeBSD.org) Message-Id: <201704161917.v3GJHAD9074759@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pkelsey set sender to pkelsey@FreeBSD.org using -f From: Patrick Kelsey Date: Sun, 16 Apr 2017 19:17:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317035 - in head: contrib/traceroute sbin/route sbin/routed sys/net usr.bin/netstat usr.sbin/arp usr.sbin/ndp usr.sbin/rarpd usr.sbin/route6d X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 16 Apr 2017 19:17:12 -0000 Author: pkelsey Date: Sun Apr 16 19:17:10 2017 New Revision: 317035 URL: https://svnweb.freebsd.org/changeset/base/317035 Log: Fix userland tools that don't check the format of routing socket messages before accessing message fields that may not be present, removing dead/duplicate/misleading code along the way. Document the message format for each routing socket message in route.h. Fix a bug in usr.bin/netstat introduced in r287351 that resulted in pointer computation with essentially random 16-bit offsets and dereferencing of the results. Reviewed by: ae MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D10330 Modified: head/contrib/traceroute/findsaddr-socket.c head/sbin/route/route.c head/sbin/routed/table.c head/sys/net/route.h head/usr.bin/netstat/route.c head/usr.sbin/arp/arp.c head/usr.sbin/ndp/ndp.c head/usr.sbin/rarpd/rarpd.c head/usr.sbin/route6d/route6d.c Modified: head/contrib/traceroute/findsaddr-socket.c ============================================================================== --- head/contrib/traceroute/findsaddr-socket.c Sun Apr 16 19:12:07 2017 (r317034) +++ head/contrib/traceroute/findsaddr-socket.c Sun Apr 16 19:17:10 2017 (r317035) @@ -156,7 +156,8 @@ findsaddr(register const struct sockaddr return (errbuf); } - } while (rp->rtm_seq != seq || rp->rtm_pid != pid); + } while (rp->rtm_type != RTM_GET || rp->rtm_seq != seq || + rp->rtm_pid != pid); close(s); Modified: head/sbin/route/route.c ============================================================================== --- head/sbin/route/route.c Sun Apr 16 19:12:07 2017 (r317034) +++ head/sbin/route/route.c Sun Apr 16 19:17:10 2017 (r317035) @@ -1497,10 +1497,7 @@ rtmsg(int cmd, int flags, int fib) #define NEXTADDR(w, u) \ if (rtm_addrs & (w)) { \ - l = (((struct sockaddr *)&(u))->sa_len == 0) ? \ - sizeof(long) : \ - 1 + ((((struct sockaddr *)&(u))->sa_len - 1) \ - | (sizeof(long) - 1)); \ + l = SA_SIZE(&(u)); \ memmove(cp, (char *)&(u), l); \ cp += l; \ if (verbose) \ @@ -1564,7 +1561,8 @@ rtmsg(int cmd, int flags, int fib) do { l = read(s, (char *)&m_rtmsg, sizeof(m_rtmsg)); } while (l > 0 && stop_read == 0 && - (rtm.rtm_seq != rtm_seq || rtm.rtm_pid != pid)); + (rtm.rtm_type != RTM_GET || rtm.rtm_seq != rtm_seq || + rtm.rtm_pid != pid)); if (stop_read != 0) { warnx("read from routing socket timed out"); return (-1); @@ -1706,10 +1704,13 @@ print_rtmsg(struct rt_msghdr *rtm, size_ break; default: - printf("pid: %ld, seq %d, errno %d, flags:", - (long)rtm->rtm_pid, rtm->rtm_seq, rtm->rtm_errno); - printb(rtm->rtm_flags, routeflags); - pmsg_common(rtm, msglen); + if (rtm->rtm_type <= RTM_RESOLVE) { + printf("pid: %ld, seq %d, errno %d, flags:", + (long)rtm->rtm_pid, rtm->rtm_seq, rtm->rtm_errno); + printb(rtm->rtm_flags, routeflags); + pmsg_common(rtm, msglen); + } else + printf("type: %u, len: %zu\n", rtm->rtm_type, msglen); } return; Modified: head/sbin/routed/table.c ============================================================================== --- head/sbin/routed/table.c Sun Apr 16 19:12:07 2017 (r317034) +++ head/sbin/routed/table.c Sun Apr 16 19:17:10 2017 (r317035) @@ -1233,6 +1233,15 @@ read_rt(void) if (m.r.rtm.rtm_type <= RTM_CHANGE) strp += sprintf(strp," from pid %d",m.r.rtm.rtm_pid); + /* + * Only messages that use the struct rt_msghdr format are + * allowed beyond this point. + */ + if (m.r.rtm.rtm_type > RTM_RESOLVE) { + trace_act("ignore %s", str); + continue; + } + rt_xaddrs(&info, m.r.addrs, &m.r.addrs[RTAX_MAX], m.r.rtm.rtm_addrs); Modified: head/sys/net/route.h ============================================================================== --- head/sys/net/route.h Sun Apr 16 19:12:07 2017 (r317034) +++ head/sys/net/route.h Sun Apr 16 19:17:10 2017 (r317035) @@ -265,25 +265,35 @@ struct rt_msghdr { /* * Message types. + * + * The format for each message is annotated below using the following + * identifiers: + * + * (1) struct rt_msghdr + * (2) struct ifa_msghdr + * (3) struct if_msghdr + * (4) struct ifma_msghdr + * (5) struct if_announcemsghdr + * */ -#define RTM_ADD 0x1 /* Add Route */ -#define RTM_DELETE 0x2 /* Delete Route */ -#define RTM_CHANGE 0x3 /* Change Metrics or flags */ -#define RTM_GET 0x4 /* Report Metrics */ -#define RTM_LOSING 0x5 /* Kernel Suspects Partitioning */ -#define RTM_REDIRECT 0x6 /* Told to use different route */ -#define RTM_MISS 0x7 /* Lookup failed on this address */ -#define RTM_LOCK 0x8 /* fix specified metrics */ +#define RTM_ADD 0x1 /* (1) Add Route */ +#define RTM_DELETE 0x2 /* (1) Delete Route */ +#define RTM_CHANGE 0x3 /* (1) Change Metrics or flags */ +#define RTM_GET 0x4 /* (1) Report Metrics */ +#define RTM_LOSING 0x5 /* (1) Kernel Suspects Partitioning */ +#define RTM_REDIRECT 0x6 /* (1) Told to use different route */ +#define RTM_MISS 0x7 /* (1) Lookup failed on this address */ +#define RTM_LOCK 0x8 /* (1) fix specified metrics */ /* 0x9 */ /* 0xa */ -#define RTM_RESOLVE 0xb /* req to resolve dst to LL addr */ -#define RTM_NEWADDR 0xc /* address being added to iface */ -#define RTM_DELADDR 0xd /* address being removed from iface */ -#define RTM_IFINFO 0xe /* iface going up/down etc. */ -#define RTM_NEWMADDR 0xf /* mcast group membership being added to if */ -#define RTM_DELMADDR 0x10 /* mcast group membership being deleted */ -#define RTM_IFANNOUNCE 0x11 /* iface arrival/departure */ -#define RTM_IEEE80211 0x12 /* IEEE80211 wireless event */ +#define RTM_RESOLVE 0xb /* (1) req to resolve dst to LL addr */ +#define RTM_NEWADDR 0xc /* (2) address being added to iface */ +#define RTM_DELADDR 0xd /* (2) address being removed from iface */ +#define RTM_IFINFO 0xe /* (3) iface going up/down etc. */ +#define RTM_NEWMADDR 0xf /* (4) mcast group membership being added to if */ +#define RTM_DELMADDR 0x10 /* (4) mcast group membership being deleted */ +#define RTM_IFANNOUNCE 0x11 /* (5) iface arrival/departure */ +#define RTM_IEEE80211 0x12 /* (5) IEEE80211 wireless event */ /* * Bitmask values for rtm_inits and rmx_locks. @@ -342,11 +352,10 @@ struct rt_addrinfo { * This macro returns the size of a struct sockaddr when passed * through a routing socket. Basically we round up sa_len to * a multiple of sizeof(long), with a minimum of sizeof(long). - * The check for a NULL pointer is just a convenience, probably never used. * The case sa_len == 0 should only apply to empty structures. */ #define SA_SIZE(sa) \ - ( (!(sa) || ((struct sockaddr *)(sa))->sa_len == 0) ? \ + ( (((struct sockaddr *)(sa))->sa_len == 0) ? \ sizeof(long) : \ 1 + ( (((struct sockaddr *)(sa))->sa_len - 1) | (sizeof(long) - 1) ) ) Modified: head/usr.bin/netstat/route.c ============================================================================== --- head/usr.bin/netstat/route.c Sun Apr 16 19:12:07 2017 (r317034) +++ head/usr.bin/netstat/route.c Sun Apr 16 19:17:10 2017 (r317035) @@ -360,9 +360,10 @@ p_rtentry_sysctl(const char *name, struc xo_open_instance(name); sa = (struct sockaddr *)(rtm + 1); for (i = 0; i < RTAX_MAX; i++) { - if (rtm->rtm_addrs & (1 << i)) + if (rtm->rtm_addrs & (1 << i)) { addr[i] = sa; - sa = (struct sockaddr *)((char *)sa + SA_SIZE(sa)); + sa = (struct sockaddr *)((char *)sa + SA_SIZE(sa)); + } } protrusion = p_sockaddr("destination", addr[RTAX_DST], Modified: head/usr.sbin/arp/arp.c ============================================================================== --- head/usr.sbin/arp/arp.c Sun Apr 16 19:12:07 2017 (r317034) +++ head/usr.sbin/arp/arp.c Sun Apr 16 19:17:10 2017 (r317035) @@ -404,7 +404,7 @@ set(int argc, char **argv) * the prefix route covering the local end of the * PPP link should be returned, on which ARP applies. */ - rtm = rtmsg(RTM_GET, dst, &sdl_m); + rtm = rtmsg(RTM_GET, dst, NULL); if (rtm == NULL) { xo_warn("%s", host); return (1); @@ -466,7 +466,6 @@ delete(char *host) struct sockaddr_in *addr, *dst; struct rt_msghdr *rtm; struct sockaddr_dl *sdl; - struct sockaddr_dl sdl_m; dst = getaddr(host); if (dst == NULL) @@ -477,17 +476,8 @@ delete(char *host) */ flags &= ~RTF_ANNOUNCE; - /* - * setup the data structure to notify the kernel - * it is the ARP entry the RTM_GET is interested - * in - */ - bzero(&sdl_m, sizeof(sdl_m)); - sdl_m.sdl_len = sizeof(sdl_m); - sdl_m.sdl_family = AF_LINK; - for (;;) { /* try twice */ - rtm = rtmsg(RTM_GET, dst, &sdl_m); + rtm = rtmsg(RTM_GET, dst, NULL); if (rtm == NULL) { xo_warn("%s", host); return (1); @@ -511,7 +501,7 @@ delete(char *host) } /* - * Regualar entry delete failed, now check if there + * Regular entry delete failed, now check if there * is a proxy-arp entry to remove. */ if (flags & RTF_ANNOUNCE) { @@ -815,7 +805,8 @@ doit: } do { l = read(s, (char *)&m_rtmsg, sizeof(m_rtmsg)); - } while (l > 0 && (rtm->rtm_seq != seq || rtm->rtm_pid != pid)); + } while (l > 0 && (rtm->rtm_type != cmd || rtm->rtm_seq != seq || + rtm->rtm_pid != pid)); if (l < 0) xo_warn("read from routing socket"); return (rtm); Modified: head/usr.sbin/ndp/ndp.c ============================================================================== --- head/usr.sbin/ndp/ndp.c Sun Apr 16 19:12:07 2017 (r317034) +++ head/usr.sbin/ndp/ndp.c Sun Apr 16 19:17:10 2017 (r317035) @@ -888,7 +888,8 @@ doit: } do { l = read(s, (char *)&m_rtmsg, sizeof(m_rtmsg)); - } while (l > 0 && (rtm->rtm_seq != seq || rtm->rtm_pid != pid)); + } while (l > 0 && (rtm->rtm_type != cmd || rtm->rtm_seq != seq || + rtm->rtm_pid != pid)); if (l < 0) (void) fprintf(stderr, "ndp: read from routing socket: %s\n", strerror(errno)); Modified: head/usr.sbin/rarpd/rarpd.c ============================================================================== --- head/usr.sbin/rarpd/rarpd.c Sun Apr 16 19:12:07 2017 (r317034) +++ head/usr.sbin/rarpd/rarpd.c Sun Apr 16 19:17:10 2017 (r317035) @@ -755,7 +755,8 @@ update_arptab(u_char *ep, in_addr_t ipad } do { cc = read(r, rt, sizeof(rtmsg)); - } while (cc > 0 && (rt->rtm_seq != seq || rt->rtm_pid != pid)); + } while (cc > 0 && (rt->rtm_type != RTM_GET || rt->rtm_seq != seq || + rt->rtm_pid != pid)); if (cc == -1) { logmsg(LOG_ERR, "rtmsg get read: %m"); close(r); @@ -803,7 +804,8 @@ update_arptab(u_char *ep, in_addr_t ipad } do { cc = read(r, rt, sizeof(rtmsg)); - } while (cc > 0 && (rt->rtm_seq != seq || rt->rtm_pid != pid)); + } while (cc > 0 && (rt->rtm_type != RTM_ADD || rt->rtm_seq != seq || + rt->rtm_pid != pid)); close(r); if (cc == -1) { logmsg(LOG_ERR, "rtmsg add read: %m"); Modified: head/usr.sbin/route6d/route6d.c ============================================================================== --- head/usr.sbin/route6d/route6d.c Sun Apr 16 19:12:07 2017 (r317034) +++ head/usr.sbin/route6d/route6d.c Sun Apr 16 19:17:10 2017 (r317035) @@ -1768,14 +1768,23 @@ rtrecv(void) break; default: rtm = (struct rt_msghdr *)(void *)p; - addrs = rtm->rtm_addrs; - q = (char *)(rtm + 1); if (rtm->rtm_version != RTM_VERSION) { trace(1, "unexpected rtmsg version %d " "(should be %d)\n", rtm->rtm_version, RTM_VERSION); continue; } + /* + * Only messages that use the struct rt_msghdr + * format are allowed beyond this point. + */ + if (rtm->rtm_type > RTM_RESOLVE) { + trace(1, "rtmsg type %d ignored\n", + rtm->rtm_type); + continue; + } + addrs = rtm->rtm_addrs; + q = (char *)(rtm + 1); if (rtm->rtm_pid == pid) { #if 0 trace(1, "rtmsg looped back to me, ignored\n"); @@ -2973,7 +2982,8 @@ getroute(struct netinfo6 *np, struct in6 exit(1); } rtm = (struct rt_msghdr *)(void *)buf; - } while (rtm->rtm_seq != myseq || rtm->rtm_pid != pid); + } while (rtm->rtm_type != RTM_GET || rtm->rtm_seq != myseq || + rtm->rtm_pid != pid); sin6 = (struct sockaddr_in6 *)(void *)&buf[sizeof(struct rt_msghdr)]; if (rtm->rtm_addrs & RTA_DST) { sin6 = (struct sockaddr_in6 *)(void *) From owner-svn-src-head@freebsd.org Sun Apr 16 19:23:11 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E2F6BD41111; Sun, 16 Apr 2017 19:23:11 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B50796EA; Sun, 16 Apr 2017 19:23:11 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3GJNAdA078635; Sun, 16 Apr 2017 19:23:10 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3GJNAnf078634; Sun, 16 Apr 2017 19:23:10 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201704161923.v3GJNAnf078634@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sun, 16 Apr 2017 19:23:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317036 - head/lib/libjail X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 16 Apr 2017 19:23:12 -0000 Author: pfg Date: Sun Apr 16 19:23:10 2017 New Revision: 317036 URL: https://svnweb.freebsd.org/changeset/base/317036 Log: libjail: make allocation in jailparam_all() somewhat more robust. Unsign some variables involved in allocation as they will never be negative anyways. Provide some bounds checking through reallocarray(3). This is all very unlikely to have any visible effect. Reviewed by: jamie MFC after: 3 weeks Modified: head/lib/libjail/jail.c Modified: head/lib/libjail/jail.c ============================================================================== --- head/lib/libjail/jail.c Sun Apr 16 19:17:10 2017 (r317035) +++ head/lib/libjail/jail.c Sun Apr 16 19:23:10 2017 (r317036) @@ -200,7 +200,7 @@ jailparam_all(struct jailparam **jpp) { struct jailparam *jp, *tjp; size_t mlen1, mlen2, buflen; - int njp, nlist; + unsigned njp, nlist; int mib1[CTL_MAXNAME], mib2[CTL_MAXNAME - 2]; char buf[MAXPATHLEN]; @@ -250,7 +250,7 @@ jailparam_all(struct jailparam **jpp) /* Add the parameter to the list */ if (njp >= nlist) { nlist *= 2; - tjp = realloc(jp, nlist * sizeof(*jp)); + tjp = reallocarray(jp, nlist, sizeof(*jp)); if (tjp == NULL) goto error; jp = tjp; @@ -259,7 +259,7 @@ jailparam_all(struct jailparam **jpp) goto error; mib1[1] = 2; } - jp = realloc(jp, njp * sizeof(*jp)); + jp = reallocarray(jp, njp, sizeof(*jp)); *jpp = jp; return (njp); From owner-svn-src-head@freebsd.org Sun Apr 16 19:27:22 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E4BBDD4140D; Sun, 16 Apr 2017 19:27:22 +0000 (UTC) (envelope-from des@des.no) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id B01CDA99; Sun, 16 Apr 2017 19:27:22 +0000 (UTC) (envelope-from des@des.no) Received: from desk.des.no (smtp.des.no [194.63.250.102]) by smtp.des.no (Postfix) with ESMTP id 35462F5D1; Sun, 16 Apr 2017 19:26:02 +0000 (UTC) Received: by desk.des.no (Postfix, from userid 1001) id 27338422C; Sun, 16 Apr 2017 21:26:03 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Mark Murray Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r317015 - in head/sys: boot/forth conf crypto/chacha20 dev/random libkern sys References: <201704160911.v3G9B3df023095@repo.freebsd.org> Date: Sun, 16 Apr 2017 21:26:03 +0200 In-Reply-To: <201704160911.v3G9B3df023095@repo.freebsd.org> (Mark Murray's message of "Sun, 16 Apr 2017 09:11:03 +0000 (UTC)") Message-ID: <86lgr09mt0.fsf@desk.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 16 Apr 2017 19:27:23 -0000 Mark Murray writes: > Added: > head/sys/crypto/chacha20/chacha.c (contents, props changed) > head/sys/crypto/chacha20/chacha.h (contents, props changed) Really? You committed this code despite having been informed of its dubious legal status, and despite knowing full well that another implementation was already available? DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-head@freebsd.org Sun Apr 16 21:17:42 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CED85D4179F; Sun, 16 Apr 2017 21:17:42 +0000 (UTC) (envelope-from markm@FreeBSD.org) Received: from gromit.grondar.org (grandfather.grondar.org [IPv6:2a01:348:0:15:5d59:5c20:0:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9EE1B8A1; Sun, 16 Apr 2017 21:17:42 +0000 (UTC) (envelope-from markm@FreeBSD.org) Received: from graveyard.grondar.org ([88.96.155.33] helo=gronkulator.grondar.org) by gromit.grondar.org with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.88 (FreeBSD)) (envelope-from ) id 1czrY9-0000cp-Uy; Sun, 16 Apr 2017 22:17:40 +0100 Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: svn commit: r317015 - in head/sys: boot/forth conf crypto/chacha20 dev/random libkern sys From: Mark R V Murray In-Reply-To: <86lgr09mt0.fsf@desk.des.no> Date: Sun, 16 Apr 2017 22:17:37 +0100 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <201704160911.v3G9B3df023095@repo.freebsd.org> <86lgr09mt0.fsf@desk.des.no> To: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= X-Mailer: Apple Mail (2.3273) X-SA-Score: -1.0 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 16 Apr 2017 21:17:42 -0000 > On 16 Apr 2017, at 20:26, Dag-Erling Sm=C3=B8rgrav wrote: >=20 > Mark Murray writes: >> Added: >> head/sys/crypto/chacha20/chacha.c (contents, props changed) >> head/sys/crypto/chacha20/chacha.h (contents, props changed) >=20 > Really? You committed this code despite having been informed of its > dubious legal status, and despite knowing full well that another > implementation was already available? "Dubious legal status"? Please go and look at the chacha that OpenSSH = uses. You will find it strangely familiar. You informed me *that* you had written another implementation. You = didn't inform me *when* you were going to pull the trigger. The time between warning me and committing was a shade over 2 hours. The fact that 1) yours is optional (arc4random needs standard) 2) your = API is incompatible and 3) both code-sets can co-exist without conflict = means that there is no technical problem, except for the time taken adapt to = your API and bikeshed out the module "standard" vs "optional" status. Oh, and the time to retest everything. In the past you have made me wait *months* to make changes to my own = code. Your commit took 2 *hours* between first warning of commit and it = hitting the tree. You can't say you didn't know my commit was imminent. I had just gotten a green light from the SO a day or so before. Here's the timeline: 18th March: I open D10048 - a change that replaces RC4 with ChaCha as underlying algorithm for arc4random(9). I choose the OpenSSH copy of chacha.c. 21st March: A brief exchange of emails where DES' Chacha is announced as existing. No timeline for its committal is discussed. Fri 14th April, 2:58: SO Green-lights my commit after a few rounds of changes and discussion. Sat 14th April, 17:45: DES Adds himself to the reviewer list of D10048 for the first time and makes this comment "Please allow me some time to commit my Chacha20 implementation first so we can use that instead of the legally dubious version which is included in this patch. I hit a snag that I haven't had time to debug, but I'm hoping to have it done by Tuesday." Sat 14th April, 19:54: DES make this comment: "Turns out the snag was that I was loading the wrong version of the module. I have committed it now (r316982). If anyone is interested, I have a version that includes test vectors and runs self-tests when loaded, but I removed them from the final version as they are about six times larger than the actual code." DES - are you kidding me??! 2 hours 9 minutes warning? I already had a green light; I wan't watching Phabricator, I was prepping my commit! "Please allow me some time", then you drop your warning from 3 days to 2 hours! M --=20 Mark R V Murray From owner-svn-src-head@freebsd.org Sun Apr 16 21:42:45 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6971BD41F39; Sun, 16 Apr 2017 21:42:45 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2092814DE; Sun, 16 Apr 2017 21:42:45 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3GLginL035614; Sun, 16 Apr 2017 21:42:44 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3GLgin1035612; Sun, 16 Apr 2017 21:42:44 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201704162142.v3GLgin1035612@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Sun, 16 Apr 2017 21:42:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317037 - in head/bin/sh: . tests/parser X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 16 Apr 2017 21:42:45 -0000 Author: jilles Date: Sun Apr 16 21:42:43 2017 New Revision: 317037 URL: https://svnweb.freebsd.org/changeset/base/317037 Log: sh: Fix unalias -a while an alias is currently in use. It is a rare situation to modify aliases while an alias is currently in use, but this is handled for plain unalias. Handle it for unalias -a as well. Added: head/bin/sh/tests/parser/alias17.0 (contents, props changed) Modified: head/bin/sh/alias.c Modified: head/bin/sh/alias.c ============================================================================== --- head/bin/sh/alias.c Sun Apr 16 19:23:10 2017 (r317036) +++ head/bin/sh/alias.c Sun Apr 16 21:42:43 2017 (r317037) @@ -85,6 +85,14 @@ setalias(const char *name, const char *v INTON; } +static void +freealias(struct alias *ap) +{ + ckfree(ap->name); + ckfree(ap->val); + ckfree(ap); +} + static int unalias(const char *name) { @@ -106,9 +114,7 @@ unalias(const char *name) else { INTOFF; *app = ap->next; - ckfree(ap->name); - ckfree(ap->val); - ckfree(ap); + freealias(ap); INTON; } aliases--; @@ -122,19 +128,21 @@ unalias(const char *name) static void rmaliases(void) { - struct alias *ap, *tmp; + struct alias *ap, **app; int i; INTOFF; for (i = 0; i < ATABSIZE; i++) { - ap = atab[i]; - atab[i] = NULL; - while (ap) { - ckfree(ap->name); - ckfree(ap->val); - tmp = ap; - ap = ap->next; - ckfree(tmp); + app = &atab[i]; + while (*app) { + ap = *app; + if (ap->flag & ALIASINUSE) { + *ap->name = '\0'; + app = &(*app)->next; + } else { + *app = ap->next; + freealias(ap); + } } } aliases = 0; Added: head/bin/sh/tests/parser/alias17.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/bin/sh/tests/parser/alias17.0 Sun Apr 16 21:42:43 2017 (r317037) @@ -0,0 +1,7 @@ +# $FreeBSD$ + +v=1 +alias a='unalias -a +v=2' +eval a +[ "$v" = 2 ] From owner-svn-src-head@freebsd.org Sun Apr 16 21:57:26 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A46CFD402B1; Sun, 16 Apr 2017 21:57:26 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 711D719C2; Sun, 16 Apr 2017 21:57:26 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3GLvPdR039639; Sun, 16 Apr 2017 21:57:25 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3GLvPPP039638; Sun, 16 Apr 2017 21:57:25 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201704162157.v3GLvPPP039638@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Sun, 16 Apr 2017 21:57:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317038 - head/bin/sh/tests/parser X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 16 Apr 2017 21:57:26 -0000 Author: jilles Date: Sun Apr 16 21:57:25 2017 New Revision: 317038 URL: https://svnweb.freebsd.org/changeset/base/317038 Log: sh: Link the new test to the build. Modified: head/bin/sh/tests/parser/Makefile Modified: head/bin/sh/tests/parser/Makefile ============================================================================== --- head/bin/sh/tests/parser/Makefile Sun Apr 16 21:42:43 2017 (r317037) +++ head/bin/sh/tests/parser/Makefile Sun Apr 16 21:57:25 2017 (r317038) @@ -23,6 +23,7 @@ ${PACKAGE}FILES+= alias13.0 ${PACKAGE}FILES+= alias14.0 ${PACKAGE}FILES+= alias15.0 alias15.0.stdout ${PACKAGE}FILES+= alias16.0 +${PACKAGE}FILES+= alias17.0 ${PACKAGE}FILES+= and-pipe-not.0 ${PACKAGE}FILES+= case1.0 ${PACKAGE}FILES+= case2.0 From owner-svn-src-head@freebsd.org Sun Apr 16 22:10:03 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8DEBCD4050C; Sun, 16 Apr 2017 22:10:03 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 45B011E15; Sun, 16 Apr 2017 22:10:03 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3GMA2JV043793; Sun, 16 Apr 2017 22:10:02 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3GMA2mm043789; Sun, 16 Apr 2017 22:10:02 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201704162210.v3GMA2mm043789@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Sun, 16 Apr 2017 22:10:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317039 - in head/bin/sh: . tests/parser X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 16 Apr 2017 22:10:03 -0000 Author: jilles Date: Sun Apr 16 22:10:02 2017 New Revision: 317039 URL: https://svnweb.freebsd.org/changeset/base/317039 Log: sh: Fix use after free when resetting an in-use alias. The special case of modifying an existing alias does not work correctly if the alias is currently in use. Instead, handle this case by unaliasing the old alias (if any) and then creating a new alias. Added: head/bin/sh/tests/parser/alias18.0 (contents, props changed) Modified: head/bin/sh/alias.c head/bin/sh/tests/parser/Makefile Modified: head/bin/sh/alias.c ============================================================================== --- head/bin/sh/alias.c Sun Apr 16 21:57:25 2017 (r317038) +++ head/bin/sh/alias.c Sun Apr 16 22:10:02 2017 (r317039) @@ -63,17 +63,8 @@ setalias(const char *name, const char *v { struct alias *ap, **app; + unalias(name); app = hashalias(name); - for (ap = *app; ap; ap = ap->next) { - if (equal(name, ap->name)) { - INTOFF; - ckfree(ap->val); - ap->val = savestr(val); - INTON; - return; - } - } - /* not found */ INTOFF; ap = ckmalloc(sizeof (struct alias)); ap->name = savestr(name); Modified: head/bin/sh/tests/parser/Makefile ============================================================================== --- head/bin/sh/tests/parser/Makefile Sun Apr 16 21:57:25 2017 (r317038) +++ head/bin/sh/tests/parser/Makefile Sun Apr 16 22:10:02 2017 (r317039) @@ -24,6 +24,7 @@ ${PACKAGE}FILES+= alias14.0 ${PACKAGE}FILES+= alias15.0 alias15.0.stdout ${PACKAGE}FILES+= alias16.0 ${PACKAGE}FILES+= alias17.0 +${PACKAGE}FILES+= alias18.0 ${PACKAGE}FILES+= and-pipe-not.0 ${PACKAGE}FILES+= case1.0 ${PACKAGE}FILES+= case2.0 Added: head/bin/sh/tests/parser/alias18.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/bin/sh/tests/parser/alias18.0 Sun Apr 16 22:10:02 2017 (r317039) @@ -0,0 +1,8 @@ +# $FreeBSD$ + +v=1 +alias a='alias a=v=2 +v=3 +a' +eval a +[ "$v" = 2 ] From owner-svn-src-head@freebsd.org Sun Apr 16 22:57:29 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D2C58D4139C; Sun, 16 Apr 2017 22:57:29 +0000 (UTC) (envelope-from linimon@lonesome.com) Received: from mail.soaustin.net (mail.soaustin.net [192.108.105.60]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.soaustin.net", Issuer "StartCom Class 2 IV Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BACA515C7; Sun, 16 Apr 2017 22:57:29 +0000 (UTC) (envelope-from linimon@lonesome.com) Received: from lonesome.com (bones.soaustin.net [192.108.105.22]) by mail.soaustin.net (Postfix) with ESMTPSA id 6F954EE0; Sun, 16 Apr 2017 17:57:22 -0500 (CDT) Date: Sun, 16 Apr 2017 17:57:21 -0500 From: Mark Linimon To: Ian Lepore Cc: rgrimes@FreeBSD.org, svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers Subject: Re: svn commit: r317015 - in head/sys: boot/forth conf crypto/chacha20 dev/random libkern sys Message-ID: <20170416225721.GB11983@lonesome.com> References: <201704161604.v3GG4aoq017437@pdx.rh.CN85.dnsmgr.net> <1492360559.96207.1.camel@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1492360559.96207.1.camel@freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 16 Apr 2017 22:57:29 -0000 On Sun, Apr 16, 2017 at 10:35:59AM -0600, Ian Lepore wrote: > (The most basic rule would be "notify me about every new change put > up for review", which seems like it would be a real spam generator, > but at least one person uses such a rule.) I tried the latter once, as a test. I doubt many people will leave it on for long. I do find the feature very useful. A "For Dummies" writeup would have save me some time experimenting. mcl From owner-svn-src-head@freebsd.org Sun Apr 16 23:02:34 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8BB92D41608; Sun, 16 Apr 2017 23:02:34 +0000 (UTC) (envelope-from linimon@lonesome.com) Received: from mail.soaustin.net (mail.soaustin.net [192.108.105.60]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.soaustin.net", Issuer "StartCom Class 2 IV Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 05BD01A11; Sun, 16 Apr 2017 23:02:34 +0000 (UTC) (envelope-from linimon@lonesome.com) Received: from lonesome.com (bones.soaustin.net [192.108.105.22]) by mail.soaustin.net (Postfix) with ESMTPSA id 3B9D3C0E; Sun, 16 Apr 2017 18:02:33 -0500 (CDT) Date: Sun, 16 Apr 2017 18:02:32 -0500 From: Mark Linimon To: Conrad Meyer Cc: "Rodney W. Grimes" , svn-src-head@freebsd.org, Baptiste Daroussin , src-committers , svn-src-all@freebsd.org Subject: Re: svn commit: r316978 - in head: contrib/zstd etc/mtree lib lib/libzstd share/mk usr.bin usr.bin/zstd Message-ID: <20170416230232.GC11983@lonesome.com> References: <201704152005.v3FK5M2j002459@repo.freebsd.org> <201704152337.v3FNb2m1014053@pdx.rh.CN85.dnsmgr.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 16 Apr 2017 23:02:34 -0000 On Sat, Apr 15, 2017 at 05:01:10PM -0700, Conrad Meyer wrote: > Can you tone down the condescension, Rod? Being rude doesn't help you > make your case. I'm going to have to +1 this. We're a huge community now. Comments that might be appropriate among a handful of people aren't as appropriate now. Add in all the different (human) languages and cultures, and we have a hard enough time commmunicating as it is. mcl From owner-svn-src-head@freebsd.org Sun Apr 16 23:42:10 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 64115D41E76 for ; Sun, 16 Apr 2017 23:42:10 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x22b.google.com (mail-io0-x22b.google.com [IPv6:2607:f8b0:4001:c06::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2C41AB85 for ; Sun, 16 Apr 2017 23:42:10 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x22b.google.com with SMTP id a103so138114729ioj.1 for ; Sun, 16 Apr 2017 16:42:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=kdWKAScu/OlSNFyYhZpJK60Qa/nKo9c/8aN2V74WNwM=; b=AtNi9Cyd5juWV1k1cu+XqA26UvQSE2VNQT3ioOZmni6TBXaxe6UHUo0qSywf/F54Xy kKW20nsI89nA9vVpHwxxYEem9xmomCqEyjUefGllbalESG6zMdkKfeBtLP5KPFMiY2an UihK2/6vkLskVKRmr4S99QVf1aMJVZW4ZrInnETZwUtdQP3RbGgqkOQbfT5/sSCPVu3S qBBsLpG6bXQLNIYNXOYuIUx8gX2VTCpsRwvmSaDYhG/XZHYXnikthS7Z5OrApl6sA9cv 1ut7fJbbRISZhBgKyyrArcxjpRWxHcMLZJCF54jD3mN1KyODEV9nPGfisQTyWzrwsLRn gX/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=kdWKAScu/OlSNFyYhZpJK60Qa/nKo9c/8aN2V74WNwM=; b=Gl9OFo5uMQtIxEtp4oyuumc3g8Kr0djTCPxZSPsbvRSuRLSArfXB/Sv90lXMwFGoKY M8iPnBahZAqZRhFESUu769ODODy86uPAlg63OxINksP94GLvDGuFOm1RvZUX/ubp3s3e zWOyLDhRKvN0hdK1f+WysstNly9uEcNfsZJbTSLEhvQlK+GIU5k25t+uMGpTZ8S0YLu1 m9NFtFNwXHdBte4dHSjAusuVWk3TTLJ/PRoOioqnP71CvOb57FME0cMMJ84LNeaYa+bD KD2Agvf4JNB89E0fugIk8NXLQBKTbTpbeXi1JgLmlV5TGps9PyM0RZSuDcM2S0ycMRMY oB6g== X-Gm-Message-State: AN3rC/5D84+izD3YPZ+vWGkfLvPaJsGBpOV+BOSrOa1n1fhKOjbCf+xk T4k8gyQi0e299RyWyaNgt7AFnQod9A== X-Received: by 10.36.44.14 with SMTP id i14mr7388699iti.103.1492386129513; Sun, 16 Apr 2017 16:42:09 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.146.69 with HTTP; Sun, 16 Apr 2017 16:42:09 -0700 (PDT) X-Originating-IP: [2603:300b:6:5100:88c0:1b6b:e9c9:dca7] In-Reply-To: <1492360559.96207.1.camel@freebsd.org> References: <201704161604.v3GG4aoq017437@pdx.rh.CN85.dnsmgr.net> <1492360559.96207.1.camel@freebsd.org> From: Warner Losh Date: Sun, 16 Apr 2017 17:42:09 -0600 X-Google-Sender-Auth: 4kCfnbdfohdNnbQVZtiS5JoVwUk Message-ID: Subject: Re: svn commit: r317015 - in head/sys: boot/forth conf crypto/chacha20 dev/random libkern sys To: Ian Lepore Cc: rgrimes@freebsd.org, src-committers , "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.23 Precedence: list List-Id: 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, 16 Apr 2017 23:42:10 -0000 On Sun, Apr 16, 2017 at 10:35 AM, Ian Lepore wrote: > On Sun, 2017-04-16 at 09:04 -0700, Rodney W. Grimes wrote: >> What watch list is this? And do we have a watch list that is just "New Phabricator >> created" so we can make just that incident go to some mailling list so people stop >> getting caught off guard by commits that have been reviews that they wish they had >> even known there was a review? We just need a way for being allerted there is a >> new review that we *might* be interested, or care to participate in without being >> on all the watch lists. > > Sounds like you need to learn about the Herald feature of Phab and set > yourself up some rules. (The most basic rule would be "notify me about > every new change put up for review", which seems like it would be a > real spam generator, but at least one person uses such a rule.) I'm not that crazy: just all src reviews :). And it's quite handy if you can quickly drop 'don't care' reviews while you're scanning through the spam :) Warner From owner-svn-src-head@freebsd.org Mon Apr 17 01:02:54 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3884ED32E8D; Mon, 17 Apr 2017 01:02:54 +0000 (UTC) (envelope-from mahrens@gmail.com) Received: from mail-vk0-x235.google.com (mail-vk0-x235.google.com [IPv6:2607:f8b0:400c:c05::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DF60D1928; Mon, 17 Apr 2017 01:02:53 +0000 (UTC) (envelope-from mahrens@gmail.com) Received: by mail-vk0-x235.google.com with SMTP id j127so48504336vkh.0; Sun, 16 Apr 2017 18:02:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=7fU2u2jl6tWKFVZ9Easz8hsmMNOxlY9te70plXg2xLI=; b=Io6uyfsKoLAUQRO5qIygvPMB+vxH+z8XnXpN/qKn9qIfe2E7rwxgZxVTvp3HXxZM+L z0iA7dPX92e6cNgS/iXxC7ad/818lVleWi0qtakqdoZ3ii3lk0I/4uYCcF6GnuLZhIrY 8UPGNuiVCGQ7VDoK/55vUWvrOJ3en2jGGkjvK7R6G3ULBfv68ZfcoA1RVJvl7UJayD/y oS+vtyxf7hVIpemLHE8zkok6NoXO+/bw7pWHmDGX0hQqJ4AmepbnaG9o+JzzqX6NgK1/ L1+JsZAucGc91xvMV6apKDbABUEEweuoTLj6kaQD1gb1nICkXfzlZST/Clw0juJtk8cT AVkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=7fU2u2jl6tWKFVZ9Easz8hsmMNOxlY9te70plXg2xLI=; b=IShvMHoo69CHqJMd54J1pEUxoLcP8DX9bwPyELp/bZTGHJidkyifS3SywgLSBAbkNN NDZKDO9XZX5WKfu209VkVA96EuCV+10bZzW9H9mEulQr9Y+aXcd9fyH7MPSlHUhAHXtx gZDgyVl8iBBuJYj5DkIs4fxPFx8MDlstZETAj4F8EbyfjPoRDdf+0OSt5lInlie7bJAJ FfJ4gvSqIXkbsKAGr55nI0zq4bCnOs/iz4jmTYGHvfXkI2yVTNEXiu+7MaRHhZuTyfI7 cIP7MCBFV8KkeSJZQSfCf6zQE+7rRS5aLllD06Jhn44ehEtF7zmmQIeZmOKOpXfexQs7 tI2g== X-Gm-Message-State: AN3rC/7xoDc108Nt2P4uPSWvBfaA/Sa9wN59zFxjAd4Pv3Odzm/HSe/C pjrn5c0p7UgpI/ksONrC1oqfD/FnXAqws58= X-Received: by 10.31.157.130 with SMTP id g124mr7235416vke.139.1492390972384; Sun, 16 Apr 2017 18:02:52 -0700 (PDT) MIME-Version: 1.0 Sender: mahrens@gmail.com Received: by 10.176.80.18 with HTTP; Sun, 16 Apr 2017 18:02:52 -0700 (PDT) In-Reply-To: <20170416073551.557czdcksdmmuz24@ivaldir.net> References: <201704152005.v3FK5M2j002459@repo.freebsd.org> <201704152337.v3FNb2m1014053@pdx.rh.CN85.dnsmgr.net> <20170416073551.557czdcksdmmuz24@ivaldir.net> From: Matthew Ahrens Date: Sun, 16 Apr 2017 18:02:52 -0700 X-Google-Sender-Auth: 5GBv-HAU3rbcsir5bccEU2ZrCjE Message-ID: Subject: Re: svn commit: r316978 - in head: contrib/zstd etc/mtree lib lib/libzstd share/mk usr.bin usr.bin/zstd To: Baptiste Daroussin Cc: rgrimes@freebsd.org, "src-committers@freebsd.org" , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 17 Apr 2017 01:02:54 -0000 On Sun, Apr 16, 2017 at 12:35 AM, Baptiste Daroussin wrote: > > zstandard is the successor to lz4, That's not my understanding. zstandard is an improvement in every respect over zlib (gzip), but lz4 is faster, especially at decompression[*]. If you have data to the contrary I'd be happy to be wrong, but AFAIK, lz4 will retain its usefulness for some time, at least for ZFS. there are attempts to integrate zstandard in > ZFS, Allan Jude is working on that, That's great, I look forward to it! --matt [*] According to the zstandard github page, lz4 is 1.5x faster at compression and 3x faster at decompression. https://github.com/facebook/zstd From owner-svn-src-head@freebsd.org Mon Apr 17 03:15:24 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 63F56D4028A; Mon, 17 Apr 2017 03:15:24 +0000 (UTC) (envelope-from des@des.no) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id 2DA83892; Mon, 17 Apr 2017 03:15:23 +0000 (UTC) (envelope-from des@des.no) Received: from desk.des.no (smtp.des.no [194.63.250.102]) by smtp.des.no (Postfix) with ESMTP id 49BA2FB15; Mon, 17 Apr 2017 03:15:17 +0000 (UTC) Received: by desk.des.no (Postfix, from userid 1001) id 1808B426A; Mon, 17 Apr 2017 05:15:18 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Mark R V Murray Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r317015 - in head/sys: boot/forth conf crypto/chacha20 dev/random libkern sys References: <201704160911.v3G9B3df023095@repo.freebsd.org> <86lgr09mt0.fsf@desk.des.no> Date: Mon, 17 Apr 2017 05:15:17 +0200 In-Reply-To: (Mark R. V. Murray's message of "Sun, 16 Apr 2017 22:17:37 +0100") Message-ID: <86bmrvafne.fsf@desk.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 17 Apr 2017 03:15:24 -0000 Mark R V Murray writes: > "Dubious legal status"? Please go and look at the chacha that OpenSSH use= s. > You will find it strangely familiar. I know exactly where that code comes from. It lacks a proper license. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-head@freebsd.org Mon Apr 17 04:35:15 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 67714D41DC9; Mon, 17 Apr 2017 04:35:15 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from anubis.delphij.net (anubis.delphij.net [IPv6:2001:470:1:117::25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "anubis.delphij.net", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 445D4195D; Mon, 17 Apr 2017 04:35:15 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from Xins-MacBook-Pro.local (ip-64-134-178-180.public.wayport.net [64.134.178.180]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by anubis.delphij.net (Postfix) with ESMTPSA id 784EA2E10E; Sun, 16 Apr 2017 21:35:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=delphij.net; s=anubis; t=1492403715; x=1492418115; bh=aRJiT37hLvsYFVitlMiJC94pIHA6Fyb/eRtVJYOyf+s=; h=Cc:Subject:To:References:From:Date:In-Reply-To; b=A1Od69+ZTVJF/7xJOabbdYIoLE7/mV+DO4LBb4jwHzxelkaDpa28u5nXEH5XTCd1h UuSYJltxw2e3+MQyvG+6TzBPQ/lm1nbo/wNAxI+B4PnQJk11gPhBFs7pumVIM4U87p JJrRcl+2fq1xIjp9n38FYoCdya2xSU40Gs+ibPkU= Cc: d@delphij.net, src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r317015 - in head/sys: boot/forth conf crypto/chacha20 dev/random libkern sys To: rgrimes@freebsd.org, Mark R V Murray References: <201704161230.v3GCUujl016578@pdx.rh.CN85.dnsmgr.net> From: Xin Li Message-ID: Date: Mon, 17 Apr 2017 00:35:10 -0400 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.0 MIME-Version: 1.0 In-Reply-To: <201704161230.v3GCUujl016578@pdx.rh.CN85.dnsmgr.net> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="dTuQLg0JkVfFFEBSOEmOpKLbQJRxxq7SF" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 17 Apr 2017 04:35:15 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --dTuQLg0JkVfFFEBSOEmOpKLbQJRxxq7SF Content-Type: multipart/mixed; boundary="bwRDKMbUGeHxcAG2WQ4Tu8b8LqcgqABN1"; protected-headers="v1" From: Xin Li To: rgrimes@freebsd.org, Mark R V Murray Cc: d@delphij.net, src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: Subject: Re: svn commit: r317015 - in head/sys: boot/forth conf crypto/chacha20 dev/random libkern sys References: <201704161230.v3GCUujl016578@pdx.rh.CN85.dnsmgr.net> In-Reply-To: <201704161230.v3GCUujl016578@pdx.rh.CN85.dnsmgr.net> --bwRDKMbUGeHxcAG2WQ4Tu8b8LqcgqABN1 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 4/16/17 08:30, Rodney W. Grimes wrote: >> >>> On 16 Apr 2017, at 13:07, Rodney W. Grimes wrote: >>> >>>>> From replacing the rc4 algorithm with chacha20, this chalice has no= w >>>> become poisoned with the job of redesigning the entire structure of >>>> kernel random-number generation. >>>> >>>> This may take a while, and I'm already behind on RNG jobs. >>> >>> I do not see how this is a complete redesign of RNG, and if it is >>> such a heart ache to change algorithms in this code then it probably >>> should be redesigned? >> >> The RC4 algorithm is standard. Making the alogorithm pluggable means m= ore >> code, more testing and more time (time which I am rather short of). >=20 > I would rather see a proper implementation later, than a poor design > decision today. I don't see how not supporting pluggable algorithm for the kernel arc4andom() a poor design decision. We are supposed to make good algorithm choices, making it pluggable would only make the code much more bloated (to make the load/unload PRNG seeding right), less efficient (to allow caller to safely call the interfaces) for something that system administrators should never fiddle with. Cheers, --bwRDKMbUGeHxcAG2WQ4Tu8b8LqcgqABN1-- --dTuQLg0JkVfFFEBSOEmOpKLbQJRxxq7SF Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQIcBAEBCgAGBQJY9EYBAAoJEJW2GBstM+ns4vUP/jj025mSLy1zEdkdJQcrRsSv 5mfbfk1u9JLD5aFl2o876hLebe6d5xUwRZWYHL0JUSTO6SpoWODp/Qs66A93ZGbg GL7gnX3JD7A9hd1U1f5sY6uGCm3wOc2Y26gZIBk2PaO8MEe2ulBnWnAuQ8EiYVlx l4dE1pkXltRJVwujllFGJIhYnCbrpwz0nSFlRcWz5skbA5ALuTEpEgfkG4qhb63i zmKouALnpuN+XtJMTJc6044+8BCHKNyP6oxfqKcNB4AV709TRIpa61uQh1BhyYSl 1ucbHYH0WsJmVTMaXLzSZ1tjkdwIlwbCLbauduSW25VruEWTUqRA+/QBcRgtKTcI 71uhiUK4RSv/g35FeKOVVYYaXDx38uEuJ1cvlY5217RUk4jpfyk+ytw/k2+5b6X3 hI3+05MEQAYgSJeWwtNVEd3QsR3WNLDD/zdQ0o39eq08Rms7KklfixDp08mYDTRT 8ljKeCwFvtMkGC3NzviCX81JC0YpfgNkIPYqpLPQODRqPk4vNMc2ga1fbmWl1fJm m4eeg5Q1P9E586tZYx0UcHeBkOWIXLX0d/6y3HZz1c9EpDOzwsPB8aksguSEXzLS MNVQ333/2I9bmSrTGheYng/9jkCVfe+v2DQ/gD7TM5FrQtz+KfvERoVX5iHloL/L Y925PzaPBdRG3BF9jZsm =v3CT -----END PGP SIGNATURE----- --dTuQLg0JkVfFFEBSOEmOpKLbQJRxxq7SF-- From owner-svn-src-head@freebsd.org Mon Apr 17 05:18:20 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 252C9D40EED; Mon, 17 Apr 2017 05:18:20 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from mail.allbsd.org (gatekeeper.allbsd.org [IPv6:2001:2f0:104:e001::32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.allbsd.org", Issuer "RapidSSL SHA256 CA - G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A84E810CD; Mon, 17 Apr 2017 05:18:19 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from mail-d.allbsd.org (p2027-ipbf1605funabasi.chiba.ocn.ne.jp [123.225.191.27]) (authenticated bits=56) by mail.allbsd.org (8.15.2/8.15.2) with ESMTPSA id v3H5HkbG052733 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) (Client CN "/OU=GT07882699/OU=See+20www.rapidssl.com/resources/cps+20+28c+2915/OU=Domain+20Control+20Validated+20-+20RapidSSL+28R+29/CN=*.allbsd.org", Issuer "/C=US/O=GeoTrust+20Inc./CN=RapidSSL+20SHA256+20CA+20-+20G3"); Mon, 17 Apr 2017 14:18:05 +0900 (JST) (envelope-from hrs@FreeBSD.org) Received: from alph.allbsd.org (alph.allbsd.org [192.168.0.10]) by mail-d.allbsd.org (8.15.2/8.15.2) with ESMTPS id v3H5GU1T064052 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 17 Apr 2017 14:16:30 +0900 (JST) (envelope-from hrs@FreeBSD.org) Received: from localhost (localhost [IPv6:::1]) (authenticated bits=0) by alph.allbsd.org (8.15.2/8.15.2) with ESMTPA id v3H5GSah064049; Mon, 17 Apr 2017 14:16:28 +0900 (JST) (envelope-from hrs@FreeBSD.org) Date: Mon, 17 Apr 2017 14:16:06 +0900 (JST) Message-Id: <20170417.141606.1653550433426676222.hrs@allbsd.org> To: sobomax@freebsd.org Cc: ohartmann@walstatt.org, ler@lerctr.org, peter@wemm.org, src-committers@freebsd.org, svn-src-all@freebsd.org, hiren@freebsd.org, svn-src-head@freebsd.org, yaneurabeya@gmail.com Subject: Re: svn commit: r316874 - head/sys/kern From: Hiroki Sato In-Reply-To: References: <5B7F917E-EA2A-4DB4-B032-48BBBEDD7556@lerctr.org> <20170415174533.3dd6349a@thor.intern.walstatt.dynvpn.de> X-PGPkey-fingerprint: BDB3 443F A5DD B3D0 A530 FFD7 4F2C D3D8 2793 CF2D X-Mailer: Mew version 6.7 on Emacs 25.1 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Multipart/Signed; protocol="application/pgp-signature"; micalg=pgp-sha1; boundary="--Security_Multipart(Mon_Apr_17_14_16_06_2017_524)--" Content-Transfer-Encoding: 7bit X-Virus-Scanned: clamav-milter 0.99 at gatekeeper.allbsd.org X-Virus-Status: Clean X-Greylist: Sender DNS name whitelisted, not delayed by milter-greylist-4.4.3 (mail.allbsd.org [133.31.130.32]); Mon, 17 Apr 2017 14:18:08 +0900 (JST) X-Spam-Status: No, score=-99.9 required=13.0 tests=CONTENT_TYPE_PRESENT, QENCPTR1,USER_IN_WHITELIST autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on gatekeeper.allbsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 17 Apr 2017 05:18:20 -0000 ----Security_Multipart(Mon_Apr_17_14_16_06_2017_524)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Maxim Sobolev wrote in : so> I've committed another fix for the syslogd code in question which should so> hopefully make it functional again. Peter, please let me know if you still so> having any issues. Thanks! I am sorry for being late and thank you for fixing the breakage in the refactored code. I tried not to change the original code path but it seemed I added some bugs. I will double-check and clean up them. -- Hiroki ----Security_Multipart(Mon_Apr_17_14_16_06_2017_524)-- Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEABECAAYFAlj0T5YACgkQTyzT2CeTzy02HgCgoPYSr8dJ5dzFkPBYcMEUVaLy upsAniLNZHi8kxsrPGeN9W9kscZSRlEy =y/A3 -----END PGP SIGNATURE----- ----Security_Multipart(Mon_Apr_17_14_16_06_2017_524)---- From owner-svn-src-head@freebsd.org Mon Apr 17 07:27:47 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3D66FD42408; Mon, 17 Apr 2017 07:27:47 +0000 (UTC) (envelope-from ganbold@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0945ED36; Mon, 17 Apr 2017 07:27:46 +0000 (UTC) (envelope-from ganbold@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3H7Rkhr068864; Mon, 17 Apr 2017 07:27:46 GMT (envelope-from ganbold@FreeBSD.org) Received: (from ganbold@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3H7RkPx068863; Mon, 17 Apr 2017 07:27:46 GMT (envelope-from ganbold@FreeBSD.org) Message-Id: <201704170727.v3H7RkPx068863@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ganbold set sender to ganbold@FreeBSD.org using -f From: Ganbold Tsagaankhuu Date: Mon, 17 Apr 2017 07:27:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317040 - head/share/misc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 17 Apr 2017 07:27:47 -0000 Author: ganbold Date: Mon Apr 17 07:27:45 2017 New Revision: 317040 URL: https://svnweb.freebsd.org/changeset/base/317040 Log: Belatedly add myself to committers-src.dot file. Modified: head/share/misc/committers-src.dot Modified: head/share/misc/committers-src.dot ============================================================================== --- head/share/misc/committers-src.dot Sun Apr 16 22:10:02 2017 (r317039) +++ head/share/misc/committers-src.dot Mon Apr 17 07:27:45 2017 (r317040) @@ -169,6 +169,7 @@ flz [label="Florent Thoumie\nflz@FreeBSD gabor [label="Gabor Kovesdan\ngabor@FreeBSD.org\n2010/02/02"] gad [label="Garance A. Drosehn\ngad@FreeBSD.org\n2000/10/27"] gallatin [label="Andrew Gallatin\ngallatin@FreeBSD.org\n1999/01/15"] +ganbold [label="Ganbold Tsagaankhuu\nganbold@FreeBSD.org\n2013/12/18"] gavin [label="Gavin Atkinson\ngavin@FreeBSD.org\n2009/12/07"] gibbs [label="Justin T. Gibbs\ngibbs@FreeBSD.org\n????/??/??"] gjb [label="Glen Barber\ngjb@FreeBSD.org\n2013/06/04"] @@ -772,6 +773,8 @@ sjg -> stevek sos -> marcel +stas -> ganbold + theraven -> phil thompsa -> weongyo From owner-svn-src-head@freebsd.org Mon Apr 17 09:00:22 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 20B51D4183F; Mon, 17 Apr 2017 09:00:22 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D9748A5F; Mon, 17 Apr 2017 09:00:21 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3H90LGH005619; Mon, 17 Apr 2017 09:00:21 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3H90K98005617; Mon, 17 Apr 2017 09:00:20 GMT (envelope-from np@FreeBSD.org) Message-Id: <201704170900.v3H90K98005617@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Mon, 17 Apr 2017 09:00:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317041 - head/sys/dev/cxgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 17 Apr 2017 09:00:22 -0000 Author: np Date: Mon Apr 17 09:00:20 2017 New Revision: 317041 URL: https://svnweb.freebsd.org/changeset/base/317041 Log: cxgbe: Add tunables to control the number of LRO entries and the number of rx mbufs that should be presorted before LRO. There is no change in default behavior. MFC after: 1 week Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/adapter.h head/sys/dev/cxgbe/t4_sge.c Modified: head/sys/dev/cxgbe/adapter.h ============================================================================== --- head/sys/dev/cxgbe/adapter.h Mon Apr 17 07:27:45 2017 (r317040) +++ head/sys/dev/cxgbe/adapter.h Mon Apr 17 09:00:20 2017 (r317041) @@ -322,6 +322,7 @@ enum { IQ_HAS_FL = (1 << 1), /* iq associated with a freelist */ IQ_INTR = (1 << 2), /* iq takes direct interrupt */ IQ_LRO_ENABLED = (1 << 3), /* iq is an eth rxq with LRO enabled */ + IQ_ADJ_CREDIT = (1 << 4), /* hw is off by 1 credit for this iq */ /* iq state */ IQS_DISABLED = 0, Modified: head/sys/dev/cxgbe/t4_sge.c ============================================================================== --- head/sys/dev/cxgbe/t4_sge.c Mon Apr 17 07:27:45 2017 (r317040) +++ head/sys/dev/cxgbe/t4_sge.c Mon Apr 17 09:00:20 2017 (r317041) @@ -157,6 +157,18 @@ TUNABLE_INT("hw.cxgbe.safest_rx_cluster" static int tscale = 1; TUNABLE_INT("hw.cxgbe.tscale", &tscale); +/* + * Number of LRO entries in the lro_ctrl structure per rx queue. + */ +static int lro_entries = TCP_LRO_ENTRIES; +TUNABLE_INT("hw.cxgbe.lro_entries", &lro_entries); + +/* + * This enables presorting of frames before they're fed into tcp_lro_rx. + */ +static int lro_mbufs = 0; +TUNABLE_INT("hw.cxgbe.lro_mbufs", &lro_mbufs); + struct txpkts { u_int wr_type; /* type 0 or type 1 */ u_int npkt; /* # of packets in this work request */ @@ -1380,6 +1392,13 @@ t4_vi_intr(void *arg) t4_intr(irq->rxq); } +static inline int +sort_before_lro(struct lro_ctrl *lro) +{ + + return (lro->lro_mbuf_max != 0); +} + /* * Deals with anything and everything on the given ingress queue. */ @@ -1399,6 +1418,7 @@ service_iq(struct sge_iq *iq, int budget STAILQ_HEAD(, sge_iq) iql = STAILQ_HEAD_INITIALIZER(iql); #if defined(INET) || defined(INET6) const struct timeval lro_timeout = {0, sc->lro_timeout}; + struct lro_ctrl *lro = &rxq->lro; #endif KASSERT(iq->state == IQS_BUSY, ("%s: iq %p not BUSY", __func__, iq)); @@ -1413,6 +1433,23 @@ service_iq(struct sge_iq *iq, int budget fl_hw_cidx = 0; /* to silence gcc warning */ } +#if defined(INET) || defined(INET6) + if (iq->flags & IQ_ADJ_CREDIT) { + MPASS(sort_before_lro(lro)); + iq->flags &= ~IQ_ADJ_CREDIT; + if ((d->rsp.u.type_gen & F_RSPD_GEN) != iq->gen) { + tcp_lro_flush_all(lro); + t4_write_reg(sc, sc->sge_gts_reg, V_CIDXINC(1) | + V_INGRESSQID((u32)iq->cntxt_id) | + V_SEINTARM(iq->intr_params)); + return (0); + } + ndescs = 1; + } +#else + MPASS((iq->flags & IQ_ADJ_CREDIT) == 0); +#endif + /* * We always come back and check the descriptor ring for new indirect * interrupts and other responses after running a single handler. @@ -1524,8 +1561,9 @@ service_iq(struct sge_iq *iq, int budget #if defined(INET) || defined(INET6) if (iq->flags & IQ_LRO_ENABLED && + !sort_before_lro(lro) && sc->lro_timeout != 0) { - tcp_lro_flush_inactive(&rxq->lro, + tcp_lro_flush_inactive(lro, &lro_timeout); } #endif @@ -1565,9 +1603,14 @@ process_iql: #if defined(INET) || defined(INET6) if (iq->flags & IQ_LRO_ENABLED) { - struct lro_ctrl *lro = &rxq->lro; - - tcp_lro_flush_all(lro); + if (ndescs > 0 && lro->lro_mbuf_count > 8) { + MPASS(sort_before_lro(lro)); + /* hold back one credit and don't flush LRO state */ + iq->flags |= IQ_ADJ_CREDIT; + ndescs--; + } else { + tcp_lro_flush_all(lro); + } } #endif @@ -1856,10 +1899,14 @@ t4_eth_rx(struct sge_iq *iq, const struc } #if defined(INET) || defined(INET6) - if (iq->flags & IQ_LRO_ENABLED && - tcp_lro_rx(lro, m0, 0) == 0) { - /* queued for LRO */ - } else + if (iq->flags & IQ_LRO_ENABLED) { + if (sort_before_lro(lro)) { + tcp_lro_queue_mbuf(lro, m0); + return (0); /* queued for sort, then LRO */ + } + if (tcp_lro_rx(lro, m0, 0) == 0) + return (0); /* queued for LRO */ + } #endif ifp->if_input(ifp, m0); @@ -3050,10 +3097,10 @@ alloc_rxq(struct vi_info *vi, struct sge FL_UNLOCK(&rxq->fl); #if defined(INET) || defined(INET6) - rc = tcp_lro_init(&rxq->lro); + rc = tcp_lro_init_args(&rxq->lro, vi->ifp, lro_entries, lro_mbufs); if (rc != 0) return (rc); - rxq->lro.ifp = vi->ifp; /* also indicates LRO init'ed */ + MPASS(rxq->lro.ifp == vi->ifp); /* also indicates LRO init'ed */ if (vi->ifp->if_capenable & IFCAP_LRO) rxq->iq.flags |= IQ_LRO_ENABLED; From owner-svn-src-head@freebsd.org Mon Apr 17 13:14:20 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A1D1CD41674; Mon, 17 Apr 2017 13:14:20 +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 mx1.freebsd.org (Postfix) with ESMTPS id 60172EE; Mon, 17 Apr 2017 13:14:20 +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 v3HDEJ7R011985; Mon, 17 Apr 2017 13:14:19 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3HDEI7K011979; Mon, 17 Apr 2017 13:14:18 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201704171314.v3HDEI7K011979@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 17 Apr 2017 13:14:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317049 - head/usr.bin/grep X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 17 Apr 2017 13:14:20 -0000 Author: emaste Date: Mon Apr 17 13:14:18 2017 New Revision: 317049 URL: https://svnweb.freebsd.org/changeset/base/317049 Log: bsdgrep: add -z/--null-data support -z treats input and output data as sequences of lines terminated by a zero byte instead of a newline. This brings it more in line with GNU grep and brings us closer to passing the current tests with BSD grep. Submitted by: Kyle Evans Reviewed by: cem Relnotes: Yes Differential Revision: https://reviews.freebsd.org/D10101 Modified: head/usr.bin/grep/file.c head/usr.bin/grep/grep.1 head/usr.bin/grep/grep.c head/usr.bin/grep/grep.h head/usr.bin/grep/util.c Modified: head/usr.bin/grep/file.c ============================================================================== --- head/usr.bin/grep/file.c Mon Apr 17 13:01:42 2017 (r317048) +++ head/usr.bin/grep/file.c Mon Apr 17 13:14:18 2017 (r317049) @@ -197,7 +197,7 @@ grep_fgetln(struct file *f, size_t *lenp } /* Look for a newline in the remaining part of the buffer */ - if ((p = memchr(bufpos, '\n', bufrem)) != NULL) { + if ((p = memchr(bufpos, fileeol, bufrem)) != NULL) { ++p; /* advance over newline */ ret = bufpos; len = p - bufpos; @@ -219,7 +219,7 @@ grep_fgetln(struct file *f, size_t *lenp if (bufrem == 0) /* EOF: return partial line */ break; - if ((p = memchr(bufpos, '\n', bufrem)) == NULL && + if ((p = memchr(bufpos, fileeol, bufrem)) == NULL && filebehave != FILE_MMAP) continue; if (p == NULL) { @@ -322,7 +322,8 @@ grep_open(const char *path) goto error2; /* Check for binary stuff, if necessary */ - if (binbehave != BINFILE_TEXT && memchr(bufpos, '\0', bufrem) != NULL) + if (binbehave != BINFILE_TEXT && fileeol != '\0' && + memchr(bufpos, '\0', bufrem) != NULL) f->binary = true; return (f); Modified: head/usr.bin/grep/grep.1 ============================================================================== --- head/usr.bin/grep/grep.1 Mon Apr 17 13:01:42 2017 (r317048) +++ head/usr.bin/grep/grep.1 Mon Apr 17 13:14:18 2017 (r317049) @@ -30,7 +30,7 @@ .\" .\" @(#)grep.1 8.3 (Berkeley) 4/18/94 .\" -.Dd July 28, 2010 +.Dd April 17, 2017 .Dt GREP 1 .Os .Sh NAME @@ -40,7 +40,7 @@ .Sh SYNOPSIS .Nm grep .Bk -words -.Op Fl abcdDEFGHhIiJLlmnOopqRSsUVvwxZ +.Op Fl abcdDEFGHhIiJLlmnOopqRSsUVvwxZz .Op Fl A Ar num .Op Fl B Ar num .Op Fl C Ns Op Ar num @@ -378,7 +378,10 @@ expression are considered to be matching Equivalent to .Fl i . Obsoleted. -.It Fl Z , Fl z , Fl Fl decompress +.It Fl z , Fl Fl null-data +Treat input and output data as sequences of lines terminated by a +zero-byte instead of a newline. +.It Fl Z , Fl Fl decompress Force .Nm grep to behave as Modified: head/usr.bin/grep/grep.c ============================================================================== --- head/usr.bin/grep/grep.c Mon Apr 17 13:01:42 2017 (r317048) +++ head/usr.bin/grep/grep.c Mon Apr 17 13:14:18 2017 (r317049) @@ -66,7 +66,7 @@ const char *errstr[] = { /* 1*/ "(standard input)", /* 2*/ "cannot read bzip2 compressed file", /* 3*/ "unknown %s option", -/* 4*/ "usage: %s [-abcDEFGHhIiJLlmnOoPqRSsUVvwxZ] [-A num] [-B num] [-C[num]]\n", +/* 4*/ "usage: %s [-abcDEFGHhIiJLlmnOoPqRSsUVvwxZz] [-A num] [-B num] [-C[num]]\n", /* 5*/ "\t[-e pattern] [-f file] [--binary-files=value] [--color=when]\n", /* 6*/ "\t[--context[=num]] [--directories=action] [--label] [--line-buffered]\n", /* 7*/ "\t[--null] [pattern] [file ...]\n", @@ -109,6 +109,7 @@ bool lflag; /* -l: only show names of bool mflag; /* -m x: stop reading the files after x matches */ long long mcount; /* count for -m */ long long mlimit; /* requested value for -m */ +char fileeol; /* indicator for eol */ bool nflag; /* -n: show line numbers in front of matching lines */ bool oflag; /* -o: print only matching part */ bool qflag; /* -q: quiet mode (don't output anything) */ @@ -165,7 +166,7 @@ usage(void) exit(2); } -static const char *optstr = "0123456789A:B:C:D:EFGHIJMLOPSRUVZabcd:e:f:hilm:nopqrsuvwxXy"; +static const char *optstr = "0123456789A:B:C:D:EFGHIJMLOPSRUVZabcd:e:f:hilm:nopqrsuvwxXyz"; static const struct option long_options[] = { @@ -215,6 +216,7 @@ static const struct option long_options[ {"word-regexp", no_argument, NULL, 'w'}, {"line-regexp", no_argument, NULL, 'x'}, {"xz", no_argument, NULL, 'X'}, + {"null-data", no_argument, NULL, 'z'}, {"decompress", no_argument, NULL, 'Z'}, {NULL, no_argument, NULL, 0} }; @@ -384,6 +386,7 @@ main(int argc, char *argv[]) newarg = 1; prevoptind = 1; needpattern = 1; + fileeol = '\n'; eopts = getenv("GREP_OPTIONS"); @@ -605,6 +608,9 @@ main(int argc, char *argv[]) case 'X': filebehave = FILE_XZ; break; + case 'z': + fileeol = '\0'; + break; case 'Z': filebehave = FILE_GZIP; break; Modified: head/usr.bin/grep/grep.h ============================================================================== --- head/usr.bin/grep/grep.h Mon Apr 17 13:01:42 2017 (r317048) +++ head/usr.bin/grep/grep.h Mon Apr 17 13:14:18 2017 (r317049) @@ -116,6 +116,7 @@ extern bool dexclude, dinclude, fexclud extern unsigned long long Aflag, Bflag; extern long long mcount; extern long long mlimit; +extern char fileeol; extern char *label; extern const char *color; extern int binbehave, devbehave, dirbehave, filebehave, grepbehave, linkbehave; Modified: head/usr.bin/grep/util.c ============================================================================== --- head/usr.bin/grep/util.c Mon Apr 17 13:01:42 2017 (r317048) +++ head/usr.bin/grep/util.c Mon Apr 17 13:14:18 2017 (r317049) @@ -221,7 +221,7 @@ procfile(const char *fn) else break; } - if (ln.len > 0 && ln.dat[ln.len - 1] == '\n') + if (ln.len > 0 && ln.dat[ln.len - 1] == fileeol) --ln.len; ln.line_no++; @@ -530,6 +530,6 @@ printline(struct str *line, int sep, reg } } else { fwrite(line->dat, line->len, 1, stdout); - putchar('\n'); + putchar(fileeol); } } From owner-svn-src-head@freebsd.org Mon Apr 17 13:22:41 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8EA98D4196A; Mon, 17 Apr 2017 13:22:41 +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 mx1.freebsd.org (Postfix) with ESMTPS id 4BC2A8DB; Mon, 17 Apr 2017 13:22:41 +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 v3HDMedZ015975; Mon, 17 Apr 2017 13:22:40 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3HDMeZE015971; Mon, 17 Apr 2017 13:22:40 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201704171322.v3HDMeZE015971@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 17 Apr 2017 13:22:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317050 - in head/usr.bin/grep: . tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 17 Apr 2017 13:22:41 -0000 Author: emaste Date: Mon Apr 17 13:22:39 2017 New Revision: 317050 URL: https://svnweb.freebsd.org/changeset/base/317050 Log: bsdgrep: for -r, use the working directory if none specified This is more sensible than the previous behaviour of grepping stdin, and matches newer GNU grep behaviour. PR: 216307 Submitted by: Kyle Evans Reviewed by: cem, emaste, ngie Relnotes: Yes Differential Revision: https://reviews.freebsd.org/ Added: head/usr.bin/grep/tests/grep_freebsd_test.sh (contents, props changed) Modified: head/usr.bin/grep/grep.c head/usr.bin/grep/tests/Makefile head/usr.bin/grep/util.c Modified: head/usr.bin/grep/grep.c ============================================================================== --- head/usr.bin/grep/grep.c Mon Apr 17 13:14:18 2017 (r317049) +++ head/usr.bin/grep/grep.c Mon Apr 17 13:22:39 2017 (r317050) @@ -738,7 +738,7 @@ main(int argc, char *argv[]) if ((aargc == 0 || aargc == 1) && !Hflag) hflag = true; - if (aargc == 0) + if (aargc == 0 && dirbehave != DIR_RECURSE) exit(!procfile("-")); if (dirbehave == DIR_RECURSE) Modified: head/usr.bin/grep/tests/Makefile ============================================================================== --- head/usr.bin/grep/tests/Makefile Mon Apr 17 13:14:18 2017 (r317049) +++ head/usr.bin/grep/tests/Makefile Mon Apr 17 13:22:39 2017 (r317050) @@ -2,6 +2,7 @@ PACKAGE= tests +ATF_TESTS_SH+= grep_freebsd_test NETBSD_ATF_TESTS_SH= grep_test ${PACKAGE}FILES+= d_basic.out Added: head/usr.bin/grep/tests/grep_freebsd_test.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/grep/tests/grep_freebsd_test.sh Mon Apr 17 13:22:39 2017 (r317050) @@ -0,0 +1,55 @@ +# +# Copyright (c) 2017 Kyle Evans +# 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 NETBSD FOUNDATION, INC. AND CONTRIBUTORS +# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS +# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +# +# $FreeBSD$ + +atf_test_case grep_r_implied +grep_r_implied_body() +{ + (cd "$(atf_get_srcdir)" && grep -r -e "test" < /dev/null) || + atf_skip "Implied working directory is not supported with your version of grep(1)" + (cd "$(atf_get_srcdir)" && grep -r --exclude="*.out" -e "test" .) > d_grep_r_implied.out + + atf_check -s exit:0 -x \ + "(cd $(atf_get_srcdir) && grep -r --exclude=\"*.out\" -e \"test\") | diff d_grep_r_implied.out -" +} + +atf_test_case rgrep +rgrep_head() +{ + atf_set "require.progs" "rgrep" +} +rgrep_body() +{ + grep -r --exclude="*.out" -e "test" "$(atf_get_srcdir)" > d_grep_r_implied.out + + atf_check -o file:d_grep_r_implied.out rgrep --exclude="*.out" -e "test" "$(atf_get_srcdir)" +} + +atf_init_test_cases() +{ + atf_add_test_case grep_r_implied + atf_add_test_case rgrep +} Modified: head/usr.bin/grep/util.c ============================================================================== --- head/usr.bin/grep/util.c Mon Apr 17 13:14:18 2017 (r317049) +++ head/usr.bin/grep/util.c Mon Apr 17 13:22:39 2017 (r317050) @@ -111,6 +111,7 @@ grep_tree(char **argv) FTSENT *p; int c, fts_flags; bool ok; + const char *wd[] = { ".", NULL }; c = fts_flags = 0; @@ -128,7 +129,9 @@ grep_tree(char **argv) fts_flags |= FTS_NOSTAT | FTS_NOCHDIR; - if (!(fts = fts_open(argv, fts_flags, NULL))) + fts = fts_open((argv[0] == NULL) ? + __DECONST(char * const *, wd) : argv, fts_flags, NULL); + if (fts == NULL) err(2, "fts_open"); while ((p = fts_read(fts)) != NULL) { switch (p->fts_info) { From owner-svn-src-head@freebsd.org Mon Apr 17 13:36:31 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 857BFD41EFC; Mon, 17 Apr 2017 13:36: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 mx1.freebsd.org (Postfix) with ESMTPS id 3F02F77; Mon, 17 Apr 2017 13:36: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 v3HDaU4h019983; Mon, 17 Apr 2017 13:36:30 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3HDaUKx019982; Mon, 17 Apr 2017 13:36:30 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201704171336.v3HDaUKx019982@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 17 Apr 2017 13:36:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317051 - head/usr.bin/grep X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 17 Apr 2017 13:36:31 -0000 Author: emaste Date: Mon Apr 17 13:36:30 2017 New Revision: 317051 URL: https://svnweb.freebsd.org/changeset/base/317051 Log: bsdgrep: remove output separators between overlapping segments Make bsdgrep more sensitive to context overlaps. If it's printing context that either overlaps or is immediately adjacent to another bit of context, don't print a separator. - Non-overlapping segments no longer have two separators between them - Overlapping segments no longer have separators between them with overlapping sections repeated Submitted by: Kyle Evans Reviewed by: cem Differential Revision: https://reviews.freebsd.org/D10105 Modified: head/usr.bin/grep/util.c Modified: head/usr.bin/grep/util.c ============================================================================== --- head/usr.bin/grep/util.c Mon Apr 17 13:22:39 2017 (r317050) +++ head/usr.bin/grep/util.c Mon Apr 17 13:36:30 2017 (r317051) @@ -55,6 +55,9 @@ __FBSDID("$FreeBSD$"); static int linesqueued; static int procline(struct str *l, int); +static int lasta; +static bool ctxover; + bool file_matching(const char *fname) { @@ -212,8 +215,10 @@ procfile(const char *fn) strcpy(ln.file, fn); ln.line_no = 0; ln.len = 0; + ctxover = false; linesqueued = 0; tail = 0; + lasta = 0; ln.off = -1; for (c = 0; c == 0 || !(lflag || qflag); ) { @@ -235,10 +240,24 @@ procfile(const char *fn) free(f); return (0); } - /* Process the file line-by-line */ + + /* Process the file line-by-line, enqueue non-matching lines */ if ((t = procline(&ln, f->binary)) == 0 && Bflag > 0) { - enqueue(&ln); - linesqueued++; + /* Except don't enqueue lines that appear in -A ctx */ + if (ln.line_no == 0 || lasta != ln.line_no) { + /* queue is maxed to Bflag number of lines */ + enqueue(&ln); + linesqueued++; + ctxover = false; + } else { + /* + * Indicate to procline() that we have ctx + * overlap and make sure queue is empty. + */ + if (!ctxover) + clearqueue(); + ctxover = true; + } } c += t; if (mflag && mcount <= 0) @@ -396,17 +415,19 @@ procline(struct str *l, int nottext) /* Dealing with the context */ if ((tail || c) && !cflag && !qflag && !lflag && !Lflag) { if (c) { - if (!first && !prev && !tail && Aflag) + if (!first && !prev && !tail && (Bflag || Aflag) && + !ctxover) printf("--\n"); tail = Aflag; if (Bflag > 0) { - if (!first && !prev) - printf("--\n"); printqueue(); + ctxover = false; } linesqueued = 0; printline(l, ':', matches, m); } else { + /* Print -A lines following matches */ + lasta = l->line_no; printline(l, '-', matches, m); tail--; } From owner-svn-src-head@freebsd.org Mon Apr 17 13:40:10 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 03224D41FB7; Mon, 17 Apr 2017 13:40:10 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-io0-x229.google.com (mail-io0-x229.google.com [IPv6:2607:f8b0:4001:c06::229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D2A611FC; Mon, 17 Apr 2017 13:40:09 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-io0-x229.google.com with SMTP id o22so29771087iod.3; Mon, 17 Apr 2017 06:40:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to; bh=sV+UlxVvNwaBELl50Swv9PqH6ZoKYShpq5ukUOa4SuM=; b=oD7n8ttcL1z3t1q9yl41uqURxjZjXBFY4DDcdbxu+3D4/r7JyqntlYqam1MqfBmf/P t6qo9LkAbNzUupn7rAWTmcOwECFoEJMsakDzCqjn7m85GrgTlHxsDhpESbcCjau8Ul9I tvv1tqrt3ff9r3iP+tUZjO6NJKtKXgBcchDJxlH7u2y+ZWjLgwTS1x78iQAbgp527KTm 20ta8Q8ddCqMPBGDfF0OUJrI8ErRXiblKbfSsILznH9QxibldFUDUq7nUUpSIREXpvCF Vg2tno+QK8o3Mr+8PzBtL//7D6lbrngyPbg8gYYyCwYqHCZ+mjLFyzYb3u2pCzQYrZhM vBeA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to; bh=sV+UlxVvNwaBELl50Swv9PqH6ZoKYShpq5ukUOa4SuM=; b=aprKUxW6rLKihnChvZV8NLXqWusIEZoQCum+cGEv9Bnz+QmCBdIvN3MWxes+HaL6Ut qsZ0H5KCi0lhBaUJnTDxRYjnoAr3zZqQE/ozcEJzS0vB0R5TTXRzNPRZMCV4BjAcsw6q Ut9MnmPDcpfpt2MSw8pd/zwHzyLnhejYcW6qB9db6kztQVqv57xmFpmDU90iqN6iuY+s JDJmG5o15d9qy0hTnYAA7L98zzoh8bKCsNwR69GAY7z8gbtAMUh7ezWtWN4dbslrxcgR fPOC0rDOFQlcx2oorIwrp9FZIBppeBZdwKKR9IGU4YU9drSGL46zT0DJsbQPAAER30s4 3vdw== X-Gm-Message-State: AN3rC/6nTJb4eJ45MDqU7YEG+dlHN6+dvbnDUBjoWI2zvVTLaetalhUl iR/m2Dl9GGwKKdCM7P/cVBpsS6rVgoPD X-Received: by 10.36.35.129 with SMTP id u123mr8587156itu.105.1492436408965; Mon, 17 Apr 2017 06:40:08 -0700 (PDT) MIME-Version: 1.0 Sender: carpeddiem@gmail.com Received: by 10.107.30.136 with HTTP; Mon, 17 Apr 2017 06:39:48 -0700 (PDT) In-Reply-To: <201704171322.v3HDMeZE015971@repo.freebsd.org> References: <201704171322.v3HDMeZE015971@repo.freebsd.org> From: Ed Maste Date: Mon, 17 Apr 2017 09:39:48 -0400 X-Google-Sender-Auth: 6SgtQCcWhnAjDF-5FiAb2hiQqRo Message-ID: Subject: Re: svn commit: r317050 - in head/usr.bin/grep: . tests To: "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.23 Precedence: list List-Id: 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, 17 Apr 2017 13:40:10 -0000 On 17 April 2017 at 09:22, Ed Maste wrote: > Author: emaste > Date: Mon Apr 17 13:22:39 2017 > New Revision: 317050 > URL: https://svnweb.freebsd.org/changeset/base/317050 > > Log: > bsdgrep: for -r, use the working directory if none specified Oops, Differential Revision: https://reviews.freebsd.org/D10108 From owner-svn-src-head@freebsd.org Mon Apr 17 14:59:56 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BD780D4161F; Mon, 17 Apr 2017 14:59:56 +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 mx1.freebsd.org (Postfix) with ESMTPS id 703EFD0F; Mon, 17 Apr 2017 14:59:56 +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 v3HExtZd054219; Mon, 17 Apr 2017 14:59:55 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3HExtnZ054217; Mon, 17 Apr 2017 14:59:55 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201704171459.v3HExtnZ054217@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 17 Apr 2017 14:59:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317052 - in head: contrib/netbsd-tests/usr.bin/grep usr.bin/grep X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 17 Apr 2017 14:59:56 -0000 Author: emaste Date: Mon Apr 17 14:59:55 2017 New Revision: 317052 URL: https://svnweb.freebsd.org/changeset/base/317052 Log: bsdgrep: fix zero-length matches without the -o flag r316477 broke zero-length matches when not using the -o flag, by skipping over them entirely. Add a regression test so that it doesn't break again in the future. Submitted by: Kyle Evans Reviewed by: cem emaste ngie Differential Revision: https://reviews.freebsd.org/D10333 Modified: head/contrib/netbsd-tests/usr.bin/grep/t_grep.sh head/usr.bin/grep/util.c Modified: head/contrib/netbsd-tests/usr.bin/grep/t_grep.sh ============================================================================== --- head/contrib/netbsd-tests/usr.bin/grep/t_grep.sh Mon Apr 17 13:36:30 2017 (r317051) +++ head/contrib/netbsd-tests/usr.bin/grep/t_grep.sh Mon Apr 17 14:59:55 2017 (r317052) @@ -377,6 +377,20 @@ egrep_empty_invalid_body() { atf_check -s exit:1 egrep '{' /dev/null } + +atf_test_case zerolen +zerolen_head() +{ + atf_set "descr" "Check for successful zero-length matches with ^$" +} +zerolen_body() +{ + printf "Eggs\n\nCheese" > test1 + + atf_check -o inline:"\n" grep -e "^$" test1 + + atf_check -o inline:"Eggs\nCheese\n" grep -v -e "^$" test1 +} # End FreeBSD atf_init_test_cases() @@ -404,5 +418,6 @@ atf_init_test_cases() atf_add_test_case f_file_empty atf_add_test_case escmap atf_add_test_case egrep_empty_invalid + atf_add_test_case zerolen # End FreeBSD } Modified: head/usr.bin/grep/util.c ============================================================================== --- head/usr.bin/grep/util.c Mon Apr 17 13:36:30 2017 (r317051) +++ head/usr.bin/grep/util.c Mon Apr 17 14:59:55 2017 (r317052) @@ -352,9 +352,6 @@ procline(struct str *l, int nottext) if (r == 0) { lastmatches++; lastmatch = pmatch; - /* Skip over zero-length matches */ - if (pmatch.rm_so == pmatch.rm_eo) - continue; if (m == 0) c++; @@ -532,6 +529,9 @@ printline(struct str *line, int sep, reg /* --color and -o */ if ((oflag || color) && m > 0) { for (i = 0; i < m; i++) { + /* Don't output zero length matches */ + if (matches[i].rm_so == matches[i].rm_eo) + continue; if (!oflag) fwrite(line->dat + a, matches[i].rm_so - a, 1, stdout); From owner-svn-src-head@freebsd.org Mon Apr 17 16:51:05 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E1784D41AAE; Mon, 17 Apr 2017 16:51:05 +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 mx1.freebsd.org (Postfix) with ESMTPS id BCB7E1A3D; Mon, 17 Apr 2017 16:51:05 +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 v3HGp4nT003466; Mon, 17 Apr 2017 16:51:04 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3HGp40c003460; Mon, 17 Apr 2017 16:51:04 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201704171651.v3HGp40c003460@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Mon, 17 Apr 2017 16:51:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317053 - in head/sys: compat/linuxkpi/common/src contrib/vchiq/interface/vchiq_arm dev/xen/gntdev dev/xen/privcmd kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 17 Apr 2017 16:51:06 -0000 Author: glebius Date: Mon Apr 17 16:51:04 2017 New Revision: 317053 URL: https://svnweb.freebsd.org/changeset/base/317053 Log: Remove unneeded include of vm_phys.h. Modified: head/sys/compat/linuxkpi/common/src/linux_page.c head/sys/contrib/vchiq/interface/vchiq_arm/vchiq_2835_arm.c head/sys/dev/xen/gntdev/gntdev.c head/sys/dev/xen/privcmd/privcmd.c head/sys/kern/kern_cpuset.c head/sys/kern/kern_numa.c Modified: head/sys/compat/linuxkpi/common/src/linux_page.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_page.c Mon Apr 17 14:59:55 2017 (r317052) +++ head/sys/compat/linuxkpi/common/src/linux_page.c Mon Apr 17 16:51:04 2017 (r317053) @@ -51,7 +51,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include Modified: head/sys/contrib/vchiq/interface/vchiq_arm/vchiq_2835_arm.c ============================================================================== --- head/sys/contrib/vchiq/interface/vchiq_arm/vchiq_2835_arm.c Mon Apr 17 14:59:55 2017 (r317052) +++ head/sys/contrib/vchiq/interface/vchiq_arm/vchiq_2835_arm.c Mon Apr 17 16:51:04 2017 (r317053) @@ -45,7 +45,6 @@ #include #include #include -#include #include #include Modified: head/sys/dev/xen/gntdev/gntdev.c ============================================================================== --- head/sys/dev/xen/gntdev/gntdev.c Mon Apr 17 14:59:55 2017 (r317052) +++ head/sys/dev/xen/gntdev/gntdev.c Mon Apr 17 16:51:04 2017 (r317053) @@ -64,7 +64,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include Modified: head/sys/dev/xen/privcmd/privcmd.c ============================================================================== --- head/sys/dev/xen/privcmd/privcmd.c Mon Apr 17 14:59:55 2017 (r317052) +++ head/sys/dev/xen/privcmd/privcmd.c Mon Apr 17 16:51:04 2017 (r317053) @@ -55,7 +55,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include Modified: head/sys/kern/kern_cpuset.c ============================================================================== --- head/sys/kern/kern_cpuset.c Mon Apr 17 14:59:55 2017 (r317052) +++ head/sys/kern/kern_cpuset.c Mon Apr 17 16:51:04 2017 (r317053) @@ -59,7 +59,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #ifdef DDB #include Modified: head/sys/kern/kern_numa.c ============================================================================== --- head/sys/kern/kern_numa.c Mon Apr 17 14:59:55 2017 (r317052) +++ head/sys/kern/kern_numa.c Mon Apr 17 16:51:04 2017 (r317053) @@ -54,7 +54,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include int From owner-svn-src-head@freebsd.org Mon Apr 17 17:07:05 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 59340D42111; Mon, 17 Apr 2017 17:07:05 +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 mx1.freebsd.org (Postfix) with ESMTPS id 22B8D960; Mon, 17 Apr 2017 17:07:05 +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 v3HH74B7010705; Mon, 17 Apr 2017 17:07:04 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3HH70TM010666; Mon, 17 Apr 2017 17:07:00 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201704171707.v3HH70TM010666@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Mon, 17 Apr 2017 17:07:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317055 - in head/sys: amd64/amd64 arm/arm arm64/arm64 cddl/compat/opensolaris/kern cddl/compat/opensolaris/sys cddl/contrib/opensolaris/uts/common/fs/zfs compat/linuxkpi/common/include... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 17 Apr 2017 17:07:05 -0000 Author: glebius Date: Mon Apr 17 17:07:00 2017 New Revision: 317055 URL: https://svnweb.freebsd.org/changeset/base/317055 Log: All these files need sys/vmmeter.h, but now they got it implicitly included via sys/pcpu.h. Modified: head/sys/amd64/amd64/efirt.c head/sys/amd64/amd64/minidump_machdep.c head/sys/amd64/amd64/uma_machdep.c head/sys/arm/arm/intr.c head/sys/arm/arm/machdep.c head/sys/arm/arm/trap-v4.c head/sys/arm/arm/trap-v6.c head/sys/arm/arm/undefined.c head/sys/arm64/arm64/minidump_machdep.c head/sys/arm64/arm64/uma_machdep.c head/sys/cddl/compat/opensolaris/kern/opensolaris_kmem.c head/sys/cddl/compat/opensolaris/sys/kmem.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c head/sys/compat/linuxkpi/common/include/linux/page.h head/sys/dev/drm/drmP.h head/sys/dev/drm2/drmP.h head/sys/fs/msdosfs/msdosfs_denode.c head/sys/fs/msdosfs/msdosfs_vnops.c head/sys/kern/kern_mib.c head/sys/kern/kern_thread.c head/sys/kern/subr_intr.c head/sys/kern/subr_syscall.c head/sys/mips/include/intr_machdep.h head/sys/mips/mips/minidump_machdep.c head/sys/mips/mips/uma_machdep.c head/sys/ofed/drivers/infiniband/core/umem.c head/sys/powerpc/powerpc/uma_machdep.c head/sys/sparc64/sparc64/intr_machdep.c head/sys/sparc64/sparc64/machdep.c head/sys/sparc64/sparc64/mem.c head/sys/ufs/ffs/ffs_balloc.c head/sys/ufs/ffs/ffs_vfsops.c head/sys/vm/device_pager.c head/sys/vm/memguard.c head/sys/vm/sg_pager.c head/sys/vm/vm_reserv.c head/sys/x86/x86/intr_machdep.c head/sys/x86/xen/xenpv.c Modified: head/sys/amd64/amd64/efirt.c ============================================================================== --- head/sys/amd64/amd64/efirt.c Mon Apr 17 16:59:18 2017 (r317054) +++ head/sys/amd64/amd64/efirt.c Mon Apr 17 17:07:00 2017 (r317055) @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: head/sys/amd64/amd64/minidump_machdep.c ============================================================================== --- head/sys/amd64/amd64/minidump_machdep.c Mon Apr 17 16:59:18 2017 (r317054) +++ head/sys/amd64/amd64/minidump_machdep.c Mon Apr 17 17:07:00 2017 (r317055) @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: head/sys/amd64/amd64/uma_machdep.c ============================================================================== --- head/sys/amd64/amd64/uma_machdep.c Mon Apr 17 16:59:18 2017 (r317054) +++ head/sys/amd64/amd64/uma_machdep.c Mon Apr 17 17:07:00 2017 (r317055) @@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: head/sys/arm/arm/intr.c ============================================================================== --- head/sys/arm/arm/intr.c Mon Apr 17 16:59:18 2017 (r317054) +++ head/sys/arm/arm/intr.c Mon Apr 17 17:07:00 2017 (r317055) @@ -53,6 +53,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include Modified: head/sys/arm/arm/machdep.c ============================================================================== --- head/sys/arm/arm/machdep.c Mon Apr 17 16:59:18 2017 (r317054) +++ head/sys/arm/arm/machdep.c Mon Apr 17 17:07:00 2017 (r317055) @@ -69,6 +69,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include Modified: head/sys/arm/arm/trap-v4.c ============================================================================== --- head/sys/arm/arm/trap-v4.c Mon Apr 17 16:59:18 2017 (r317054) +++ head/sys/arm/arm/trap-v4.c Mon Apr 17 17:07:00 2017 (r317055) @@ -87,6 +87,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include Modified: head/sys/arm/arm/trap-v6.c ============================================================================== --- head/sys/arm/arm/trap-v6.c Mon Apr 17 16:59:18 2017 (r317054) +++ head/sys/arm/arm/trap-v6.c Mon Apr 17 17:07:00 2017 (r317055) @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #ifdef KTRACE #include #include Modified: head/sys/arm/arm/undefined.c ============================================================================== --- head/sys/arm/arm/undefined.c Mon Apr 17 16:59:18 2017 (r317054) +++ head/sys/arm/arm/undefined.c Mon Apr 17 17:07:00 2017 (r317055) @@ -62,6 +62,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #ifdef KDB #include #endif Modified: head/sys/arm64/arm64/minidump_machdep.c ============================================================================== --- head/sys/arm64/arm64/minidump_machdep.c Mon Apr 17 16:59:18 2017 (r317054) +++ head/sys/arm64/arm64/minidump_machdep.c Mon Apr 17 17:07:00 2017 (r317055) @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include Modified: head/sys/arm64/arm64/uma_machdep.c ============================================================================== --- head/sys/arm64/arm64/uma_machdep.c Mon Apr 17 16:59:18 2017 (r317054) +++ head/sys/arm64/arm64/uma_machdep.c Mon Apr 17 17:07:00 2017 (r317055) @@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: head/sys/cddl/compat/opensolaris/kern/opensolaris_kmem.c ============================================================================== --- head/sys/cddl/compat/opensolaris/kern/opensolaris_kmem.c Mon Apr 17 16:59:18 2017 (r317054) +++ head/sys/cddl/compat/opensolaris/kern/opensolaris_kmem.c Mon Apr 17 17:07:00 2017 (r317055) @@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include Modified: head/sys/cddl/compat/opensolaris/sys/kmem.h ============================================================================== --- head/sys/cddl/compat/opensolaris/sys/kmem.h Mon Apr 17 16:59:18 2017 (r317054) +++ head/sys/cddl/compat/opensolaris/sys/kmem.h Mon Apr 17 17:07:00 2017 (r317055) @@ -33,6 +33,7 @@ #include #include #include +#include #include #include Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Mon Apr 17 16:59:18 2017 (r317054) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Mon Apr 17 17:07:00 2017 (r317055) @@ -73,6 +73,7 @@ #include #include #include +#include #include /* Modified: head/sys/compat/linuxkpi/common/include/linux/page.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/page.h Mon Apr 17 16:59:18 2017 (r317054) +++ head/sys/compat/linuxkpi/common/include/linux/page.h Mon Apr 17 17:07:00 2017 (r317055) @@ -34,6 +34,7 @@ #include #include +#include #include #include Modified: head/sys/dev/drm/drmP.h ============================================================================== --- head/sys/dev/drm/drmP.h Mon Apr 17 16:59:18 2017 (r317054) +++ head/sys/dev/drm/drmP.h Mon Apr 17 17:07:00 2017 (r317055) @@ -65,6 +65,7 @@ struct drm_file; #include #include #include +#include #include #include #include Modified: head/sys/dev/drm2/drmP.h ============================================================================== --- head/sys/dev/drm2/drmP.h Mon Apr 17 16:59:18 2017 (r317054) +++ head/sys/dev/drm2/drmP.h Mon Apr 17 17:07:00 2017 (r317055) @@ -66,6 +66,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: head/sys/fs/msdosfs/msdosfs_denode.c ============================================================================== --- head/sys/fs/msdosfs/msdosfs_denode.c Mon Apr 17 16:59:18 2017 (r317054) +++ head/sys/fs/msdosfs/msdosfs_denode.c Mon Apr 17 17:07:00 2017 (r317055) @@ -55,6 +55,7 @@ #include #include #include +#include #include #include Modified: head/sys/fs/msdosfs/msdosfs_vnops.c ============================================================================== --- head/sys/fs/msdosfs/msdosfs_vnops.c Mon Apr 17 16:59:18 2017 (r317054) +++ head/sys/fs/msdosfs/msdosfs_vnops.c Mon Apr 17 17:07:00 2017 (r317055) @@ -64,6 +64,7 @@ #include #include #include +#include #include #include Modified: head/sys/kern/kern_mib.c ============================================================================== --- head/sys/kern/kern_mib.c Mon Apr 17 16:59:18 2017 (r317054) +++ head/sys/kern/kern_mib.c Mon Apr 17 17:07:00 2017 (r317055) @@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: head/sys/kern/kern_thread.c ============================================================================== --- head/sys/kern/kern_thread.c Mon Apr 17 16:59:18 2017 (r317054) +++ head/sys/kern/kern_thread.c Mon Apr 17 17:07:00 2017 (r317055) @@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #ifdef HWPMC_HOOKS #include Modified: head/sys/kern/subr_intr.c ============================================================================== --- head/sys/kern/subr_intr.c Mon Apr 17 16:59:18 2017 (r317054) +++ head/sys/kern/subr_intr.c Mon Apr 17 17:07:00 2017 (r317055) @@ -53,6 +53,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #ifdef HWPMC_HOOKS #include #endif Modified: head/sys/kern/subr_syscall.c ============================================================================== --- head/sys/kern/subr_syscall.c Mon Apr 17 16:59:18 2017 (r317054) +++ head/sys/kern/subr_syscall.c Mon Apr 17 17:07:00 2017 (r317055) @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include Modified: head/sys/mips/include/intr_machdep.h ============================================================================== --- head/sys/mips/include/intr_machdep.h Mon Apr 17 16:59:18 2017 (r317054) +++ head/sys/mips/include/intr_machdep.h Mon Apr 17 17:07:00 2017 (r317055) @@ -29,6 +29,7 @@ #ifndef _MACHINE_INTR_MACHDEP_H_ #define _MACHINE_INTR_MACHDEP_H_ +#include #include #if defined(CPU_RMI) || defined(CPU_NLM) Modified: head/sys/mips/mips/minidump_machdep.c ============================================================================== --- head/sys/mips/mips/minidump_machdep.c Mon Apr 17 16:59:18 2017 (r317054) +++ head/sys/mips/mips/minidump_machdep.c Mon Apr 17 17:07:00 2017 (r317055) @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: head/sys/mips/mips/uma_machdep.c ============================================================================== --- head/sys/mips/mips/uma_machdep.c Mon Apr 17 16:59:18 2017 (r317054) +++ head/sys/mips/mips/uma_machdep.c Mon Apr 17 17:07:00 2017 (r317055) @@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: head/sys/ofed/drivers/infiniband/core/umem.c ============================================================================== --- head/sys/ofed/drivers/infiniband/core/umem.c Mon Apr 17 16:59:18 2017 (r317054) +++ head/sys/ofed/drivers/infiniband/core/umem.c Mon Apr 17 17:07:00 2017 (r317055) @@ -42,6 +42,7 @@ #include #include #include +#include #include #include #include "uverbs.h" Modified: head/sys/powerpc/powerpc/uma_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/uma_machdep.c Mon Apr 17 16:59:18 2017 (r317054) +++ head/sys/powerpc/powerpc/uma_machdep.c Mon Apr 17 17:07:00 2017 (r317055) @@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: head/sys/sparc64/sparc64/intr_machdep.c ============================================================================== --- head/sys/sparc64/sparc64/intr_machdep.c Mon Apr 17 16:59:18 2017 (r317054) +++ head/sys/sparc64/sparc64/intr_machdep.c Mon Apr 17 17:07:00 2017 (r317055) @@ -73,6 +73,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include Modified: head/sys/sparc64/sparc64/machdep.c ============================================================================== --- head/sys/sparc64/sparc64/machdep.c Mon Apr 17 16:59:18 2017 (r317054) +++ head/sys/sparc64/sparc64/machdep.c Mon Apr 17 17:07:00 2017 (r317055) @@ -73,6 +73,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include Modified: head/sys/sparc64/sparc64/mem.c ============================================================================== --- head/sys/sparc64/sparc64/mem.c Mon Apr 17 16:59:18 2017 (r317054) +++ head/sys/sparc64/sparc64/mem.c Mon Apr 17 17:07:00 2017 (r317055) @@ -61,6 +61,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include Modified: head/sys/ufs/ffs/ffs_balloc.c ============================================================================== --- head/sys/ufs/ffs/ffs_balloc.c Mon Apr 17 16:59:18 2017 (r317054) +++ head/sys/ufs/ffs/ffs_balloc.c Mon Apr 17 17:07:00 2017 (r317055) @@ -69,6 +69,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include Modified: head/sys/ufs/ffs/ffs_vfsops.c ============================================================================== --- head/sys/ufs/ffs/ffs_vfsops.c Mon Apr 17 16:59:18 2017 (r317054) +++ head/sys/ufs/ffs/ffs_vfsops.c Mon Apr 17 17:07:00 2017 (r317055) @@ -54,6 +54,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include Modified: head/sys/vm/device_pager.c ============================================================================== --- head/sys/vm/device_pager.c Mon Apr 17 16:59:18 2017 (r317054) +++ head/sys/vm/device_pager.c Mon Apr 17 17:07:00 2017 (r317055) @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include Modified: head/sys/vm/memguard.c ============================================================================== --- head/sys/vm/memguard.c Mon Apr 17 16:59:18 2017 (r317054) +++ head/sys/vm/memguard.c Mon Apr 17 17:07:00 2017 (r317055) @@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include Modified: head/sys/vm/sg_pager.c ============================================================================== --- head/sys/vm/sg_pager.c Mon Apr 17 16:59:18 2017 (r317054) +++ head/sys/vm/sg_pager.c Mon Apr 17 17:07:00 2017 (r317055) @@ -38,6 +38,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include + #include #include #include Modified: head/sys/vm/vm_reserv.c ============================================================================== --- head/sys/vm/vm_reserv.c Mon Apr 17 16:59:18 2017 (r317054) +++ head/sys/vm/vm_reserv.c Mon Apr 17 17:07:00 2017 (r317055) @@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include Modified: head/sys/x86/x86/intr_machdep.c ============================================================================== --- head/sys/x86/x86/intr_machdep.c Mon Apr 17 16:59:18 2017 (r317054) +++ head/sys/x86/x86/intr_machdep.c Mon Apr 17 17:07:00 2017 (r317055) @@ -49,6 +49,7 @@ #include #include #include +#include #include #include #include Modified: head/sys/x86/xen/xenpv.c ============================================================================== --- head/sys/x86/xen/xenpv.c Mon Apr 17 16:59:18 2017 (r317054) +++ head/sys/x86/xen/xenpv.c Mon Apr 17 17:07:00 2017 (r317055) @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include From owner-svn-src-head@freebsd.org Mon Apr 17 17:07:52 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8D887D4219E; Mon, 17 Apr 2017 17:07:52 +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 mx1.freebsd.org (Postfix) with ESMTPS id 5D22DAB4; Mon, 17 Apr 2017 17:07:52 +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 v3HH7pEo010775; Mon, 17 Apr 2017 17:07:51 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3HH7pck010774; Mon, 17 Apr 2017 17:07:51 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201704171707.v3HH7pck010774@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Mon, 17 Apr 2017 17:07:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317056 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 17 Apr 2017 17:07:52 -0000 Author: glebius Date: Mon Apr 17 17:07:51 2017 New Revision: 317056 URL: https://svnweb.freebsd.org/changeset/base/317056 Log: Typo! Modified: head/sys/kern/subr_syscall.c Modified: head/sys/kern/subr_syscall.c ============================================================================== --- head/sys/kern/subr_syscall.c Mon Apr 17 17:07:00 2017 (r317055) +++ head/sys/kern/subr_syscall.c Mon Apr 17 17:07:51 2017 (r317056) @@ -45,7 +45,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include #ifdef KTRACE #include #include From owner-svn-src-head@freebsd.org Mon Apr 17 17:18:09 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 12D49D425F1; Mon, 17 Apr 2017 17:18:09 +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 mx1.freebsd.org (Postfix) with ESMTPS id D8A9A242; Mon, 17 Apr 2017 17:18:08 +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 v3HHI898014863; Mon, 17 Apr 2017 17:18:08 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3HHI7K9014861; Mon, 17 Apr 2017 17:18:07 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201704171718.v3HHI7K9014861@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Mon, 17 Apr 2017 17:18:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317057 - in head/sys: amd64/amd64 i386/i386 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 17 Apr 2017 17:18:09 -0000 Author: glebius Date: Mon Apr 17 17:18:07 2017 New Revision: 317057 URL: https://svnweb.freebsd.org/changeset/base/317057 Log: Remove unused assembly symbols pointing to vmmeter. Modified: head/sys/amd64/amd64/genassym.c head/sys/i386/i386/genassym.c Modified: head/sys/amd64/amd64/genassym.c ============================================================================== --- head/sys/amd64/amd64/genassym.c Mon Apr 17 17:07:51 2017 (r317056) +++ head/sys/amd64/amd64/genassym.c Mon Apr 17 17:18:07 2017 (r317057) @@ -90,9 +90,6 @@ ASSYM(TDF_NEEDRESCHED, TDF_NEEDRESCHED); ASSYM(TDP_CALLCHAIN, TDP_CALLCHAIN); ASSYM(TDP_KTHREAD, TDP_KTHREAD); -ASSYM(V_TRAP, offsetof(struct vmmeter, v_trap)); -ASSYM(V_SYSCALL, offsetof(struct vmmeter, v_syscall)); -ASSYM(V_INTR, offsetof(struct vmmeter, v_intr)); ASSYM(PAGE_SIZE, PAGE_SIZE); ASSYM(NPTEPG, NPTEPG); ASSYM(NPDEPG, NPDEPG); Modified: head/sys/i386/i386/genassym.c ============================================================================== --- head/sys/i386/i386/genassym.c Mon Apr 17 17:07:51 2017 (r317056) +++ head/sys/i386/i386/genassym.c Mon Apr 17 17:18:07 2017 (r317057) @@ -98,9 +98,6 @@ ASSYM(MD_LDT, offsetof(struct mdproc, md ASSYM(TDF_ASTPENDING, TDF_ASTPENDING); ASSYM(TDF_NEEDRESCHED, TDF_NEEDRESCHED); -ASSYM(V_TRAP, offsetof(struct vmmeter, v_trap)); -ASSYM(V_SYSCALL, offsetof(struct vmmeter, v_syscall)); -ASSYM(V_INTR, offsetof(struct vmmeter, v_intr)); ASSYM(TD0_KSTACK_PAGES, TD0_KSTACK_PAGES); ASSYM(PAGE_SIZE, PAGE_SIZE); ASSYM(NPTEPG, NPTEPG); From owner-svn-src-head@freebsd.org Mon Apr 17 17:18:50 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AF9D1D42659; Mon, 17 Apr 2017 17:18:50 +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 mx1.freebsd.org (Postfix) with ESMTPS id 67DB13E4; Mon, 17 Apr 2017 17:18:50 +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 v3HHInTt014932; Mon, 17 Apr 2017 17:18:49 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3HHIncs014931; Mon, 17 Apr 2017 17:18:49 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201704171718.v3HHIncs014931@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 17 Apr 2017 17:18:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317058 - head/usr.bin/dtc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 17 Apr 2017 17:18:50 -0000 Author: emaste Date: Mon Apr 17 17:18:49 2017 New Revision: 317058 URL: https://svnweb.freebsd.org/changeset/base/317058 Log: dtc: remove unused (since r306806) string.hh Deleted: head/usr.bin/dtc/string.hh From owner-svn-src-head@freebsd.org Mon Apr 17 17:20:49 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9A25AD42732; Mon, 17 Apr 2017 17:20:49 +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 mx1.freebsd.org (Postfix) with ESMTPS id 698BC813; Mon, 17 Apr 2017 17:20:49 +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 v3HHKmT4015079; Mon, 17 Apr 2017 17:20:48 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3HHKmli015077; Mon, 17 Apr 2017 17:20:48 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201704171720.v3HHKmli015077@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Mon, 17 Apr 2017 17:20:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317059 - in head/sys/fs: ext2fs fuse X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 17 Apr 2017 17:20:49 -0000 Author: glebius Date: Mon Apr 17 17:20:48 2017 New Revision: 317059 URL: https://svnweb.freebsd.org/changeset/base/317059 Log: Two more files missed in r317055: these files need sys/vmmeter.h, but now they got it implicitly included via sys/pcpu.h. Modified: head/sys/fs/ext2fs/ext2_vnops.c head/sys/fs/fuse/fuse_vnops.c Modified: head/sys/fs/ext2fs/ext2_vnops.c ============================================================================== --- head/sys/fs/ext2fs/ext2_vnops.c Mon Apr 17 17:18:49 2017 (r317058) +++ head/sys/fs/ext2fs/ext2_vnops.c Mon Apr 17 17:20:48 2017 (r317059) @@ -65,6 +65,7 @@ #include #include #include +#include #include #include Modified: head/sys/fs/fuse/fuse_vnops.c ============================================================================== --- head/sys/fs/fuse/fuse_vnops.c Mon Apr 17 17:18:49 2017 (r317058) +++ head/sys/fs/fuse/fuse_vnops.c Mon Apr 17 17:20:48 2017 (r317059) @@ -82,6 +82,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include From owner-svn-src-head@freebsd.org Mon Apr 17 17:23:21 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F2CAAD429BC; Mon, 17 Apr 2017 17:23:21 +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 mx1.freebsd.org (Postfix) with ESMTPS id B74B1D39; Mon, 17 Apr 2017 17:23:21 +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 v3HHNKrM018844; Mon, 17 Apr 2017 17:23:20 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3HHNKqM018836; Mon, 17 Apr 2017 17:23:20 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201704171723.v3HHNKqM018836@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 17 Apr 2017 17:23:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317060 - head/usr.bin/dtc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 17 Apr 2017 17:23:22 -0000 Author: emaste Date: Mon Apr 17 17:23:19 2017 New Revision: 317060 URL: https://svnweb.freebsd.org/changeset/base/317060 Log: dtc: update to upstream 227d6a3 - Report missing includes at the correct location. - Add initial support for the -@ option emitting a symbol table. - Add support for running tests with and without -@ - Add support for generating __fixups__ and __local_fixups__ - Attach the to-string transform to the node path. Modified: head/usr.bin/dtc/checking.cc head/usr.bin/dtc/dtb.hh head/usr.bin/dtc/dtc.1 head/usr.bin/dtc/dtc.cc head/usr.bin/dtc/fdt.cc head/usr.bin/dtc/fdt.hh head/usr.bin/dtc/input_buffer.cc head/usr.bin/dtc/string.cc Modified: head/usr.bin/dtc/checking.cc ============================================================================== --- head/usr.bin/dtc/checking.cc Mon Apr 17 17:20:48 2017 (r317059) +++ head/usr.bin/dtc/checking.cc Mon Apr 17 17:23:19 2017 (r317060) @@ -97,16 +97,16 @@ namespace } if (found_size && found_address) { - break; + break; } } if (!found_address) { - report_error("Missing #address-cells property"); + report_error("Missing #address-cells property"); } if (!found_size) { - report_error("Missing #size-cells property"); + report_error("Missing #size-cells property"); } return found_address && found_size; } Modified: head/usr.bin/dtc/dtb.hh ============================================================================== --- head/usr.bin/dtc/dtb.hh Mon Apr 17 17:20:48 2017 (r317059) +++ head/usr.bin/dtc/dtb.hh Mon Apr 17 17:23:19 2017 (r317060) @@ -189,17 +189,17 @@ class binary_writer : public output_writ * The binary format does not support labels, so this method * does nothing. */ - virtual void write_label(const std::string &) {} + void write_label(const std::string &) override {} /** * Comments are ignored by the binary writer. */ - virtual void write_comment(const std::string&) {} - virtual void write_string(const std::string &name); - virtual void write_data(uint8_t v); - virtual void write_data(uint32_t v); - virtual void write_data(uint64_t v); - virtual void write_to_file(int fd); - virtual uint32_t size(); + void write_comment(const std::string&) override {} + void write_string(const std::string &name) override; + void write_data(uint8_t v) override; + void write_data(uint32_t v) override; + void write_data(uint64_t v) override; + void write_to_file(int fd) override; + uint32_t size() override; }; /** * Assembly writer. This class is responsible for writing the output in an @@ -234,7 +234,7 @@ class asm_writer : public output_writer /** * Write a string to the output. */ - void write_string(const std::string &c); + void write_string(const std::string &c) override; /** * Writes the string, starting on a new line. */ @@ -246,13 +246,13 @@ class asm_writer : public output_writer void write_byte(uint8_t b); public: asm_writer() : byte_count(0), bytes_written(0) {} - virtual void write_label(const std::string &name); - virtual void write_comment(const std::string &name); - virtual void write_data(uint8_t v); - virtual void write_data(uint32_t v); - virtual void write_data(uint64_t v); - virtual void write_to_file(int fd); - virtual uint32_t size(); + void write_label(const std::string &name) override; + void write_comment(const std::string &name) override; + void write_data(uint8_t v) override; + void write_data(uint32_t v) override; + void write_data(uint64_t v) override; + void write_to_file(int fd) override; + uint32_t size() override; }; /** Modified: head/usr.bin/dtc/dtc.1 ============================================================================== --- head/usr.bin/dtc/dtc.1 Mon Apr 17 17:20:48 2017 (r317059) +++ head/usr.bin/dtc/dtc.1 Mon Apr 17 17:23:19 2017 (r317060) @@ -38,7 +38,7 @@ .Nd device tree compiler .Sh SYNOPSIS .Nm -.Op Fl fhsv +.Op Fl @fhsv .Op Fl b Ar boot_cpu_id .Op Fl d Ar dependency_file .Op Fl E Ar [no-]checker_name @@ -84,6 +84,8 @@ Enable or disable a specified checker. The argument is the name of the checker. The full list of checkers is given in .Sx CHECKERS . +.It Fl @ +Emit a __symbols__ node to allow plugins to be loaded. .It Fl f Force the tool to attempt to generate the output, even if the input had errors. .It Fl h Modified: head/usr.bin/dtc/dtc.cc ============================================================================== --- head/usr.bin/dtc/dtc.cc Mon Apr 17 17:20:48 2017 (r317059) +++ head/usr.bin/dtc/dtc.cc Mon Apr 17 17:23:19 2017 (r317060) @@ -54,7 +54,7 @@ int version_major = 0; /** * The current minor version of the tool. */ -int version_minor = 4; +int version_minor = 5; /** * The current patch level of the tool. */ @@ -63,7 +63,7 @@ int version_patch = 0; static void usage(const string &argv0) { fprintf(stderr, "Usage:\n" - "\t%s\t[-fhsv] [-b boot_cpu_id] [-d dependency_file]" + "\t%s\t[-fhsv@] [-b boot_cpu_id] [-d dependency_file]" "[-E [no-]checker_name]\n" "\t\t[-H phandle_format] [-I input_format]" "[-O output_format]\n" @@ -101,7 +101,7 @@ main(int argc, char **argv) clock_t c0 = clock(); class device_tree tree; fdt::checking::check_manager checks; - const char *options = "hqI:O:o:V:d:R:S:p:b:fi:svH:W:E:DP:"; + const char *options = "@hqI:O:o:V:d:R:S:p:b:fi:svH:W:E:DP:"; // Don't forget to update the man page if any more options are added. while ((ch = getopt(argc, argv, options)) != -1) @@ -114,6 +114,9 @@ main(int argc, char **argv) case 'v': version(argv[0]); return EXIT_SUCCESS; + case '@': + tree.write_symbols = true; + break; case 'I': { string arg(optarg); Modified: head/usr.bin/dtc/fdt.cc ============================================================================== --- head/usr.bin/dtc/fdt.cc Mon Apr 17 17:20:48 2017 (r317059) +++ head/usr.bin/dtc/fdt.cc Mon Apr 17 17:23:19 2017 (r317060) @@ -169,6 +169,16 @@ property_value::resolve_type() type = BINARY; } +size_t +property_value::size() +{ + if (!byte_data.empty()) + { + return byte_data.size(); + } + return string_data.size() + 1; +} + void property_value::write_as_string(FILE *file) { @@ -286,7 +296,6 @@ property::parse_cells(text_input_buffer return; } input.next_token(); - bool isPath = false; string referenced; if (!input.consume('{')) { @@ -296,7 +305,6 @@ property::parse_cells(text_input_buffer { referenced = input.parse_to('}'); input.consume('}'); - isPath = true; } if (referenced.empty()) { @@ -655,6 +663,21 @@ property::write_dts(FILE *file, int inde fputs(";\n", file); } +size_t +property::offset_of_value(property_value &val) +{ + size_t off = 0; + for (auto &v : values) + { + if (&v == &val) + { + return off; + } + off += v.size(); + } + return -1; +} + string node::parse_name(text_input_buffer &input, bool &is_property, const char *error) { @@ -764,6 +787,21 @@ node::node(input_buffer &structs, input_ return; } + +node::node(const string &n, + const std::vector &p) + : name(n) +{ + props.insert(props.begin(), p.begin(), p.end()); +} + +node_ptr node::create_special_node(const string &name, + const std::vector &props) +{ + node_ptr n(new node(name, props)); + return n; +} + node::node(text_input_buffer &input, string &&n, std::unordered_set &&l, @@ -1123,7 +1161,6 @@ device_tree::collect_names_recursive(nod { collect_names_recursive(c, path); } - path.pop_back(); // Now we collect the phandles and properties that reference // other nodes. for (auto &p : n->properties()) @@ -1132,7 +1169,7 @@ device_tree::collect_names_recursive(nod { if (v.is_phandle()) { - phandles.push_back(&v); + fixups.push_back({path, p, v}); } if (v.is_cross_reference()) { @@ -1154,6 +1191,7 @@ device_tree::collect_names_recursive(nod } } } + path.pop_back(); } void @@ -1163,7 +1201,7 @@ device_tree::collect_names() node_names.clear(); node_paths.clear(); cross_references.clear(); - phandles.clear(); + fixups.clear(); collect_names_recursive(root, p); } @@ -1191,37 +1229,38 @@ device_tree::resolve_cross_references() } } } - std::unordered_set phandle_set; - for (auto &i : phandles) + std::unordered_map phandle_set; + for (auto &i : fixups) { - phandle_set.insert(i); + phandle_set.insert({&i.val, i}); } - std::vector sorted_phandles; + std::vector> sorted_phandles; root->visit([&](node &n) { for (auto &p : n.properties()) { for (auto &v : *p) { - if (phandle_set.count(&v)) + auto i = phandle_set.find(&v); + if (i != phandle_set.end()) { - sorted_phandles.push_back(&v); + sorted_phandles.push_back(i->second); } } } }); - assert(sorted_phandles.size() == phandles.size()); + assert(sorted_phandles.size() == fixups.size()); uint32_t phandle = 1; for (auto &i : sorted_phandles) { - string target_name = i->string_data; + string target_name = i.get().val.string_data; node *target = nullptr; string possible; // If the node name is a path, then look it up by following the path, // otherwise jump directly to the named node. if (target_name[0] == '/') { - std::string path; + string path; target = root.get(); std::istringstream ss(target_name); string path_element; @@ -1276,13 +1315,21 @@ device_tree::resolve_cross_references() } if (target == nullptr) { - fprintf(stderr, "Failed to find node with label: %s\n", target_name.c_str()); - if (possible != string()) + if (is_plugin) { - fprintf(stderr, "Possible intended match: %s\n", possible.c_str()); + unresolved_fixups.push_back(i); + continue; + } + else + { + fprintf(stderr, "Failed to find node with label: %s\n", target_name.c_str()); + if (possible != string()) + { + fprintf(stderr, "Possible intended match: %s\n", possible.c_str()); + } + valid = 0; + return; } - valid = 0; - return; } // If there is an existing phandle, use it property_ptr p = target->get_property("phandle"); @@ -1322,8 +1369,8 @@ device_tree::resolve_cross_references() target->add_property(p); } } - p->begin()->push_to_buffer(i->byte_data); - assert(i->byte_data.size() == 4); + p->begin()->push_to_buffer(i.get().val.byte_data); + assert(i.get().val.byte_data.size() == 4); } } @@ -1340,6 +1387,10 @@ device_tree::parse_file(text_input_buffe read_header = true; } input.next_token(); + if (input.consume("/plugin/;")) + { + is_plugin = true; + } input.next_token(); if (!read_header) { @@ -1567,6 +1618,30 @@ device_tree::parse_dtb(const string &fn, valid = (root != 0); } +string +device_tree::node_path::to_string() const +{ + string path; + auto p = begin(); + auto pe = end(); + if ((p == pe) || (p+1 == pe)) + { + return string("/"); + } + // Skip the first name in the path. It's always "", and implicitly / + for (++p ; p!=pe ; ++p) + { + path += '/'; + path += p->first; + if (!(p->second.empty())) + { + path += '@'; + path += p->second; + } + } + return path; +} + void device_tree::parse_dts(const string &fn, FILE *depfile) { @@ -1631,6 +1706,85 @@ device_tree::parse_dts(const string &fn, } collect_names(); resolve_cross_references(); + if (write_symbols) + { + std::vector symbols; + // Create a symbol table. Each label in this device tree may be + // referenced by other plugins, so we create a __symbols__ node inside + // the root that contains mappings (properties) from label names to + // paths. + for (auto &s : node_paths) + { + property_value v; + v.string_data = s.second.to_string(); + v.type = property_value::STRING; + string name = s.first; + auto prop = std::make_shared(std::move(name)); + prop->add_value(v); + symbols.push_back(prop); + } + root->add_child(node::create_special_node("__symbols__", symbols)); + // If this is a plugin, then we also need to create two extra nodes. + // Internal phandles will need to be renumbered to avoid conflicts with + // already-loaded nodes and external references will need to be + // resolved. + if (is_plugin) + { + // Create the fixups entry. This is of the form: + // {target} = {path}:{property name}:{offset} + auto create_fixup_entry = [&](fixup &i, string target) + { + string value = i.path.to_string(); + value += ':'; + value += i.prop->get_key(); + value += ':'; + value += std::to_string(i.prop->offset_of_value(i.val)); + property_value v; + v.string_data = value; + v.type = property_value::STRING; + auto prop = std::make_shared(std::move(target)); + prop->add_value(v); + return prop; + }; + // If we have any unresolved phandle references in this plugin, + // then we must update them to 0xdeadbeef and leave a property in + // the /__fixups__ node whose key is the label and whose value is + // as described above. + if (!unresolved_fixups.empty()) + { + symbols.clear(); + for (auto &i : unresolved_fixups) + { + auto &val = i.get().val; + symbols.push_back(create_fixup_entry(i, val.string_data)); + val.byte_data.push_back(0xde); + val.byte_data.push_back(0xad); + val.byte_data.push_back(0xbe); + val.byte_data.push_back(0xef); + val.type = property_value::BINARY; + } + root->add_child(node::create_special_node("__fixups__", symbols)); + } + symbols.clear(); + // If we have any resolved phandle references in this plugin, then + // we must leave a property in the /__local_fixups__ node whose key + // is 'fixup' and whose value is as described above. + for (auto &i : fixups) + { + if (!i.val.is_phandle()) + { + continue; + } + symbols.push_back(create_fixup_entry(i, "fixup")); + } + // We've iterated over all fixups, but only emit the + // __local_fixups__ if we found some that were resolved internally. + if (!symbols.empty()) + { + root->add_child(node::create_special_node("__local_fixups__", symbols)); + } + } + } } bool device_tree::parse_define(const char *def) @@ -1653,7 +1807,7 @@ bool device_tree::parse_define(const cha text_input_buffer in(std::move(raw), std::unordered_set(), std::vector(), - std::string(), + string(), nullptr); property_ptr p = property::parse(in, std::move(name_copy), string_set(), false); if (p) Modified: head/usr.bin/dtc/fdt.hh ============================================================================== --- head/usr.bin/dtc/fdt.hh Mon Apr 17 17:20:48 2017 (r317059) +++ head/usr.bin/dtc/fdt.hh Mon Apr 17 17:23:19 2017 (r317060) @@ -211,6 +211,10 @@ struct property_value * false otherwise. */ bool try_to_merge(property_value &other); + /** + * Returns the size (in bytes) of this property value. + */ + size_t size(); private: /** * Returns whether the value is of the specified type. If the type of @@ -380,6 +384,10 @@ class property * applicable way that it can determine. */ void write_dts(FILE *file, int indent); + /** + * Returns the byte offset of the specified property value. + */ + size_t offset_of_value(property_value &val); }; /** @@ -479,6 +487,10 @@ class node std::string &&a, define_map*); /** + * Creates a special node with the specified name and properties. + */ + node(const std::string &n, const std::vector &p); + /** * Comparison function for properties, used when sorting the properties * vector. Orders the properties based on their names. */ @@ -579,6 +591,11 @@ class node */ static node_ptr parse_dtb(input_buffer &structs, input_buffer &strings); /** + * Construct a new special node from a name and set of properties. + */ + static node_ptr create_special_node(const std::string &name, + const std::vector &props); + /** * Returns a property corresponding to the specified key, or 0 if this * node does not contain a property of that name. */ @@ -591,6 +608,13 @@ class node props.push_back(p); } /** + * Adds a new child to this node. + */ + inline void add_child(node_ptr &&n) + { + children.push_back(std::move(n)); + } + /** * Merges a node into this one. Any properties present in both are * overridden, any properties present in only one are preserved. */ @@ -626,7 +650,14 @@ class device_tree * Type used for node paths. A node path is sequence of names and unit * addresses. */ - typedef std::vector > node_path; + class node_path : public std::vector> + { + public: + /** + * Converts this to a string representation. + */ + std::string to_string() const; + }; /** * Name that we should use for phandle nodes. */ @@ -681,11 +712,34 @@ class device_tree */ std::vector cross_references; /** + * The location of something requiring a fixup entry. + */ + struct fixup + { + /** + * The path to the node. + */ + node_path path; + /** + * The property containing the reference. + */ + property_ptr prop; + /** + * The property value that contains the reference. + */ + property_value &val; + }; + /** * A collection of property values that refer to phandles. These will * be replaced by the value of the phandle property in their * destination. */ - std::vector phandles; + std::vector fixups; + /** + * The locations of all of the values that are supposed to become phandle + * references, but refer to things outside of this file. + */ + std::vector> unresolved_fixups; /** * The names of nodes that target phandles. */ @@ -733,6 +787,10 @@ class device_tree */ uint32_t blob_padding; /** + * Is this tree a plugin? + */ + bool is_plugin; + /** * Visit all of the nodes recursively, and if they have labels then add * them to the node_paths and node_names vectors so that they can be * used in resolving cross references. Also collects phandle @@ -772,6 +830,11 @@ class device_tree void write(int fd); public: /** + * Should we write the __symbols__ node (to allow overlays to be linked + * against this blob)? + */ + bool write_symbols = false; + /** * Returns the node referenced by the property. If this is a tree that * is in source form, then we have a string that we can use to index * the cross_references array and so we can just look that up. Modified: head/usr.bin/dtc/input_buffer.cc ============================================================================== --- head/usr.bin/dtc/input_buffer.cc Mon Apr 17 17:20:48 2017 (r317059) +++ head/usr.bin/dtc/input_buffer.cc Mon Apr 17 17:23:19 2017 (r317060) @@ -102,7 +102,7 @@ struct stream_input_buffer : public dtc: stream_input_buffer(); }; -mmap_input_buffer::mmap_input_buffer(int fd, std::string &&filename) +mmap_input_buffer::mmap_input_buffer(int fd, string &&filename) : input_buffer(0, 0), fn(filename) { struct stat sb; @@ -216,6 +216,7 @@ text_input_buffer::handle_include() parse_error("Expected quoted filename"); return; } + auto loc = location(); string file = parse_to('"'); consume('"'); if (!reallyInclude) @@ -243,7 +244,7 @@ text_input_buffer::handle_include() } if (!include_buffer) { - parse_error("Unable to locate input file"); + loc.report_error("Unable to locate input file"); return; } input_stack.push(std::move(include_buffer)); @@ -1214,7 +1215,7 @@ input_buffer::buffer_for_file(const stri close(source); return 0; } - std::unique_ptr b(new mmap_input_buffer(source, std::string(path))); + std::unique_ptr b(new mmap_input_buffer(source, string(path))); close(source); return b; } Modified: head/usr.bin/dtc/string.cc ============================================================================== --- head/usr.bin/dtc/string.cc Mon Apr 17 17:20:48 2017 (r317059) +++ head/usr.bin/dtc/string.cc Mon Apr 17 17:23:19 2017 (r317060) @@ -31,6 +31,7 @@ */ #include +#include #include #include #include @@ -121,28 +122,28 @@ push_string(byte_buffer &buffer, const s } } -std::string dirname(const string &s) +namespace { +string +dirbasename(std::function fn, const string &s) { if (s == string()) { return string(); } - char *str = strdup(s.c_str()); - string dn(::dirname(str)); - free(str); + std::unique_ptr str = {strdup(s.c_str()), free}; + string dn(fn(str.get())); return dn; } +} -std::string basename(const string &s) +string dirname(const string &s) { - if (s == string()) - { - return string(); - } - char *str = strdup(s.c_str()); - string bn(::basename(str)); - free(str); - return bn; + return dirbasename(::dirname, s); +} + +string basename(const string &s) +{ + return dirbasename(::basename, s); } } // namespace dtc From owner-svn-src-head@freebsd.org Mon Apr 17 17:34:54 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 21621D42C2E; Mon, 17 Apr 2017 17:34:54 +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 mx1.freebsd.org (Postfix) with ESMTPS id B309A1468; Mon, 17 Apr 2017 17:34:53 +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 v3HHYq5n022998; Mon, 17 Apr 2017 17:34:52 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3HHYlf5022945; Mon, 17 Apr 2017 17:34:47 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201704171734.v3HHYlf5022945@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Mon, 17 Apr 2017 17:34:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317061 - in head: libexec/rpc.rstatd sys/amd64/amd64 sys/amd64/include sys/arm/arm sys/arm/include sys/arm64/include sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/compat/linprocfs... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 17 Apr 2017 17:34:54 -0000 Author: glebius Date: Mon Apr 17 17:34:47 2017 New Revision: 317061 URL: https://svnweb.freebsd.org/changeset/base/317061 Log: - Remove 'struct vmmeter' from 'struct pcpu', leaving only global vmmeter in place. To do per-cpu stats, convert all fields that previously were maintained in the vmmeters that sit in pcpus to counter(9). - Since some vmmeter stats may be touched at very early stages of boot, before we have set up UMA and we can do counter_u64_alloc(), provide an early counter mechanism: o Leave one spare uint64_t in struct pcpu, named pc_early_dummy_counter. o Point counter(9) fields of vmmeter to pcpu[0].pc_early_dummy_counter, so that at early stages of boot, before counters are allocated we already point to a counter that can be safely written to. o For sparc64 that required a whole dummy pcpu[MAXCPU] array. Further related changes: - Don't include vmmeter.h into pcpu.h. - vm.stats.vm.v_swappgsout and vm.stats.vm.v_swappgsin changed to 64-bit, to match kernel representation. - struct vmmeter hidden under _KERNEL, and only vmstat(1) is an exclusion. This is based on benno@'s 4-year old patch: https://lists.freebsd.org/pipermail/freebsd-arch/2013-July/014471.html Reviewed by: kib, gallatin, marius, lidl Differential Revision: https://reviews.freebsd.org/D10156 Modified: head/libexec/rpc.rstatd/rstat_proc.c head/sys/amd64/amd64/trap.c head/sys/amd64/include/atomic.h head/sys/amd64/include/counter.h head/sys/amd64/include/pcpu.h head/sys/arm/arm/intr.c head/sys/arm/arm/trap-v4.c head/sys/arm/arm/trap-v6.c head/sys/arm/arm/undefined.c head/sys/arm/include/counter.h head/sys/arm/include/pcpu.h head/sys/arm64/include/counter.h head/sys/arm64/include/pcpu.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c head/sys/compat/linprocfs/linprocfs.c head/sys/fs/fuse/fuse_vnops.c head/sys/fs/nfsclient/nfs_clbio.c head/sys/fs/smbfs/smbfs_io.c head/sys/i386/i386/trap.c head/sys/i386/include/atomic.h head/sys/i386/include/counter.h head/sys/i386/include/pcpu.h head/sys/kern/kern_fork.c head/sys/kern/kern_intr.c head/sys/kern/kern_synch.c head/sys/kern/kern_thread.c head/sys/kern/subr_intr.c head/sys/kern/subr_syscall.c head/sys/kern/subr_trap.c head/sys/kern/vfs_bio.c head/sys/mips/include/counter.h head/sys/mips/include/intr_machdep.h head/sys/mips/include/pcpu.h head/sys/powerpc/include/counter.h head/sys/powerpc/include/pcpu.h head/sys/powerpc/powerpc/trap.c head/sys/sparc64/include/counter.h head/sys/sparc64/include/pcpu.h head/sys/sparc64/sparc64/exception.S head/sys/sparc64/sparc64/genassym.c head/sys/sparc64/sparc64/intr_machdep.c head/sys/sparc64/sparc64/machdep.c head/sys/sparc64/sparc64/trap.c head/sys/sys/pcpu.h head/sys/sys/vmmeter.h head/sys/vm/swap_pager.c head/sys/vm/vm_fault.c head/sys/vm/vm_meter.c head/sys/vm/vm_object.c head/sys/vm/vm_page.c head/sys/vm/vm_pageout.c head/sys/vm/vnode_pager.c head/sys/x86/acpica/srat.c head/sys/x86/x86/intr_machdep.c head/usr.bin/top/machine.c head/usr.bin/vmstat/vmstat.c Modified: head/libexec/rpc.rstatd/rstat_proc.c ============================================================================== --- head/libexec/rpc.rstatd/rstat_proc.c Mon Apr 17 17:23:19 2017 (r317060) +++ head/libexec/rpc.rstatd/rstat_proc.c Mon Apr 17 17:34:47 2017 (r317061) @@ -170,6 +170,7 @@ updatestat(void) struct timeval tm, btm; int mib[6]; size_t len; + uint64_t val; int ifcount; #ifdef DEBUG @@ -229,11 +230,12 @@ updatestat(void) #endif #define FETCH_CNT(stat, cnt) do { \ - len = sizeof((stat)); \ - if (sysctlbyname("vm.stats." #cnt , &(stat), &len, 0, 0) < 0) { \ - syslog(LOG_ERR, "sysctl(vm.stats." #cnt "): %m"); \ + len = sizeof(uint64_t); \ + if (sysctlbyname("vm.stats." #cnt , &val, &len, NULL, 0) < 0) { \ + syslog(LOG_ERR, "sysctl(vm.stats." #cnt "): %m"); \ exit(1); \ } \ + stat = val; \ } while (0) FETCH_CNT(stats_all.s1.v_pgpgin, vm.v_vnodepgsin); Modified: head/sys/amd64/amd64/trap.c ============================================================================== --- head/sys/amd64/amd64/trap.c Mon Apr 17 17:23:19 2017 (r317060) +++ head/sys/amd64/amd64/trap.c Mon Apr 17 17:34:47 2017 (r317061) @@ -176,7 +176,7 @@ trap(struct trapframe *frame) register_t addr = 0; ksiginfo_t ksi; - PCPU_INC(cnt.v_trap); + VM_CNT_INC(v_trap); type = frame->tf_trapno; #ifdef SMP Modified: head/sys/amd64/include/atomic.h ============================================================================== --- head/sys/amd64/include/atomic.h Mon Apr 17 17:23:19 2017 (r317060) +++ head/sys/amd64/include/atomic.h Mon Apr 17 17:34:47 2017 (r317061) @@ -348,7 +348,7 @@ atomic_testandclear_long(volatile u_long * avoid a dependency on sys/pcpu.h in machine/atomic.h consumers. * An assertion in amd64/vm_machdep.c ensures that the value is correct. */ -#define OFFSETOF_MONITORBUF 0x180 +#define OFFSETOF_MONITORBUF 0x100 #if defined(SMP) static __inline void Modified: head/sys/amd64/include/counter.h ============================================================================== --- head/sys/amd64/include/counter.h Mon Apr 17 17:23:19 2017 (r317060) +++ head/sys/amd64/include/counter.h Mon Apr 17 17:34:47 2017 (r317061) @@ -31,7 +31,9 @@ #include -extern struct pcpu __pcpu[1]; +extern struct pcpu __pcpu[]; + +#define EARLY_COUNTER &__pcpu[0].pc_early_dummy_counter #define counter_enter() do {} while (0) #define counter_exit() do {} while (0) Modified: head/sys/amd64/include/pcpu.h ============================================================================== --- head/sys/amd64/include/pcpu.h Mon Apr 17 17:23:19 2017 (r317060) +++ head/sys/amd64/include/pcpu.h Mon Apr 17 17:34:47 2017 (r317061) @@ -66,7 +66,7 @@ uint32_t pc_pcid_next; \ uint32_t pc_pcid_gen; \ uint32_t pc_smp_tlb_done; /* TLB op acknowledgement */ \ - char __pad[145] /* be divisor of PAGE_SIZE \ + char __pad[384] /* be divisor of PAGE_SIZE \ after cache alignment */ #define PC_DBREG_CMD_NONE 0 Modified: head/sys/arm/arm/intr.c ============================================================================== --- head/sys/arm/arm/intr.c Mon Apr 17 17:23:19 2017 (r317060) +++ head/sys/arm/arm/intr.c Mon Apr 17 17:34:47 2017 (r317061) @@ -185,7 +185,7 @@ intr_irq_handler(struct trapframe *frame struct intr_event *event; int i; - PCPU_INC(cnt.v_intr); + VM_CNT_INC(v_intr); i = -1; while ((i = arm_get_next_irq(i)) != -1) { intrcnt[i]++; Modified: head/sys/arm/arm/trap-v4.c ============================================================================== --- head/sys/arm/arm/trap-v4.c Mon Apr 17 17:23:19 2017 (r317060) +++ head/sys/arm/arm/trap-v4.c Mon Apr 17 17:34:47 2017 (r317061) @@ -204,7 +204,7 @@ abort_handler(struct trapframe *tf, int td = curthread; p = td->td_proc; - PCPU_INC(cnt.v_trap); + VM_CNT_INC(v_trap); /* Data abort came from user mode? */ user = TRAP_USERMODE(tf); @@ -615,7 +615,7 @@ prefetch_abort_handler(struct trapframe td = curthread; p = td->td_proc; - PCPU_INC(cnt.v_trap); + VM_CNT_INC(v_trap); if (TRAP_USERMODE(tf)) { td->td_frame = tf; Modified: head/sys/arm/arm/trap-v6.c ============================================================================== --- head/sys/arm/arm/trap-v6.c Mon Apr 17 17:23:19 2017 (r317060) +++ head/sys/arm/arm/trap-v6.c Mon Apr 17 17:34:47 2017 (r317061) @@ -291,7 +291,7 @@ abort_handler(struct trapframe *tf, int void *onfault; #endif - PCPU_INC(cnt.v_trap); + VM_CNT_INC(v_trap); td = curthread; fsr = (prefetch) ? cp15_ifsr_get(): cp15_dfsr_get(); Modified: head/sys/arm/arm/undefined.c ============================================================================== --- head/sys/arm/arm/undefined.c Mon Apr 17 17:23:19 2017 (r317060) +++ head/sys/arm/arm/undefined.c Mon Apr 17 17:34:47 2017 (r317061) @@ -201,7 +201,7 @@ undefinedinstruction(struct trapframe *f if (__predict_true(frame->tf_spsr & PSR_F) == 0) enable_interrupts(PSR_F); - PCPU_INC(cnt.v_trap); + VM_CNT_INC(v_trap); fault_pc = frame->tf_pc; Modified: head/sys/arm/include/counter.h ============================================================================== --- head/sys/arm/include/counter.h Mon Apr 17 17:23:19 2017 (r317060) +++ head/sys/arm/include/counter.h Mon Apr 17 17:34:47 2017 (r317061) @@ -32,6 +32,10 @@ #include #include +extern struct pcpu __pcpu[]; + +#define EARLY_COUNTER &__pcpu[0].pc_early_dummy_counter + #define counter_enter() do {} while (0) #define counter_exit() do {} while (0) Modified: head/sys/arm/include/pcpu.h ============================================================================== --- head/sys/arm/include/pcpu.h Mon Apr 17 17:23:19 2017 (r317060) +++ head/sys/arm/include/pcpu.h Mon Apr 17 17:34:47 2017 (r317061) @@ -57,10 +57,10 @@ struct vmspace; void *pc_qmap_pte2p; \ unsigned int pc_dbreg[32]; \ int pc_dbreg_cmd; \ - char __pad[27] + char __pad[155] #else #define PCPU_MD_FIELDS \ - char __pad[157] + char __pad[93] #endif #ifdef _KERNEL Modified: head/sys/arm64/include/counter.h ============================================================================== --- head/sys/arm64/include/counter.h Mon Apr 17 17:23:19 2017 (r317060) +++ head/sys/arm64/include/counter.h Mon Apr 17 17:34:47 2017 (r317061) @@ -32,6 +32,10 @@ #include #include +extern struct pcpu __pcpu[]; + +#define EARLY_COUNTER &__pcpu[0].pc_early_dummy_counter + #define counter_enter() do {} while (0) #define counter_exit() do {} while (0) Modified: head/sys/arm64/include/pcpu.h ============================================================================== --- head/sys/arm64/include/pcpu.h Mon Apr 17 17:23:19 2017 (r317060) +++ head/sys/arm64/include/pcpu.h Mon Apr 17 17:34:47 2017 (r317061) @@ -39,7 +39,7 @@ u_int pc_acpi_id; /* ACPI CPU id */ \ u_int pc_midr; /* stored MIDR value */ \ uint64_t pc_clock; \ - char __pad[113] + char __pad[241] #ifdef _KERNEL Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Mon Apr 17 17:23:19 2017 (r317060) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Mon Apr 17 17:34:47 2017 (r317061) @@ -4575,8 +4575,8 @@ zfs_getpages(struct vnode *vp, vm_page_t return (zfs_vm_pagerret_bad); } - PCPU_INC(cnt.v_vnodein); - PCPU_ADD(cnt.v_vnodepgsin, count); + VM_CNT_INC(v_vnodein); + VM_CNT_ADD(v_vnodepgsin, count); lsize = PAGE_SIZE; if (IDX_TO_OFF(mlast->pindex) + lsize > object->un_pager.vnp.vnp_size) @@ -4758,8 +4758,8 @@ zfs_putpages(struct vnode *vp, vm_page_t vm_page_undirty(ma[i]); } zfs_vmobject_wunlock(object); - PCPU_INC(cnt.v_vnodeout); - PCPU_ADD(cnt.v_vnodepgsout, ncount); + VM_CNT_INC(v_vnodeout); + VM_CNT_ADD(v_vnodepgsout, ncount); } dmu_tx_commit(tx); Modified: head/sys/compat/linprocfs/linprocfs.c ============================================================================== --- head/sys/compat/linprocfs/linprocfs.c Mon Apr 17 17:23:19 2017 (r317060) +++ head/sys/compat/linprocfs/linprocfs.c Mon Apr 17 17:34:47 2017 (r317061) @@ -425,17 +425,17 @@ linprocfs_dostat(PFS_FILL_ARGS) } sbuf_printf(sb, "disk 0 0 0 0\n" - "page %u %u\n" - "swap %u %u\n" - "intr %u\n" - "ctxt %u\n" + "page %ju %ju\n" + "swap %ju %ju\n" + "intr %ju\n" + "ctxt %ju\n" "btime %lld\n", - vm_cnt.v_vnodepgsin, - vm_cnt.v_vnodepgsout, - vm_cnt.v_swappgsin, - vm_cnt.v_swappgsout, - vm_cnt.v_intr, - vm_cnt.v_swtch, + (uintmax_t)VM_CNT_FETCH(v_vnodepgsin), + (uintmax_t)VM_CNT_FETCH(v_vnodepgsout), + (uintmax_t)VM_CNT_FETCH(v_swappgsin), + (uintmax_t)VM_CNT_FETCH(v_swappgsout), + (uintmax_t)VM_CNT_FETCH(v_intr), + (uintmax_t)VM_CNT_FETCH(v_swtch), (long long)boottime.tv_sec); return (0); } Modified: head/sys/fs/fuse/fuse_vnops.c ============================================================================== --- head/sys/fs/fuse/fuse_vnops.c Mon Apr 17 17:23:19 2017 (r317060) +++ head/sys/fs/fuse/fuse_vnops.c Mon Apr 17 17:34:47 2017 (r317061) @@ -1793,8 +1793,8 @@ fuse_vnop_getpages(struct vop_getpages_a kva = (vm_offset_t)bp->b_data; pmap_qenter(kva, pages, npages); - PCPU_INC(cnt.v_vnodein); - PCPU_ADD(cnt.v_vnodepgsin, npages); + VM_CNT_INC(v_vnodein); + VM_CNT_ADD(v_vnodepgsin, npages); count = npages << PAGE_SHIFT; iov.iov_base = (caddr_t)kva; @@ -1927,8 +1927,8 @@ fuse_vnop_putpages(struct vop_putpages_a kva = (vm_offset_t)bp->b_data; pmap_qenter(kva, pages, npages); - PCPU_INC(cnt.v_vnodeout); - PCPU_ADD(cnt.v_vnodepgsout, count); + VM_CNT_INC(v_vnodeout); + VM_CNT_ADD(v_vnodepgsout, count); iov.iov_base = (caddr_t)kva; iov.iov_len = count; Modified: head/sys/fs/nfsclient/nfs_clbio.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clbio.c Mon Apr 17 17:23:19 2017 (r317060) +++ head/sys/fs/nfsclient/nfs_clbio.c Mon Apr 17 17:34:47 2017 (r317061) @@ -184,8 +184,8 @@ ncl_getpages(struct vop_getpages_args *a kva = (vm_offset_t) bp->b_data; pmap_qenter(kva, pages, npages); - PCPU_INC(cnt.v_vnodein); - PCPU_ADD(cnt.v_vnodepgsin, npages); + VM_CNT_INC(v_vnodein); + VM_CNT_ADD(v_vnodepgsin, npages); count = npages << PAGE_SHIFT; iov.iov_base = (caddr_t) kva; @@ -320,8 +320,8 @@ ncl_putpages(struct vop_putpages_args *a } mtx_unlock(&np->n_mtx); - PCPU_INC(cnt.v_vnodeout); - PCPU_ADD(cnt.v_vnodepgsout, count); + VM_CNT_INC(v_vnodeout); + VM_CNT_ADD(v_vnodepgsout, count); iov.iov_base = unmapped_buf; iov.iov_len = count; Modified: head/sys/fs/smbfs/smbfs_io.c ============================================================================== --- head/sys/fs/smbfs/smbfs_io.c Mon Apr 17 17:23:19 2017 (r317060) +++ head/sys/fs/smbfs/smbfs_io.c Mon Apr 17 17:34:47 2017 (r317061) @@ -470,8 +470,8 @@ smbfs_getpages(ap) kva = (vm_offset_t) bp->b_data; pmap_qenter(kva, pages, npages); - PCPU_INC(cnt.v_vnodein); - PCPU_ADD(cnt.v_vnodepgsin, npages); + VM_CNT_INC(v_vnodein); + VM_CNT_ADD(v_vnodepgsin, npages); count = npages << PAGE_SHIFT; iov.iov_base = (caddr_t) kva; @@ -595,8 +595,8 @@ smbfs_putpages(ap) kva = (vm_offset_t) bp->b_data; pmap_qenter(kva, pages, npages); - PCPU_INC(cnt.v_vnodeout); - PCPU_ADD(cnt.v_vnodepgsout, count); + VM_CNT_INC(v_vnodeout); + VM_CNT_ADD(v_vnodepgsout, count); iov.iov_base = (caddr_t) kva; iov.iov_len = count; Modified: head/sys/i386/i386/trap.c ============================================================================== --- head/sys/i386/i386/trap.c Mon Apr 17 17:23:19 2017 (r317060) +++ head/sys/i386/i386/trap.c Mon Apr 17 17:34:47 2017 (r317061) @@ -192,7 +192,7 @@ trap(struct trapframe *frame) static int lastalert = 0; #endif - PCPU_INC(cnt.v_trap); + VM_CNT_INC(v_trap); type = frame->tf_trapno; #ifdef SMP Modified: head/sys/i386/include/atomic.h ============================================================================== --- head/sys/i386/include/atomic.h Mon Apr 17 17:23:19 2017 (r317060) +++ head/sys/i386/include/atomic.h Mon Apr 17 17:34:47 2017 (r317061) @@ -45,7 +45,7 @@ * avoid a dependency on sys/pcpu.h in machine/atomic.h consumers. * An assertion in i386/vm_machdep.c ensures that the value is correct. */ -#define __OFFSETOF_MONITORBUF 0x180 +#define __OFFSETOF_MONITORBUF 0x80 static __inline void __mbk(void) Modified: head/sys/i386/include/counter.h ============================================================================== --- head/sys/i386/include/counter.h Mon Apr 17 17:23:19 2017 (r317060) +++ head/sys/i386/include/counter.h Mon Apr 17 17:34:47 2017 (r317061) @@ -36,6 +36,10 @@ #include #include +extern struct pcpu __pcpu[]; + +#define EARLY_COUNTER &__pcpu[0].pc_early_dummy_counter + #define counter_enter() do { \ if ((cpu_feature & CPUID_CX8) == 0) \ critical_enter(); \ @@ -46,8 +50,6 @@ critical_exit(); \ } while (0) -extern struct pcpu __pcpu[MAXCPU]; - static inline void counter_64_inc_8b(uint64_t *p, int64_t inc) { Modified: head/sys/i386/include/pcpu.h ============================================================================== --- head/sys/i386/include/pcpu.h Mon Apr 17 17:23:19 2017 (r317060) +++ head/sys/i386/include/pcpu.h Mon Apr 17 17:34:47 2017 (r317061) @@ -68,7 +68,7 @@ caddr_t pc_cmap_addr2; \ vm_offset_t pc_qmap_addr; /* KVA for temporary mappings */\ uint32_t pc_smp_tlb_done; /* TLB op acknowledgement */ \ - char __pad[189] + char __pad[445] #ifdef _KERNEL Modified: head/sys/kern/kern_fork.c ============================================================================== --- head/sys/kern/kern_fork.c Mon Apr 17 17:23:19 2017 (r317060) +++ head/sys/kern/kern_fork.c Mon Apr 17 17:34:47 2017 (r317061) @@ -664,20 +664,20 @@ do_fork(struct thread *td, struct fork_r vm_forkproc(td, p2, td2, vm2, fr->fr_flags); if (fr->fr_flags == (RFFDG | RFPROC)) { - PCPU_INC(cnt.v_forks); - PCPU_ADD(cnt.v_forkpages, p2->p_vmspace->vm_dsize + + VM_CNT_INC(v_forks); + VM_CNT_ADD(v_forkpages, p2->p_vmspace->vm_dsize + p2->p_vmspace->vm_ssize); } else if (fr->fr_flags == (RFFDG | RFPROC | RFPPWAIT | RFMEM)) { - PCPU_INC(cnt.v_vforks); - PCPU_ADD(cnt.v_vforkpages, p2->p_vmspace->vm_dsize + + VM_CNT_INC(v_vforks); + VM_CNT_ADD(v_vforkpages, p2->p_vmspace->vm_dsize + p2->p_vmspace->vm_ssize); } else if (p1 == &proc0) { - PCPU_INC(cnt.v_kthreads); - PCPU_ADD(cnt.v_kthreadpages, p2->p_vmspace->vm_dsize + + VM_CNT_INC(v_kthreads); + VM_CNT_ADD(v_kthreadpages, p2->p_vmspace->vm_dsize + p2->p_vmspace->vm_ssize); } else { - PCPU_INC(cnt.v_rforks); - PCPU_ADD(cnt.v_rforkpages, p2->p_vmspace->vm_dsize + + VM_CNT_INC(v_rforks); + VM_CNT_ADD(v_rforkpages, p2->p_vmspace->vm_dsize + p2->p_vmspace->vm_ssize); } Modified: head/sys/kern/kern_intr.c ============================================================================== --- head/sys/kern/kern_intr.c Mon Apr 17 17:23:19 2017 (r317060) +++ head/sys/kern/kern_intr.c Mon Apr 17 17:34:47 2017 (r317061) @@ -1156,7 +1156,7 @@ swi_sched(void *cookie, int flags) ih->ih_need = 1; if (!(flags & SWI_DELAY)) { - PCPU_INC(cnt.v_soft); + VM_CNT_INC(v_soft); #ifdef INTR_FILTER error = intr_event_schedule_thread(ie, ie->ie_thread); #else Modified: head/sys/kern/kern_synch.c ============================================================================== --- head/sys/kern/kern_synch.c Mon Apr 17 17:23:19 2017 (r317060) +++ head/sys/kern/kern_synch.c Mon Apr 17 17:34:47 2017 (r317061) @@ -426,7 +426,7 @@ mi_switch(int flags, struct thread *newt td->td_incruntime += runtime; PCPU_SET(switchtime, new_switchtime); td->td_generation++; /* bump preempt-detect counter */ - PCPU_INC(cnt.v_swtch); + VM_CNT_INC(v_swtch); PCPU_SET(switchticks, ticks); CTR4(KTR_PROC, "mi_switch: old thread %ld (td_sched %p, pid %ld, %s)", td->td_tid, td_get_sched(td), td->td_proc->p_pid, td->td_name); Modified: head/sys/kern/kern_thread.c ============================================================================== --- head/sys/kern/kern_thread.c Mon Apr 17 17:23:19 2017 (r317060) +++ head/sys/kern/kern_thread.c Mon Apr 17 17:34:47 2017 (r317061) @@ -546,7 +546,7 @@ thread_exit(void) td->td_incruntime += runtime; PCPU_SET(switchtime, new_switchtime); PCPU_SET(switchticks, ticks); - PCPU_INC(cnt.v_swtch); + VM_CNT_INC(v_swtch); /* Save our resource usage in our process. */ td->td_ru.ru_nvcsw++; Modified: head/sys/kern/subr_intr.c ============================================================================== --- head/sys/kern/subr_intr.c Mon Apr 17 17:23:19 2017 (r317060) +++ head/sys/kern/subr_intr.c Mon Apr 17 17:34:47 2017 (r317061) @@ -292,7 +292,7 @@ intr_irq_handler(struct trapframe *tf) KASSERT(irq_root_filter != NULL, ("%s: no filter", __func__)); - PCPU_INC(cnt.v_intr); + VM_CNT_INC(v_intr); critical_enter(); td = curthread; oldframe = td->td_intr_frame; Modified: head/sys/kern/subr_syscall.c ============================================================================== --- head/sys/kern/subr_syscall.c Mon Apr 17 17:23:19 2017 (r317060) +++ head/sys/kern/subr_syscall.c Mon Apr 17 17:34:47 2017 (r317061) @@ -58,7 +58,7 @@ syscallenter(struct thread *td, struct s struct proc *p; int error, traced; - PCPU_INC(cnt.v_syscall); + VM_CNT_INC(v_syscall); p = td->td_proc; td->td_pticks = 0; Modified: head/sys/kern/subr_trap.c ============================================================================== --- head/sys/kern/subr_trap.c Mon Apr 17 17:23:19 2017 (r317060) +++ head/sys/kern/subr_trap.c Mon Apr 17 17:34:47 2017 (r317061) @@ -234,7 +234,7 @@ ast(struct trapframe *framep) td->td_flags &= ~(TDF_ASTPENDING | TDF_NEEDSIGCHK | TDF_NEEDSUSPCHK | TDF_NEEDRESCHED | TDF_ALRMPEND | TDF_PROFPEND | TDF_MACPEND); thread_unlock(td); - PCPU_INC(cnt.v_trap); + VM_CNT_INC(v_trap); if (td->td_cowgen != p->p_cowgen) thread_cow_update(td); Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Mon Apr 17 17:23:19 2017 (r317060) +++ head/sys/kern/vfs_bio.c Mon Apr 17 17:34:47 2017 (r317061) @@ -4769,8 +4769,8 @@ vfs_bio_getpages(struct vnode *vp, vm_pa pgsin += pgsin_a; if (rahead != NULL) *rahead = pgsin_a; - PCPU_INC(cnt.v_vnodein); - PCPU_ADD(cnt.v_vnodepgsin, pgsin); + VM_CNT_INC(v_vnodein); + VM_CNT_ADD(v_vnodepgsin, pgsin); br_flags = (mp != NULL && (mp->mnt_kern_flag & MNTK_UNMAPPED_BUFS) != 0) ? GB_UNMAPPED : 0; Modified: head/sys/mips/include/counter.h ============================================================================== --- head/sys/mips/include/counter.h Mon Apr 17 17:23:19 2017 (r317060) +++ head/sys/mips/include/counter.h Mon Apr 17 17:34:47 2017 (r317061) @@ -34,6 +34,8 @@ #include #endif +#define EARLY_COUNTER &((struct pcpu *)pcpu_space)->pc_early_dummy_counter + #define counter_enter() critical_enter() #define counter_exit() critical_exit() Modified: head/sys/mips/include/intr_machdep.h ============================================================================== --- head/sys/mips/include/intr_machdep.h Mon Apr 17 17:23:19 2017 (r317060) +++ head/sys/mips/include/intr_machdep.h Mon Apr 17 17:34:47 2017 (r317061) @@ -71,6 +71,6 @@ mips_intrcnt_inc(mips_intrcnt_t counter) { if (counter) atomic_add_long(counter, 1); - PCPU_INC(cnt.v_intr); + VM_CNT_INC(v_intr); } #endif /* !_MACHINE_INTR_MACHDEP_H_ */ Modified: head/sys/mips/include/pcpu.h ============================================================================== --- head/sys/mips/include/pcpu.h Mon Apr 17 17:23:19 2017 (r317060) +++ head/sys/mips/include/pcpu.h Mon Apr 17 17:34:47 2017 (r317061) @@ -45,11 +45,11 @@ #ifdef __mips_n64 #define PCPU_MD_MIPS64_FIELDS \ PCPU_MD_COMMON_FIELDS \ - char __pad[53] + char __pad[245] #else #define PCPU_MD_MIPS32_FIELDS \ PCPU_MD_COMMON_FIELDS \ - char __pad[189] + char __pad[125] #endif #ifdef __mips_n64 Modified: head/sys/powerpc/include/counter.h ============================================================================== --- head/sys/powerpc/include/counter.h Mon Apr 17 17:23:19 2017 (r317060) +++ head/sys/powerpc/include/counter.h Mon Apr 17 17:34:47 2017 (r317061) @@ -34,6 +34,10 @@ #include #endif +extern struct pcpu __pcpu[]; + +#define EARLY_COUNTER &__pcpu[0].pc_early_dummy_counter + #ifdef __powerpc64__ #define counter_enter() do {} while (0) @@ -79,8 +83,6 @@ counter_u64_zero_inline(counter_u64_t c) #define counter_u64_add_protected(c, i) counter_u64_add(c, i) -extern struct pcpu __pcpu[MAXCPU]; - static inline void counter_u64_add(counter_u64_t c, int64_t inc) { Modified: head/sys/powerpc/include/pcpu.h ============================================================================== --- head/sys/powerpc/include/pcpu.h Mon Apr 17 17:23:19 2017 (r317060) +++ head/sys/powerpc/include/pcpu.h Mon Apr 17 17:34:47 2017 (r317061) @@ -57,7 +57,7 @@ struct pvo_entry; vm_offset_t pc_qmap_addr; \ struct pvo_entry *pc_qmap_pvo; \ struct mtx pc_qmap_lock; \ - /* char __pad[0] */ + char __pad[128] #define PCPU_MD_AIM64_FIELDS \ struct slb pc_slb[64]; \ @@ -67,7 +67,7 @@ struct pvo_entry; vm_offset_t pc_qmap_addr; \ struct pvo_entry *pc_qmap_pvo; \ struct mtx pc_qmap_lock; \ - char __pad[1121 - sizeof(struct mtx)] + char __pad[1345] #ifdef __powerpc64__ #define PCPU_MD_AIM_FIELDS PCPU_MD_AIM64_FIELDS @@ -81,9 +81,9 @@ struct pvo_entry; #define BOOKE_TLBSAVE_LEN (BOOKE_TLB_SAVELEN * BOOKE_TLB_MAXNEST) #ifdef __powerpc64__ -#define BOOKE_PCPU_PAD 773 +#define BOOKE_PCPU_PAD 901 #else -#define BOOKE_PCPU_PAD 173 +#define BOOKE_PCPU_PAD 429 #endif #define PCPU_MD_BOOKE_FIELDS \ register_t pc_booke_critsave[BOOKE_CRITSAVE_LEN]; \ Modified: head/sys/powerpc/powerpc/trap.c ============================================================================== --- head/sys/powerpc/powerpc/trap.c Mon Apr 17 17:23:19 2017 (r317060) +++ head/sys/powerpc/powerpc/trap.c Mon Apr 17 17:34:47 2017 (r317061) @@ -171,7 +171,7 @@ trap(struct trapframe *frame) u_int ucode; ksiginfo_t ksi; - PCPU_INC(cnt.v_trap); + VM_CNT_INC(v_trap); td = curthread; p = td->td_proc; Modified: head/sys/sparc64/include/counter.h ============================================================================== --- head/sys/sparc64/include/counter.h Mon Apr 17 17:23:19 2017 (r317060) +++ head/sys/sparc64/include/counter.h Mon Apr 17 17:34:47 2017 (r317061) @@ -34,6 +34,9 @@ #include #endif +extern struct pcpu dummy_pcpu[]; +#define EARLY_COUNTER &dummy_pcpu[0].pc_early_dummy_counter + #define counter_enter() critical_enter() #define counter_exit() critical_exit() Modified: head/sys/sparc64/include/pcpu.h ============================================================================== --- head/sys/sparc64/include/pcpu.h Mon Apr 17 17:23:19 2017 (r317060) +++ head/sys/sparc64/include/pcpu.h Mon Apr 17 17:34:47 2017 (r317061) @@ -62,7 +62,7 @@ struct pmap; u_int pc_tlb_ctx; \ u_int pc_tlb_ctx_max; \ u_int pc_tlb_ctx_min; \ - char __pad[397] + char __pad[653] #ifdef _KERNEL Modified: head/sys/sparc64/sparc64/exception.S ============================================================================== --- head/sys/sparc64/sparc64/exception.S Mon Apr 17 17:23:19 2017 (r317060) +++ head/sys/sparc64/sparc64/exception.S Mon Apr 17 17:34:47 2017 (r317061) @@ -2476,9 +2476,8 @@ ENTRY(tl0_intr) inc %l1 stx %l1, [%l0] - lduw [PCPU(CNT) + V_INTR], %l0 - inc %l0 - stw %l0, [PCPU(CNT) + V_INTR] + call counter_intr_inc + nop ba,a %xcc, tl0_ret nop @@ -2989,11 +2988,8 @@ ENTRY(tl1_intr) add %l5, %l4, %l4 ldx [%l4], %l5 inc %l5 - stx %l5, [%l4] - - lduw [PCPU(CNT) + V_INTR], %l4 - inc %l4 - stw %l4, [PCPU(CNT) + V_INTR] + call counter_intr_inc + stx %l5, [%l4] ldx [%sp + SPOFF + CCFSZ + TF_Y], %l4 Modified: head/sys/sparc64/sparc64/genassym.c ============================================================================== --- head/sys/sparc64/sparc64/genassym.c Mon Apr 17 17:23:19 2017 (r317060) +++ head/sys/sparc64/sparc64/genassym.c Mon Apr 17 17:34:47 2017 (r317061) @@ -134,7 +134,6 @@ ASSYM(PC_CPUID, offsetof(struct pcpu, pc ASSYM(PC_IRHEAD, offsetof(struct pcpu, pc_irhead)); ASSYM(PC_IRTAIL, offsetof(struct pcpu, pc_irtail)); ASSYM(PC_IRFREE, offsetof(struct pcpu, pc_irfree)); -ASSYM(PC_CNT, offsetof(struct pcpu, pc_cnt)); ASSYM(PC_SIZEOF, sizeof(struct pcpu)); ASSYM(PC_CACHE, offsetof(struct pcpu, pc_cache)); Modified: head/sys/sparc64/sparc64/intr_machdep.c ============================================================================== --- head/sys/sparc64/sparc64/intr_machdep.c Mon Apr 17 17:23:19 2017 (r317060) +++ head/sys/sparc64/sparc64/intr_machdep.c Mon Apr 17 17:34:47 2017 (r317061) @@ -123,6 +123,7 @@ static void intr_stray_level(struct trap static void intr_stray_vector(void *); static int intrcnt_setname(const char *, int); static void intrcnt_updatename(int, const char *, int); +void counter_intr_inc(void); static void intrcnt_updatename(int vec, const char *name, int ispil) @@ -451,6 +452,19 @@ intr_describe(int vec, void *ih, const c return (error); } +/* + * Do VM_CNT_INC(intr), being in the interrupt context already. This is + * called from assembly. + * To avoid counter_enter() and appropriate assertion, unwrap VM_CNT_INC() + * and hardcode the actual increment. + */ +void +counter_intr_inc(void) +{ + + *(uint64_t *)zpcpu_get(vm_cnt.v_intr) += 1; +} + #ifdef SMP /* * Support for balancing interrupt sources across CPUs. For now we just Modified: head/sys/sparc64/sparc64/machdep.c ============================================================================== --- head/sys/sparc64/sparc64/machdep.c Mon Apr 17 17:23:19 2017 (r317060) +++ head/sys/sparc64/sparc64/machdep.c Mon Apr 17 17:34:47 2017 (r317061) @@ -126,6 +126,7 @@ long realmem; void *dpcpu0; char pcpu0[PCPU_PAGES * PAGE_SIZE]; +struct pcpu dummy_pcpu[MAXCPU]; struct trapframe frame0; vm_offset_t kstack0; Modified: head/sys/sparc64/sparc64/trap.c ============================================================================== --- head/sys/sparc64/sparc64/trap.c Mon Apr 17 17:23:19 2017 (r317060) +++ head/sys/sparc64/sparc64/trap.c Mon Apr 17 17:34:47 2017 (r317061) @@ -267,7 +267,7 @@ trap(struct trapframe *tf) trap_msg[tf->tf_type & ~T_KERNEL], (TRAPF_USERMODE(tf) ? "user" : "kernel"), rdpr(pil)); - PCPU_INC(cnt.v_trap); + VM_CNT_INC(v_trap); if ((tf->tf_tstate & TSTATE_PRIV) == 0) { KASSERT(td != NULL, ("trap: curthread NULL")); Modified: head/sys/sys/pcpu.h ============================================================================== --- head/sys/sys/pcpu.h Mon Apr 17 17:23:19 2017 (r317060) +++ head/sys/sys/pcpu.h Mon Apr 17 17:34:47 2017 (r317061) @@ -43,7 +43,6 @@ #include #include #include -#include #include #include @@ -158,7 +157,6 @@ struct pcpu { u_int pc_cpuid; /* This cpu number */ STAILQ_ENTRY(pcpu) pc_allcpu; struct lock_list_entry *pc_spinlocks; - struct vmmeter pc_cnt; /* VM stats counters */ long pc_cp_time[CPUSTATES]; /* statclock ticks */ struct device *pc_device; void *pc_netisr; /* netisr SWI cookie */ @@ -166,6 +164,7 @@ struct pcpu { int pc_domain; /* Memory domain. */ struct rm_queue pc_rm_queue; /* rmlock list of trackers */ uintptr_t pc_dynamic; /* Dynamic per-cpu data area */ + uint64_t pc_early_dummy_counter; /* Startup time counter(9) */ /* * Keep MD fields last, so that CPU-specific variations on a Modified: head/sys/sys/vmmeter.h ============================================================================== --- head/sys/sys/vmmeter.h Mon Apr 17 17:23:19 2017 (r317060) +++ head/sys/sys/vmmeter.h Mon Apr 17 17:34:47 2017 (r317061) @@ -39,50 +39,84 @@ */ #define MAXSLP 20 +/* Systemwide totals computed every five seconds. */ +struct vmtotal { + int16_t t_rq; /* length of the run queue */ + int16_t t_dw; /* jobs in ``disk wait'' (neg priority) */ + int16_t t_pw; /* jobs in page wait */ + int16_t t_sl; /* jobs sleeping in core */ + int16_t t_sw; /* swapped out runnable/short block jobs */ + int32_t t_vm; /* total virtual memory */ + int32_t t_avm; /* active virtual memory */ + int32_t t_rm; /* total real memory in use */ + int32_t t_arm; /* active real memory */ + int32_t t_vmshr; /* shared virtual memory */ + int32_t t_avmshr; /* active shared virtual memory */ + int32_t t_rmshr; /* shared real memory */ + int32_t t_armshr; /* active shared real memory */ + int32_t t_free; /* free memory pages */ +}; + +#if defined(_KERNEL) || defined(_WANT_VMMETER) +#include + /* * System wide statistics counters. * Locking: * a - locked by atomic operations * c - constant after initialization * f - locked by vm_page_queue_free_mtx - * p - locked by being in the PCPU and atomicity respect to interrupts + * p - uses counter(9) * q - changes are synchronized by the corresponding vm_pagequeue lock */ struct vmmeter { /* * General system activity. */ - u_int v_swtch; /* (p) context switches */ - u_int v_trap; /* (p) calls to trap */ - u_int v_syscall; /* (p) calls to syscall() */ - u_int v_intr; /* (p) device interrupts */ - u_int v_soft; /* (p) software interrupts */ + counter_u64_t v_swtch; /* (p) context switches */ + counter_u64_t v_trap; /* (p) calls to trap */ + counter_u64_t v_syscall; /* (p) calls to syscall() */ + counter_u64_t v_intr; /* (p) device interrupts */ + counter_u64_t v_soft; /* (p) software interrupts */ /* * Virtual memory activity. */ - u_int v_vm_faults; /* (p) address memory faults */ - u_int v_io_faults; /* (p) page faults requiring I/O */ - u_int v_cow_faults; /* (p) copy-on-writes faults */ - u_int v_cow_optim; /* (p) optimized copy-on-writes faults */ - u_int v_zfod; /* (p) pages zero filled on demand */ - u_int v_ozfod; /* (p) optimized zero fill pages */ - u_int v_swapin; /* (p) swap pager pageins */ - u_int v_swapout; /* (p) swap pager pageouts */ - u_int v_swappgsin; /* (p) swap pager pages paged in */ - u_int v_swappgsout; /* (p) swap pager pages paged out */ - u_int v_vnodein; /* (p) vnode pager pageins */ - u_int v_vnodeout; /* (p) vnode pager pageouts */ - u_int v_vnodepgsin; /* (p) vnode_pager pages paged in */ - u_int v_vnodepgsout; /* (p) vnode pager pages paged out */ - u_int v_intrans; /* (p) intransit blocking page faults */ - u_int v_reactivated; /* (p) pages reactivated by the pagedaemon */ - u_int v_pdwakeups; /* (p) times daemon has awaken from sleep */ - u_int v_pdpages; /* (p) pages analyzed by daemon */ - u_int v_pdshortfalls; /* (p) page reclamation shortfalls */ - - u_int v_dfree; /* (p) pages freed by daemon */ - u_int v_pfree; /* (p) pages freed by exiting processes */ - u_int v_tfree; /* (p) total pages freed */ + counter_u64_t v_vm_faults; /* (p) address memory faults */ + counter_u64_t v_io_faults; /* (p) page faults requiring I/O */ + counter_u64_t v_cow_faults; /* (p) copy-on-writes faults */ + counter_u64_t v_cow_optim; /* (p) optimized COW faults */ + counter_u64_t v_zfod; /* (p) pages zero filled on demand */ + counter_u64_t v_ozfod; /* (p) optimized zero fill pages */ + counter_u64_t v_swapin; /* (p) swap pager pageins */ + counter_u64_t v_swapout; /* (p) swap pager pageouts */ + counter_u64_t v_swappgsin; /* (p) swap pager pages paged in */ + counter_u64_t v_swappgsout; /* (p) swap pager pages paged out */ + counter_u64_t v_vnodein; /* (p) vnode pager pageins */ + counter_u64_t v_vnodeout; /* (p) vnode pager pageouts */ + counter_u64_t v_vnodepgsin; /* (p) vnode_pager pages paged in */ + counter_u64_t v_vnodepgsout; /* (p) vnode pager pages paged out */ + counter_u64_t v_intrans; /* (p) intransit blocking page faults */ + counter_u64_t v_reactivated; /* (p) reactivated by the pagedaemon */ + counter_u64_t v_pdwakeups; /* (p) times daemon has awaken */ + counter_u64_t v_pdpages; /* (p) pages analyzed by daemon */ + counter_u64_t v_pdshortfalls; /* (p) page reclamation shortfalls */ + + counter_u64_t v_dfree; /* (p) pages freed by daemon */ + counter_u64_t v_pfree; /* (p) pages freed by processes */ + counter_u64_t v_tfree; /* (p) total pages freed */ + /* + * Fork/vfork/rfork activity. + */ + counter_u64_t v_forks; /* (p) fork() calls */ + counter_u64_t v_vforks; /* (p) vfork() calls */ + counter_u64_t v_rforks; /* (p) rfork() calls */ + counter_u64_t v_kthreads; /* (p) fork() calls by kernel */ + counter_u64_t v_forkpages; /* (p) pages affected by fork() */ + counter_u64_t v_vforkpages; /* (p) pages affected by vfork() */ + counter_u64_t v_rforkpages; /* (p) pages affected by rfork() */ + counter_u64_t v_kthreadpages; /* (p) ... and by kernel fork() */ +#define VM_METER_NCOUNTERS \ + (offsetof(struct vmmeter, v_page_size) / sizeof(counter_u64_t)) /* * Distribution of page usages. */ @@ -100,24 +134,18 @@ struct vmmeter { u_int v_pageout_free_min; /* (c) min pages reserved for kernel */ u_int v_interrupt_free_min; /* (c) reserved pages for int code */ u_int v_free_severe; /* (c) severe page depletion point */ - /* - * Fork/vfork/rfork activity. - */ - u_int v_forks; /* (p) fork() calls */ - u_int v_vforks; /* (p) vfork() calls */ - u_int v_rforks; /* (p) rfork() calls */ - u_int v_kthreads; /* (p) fork() calls by kernel */ - u_int v_forkpages; /* (p) VM pages affected by fork() */ - u_int v_vforkpages; /* (p) VM pages affected by vfork() */ - u_int v_rforkpages; /* (p) VM pages affected by rfork() */ - u_int v_kthreadpages; /* (p) VM pages affected by fork() by kernel */ }; +#endif /* _KERNEL || _WANT_VMMETER */ + #ifdef _KERNEL extern struct vmmeter vm_cnt; - extern u_int vm_pageout_wakeup_thresh; +#define VM_CNT_ADD(var, x) counter_u64_add(vm_cnt.var, x) +#define VM_CNT_INC(var) VM_CNT_ADD(var, 1) +#define VM_CNT_FETCH(var) counter_u64_fetch(vm_cnt.var) + /* * Return TRUE if we are under our severe low-free-pages threshold * @@ -189,33 +217,5 @@ vm_laundry_target(void) return (vm_paging_target()); } - -/* - * Obtain the value of a per-CPU counter. - */ -#define VM_METER_PCPU_CNT(member) \ - vm_meter_cnt(__offsetof(struct vmmeter, member)) - -u_int vm_meter_cnt(size_t); - -#endif - -/* systemwide totals computed every five seconds */ -struct vmtotal { - int16_t t_rq; /* length of the run queue */ - int16_t t_dw; /* jobs in ``disk wait'' (neg priority) */ - int16_t t_pw; /* jobs in page wait */ - int16_t t_sl; /* jobs sleeping in core */ - int16_t t_sw; /* swapped out runnable/short block jobs */ - int32_t t_vm; /* total virtual memory */ - int32_t t_avm; /* active virtual memory */ - int32_t t_rm; /* total real memory in use */ - int32_t t_arm; /* active real memory */ - int32_t t_vmshr; /* shared virtual memory */ - int32_t t_avmshr; /* active shared virtual memory */ - int32_t t_rmshr; /* shared real memory */ - int32_t t_armshr; /* active shared real memory */ - int32_t t_free; /* free memory pages */ -}; - -#endif +#endif /* _KERNEL */ +#endif /* _SYS_VMMETER_H_ */ Modified: head/sys/vm/swap_pager.c ============================================================================== --- head/sys/vm/swap_pager.c Mon Apr 17 17:23:19 2017 (r317060) +++ head/sys/vm/swap_pager.c Mon Apr 17 17:34:47 2017 (r317061) @@ -1180,8 +1180,8 @@ swap_pager_getpages(vm_object_t object, bp->b_pgbefore = rbehind != NULL ? *rbehind : 0; bp->b_pgafter = rahead != NULL ? *rahead : 0; - PCPU_INC(cnt.v_swapin); - PCPU_ADD(cnt.v_swappgsin, count); + VM_CNT_INC(v_swapin); + VM_CNT_ADD(v_swappgsin, count); /* * perform the I/O. NOTE!!! bp cannot be considered valid after @@ -1205,7 +1205,7 @@ swap_pager_getpages(vm_object_t object, VM_OBJECT_WLOCK(object); while ((m[0]->oflags & VPO_SWAPINPROG) != 0) { m[0]->oflags |= VPO_SWAPSLEEP; - PCPU_INC(cnt.v_intrans); + VM_CNT_INC(v_intrans); if (VM_OBJECT_SLEEP(object, &object->paging_in_progress, PSWP, "swread", hz * 20)) { printf( @@ -1393,8 +1393,8 @@ swap_pager_putpages(vm_object_t object, bp->b_dirtyoff = 0; bp->b_dirtyend = bp->b_bcount; - PCPU_INC(cnt.v_swapout); - PCPU_ADD(cnt.v_swappgsout, bp->b_npages); + VM_CNT_INC(v_swapout); + VM_CNT_ADD(v_swappgsout, bp->b_npages); /* * We unconditionally set rtvals[] to VM_PAGER_PEND so that we Modified: head/sys/vm/vm_fault.c ============================================================================== --- head/sys/vm/vm_fault.c Mon Apr 17 17:23:19 2017 (r317060) +++ head/sys/vm/vm_fault.c Mon Apr 17 17:34:47 2017 (r317061) @@ -497,7 +497,7 @@ vm_fault_hold(vm_map_t map, vm_offset_t boolean_t wired; /* Passed by reference. */ bool dead, growstack, hardfault, is_first_object_locked; - PCPU_INC(cnt.v_vm_faults); + VM_CNT_INC(v_vm_faults); fs.vp = NULL; faultcount = 0; nera = -1; @@ -673,7 +673,7 @@ RetryFault:; } vm_object_pip_wakeup(fs.object); VM_OBJECT_WUNLOCK(fs.object); - PCPU_INC(cnt.v_intrans); + VM_CNT_INC(v_intrans); vm_object_deallocate(fs.first_object); goto RetryFault; } @@ -999,9 +999,9 @@ readrest: if ((fs.m->flags & PG_ZERO) == 0) { pmap_zero_page(fs.m); } else { - PCPU_INC(cnt.v_ozfod); + VM_CNT_INC(v_ozfod); } - PCPU_INC(cnt.v_zfod); + VM_CNT_INC(v_zfod); fs.m->valid = VM_PAGE_BITS_ALL; /* Don't try to prefault neighboring pages. */ faultcount = 1; @@ -1095,7 +1095,7 @@ readrest: vm_page_xbusy(fs.m); fs.first_m = fs.m; fs.m = NULL; - PCPU_INC(cnt.v_cow_optim); + VM_CNT_INC(v_cow_optim); } else { /* * Oh, well, lets copy it. @@ -1131,7 +1131,7 @@ readrest: fs.m = fs.first_m; if (!is_first_object_locked) VM_OBJECT_WLOCK(fs.object); - PCPU_INC(cnt.v_cow_faults); + VM_CNT_INC(v_cow_faults); curthread->td_cow++; } else { prot &= ~VM_PROT_WRITE; @@ -1246,7 +1246,7 @@ readrest: */ unlock_and_deallocate(&fs); if (hardfault) { - PCPU_INC(cnt.v_io_faults); + VM_CNT_INC(v_io_faults); curthread->td_ru.ru_majflt++; #ifdef RACCT if (racct_enable && fs.object->type == OBJT_VNODE) { Modified: head/sys/vm/vm_meter.c ============================================================================== --- head/sys/vm/vm_meter.c Mon Apr 17 17:23:19 2017 (r317060) +++ head/sys/vm/vm_meter.c Mon Apr 17 17:34:47 2017 (r317061) @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -55,7 +56,52 @@ __FBSDID("$FreeBSD$"); #include #include -struct vmmeter vm_cnt; +struct vmmeter vm_cnt = { + .v_swtch = EARLY_COUNTER, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Mon Apr 17 18:57:27 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8D87CD41139; Mon, 17 Apr 2017 18:57:27 +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 mx1.freebsd.org (Postfix) with ESMTPS id 5D73815C0; Mon, 17 Apr 2017 18:57:27 +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 v3HIvQ6W056712; Mon, 17 Apr 2017 18:57:26 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3HIvQuO056710; Mon, 17 Apr 2017 18:57:26 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201704171857.v3HIvQuO056710@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 17 Apr 2017 18:57:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317063 - in head/sys: arm64/include compat/linprocfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 17 Apr 2017 18:57:27 -0000 Author: emaste Date: Mon Apr 17 18:57:26 2017 New Revision: 317063 URL: https://svnweb.freebsd.org/changeset/base/317063 Log: Remove trailing whitespace from r317061 Modified: head/sys/arm64/include/counter.h head/sys/compat/linprocfs/linprocfs.c Modified: head/sys/arm64/include/counter.h ============================================================================== --- head/sys/arm64/include/counter.h Mon Apr 17 18:55:54 2017 (r317062) +++ head/sys/arm64/include/counter.h Mon Apr 17 18:57:26 2017 (r317063) @@ -33,7 +33,7 @@ #include extern struct pcpu __pcpu[]; - + #define EARLY_COUNTER &__pcpu[0].pc_early_dummy_counter #define counter_enter() do {} while (0) Modified: head/sys/compat/linprocfs/linprocfs.c ============================================================================== --- head/sys/compat/linprocfs/linprocfs.c Mon Apr 17 18:55:54 2017 (r317062) +++ head/sys/compat/linprocfs/linprocfs.c Mon Apr 17 18:57:26 2017 (r317063) @@ -434,7 +434,7 @@ linprocfs_dostat(PFS_FILL_ARGS) (uintmax_t)VM_CNT_FETCH(v_vnodepgsout), (uintmax_t)VM_CNT_FETCH(v_swappgsin), (uintmax_t)VM_CNT_FETCH(v_swappgsout), - (uintmax_t)VM_CNT_FETCH(v_intr), + (uintmax_t)VM_CNT_FETCH(v_intr), (uintmax_t)VM_CNT_FETCH(v_swtch), (long long)boottime.tv_sec); return (0); From owner-svn-src-head@freebsd.org Mon Apr 17 19:03:32 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 76770D41425; Mon, 17 Apr 2017 19:03:32 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2FD2C1C41; Mon, 17 Apr 2017 19:03:32 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3HJ3VaR060624; Mon, 17 Apr 2017 19:03:31 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3HJ3VNA060623; Mon, 17 Apr 2017 19:03:31 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201704171903.v3HJ3VNA060623@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 17 Apr 2017 19:03:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317064 - head/lib/libc/gen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 17 Apr 2017 19:03:32 -0000 Author: mav Date: Mon Apr 17 19:03:31 2017 New Revision: 317064 URL: https://svnweb.freebsd.org/changeset/base/317064 Log: Optimize pathologic case of telldir() for Samba. When application reads large directory, calling telldir() for each entry, like Samba does, it creates exponential performance drop as number of entries reach tenths to hundreds of thousands. It is caused by full search through the internal list, that never finds matches in that scenario, but creates O(n^2) delays. This patch optimizes that search, limiting it to entries of the same buffer, turning time closer to O(n) in case of linear directory scan. PR: 218622 Reviewed by: jhb, jilles MFC after: 2 weeks Sponsored by: iXsystems, Inc. Differential Revision: https://reviews.freebsd.org/D10408 Modified: head/lib/libc/gen/telldir.c Modified: head/lib/libc/gen/telldir.c ============================================================================== --- head/lib/libc/gen/telldir.c Mon Apr 17 18:57:26 2017 (r317063) +++ head/lib/libc/gen/telldir.c Mon Apr 17 19:03:31 2017 (r317064) @@ -52,15 +52,22 @@ __FBSDID("$FreeBSD$"); long telldir(DIR *dirp) { - struct ddloc *lp; + struct ddloc *lp, *flp; long idx; if (__isthreaded) _pthread_mutex_lock(&dirp->dd_lock); + flp = NULL; LIST_FOREACH(lp, &dirp->dd_td->td_locq, loc_lqe) { - if (lp->loc_seek == dirp->dd_seek && - lp->loc_loc == dirp->dd_loc) + if (lp->loc_seek == dirp->dd_seek) { + if (flp == NULL) + flp = lp; + if (lp->loc_loc == dirp->dd_loc) + break; + } else if (flp != NULL) { + lp = NULL; break; + } } if (lp == NULL) { lp = malloc(sizeof(struct ddloc)); @@ -72,7 +79,10 @@ telldir(DIR *dirp) lp->loc_index = dirp->dd_td->td_loccnt++; lp->loc_seek = dirp->dd_seek; lp->loc_loc = dirp->dd_loc; - LIST_INSERT_HEAD(&dirp->dd_td->td_locq, lp, loc_lqe); + if (flp != NULL) + LIST_INSERT_BEFORE(flp, lp, loc_lqe); + else + LIST_INSERT_HEAD(&dirp->dd_td->td_locq, lp, loc_lqe); } idx = lp->loc_index; if (__isthreaded) From owner-svn-src-head@freebsd.org Mon Apr 17 21:46:55 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7B9ACD422BD; Mon, 17 Apr 2017 21:46:55 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3DF451E4D; Mon, 17 Apr 2017 21:46:55 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3HLksPo026631; Mon, 17 Apr 2017 21:46:54 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3HLksSw026630; Mon, 17 Apr 2017 21:46:54 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201704172146.v3HLksSw026630@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Mon, 17 Apr 2017 21:46:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317069 - head/sys/i386/i386 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 17 Apr 2017 21:46:55 -0000 Author: jkim Date: Mon Apr 17 21:46:54 2017 New Revision: 317069 URL: https://svnweb.freebsd.org/changeset/base/317069 Log: Reduce diff with amd64 version. Modified: head/sys/i386/i386/bpf_jit_machdep.c Modified: head/sys/i386/i386/bpf_jit_machdep.c ============================================================================== --- head/sys/i386/i386/bpf_jit_machdep.c Mon Apr 17 20:14:32 2017 (r317068) +++ head/sys/i386/i386/bpf_jit_machdep.c Mon Apr 17 21:46:54 2017 (r317069) @@ -37,9 +37,9 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include +#include #include #else #include From owner-svn-src-head@freebsd.org Mon Apr 17 21:51:28 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2654FD423A9; Mon, 17 Apr 2017 21:51:28 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DF19C1D8; Mon, 17 Apr 2017 21:51:27 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3HLpR0K029602; Mon, 17 Apr 2017 21:51:27 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3HLpQ2c029599; Mon, 17 Apr 2017 21:51:26 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201704172151.v3HLpQ2c029599@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Mon, 17 Apr 2017 21:51:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317070 - in head/sys: amd64/amd64 i386/i386 net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 17 Apr 2017 21:51:28 -0000 Author: jkim Date: Mon Apr 17 21:51:26 2017 New Revision: 317070 URL: https://svnweb.freebsd.org/changeset/base/317070 Log: Move declarations for a machine-dependent function to the header file. Modified: head/sys/amd64/amd64/bpf_jit_machdep.c head/sys/i386/i386/bpf_jit_machdep.c head/sys/net/bpf_jitter.h Modified: head/sys/amd64/amd64/bpf_jit_machdep.c ============================================================================== --- head/sys/amd64/amd64/bpf_jit_machdep.c Mon Apr 17 21:46:54 2017 (r317069) +++ head/sys/amd64/amd64/bpf_jit_machdep.c Mon Apr 17 21:51:26 2017 (r317070) @@ -55,8 +55,6 @@ __FBSDID("$FreeBSD$"); #include -bpf_filter_func bpf_jit_compile(struct bpf_insn *, u_int, size_t *); - /* * Emit routine to update the jump table. */ Modified: head/sys/i386/i386/bpf_jit_machdep.c ============================================================================== --- head/sys/i386/i386/bpf_jit_machdep.c Mon Apr 17 21:46:54 2017 (r317069) +++ head/sys/i386/i386/bpf_jit_machdep.c Mon Apr 17 21:51:26 2017 (r317070) @@ -55,8 +55,6 @@ __FBSDID("$FreeBSD$"); #include -bpf_filter_func bpf_jit_compile(struct bpf_insn *, u_int, size_t *); - /* * Emit routine to update the jump table. */ Modified: head/sys/net/bpf_jitter.h ============================================================================== --- head/sys/net/bpf_jitter.h Mon Apr 17 21:46:54 2017 (r317069) +++ head/sys/net/bpf_jitter.h Mon Apr 17 21:51:26 2017 (r317070) @@ -80,4 +80,11 @@ bpf_jit_filter *bpf_jitter(struct bpf_in */ void bpf_destroy_jit_filter(bpf_jit_filter *filter); +/* + * Declarations for machine-dependent functions. + */ +struct bpf_insn; + +bpf_filter_func bpf_jit_compile(struct bpf_insn *, u_int, size_t *); + #endif /* _NET_BPF_JITTER_H_ */ From owner-svn-src-head@freebsd.org Mon Apr 17 21:57:24 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BFC87D425B1; Mon, 17 Apr 2017 21:57:24 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8F5F2692; Mon, 17 Apr 2017 21:57:24 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3HLvNFI030589; Mon, 17 Apr 2017 21:57:23 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3HLvNIL030588; Mon, 17 Apr 2017 21:57:23 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201704172157.v3HLvNIL030588@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Mon, 17 Apr 2017 21:57:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317071 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 17 Apr 2017 21:57:24 -0000 Author: jkim Date: Mon Apr 17 21:57:23 2017 New Revision: 317071 URL: https://svnweb.freebsd.org/changeset/base/317071 Log: Remove an unnecessary declaration missed in the previous commit. Modified: head/sys/net/bpf_jitter.c Modified: head/sys/net/bpf_jitter.c ============================================================================== --- head/sys/net/bpf_jitter.c Mon Apr 17 21:51:26 2017 (r317070) +++ head/sys/net/bpf_jitter.c Mon Apr 17 21:57:23 2017 (r317071) @@ -50,8 +50,6 @@ __FBSDID("$FreeBSD$"); #include #include -bpf_filter_func bpf_jit_compile(struct bpf_insn *, u_int, size_t *); - static u_int bpf_jit_accept_all(u_char *, u_int, u_int); #ifdef _KERNEL From owner-svn-src-head@freebsd.org Mon Apr 17 22:02:11 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 09E74D42794; Mon, 17 Apr 2017 22:02:11 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D56FBAD2; Mon, 17 Apr 2017 22:02:10 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3HM2AoF034520; Mon, 17 Apr 2017 22:02:10 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3HM29oU034516; Mon, 17 Apr 2017 22:02:09 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201704172202.v3HM29oU034516@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Mon, 17 Apr 2017 22:02:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317072 - in head/sys: amd64/amd64 i386/i386 net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 17 Apr 2017 22:02:11 -0000 Author: jkim Date: Mon Apr 17 22:02:09 2017 New Revision: 317072 URL: https://svnweb.freebsd.org/changeset/base/317072 Log: Use kmem_malloc() instead of malloc(9) for the native amd64 filter. r316767 broke the BPF JIT compiler for amd64 because malloc()'d space is no longer executable. Discussed with: kib, alc Modified: head/sys/amd64/amd64/bpf_jit_machdep.c head/sys/i386/i386/bpf_jit_machdep.c head/sys/net/bpf_jitter.c head/sys/net/bpf_jitter.h Modified: head/sys/amd64/amd64/bpf_jit_machdep.c ============================================================================== --- head/sys/amd64/amd64/bpf_jit_machdep.c Mon Apr 17 21:57:23 2017 (r317071) +++ head/sys/amd64/amd64/bpf_jit_machdep.c Mon Apr 17 22:02:09 2017 (r317072) @@ -1,6 +1,6 @@ /*- * Copyright (C) 2002-2003 NetGroup, Politecnico di Torino (Italy) - * Copyright (C) 2005-2016 Jung-uk Kim + * Copyright (C) 2005-2017 Jung-uk Kim * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -37,10 +37,14 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include +#include + #include +#include +#include +#include #else #include #include @@ -599,7 +603,11 @@ bpf_jit_compile(struct bpf_insn *prog, u *size = stream.cur_ip; #ifdef _KERNEL - stream.ibuf = malloc(*size, M_BPFJIT, M_NOWAIT); + /* + * We cannot use malloc(9) because DMAP is mapped as NX. + */ + stream.ibuf = (void *)kmem_malloc(kernel_arena, *size, + M_NOWAIT); if (stream.ibuf == NULL) break; #else @@ -648,3 +656,14 @@ bpf_jit_compile(struct bpf_insn *prog, u return ((bpf_filter_func)(void *)stream.ibuf); } + +void +bpf_jit_free(void *func, size_t size) +{ + +#ifdef _KERNEL + kmem_free(kernel_arena, (vm_offset_t)func, size); +#else + munmap(func, size); +#endif +} Modified: head/sys/i386/i386/bpf_jit_machdep.c ============================================================================== --- head/sys/i386/i386/bpf_jit_machdep.c Mon Apr 17 21:57:23 2017 (r317071) +++ head/sys/i386/i386/bpf_jit_machdep.c Mon Apr 17 22:02:09 2017 (r317072) @@ -1,6 +1,6 @@ /*- * Copyright (C) 2002-2003 NetGroup, Politecnico di Torino (Italy) - * Copyright (C) 2005-2016 Jung-uk Kim + * Copyright (C) 2005-2017 Jung-uk Kim * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -37,9 +37,10 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include +#include + #include #else #include @@ -678,3 +679,14 @@ bpf_jit_compile(struct bpf_insn *prog, u return ((bpf_filter_func)(void *)stream.ibuf); } + +void +bpf_jit_free(void *func, size_t size) +{ + +#ifdef _KERNEL + free(func, M_BPFJIT); +#else + munmap(func, size); +#endif +} Modified: head/sys/net/bpf_jitter.c ============================================================================== --- head/sys/net/bpf_jitter.c Mon Apr 17 21:57:23 2017 (r317071) +++ head/sys/net/bpf_jitter.c Mon Apr 17 22:02:09 2017 (r317072) @@ -1,6 +1,6 @@ /*- * Copyright (C) 2002-2003 NetGroup, Politecnico di Torino (Italy) - * Copyright (C) 2005-2009 Jung-uk Kim + * Copyright (C) 2005-2017 Jung-uk Kim * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -99,13 +99,11 @@ void bpf_destroy_jit_filter(bpf_jit_filter *filter) { -#ifdef _KERNEL if (filter->func != bpf_jit_accept_all) - free(filter->func, M_BPFJIT); + bpf_jit_free(filter->func, filter->size); +#ifdef _KERNEL free(filter, M_BPFJIT); #else - if (filter->func != bpf_jit_accept_all) - munmap(filter->func, filter->size); free(filter); #endif } Modified: head/sys/net/bpf_jitter.h ============================================================================== --- head/sys/net/bpf_jitter.h Mon Apr 17 21:57:23 2017 (r317071) +++ head/sys/net/bpf_jitter.h Mon Apr 17 22:02:09 2017 (r317072) @@ -86,5 +86,6 @@ void bpf_destroy_jit_filter(bpf_jit_fil struct bpf_insn; bpf_filter_func bpf_jit_compile(struct bpf_insn *, u_int, size_t *); +void bpf_jit_free(void *, size_t); #endif /* _NET_BPF_JITTER_H_ */ From owner-svn-src-head@freebsd.org Mon Apr 17 23:56:51 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B7B38D4233F; Mon, 17 Apr 2017 23:56:51 +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 mx1.freebsd.org (Postfix) with ESMTPS id 573F61C30; Mon, 17 Apr 2017 23:56:51 +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 v3HNuoHA079311; Mon, 17 Apr 2017 23:56:50 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3HNumwh079291; Mon, 17 Apr 2017 23:56:48 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201704172356.v3HNumwh079291@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 17 Apr 2017 23:56:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317075 - in head/contrib/elftoolchain: addr2line ar common cxxfilt elfcopy elfdump libdwarf libelf libelftc nm readelf strings X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 17 Apr 2017 23:56:51 -0000 Author: emaste Date: Mon Apr 17 23:56:48 2017 New Revision: 317075 URL: https://svnweb.freebsd.org/changeset/base/317075 Log: Update ELF Tool Chain to upstream r3520 Highlights of changes between r3490 and r3520: - Improve C++ demangling - Improve compatibility with Binutils tools wrt. error messages - Handle additional types/sections/etc. in readelf and elfdump - addr2line, cxxfilt: use setvbuf to set line buffering for filter use PR: 218395 MFC after: 2 weeks Relnotes: Yes Sponsored by: The FreeBSD Foundation Added: head/contrib/elftoolchain/ar/os.FreeBSD.mk - copied unchanged from r317073, vendor/elftoolchain/dist/ar/os.FreeBSD.mk head/contrib/elftoolchain/elfcopy/os.FreeBSD.mk - copied unchanged from r317073, vendor/elftoolchain/dist/elfcopy/os.FreeBSD.mk Modified: head/contrib/elftoolchain/addr2line/addr2line.c head/contrib/elftoolchain/common/elfdefinitions.h head/contrib/elftoolchain/cxxfilt/cxxfilt.c head/contrib/elftoolchain/elfcopy/main.c head/contrib/elftoolchain/elfcopy/pe.c head/contrib/elftoolchain/elfcopy/symbols.c head/contrib/elftoolchain/elfdump/elfdump.c head/contrib/elftoolchain/libdwarf/dwarf.h head/contrib/elftoolchain/libdwarf/dwarf_attrval.c head/contrib/elftoolchain/libdwarf/dwarf_attrval_signed.3 head/contrib/elftoolchain/libdwarf/dwarf_dump.c head/contrib/elftoolchain/libelf/gelf_newehdr.3 head/contrib/elftoolchain/libelf/gelf_newphdr.3 head/contrib/elftoolchain/libelftc/elftc_bfd_find_target.3 head/contrib/elftoolchain/libelftc/libelftc_bfdtarget.c head/contrib/elftoolchain/libelftc/libelftc_dem_arm.c head/contrib/elftoolchain/libelftc/libelftc_dem_gnu2.c head/contrib/elftoolchain/libelftc/libelftc_dem_gnu3.c head/contrib/elftoolchain/nm/nm.c head/contrib/elftoolchain/readelf/readelf.c head/contrib/elftoolchain/strings/strings.c Directory Properties: head/contrib/elftoolchain/ (props changed) head/contrib/elftoolchain/ar/ (props changed) head/contrib/elftoolchain/elfdump/ (props changed) Modified: head/contrib/elftoolchain/addr2line/addr2line.c ============================================================================== --- head/contrib/elftoolchain/addr2line/addr2line.c Mon Apr 17 23:30:21 2017 (r317074) +++ head/contrib/elftoolchain/addr2line/addr2line.c Mon Apr 17 23:56:48 2017 (r317075) @@ -40,7 +40,7 @@ #include "uthash.h" #include "_elftc.h" -ELFTC_VCSID("$Id: addr2line.c 3446 2016-05-03 01:31:17Z emaste $"); +ELFTC_VCSID("$Id: addr2line.c 3499 2016-11-25 16:06:29Z emaste $"); struct Func { char *name; @@ -720,11 +720,11 @@ main(int argc, char **argv) if (argc > 0) for (i = 0; i < argc; i++) translate(dbg, e, argv[i]); - else - while (fgets(line, sizeof(line), stdin) != NULL) { + else { + setvbuf(stdout, NULL, _IOLBF, 0); + while (fgets(line, sizeof(line), stdin) != NULL) translate(dbg, e, line); - fflush(stdout); - } + } dwarf_finish(dbg, &de); Copied: head/contrib/elftoolchain/ar/os.FreeBSD.mk (from r317073, vendor/elftoolchain/dist/ar/os.FreeBSD.mk) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/elftoolchain/ar/os.FreeBSD.mk Mon Apr 17 23:56:48 2017 (r317075, copy of r317073, vendor/elftoolchain/dist/ar/os.FreeBSD.mk) @@ -0,0 +1,2 @@ +DPADD+= ${LIBBZ2} +LDADD+= -lbz2 Modified: head/contrib/elftoolchain/common/elfdefinitions.h ============================================================================== --- head/contrib/elftoolchain/common/elfdefinitions.h Mon Apr 17 23:30:21 2017 (r317074) +++ head/contrib/elftoolchain/common/elfdefinitions.h Mon Apr 17 23:56:48 2017 (r317075) @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: elfdefinitions.h 3485 2016-08-18 13:38:52Z emaste $ + * $Id: elfdefinitions.h 3515 2017-01-24 22:04:22Z emaste $ */ /* @@ -153,6 +153,8 @@ _ELF_DEFINE_DT(DT_SUNW_FILTER, 0x60 "offset of string naming standard filtees") \ _ELF_DEFINE_DT(DT_SUNW_CAP, 0x60000010UL, \ "address of hardware capabilities section") \ +_ELF_DEFINE_DT(DT_SUNW_ASLR, 0x60000023UL, \ + "Address Space Layout Randomization flag") \ _ELF_DEFINE_DT(DT_HIOS, 0x6FFFF000UL, \ "end of OS-specific types") \ _ELF_DEFINE_DT(DT_VALRNGLO, 0x6FFFFD00UL, \ @@ -919,6 +921,12 @@ _ELF_DEFINE_PT(PT_GNU_STACK, 0x6474E "Stack flags") \ _ELF_DEFINE_PT(PT_GNU_RELRO, 0x6474E552UL, \ "Segment becomes read-only after relocation") \ +_ELF_DEFINE_PT(PT_OPENBSD_RANDOMIZE,0x65A3DBE6UL, \ + "Segment filled with random data") \ +_ELF_DEFINE_PT(PT_OPENBSD_WXNEEDED, 0x65A3DBE7UL, \ + "Program violates W^X") \ +_ELF_DEFINE_PT(PT_OPENBSD_BOOTDATA, 0x65A41BE6UL, \ + "Boot data") \ _ELF_DEFINE_PT(PT_SUNWBSS, 0x6FFFFFFAUL, \ "A Solaris .SUNW_bss section") \ _ELF_DEFINE_PT(PT_SUNWSTACK, 0x6FFFFFFBUL, \ Modified: head/contrib/elftoolchain/cxxfilt/cxxfilt.c ============================================================================== --- head/contrib/elftoolchain/cxxfilt/cxxfilt.c Mon Apr 17 23:30:21 2017 (r317074) +++ head/contrib/elftoolchain/cxxfilt/cxxfilt.c Mon Apr 17 23:56:48 2017 (r317075) @@ -35,7 +35,7 @@ #include "_elftc.h" -ELFTC_VCSID("$Id: cxxfilt.c 3454 2016-05-07 17:11:05Z kaiwang27 $"); +ELFTC_VCSID("$Id: cxxfilt.c 3499 2016-11-25 16:06:29Z emaste $"); #define STRBUFSZ 8192 @@ -175,6 +175,7 @@ main(int argc, char **argv) } else { p = 0; for (;;) { + setvbuf(stdout, NULL, _IOLBF, 0); c = fgetc(stdin); if (c == EOF || !(isalnum(c) || strchr(".$_", c))) { if (p > 0) { Modified: head/contrib/elftoolchain/elfcopy/main.c ============================================================================== --- head/contrib/elftoolchain/elfcopy/main.c Mon Apr 17 23:30:21 2017 (r317074) +++ head/contrib/elftoolchain/elfcopy/main.c Mon Apr 17 23:56:48 2017 (r317075) @@ -39,7 +39,7 @@ #include "elfcopy.h" -ELFTC_VCSID("$Id: main.c 3446 2016-05-03 01:31:17Z emaste $"); +ELFTC_VCSID("$Id: main.c 3520 2017-04-17 01:47:52Z kaiwang27 $"); enum options { @@ -285,6 +285,7 @@ create_elf(struct elfcopy *ecp) size_t ishnum; ecp->flags |= SYMTAB_INTACT; + ecp->flags &= ~SYMTAB_EXIST; /* Create EHDR. */ if (gelf_getehdr(ecp->ein, &ieh) == NULL) @@ -499,6 +500,10 @@ free_elf(struct elfcopy *ecp) } } + ecp->symtab = NULL; + ecp->strtab = NULL; + ecp->shstrtab = NULL; + if (ecp->secndx != NULL) { free(ecp->secndx); ecp->secndx = NULL; Copied: head/contrib/elftoolchain/elfcopy/os.FreeBSD.mk (from r317073, vendor/elftoolchain/dist/elfcopy/os.FreeBSD.mk) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/elftoolchain/elfcopy/os.FreeBSD.mk Mon Apr 17 23:56:48 2017 (r317075, copy of r317073, vendor/elftoolchain/dist/elfcopy/os.FreeBSD.mk) @@ -0,0 +1,4 @@ +.if !defined(LIBELF_AR) +DPADD+= ${LIBBZ2} +LDADD+= -lbz2 +.endif Modified: head/contrib/elftoolchain/elfcopy/pe.c ============================================================================== --- head/contrib/elftoolchain/elfcopy/pe.c Mon Apr 17 23:30:21 2017 (r317074) +++ head/contrib/elftoolchain/elfcopy/pe.c Mon Apr 17 23:56:48 2017 (r317075) @@ -34,7 +34,7 @@ #include "elfcopy.h" -ELFTC_VCSID("$Id: pe.c 3490 2016-08-31 00:12:22Z emaste $"); +ELFTC_VCSID("$Id: pe.c 3508 2016-12-27 06:19:39Z kaiwang27 $"); /* Convert ELF object to Portable Executable (PE). */ void Modified: head/contrib/elftoolchain/elfcopy/symbols.c ============================================================================== --- head/contrib/elftoolchain/elfcopy/symbols.c Mon Apr 17 23:30:21 2017 (r317074) +++ head/contrib/elftoolchain/elfcopy/symbols.c Mon Apr 17 23:56:48 2017 (r317075) @@ -34,7 +34,7 @@ #include "elfcopy.h" -ELFTC_VCSID("$Id: symbols.c 3446 2016-05-03 01:31:17Z emaste $"); +ELFTC_VCSID("$Id: symbols.c 3520 2017-04-17 01:47:52Z kaiwang27 $"); /* Backwards compatibility for systems with older ELF definitions. */ #ifndef STB_GNU_UNIQUE @@ -676,6 +676,8 @@ create_symtab(struct elfcopy *ecp) sy = ecp->symtab; st = ecp->strtab; + assert(sy != NULL && st != NULL); + /* * Set section index map for .symtab and .strtab. We need to set * these map because otherwise symbols which refer to .symtab and Modified: head/contrib/elftoolchain/elfdump/elfdump.c ============================================================================== --- head/contrib/elftoolchain/elfdump/elfdump.c Mon Apr 17 23:30:21 2017 (r317074) +++ head/contrib/elftoolchain/elfdump/elfdump.c Mon Apr 17 23:56:48 2017 (r317075) @@ -50,7 +50,7 @@ #include "_elftc.h" -ELFTC_VCSID("$Id: elfdump.c 3482 2016-08-02 18:47:00Z emaste $"); +ELFTC_VCSID("$Id: elfdump.c 3497 2016-10-17 20:57:22Z emaste $"); #if defined(ELFTC_NEED_ELF_NOTE_DEFINITION) #include "native-elf-format.h" @@ -223,9 +223,9 @@ d_tags(uint64_t tag) case 0x6ffffff0: return "DT_GNU_VERSYM"; /* 0x70000000 - 0x7fffffff processor-specific semantics */ case 0x70000000: return "DT_IA_64_PLT_RESERVE"; - case 0x7ffffffd: return "DT_SUNW_AUXILIARY"; - case 0x7ffffffe: return "DT_SUNW_USED"; - case 0x7fffffff: return "DT_SUNW_FILTER"; + case DT_AUXILIARY: return "DT_AUXILIARY"; + case DT_USED: return "DT_USED"; + case DT_FILTER: return "DT_FILTER"; } snprintf(unknown_buf, sizeof(unknown_buf), Modified: head/contrib/elftoolchain/libdwarf/dwarf.h ============================================================================== --- head/contrib/elftoolchain/libdwarf/dwarf.h Mon Apr 17 23:30:21 2017 (r317074) +++ head/contrib/elftoolchain/libdwarf/dwarf.h Mon Apr 17 23:56:48 2017 (r317075) @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: dwarf.h 3052 2014-05-26 20:36:24Z kaiwang27 $ + * $Id: dwarf.h 3494 2016-09-20 17:16:13Z emaste $ */ #ifndef _DWARF_H_ @@ -208,6 +208,25 @@ #define DW_AT_lo_user 0x2000 #define DW_AT_hi_user 0x3fff +/* SGI/MIPS extensions. */ +#define DW_AT_MIPS_fde 0x2001 +#define DW_AT_MIPS_loop_begin 0x2002 +#define DW_AT_MIPS_tail_loop_begin 0x2003 +#define DW_AT_MIPS_epilog_begin 0x2004 +#define DW_AT_MIPS_loop_unroll_factor 0x2005 +#define DW_AT_MIPS_software_pipeline_depth 0x2006 +#define DW_AT_MIPS_linkage_name 0x2007 +#define DW_AT_MIPS_stride 0x2008 +#define DW_AT_MIPS_abstract_name 0x2009 +#define DW_AT_MIPS_clone_origin 0x200a +#define DW_AT_MIPS_has_inlines 0x200b +#define DW_AT_MIPS_stride_byte 0x200c +#define DW_AT_MIPS_stride_elem 0x200d +#define DW_AT_MIPS_ptr_dopetype 0x200e +#define DW_AT_MIPS_allocatable_dopetype 0x200f +#define DW_AT_MIPS_assumed_shape_dopetype 0x2010 +#define DW_AT_MIPS_assumed_size 0x2011 + /* GNU extensions. */ #define DW_AT_sf_names 0x2101 #define DW_AT_src_info 0x2102 @@ -505,6 +524,7 @@ #define DW_LANG_UPC 0x0012 #define DW_LANG_D 0x0013 #define DW_LANG_lo_user 0x8000 +#define DW_LANG_Mips_Assembler 0x8001 #define DW_LANG_hi_user 0xffff #define DW_ID_case_sensitive 0x00 Modified: head/contrib/elftoolchain/libdwarf/dwarf_attrval.c ============================================================================== --- head/contrib/elftoolchain/libdwarf/dwarf_attrval.c Mon Apr 17 23:30:21 2017 (r317074) +++ head/contrib/elftoolchain/libdwarf/dwarf_attrval.c Mon Apr 17 23:56:48 2017 (r317075) @@ -26,7 +26,7 @@ #include "_libdwarf.h" -ELFTC_VCSID("$Id: dwarf_attrval.c 3159 2015-02-15 21:43:27Z emaste $"); +ELFTC_VCSID("$Id: dwarf_attrval.c 3509 2016-12-29 03:58:41Z emaste $"); int dwarf_attrval_flag(Dwarf_Die die, Dwarf_Half attr, Dwarf_Bool *valp, Dwarf_Error *err) Modified: head/contrib/elftoolchain/libdwarf/dwarf_attrval_signed.3 ============================================================================== --- head/contrib/elftoolchain/libdwarf/dwarf_attrval_signed.3 Mon Apr 17 23:30:21 2017 (r317074) +++ head/contrib/elftoolchain/libdwarf/dwarf_attrval_signed.3 Mon Apr 17 23:56:48 2017 (r317075) @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_attrval_signed.3 2980 2014-01-21 20:15:54Z kaiwang27 $ +.\" $Id: dwarf_attrval_signed.3 3509 2016-12-29 03:58:41Z emaste $ .\" .Dd December 26, 2016 .Os Modified: head/contrib/elftoolchain/libdwarf/dwarf_dump.c ============================================================================== --- head/contrib/elftoolchain/libdwarf/dwarf_dump.c Mon Apr 17 23:30:21 2017 (r317074) +++ head/contrib/elftoolchain/libdwarf/dwarf_dump.c Mon Apr 17 23:56:48 2017 (r317075) @@ -27,7 +27,7 @@ #include "_libdwarf.h" -ELFTC_VCSID("$Id: dwarf_dump.c 3052 2014-05-26 20:36:24Z kaiwang27 $"); +ELFTC_VCSID("$Id: dwarf_dump.c 3494 2016-09-20 17:16:13Z emaste $"); int dwarf_get_ACCESS_name(unsigned access, const char **s) @@ -262,6 +262,40 @@ dwarf_get_AT_name(unsigned attr, const c *s = "DW_AT_body_begin"; break; case DW_AT_body_end: *s = "DW_AT_body_end"; break; + case DW_AT_MIPS_fde: + *s = "DW_AT_MIPS_fde"; break; + case DW_AT_MIPS_loop_begin: + *s = "DW_AT_MIPS_loop_begin"; break; + case DW_AT_MIPS_tail_loop_begin: + *s = "DW_AT_MIPS_tail_loop_begin"; break; + case DW_AT_MIPS_epilog_begin: + *s = "DW_AT_MIPS_epilog_begin"; break; + case DW_AT_MIPS_loop_unroll_factor: + *s = "DW_AT_MIPS_loop_unroll_factor"; break; + case DW_AT_MIPS_software_pipeline_depth: + *s = "DW_AT_MIPS_software_pipeline_depth"; break; + case DW_AT_MIPS_linkage_name: + *s = "DW_AT_MIPS_linkage_name"; break; + case DW_AT_MIPS_stride: + *s = "DW_AT_MIPS_stride"; break; + case DW_AT_MIPS_abstract_name: + *s = "DW_AT_MIPS_abstract_name"; break; + case DW_AT_MIPS_clone_origin: + *s = "DW_AT_MIPS_clone_origin"; break; + case DW_AT_MIPS_has_inlines: + *s = "DW_AT_MIPS_has_inlines"; break; + case DW_AT_MIPS_stride_byte: + *s = "DW_AT_MIPS_stride_byte"; break; + case DW_AT_MIPS_stride_elem: + *s = "DW_AT_MIPS_stride_elem"; break; + case DW_AT_MIPS_ptr_dopetype: + *s = "DW_AT_MIPS_ptr_dopetype"; break; + case DW_AT_MIPS_allocatable_dopetype: + *s = "DW_AT_MIPS_allocatable_dopetype"; break; + case DW_AT_MIPS_assumed_shape_dopetype: + *s = "DW_AT_MIPS_assumed_shape_dopetype"; break; + case DW_AT_MIPS_assumed_size: + *s = "DW_AT_MIPS_assumed_size"; break; case DW_AT_GNU_vector: *s = "DW_AT_GNU_vector"; break; case DW_AT_GNU_guarded_by: @@ -756,6 +790,8 @@ dwarf_get_LANG_name(unsigned lang, const *s = "DW_LANG_D"; break; case DW_LANG_lo_user: *s = "DW_LANG_lo_user"; break; + case DW_LANG_Mips_Assembler: + *s = "DW_LANG_Mips_Assembler"; break; case DW_LANG_hi_user: *s = "DW_LANG_hi_user"; break; default: Modified: head/contrib/elftoolchain/libelf/gelf_newehdr.3 ============================================================================== --- head/contrib/elftoolchain/libelf/gelf_newehdr.3 Mon Apr 17 23:30:21 2017 (r317074) +++ head/contrib/elftoolchain/libelf/gelf_newehdr.3 Mon Apr 17 23:56:48 2017 (r317075) @@ -21,7 +21,7 @@ .\" out of the use of this software, even if advised of the possibility of .\" such damage. .\" -.\" $Id: gelf_newehdr.3 189 2008-07-20 10:38:08Z jkoshy $ +.\" $Id: gelf_newehdr.3 3500 2016-12-04 11:08:44Z jkoshy $ .\" .Dd October 22, 2007 .Os @@ -127,6 +127,15 @@ flag on ELF descriptor .Sh RETURN VALUES These functions return a pointer to a translated header descriptor if successful, or NULL on failure. +.Sh COMPATIBILITY +The +.Fn gelf_newehdr +function uses a type of +.Ft "void *" +for its returned value. +This differs from some other implementations of the ELF(3) API, which use an +.Ft "unsigned long" +return type. .Sh ERRORS These functions can fail with the following errors: .Bl -tag -width "[ELF_E_RESOURCE]" Modified: head/contrib/elftoolchain/libelf/gelf_newphdr.3 ============================================================================== --- head/contrib/elftoolchain/libelf/gelf_newphdr.3 Mon Apr 17 23:30:21 2017 (r317074) +++ head/contrib/elftoolchain/libelf/gelf_newphdr.3 Mon Apr 17 23:56:48 2017 (r317075) @@ -21,7 +21,7 @@ .\" out of the use of this software, even if advised of the possibility of .\" such damage. .\" -.\" $Id: gelf_newphdr.3 189 2008-07-20 10:38:08Z jkoshy $ +.\" $Id: gelf_newphdr.3 3500 2016-12-04 11:08:44Z jkoshy $ .\" .Dd October 22, 2007 .Os @@ -97,6 +97,15 @@ will no longer be valid. .Sh RETURN VALUES The functions a valid pointer if successful, or NULL in case an error was encountered. +.Sh COMPATIBILITY +The +.Fn gelf_newphdr +function uses a type of +.Ft "void *" +for its returned value. +This differs from some other implementations of the ELF(3) API, which use an +.Ft "unsigned long" +return type. .Sh ERRORS These functions may fail with the following errors: .Bl -tag -width "[ELF_E_RESOURCE]" Modified: head/contrib/elftoolchain/libelftc/elftc_bfd_find_target.3 ============================================================================== --- head/contrib/elftoolchain/libelftc/elftc_bfd_find_target.3 Mon Apr 17 23:30:21 2017 (r317074) +++ head/contrib/elftoolchain/libelftc/elftc_bfd_find_target.3 Mon Apr 17 23:56:48 2017 (r317075) @@ -21,7 +21,7 @@ .\" out of the use of this software, even if advised of the possibility of .\" such damage. .\" -.\" $Id: elftc_bfd_find_target.3 3488 2016-08-24 18:15:57Z emaste $ +.\" $Id: elftc_bfd_find_target.3 3516 2017-02-10 02:33:08Z emaste $ .\" .Dd November 30, 2011 .Os @@ -74,6 +74,7 @@ Known descriptor names and their propert .It Li elf32-littlearm Ta ELF Ta LSB Ta 32 .It Li elf32-littlemips Ta ELF Ta LSB Ta 32 .It Li elf32-powerpc Ta ELF Ta MSB Ta 32 +.It Li elf32-powerpc-freebsd Ta ELF Ta MSB Ta 32 .It Li elf32-powerpcle Ta ELF Ta LSB Ta 32 .It Li elf32-sh Ta ELF Ta MSB Ta 32 .It Li elf32-shl Ta ELF Ta LSB Ta 32 @@ -94,6 +95,7 @@ Known descriptor names and their propert .It Li elf64-littleaarch64 Ta ELF Ta LSB Ta 64 .It Li elf64-littlemips Ta ELF Ta LSB Ta 64 .It Li elf64-powerpc Ta ELF Ta MSB Ta 64 +.It Li elf64-powerpc-freebsd Ta ELF Ta MSB Ta 64 .It Li elf64-powerpcle Ta ELF Ta LSB Ta 64 .It Li elf64-sh64 Ta ELF Ta MSB Ta 64 .It Li elf64-sh64l Ta ELF Ta LSB Ta 64 Modified: head/contrib/elftoolchain/libelftc/libelftc_bfdtarget.c ============================================================================== --- head/contrib/elftoolchain/libelftc/libelftc_bfdtarget.c Mon Apr 17 23:30:21 2017 (r317074) +++ head/contrib/elftoolchain/libelftc/libelftc_bfdtarget.c Mon Apr 17 23:56:48 2017 (r317075) @@ -30,7 +30,7 @@ #include "_libelftc.h" -ELFTC_VCSID("$Id: libelftc_bfdtarget.c 3488 2016-08-24 18:15:57Z emaste $"); +ELFTC_VCSID("$Id: libelftc_bfdtarget.c 3516 2017-02-10 02:33:08Z emaste $"); struct _Elftc_Bfd_Target _libelftc_targets[] = { Modified: head/contrib/elftoolchain/libelftc/libelftc_dem_arm.c ============================================================================== --- head/contrib/elftoolchain/libelftc/libelftc_dem_arm.c Mon Apr 17 23:30:21 2017 (r317074) +++ head/contrib/elftoolchain/libelftc/libelftc_dem_arm.c Mon Apr 17 23:56:48 2017 (r317075) @@ -37,7 +37,7 @@ #include "_libelftc.h" -ELFTC_VCSID("$Id: libelftc_dem_arm.c 3447 2016-05-03 13:32:23Z emaste $"); +ELFTC_VCSID("$Id: libelftc_dem_arm.c 3513 2016-12-29 07:04:22Z kaiwang27 $"); /** * @file cpp_demangle_arm.c @@ -68,6 +68,7 @@ struct demangle_data { }; #define SIMPLE_HASH(x,y) (64 * x + y) +#define VEC_PUSH_STR(d,s) vector_str_push((d), (s), strlen((s))) #define CPP_DEMANGLE_ARM_TRY 128 static void dest_cstring(struct cstring *); @@ -137,7 +138,7 @@ cpp_demangle_ARM(const char *org) ++d.p; /* start argument types */ - if (vector_str_push(&d.vec, "(", 1) == false) + if (VEC_PUSH_STR(&d.vec, "(") == false) goto clean; for (;;) { @@ -169,21 +170,21 @@ cpp_demangle_ARM(const char *org) goto clean; if (d.ptr == true) { - if (vector_str_push(&d.vec, "*", 1) == false) + if (VEC_PUSH_STR(&d.vec, "*") == false) goto clean; d.ptr = false; } if (d.ref == true) { - if (vector_str_push(&d.vec, "&", 1) == false) + if (VEC_PUSH_STR(&d.vec, "&") == false) goto clean; d.ref = false; } if (d.cnst == true) { - if (vector_str_push(&d.vec, " const", 6) == false) + if (VEC_PUSH_STR(&d.vec, " const") == false) goto clean; d.cnst = false; @@ -210,7 +211,7 @@ cpp_demangle_ARM(const char *org) free(arg); - if (vector_str_push(&d.vec, ", ", 2) == false) + if (VEC_PUSH_STR(&d.vec, ", ") == false) goto clean; if (++try > CPP_DEMANGLE_ARM_TRY) @@ -218,7 +219,7 @@ cpp_demangle_ARM(const char *org) } /* end argument types */ - if (vector_str_push(&d.vec, ")", 1) == false) + if (VEC_PUSH_STR(&d.vec, ")") == false) goto clean; flat: @@ -323,11 +324,10 @@ push_CTDT(const char *s, size_t l, struc return (false); assert(v->size > 1); - if (vector_str_push(v, v->container[v->size - 2], - strlen(v->container[v->size - 2])) == false) + if (VEC_PUSH_STR(v, v->container[v->size - 2]) == false) return (false); - if (vector_str_push(v, "()", 2) == false) + if (VEC_PUSH_STR(v, "()") == false) return (false); return (true); @@ -429,7 +429,7 @@ read_func(struct demangle_data *d) if (read_class(d) == false) return (false); - if (vector_str_push(&d->vec, "::", 2) == false) + if (VEC_PUSH_STR(&d->vec, "::") == false) return (false); } @@ -486,7 +486,7 @@ read_func_name(struct demangle_data *d) if (read_qual_name(d) == false) goto clean; - if (vector_str_push(&d->vec, "::", 2) == false) + if (VEC_PUSH_STR(&d->vec, "::") == false) goto clean; if (vector_str_push(&d->vec, op_name, len) == false) @@ -508,7 +508,7 @@ read_func_name(struct demangle_data *d) if (read_class(d) == false) goto clean; - if (vector_str_push(&d->vec, "::", 2) == false) + if (VEC_PUSH_STR(&d->vec, "::") == false) goto clean; if (vector_str_push(&d->vec, op_name, len) == false) @@ -553,7 +553,7 @@ read_func_ptr(struct demangle_data *d) } if (fptr.ptr == true) { - if (vector_str_push(&fptr.vec, "*", 1) == false) { + if (VEC_PUSH_STR(&fptr.vec, "*") == false) { dest_demangle_data(&fptr); return (false); @@ -563,7 +563,7 @@ read_func_ptr(struct demangle_data *d) } if (fptr.ref == true) { - if (vector_str_push(&fptr.vec, "&", 1) == false) { + if (VEC_PUSH_STR(&fptr.vec, "&") == false) { dest_demangle_data(&fptr); return (false); @@ -573,7 +573,7 @@ read_func_ptr(struct demangle_data *d) } if (fptr.cnst == true) { - if (vector_str_push(&fptr.vec, " const", 6) == false) { + if (VEC_PUSH_STR(&fptr.vec, " const") == false) { dest_demangle_data(&fptr); return (false); @@ -585,7 +585,7 @@ read_func_ptr(struct demangle_data *d) if (*fptr.p == '_') break; - if (vector_str_push(&fptr.vec, ", ", 2) == false) { + if (VEC_PUSH_STR(&fptr.vec, ", ") == false) { dest_demangle_data(&fptr); return (false); @@ -636,7 +636,7 @@ read_func_ptr(struct demangle_data *d) free(rtn_type); - if (vector_str_push(&d->vec, " (*)(", 5) == false) { + if (VEC_PUSH_STR(&d->vec, " (*)(") == false) { free(arg_type); return (false); @@ -650,7 +650,7 @@ read_func_ptr(struct demangle_data *d) free(arg_type); - return (vector_str_push(&d->vec, ")", 1)); + return (VEC_PUSH_STR(&d->vec, ")")); } static bool @@ -689,7 +689,7 @@ read_memptr(struct demangle_data *d) if (vector_str_push(&d->vec, mptr_str, len) == false) goto clean; - if (vector_str_push(&d->vec, "::*", 3) == false) + if (VEC_PUSH_STR(&d->vec, "::*") == false) goto clean; rtn = true; @@ -712,108 +712,102 @@ read_op(struct demangle_data *d) switch (SIMPLE_HASH(*(d->p), *(d->p+1))) { case SIMPLE_HASH('m', 'l') : d->p += 2; - return (vector_str_push(&d->vec, "operator*", 9)); + return (VEC_PUSH_STR(&d->vec, "operator*")); case SIMPLE_HASH('d', 'v') : d->p += 2; - return (vector_str_push(&d->vec, "operator/", 9)); + return (VEC_PUSH_STR(&d->vec, "operator/")); case SIMPLE_HASH('m', 'd') : d->p += 2; - return (vector_str_push(&d->vec, "operator%", 9)); + return (VEC_PUSH_STR(&d->vec, "operator%")); case SIMPLE_HASH('p', 'l') : d->p += 2; - return (vector_str_push(&d->vec, "operator+", 9)); + return (VEC_PUSH_STR(&d->vec, "operator+")); case SIMPLE_HASH('m', 'i') : d->p += 2; - return (vector_str_push(&d->vec, "operator-", 9)); + return (VEC_PUSH_STR(&d->vec, "operator-")); case SIMPLE_HASH('l', 's') : d->p += 2; - return (vector_str_push(&d->vec, "operator<<", 10)); + return (VEC_PUSH_STR(&d->vec, "operator<<")); case SIMPLE_HASH('r', 's') : d->p += 2; - return (vector_str_push(&d->vec, "operator>>", 10)); + return (VEC_PUSH_STR(&d->vec, "operator>>")); case SIMPLE_HASH('e', 'q') : d->p += 2; - return (vector_str_push(&d->vec, "operator==", 10)); + return (VEC_PUSH_STR(&d->vec, "operator==")); case SIMPLE_HASH('n', 'e') : d->p += 2; - return (vector_str_push(&d->vec, "operator!=", 10)); + return (VEC_PUSH_STR(&d->vec, "operator!=")); case SIMPLE_HASH('l', 't') : d->p += 2; - return (vector_str_push(&d->vec, "operator<", 9)); + return (VEC_PUSH_STR(&d->vec, "operator<")); case SIMPLE_HASH('g', 't') : d->p += 2; - return (vector_str_push(&d->vec, "operator>", 9)); + return (VEC_PUSH_STR(&d->vec, "operator>")); case SIMPLE_HASH('l', 'e') : d->p += 2; - return (vector_str_push(&d->vec, "operator<=", 10)); + return (VEC_PUSH_STR(&d->vec, "operator<=")); case SIMPLE_HASH('g', 'e') : d->p += 2; - return (vector_str_push(&d->vec, "operator>=", 10)); + return (VEC_PUSH_STR(&d->vec, "operator>=")); case SIMPLE_HASH('a', 'd') : d->p += 2; if (*d->p == 'v') { ++d->p; - return (vector_str_push(&d->vec, "operator/=", - 10)); + return (VEC_PUSH_STR(&d->vec, "operator/=")); } else - return (vector_str_push(&d->vec, "operator&", 9)); + return (VEC_PUSH_STR(&d->vec, "operator&")); case SIMPLE_HASH('o', 'r') : d->p += 2; - return (vector_str_push(&d->vec, "operator|", 9)); + return (VEC_PUSH_STR(&d->vec, "operator|")); case SIMPLE_HASH('e', 'r') : d->p += 2; - return (vector_str_push(&d->vec, "operator^", 9)); + return (VEC_PUSH_STR(&d->vec, "operator^")); case SIMPLE_HASH('a', 'a') : d->p += 2; if (*d->p == 'd') { ++d->p; - return (vector_str_push(&d->vec, "operator&=", - 10)); + return (VEC_PUSH_STR(&d->vec, "operator&=")); } else - return (vector_str_push(&d->vec, "operator&&", - 10)); + return (VEC_PUSH_STR(&d->vec, "operator&&")); case SIMPLE_HASH('o', 'o') : d->p += 2; - return (vector_str_push(&d->vec, "operator||", 10)); + return (VEC_PUSH_STR(&d->vec, "operator||")); case SIMPLE_HASH('n', 't') : d->p += 2; - return (vector_str_push(&d->vec, "operator!", 9)); + return (VEC_PUSH_STR(&d->vec, "operator!")); case SIMPLE_HASH('c', 'o') : d->p += 2; - return (vector_str_push(&d->vec, "operator~", 9)); + return (VEC_PUSH_STR(&d->vec, "operator~")); case SIMPLE_HASH('p', 'p') : d->p += 2; - return (vector_str_push(&d->vec, "operator++", 10)); + return (VEC_PUSH_STR(&d->vec, "operator++")); case SIMPLE_HASH('m', 'm') : d->p += 2; - return (vector_str_push(&d->vec, "operator--", 10)); + return (VEC_PUSH_STR(&d->vec, "operator--")); case SIMPLE_HASH('a', 's') : d->p += 2; - return (vector_str_push(&d->vec, "operator=", 9)); + return (VEC_PUSH_STR(&d->vec, "operator=")); case SIMPLE_HASH('r', 'f') : d->p += 2; - return (vector_str_push(&d->vec, "operator->", 10)); + return (VEC_PUSH_STR(&d->vec, "operator->")); case SIMPLE_HASH('a', 'p') : /* apl */ if (*(d->p + 2) != 'l') return (false); d->p += 3; - return (vector_str_push(&d->vec, "operator+=", 10)); + return (VEC_PUSH_STR(&d->vec, "operator+=")); case SIMPLE_HASH('a', 'm') : d->p += 2; if (*d->p == 'i') { ++d->p; - return (vector_str_push(&d->vec, "operator-=", - 10)); + return (VEC_PUSH_STR(&d->vec, "operator-=")); } else if (*d->p == 'u') { ++d->p; - return (vector_str_push(&d->vec, "operator*=", - 10)); + return (VEC_PUSH_STR(&d->vec, "operator*=")); } else if (*d->p == 'd') { ++d->p; - return (vector_str_push(&d->vec, "operator%=", - 10)); + return (VEC_PUSH_STR(&d->vec, "operator%=")); } return (false); @@ -823,40 +817,40 @@ read_op(struct demangle_data *d) return (false); d->p += 3; - return (vector_str_push(&d->vec, "operator<<=", 11)); + return (VEC_PUSH_STR(&d->vec, "operator<<=")); case SIMPLE_HASH('a', 'r') : /* ars */ if (*(d->p + 2) != 's') return (false); d->p += 3; - return (vector_str_push(&d->vec, "operator>>=", 11)); + return (VEC_PUSH_STR(&d->vec, "operator>>=")); case SIMPLE_HASH('a', 'o') : /* aor */ if (*(d->p + 2) != 'r') return (false); d->p += 3; - return (vector_str_push(&d->vec, "operator|=", 10)); + return (VEC_PUSH_STR(&d->vec, "operator|=")); case SIMPLE_HASH('a', 'e') : /* aer */ if (*(d->p + 2) != 'r') return (false); d->p += 3; - return (vector_str_push(&d->vec, "operator^=", 10)); + return (VEC_PUSH_STR(&d->vec, "operator^=")); case SIMPLE_HASH('c', 'm') : d->p += 2; - return (vector_str_push(&d->vec, "operator,", 9)); + return (VEC_PUSH_STR(&d->vec, "operator,")); case SIMPLE_HASH('r', 'm') : d->p += 2; - return (vector_str_push(&d->vec, "operator->*", 11)); + return (VEC_PUSH_STR(&d->vec, "operator->*")); case SIMPLE_HASH('c', 'l') : d->p += 2; - return (vector_str_push(&d->vec, "()", 2)); + return (VEC_PUSH_STR(&d->vec, "()")); case SIMPLE_HASH('v', 'c') : d->p += 2; - return (vector_str_push(&d->vec, "[]", 2)); + return (VEC_PUSH_STR(&d->vec, "[]")); case SIMPLE_HASH('c', 't') : d->p += 4; d->type = ENCODE_OP_CT; @@ -883,11 +877,10 @@ read_op(struct demangle_data *d) return (false); case SIMPLE_HASH('n', 'w') : d->p += 2; - return (vector_str_push(&d->vec, "operator new()", 14)); + return (VEC_PUSH_STR(&d->vec, "operator new()")); case SIMPLE_HASH('d', 'l') : d->p += 2; - return (vector_str_push(&d->vec, "operator delete()", - 17)); + return (VEC_PUSH_STR(&d->vec, "operator delete()")); case SIMPLE_HASH('o', 'p') : /* __op__ */ d->p += 2; @@ -962,13 +955,13 @@ read_op_user(struct demangle_data *d) if (vector_str_push(&d->vec, from_str, from_len) == false) goto clean; - if (vector_str_push(&d->vec, "::operator ", 11) == false) + if (VEC_PUSH_STR(&d->vec, "::operator ") == false) return (false); if (vector_str_push(&d->vec, to_str, to_len) == false) goto clean; - rtn = vector_str_push(&d->vec, "()", 2); + rtn = VEC_PUSH_STR(&d->vec, "()"); clean: free(to_str); free(from_str); @@ -1000,7 +993,7 @@ read_qual_name(struct demangle_data *d) if (read_class(d) == false) return (false); - if (vector_str_push(&d->vec, "::", 2) == false) + if (VEC_PUSH_STR(&d->vec, "::") == false) return (false); } @@ -1029,12 +1022,10 @@ read_subst(struct demangle_data *d) d->p = str; - if (vector_str_push(&d->vec, d->arg.container[idx - 1], - strlen(d->arg.container[idx - 1])) == false) + if (VEC_PUSH_STR(&d->vec, d->arg.container[idx - 1]) == false) return (-1); - if (vector_str_push(&d->arg, d->arg.container[idx - 1], - strlen(d->arg.container[idx - 1])) == false) + if (VEC_PUSH_STR(&d->arg, d->arg.container[idx - 1]) == false) return (-1); if (*d->p == '\0') @@ -1073,16 +1064,14 @@ read_subst_iter(struct demangle_data *d) d->p = str; for (i = 0; i < repeat ; ++i) { - if (vector_str_push(&d->vec, d->arg.container[idx - 1], - strlen(d->arg.container[idx - 1])) == false) + if (VEC_PUSH_STR(&d->vec, d->arg.container[idx - 1]) == false) return (-1); - if (vector_str_push(&d->arg, d->arg.container[idx - 1], - strlen(d->arg.container[idx - 1])) == false) + if (VEC_PUSH_STR(&d->arg, d->arg.container[idx - 1]) == false) return (-1); if (i != repeat - 1 && - vector_str_push(&d->vec, ", ", 2) == false) + VEC_PUSH_STR(&d->vec, ", ") == false) return (-1); } @@ -1108,7 +1097,7 @@ read_type(struct demangle_data *d) case 'U' : ++d->p; - if (vector_str_push(&d->vec, "unsigned ", 9) == false) + if (VEC_PUSH_STR(&d->vec, "unsigned ") == false) return (false); break; @@ -1118,7 +1107,7 @@ read_type(struct demangle_data *d) if (*d->p == 'P') d->cnst = true; else { - if (vector_str_push(&d->vec, "const ", 6) == + if (VEC_PUSH_STR(&d->vec, "const ") == false) return (false); } @@ -1127,14 +1116,14 @@ read_type(struct demangle_data *d) case 'V' : ++d->p; - if (vector_str_push(&d->vec, "volatile ", 9) == false) + if (VEC_PUSH_STR(&d->vec, "volatile ") == false) return (false); break; case 'S' : ++d->p; - if (vector_str_push(&d->vec, "signed ", 7) == false) + if (VEC_PUSH_STR(&d->vec, "signed ") == false) return (false); break; @@ -1185,39 +1174,39 @@ read_type(struct demangle_data *d) case 'v' : ++d->p; - return (vector_str_push(&d->vec, "void", 4)); + return (VEC_PUSH_STR(&d->vec, "void")); case 'c' : ++d->p; - return (vector_str_push(&d->vec, "char", 4)); + return (VEC_PUSH_STR(&d->vec, "char")); case 's' : ++d->p; - return (vector_str_push(&d->vec, "short", 5)); + return (VEC_PUSH_STR(&d->vec, "short")); case 'i' : ++d->p; - return (vector_str_push(&d->vec, "int", 3)); + return (VEC_PUSH_STR(&d->vec, "int")); case 'l' : ++d->p; - return (vector_str_push(&d->vec, "long", 4)); + return (VEC_PUSH_STR(&d->vec, "long")); case 'f' : ++d->p; - return (vector_str_push(&d->vec, "float", 5)); + return (VEC_PUSH_STR(&d->vec, "float")); case 'd': ++d->p; - return (vector_str_push(&d->vec, "double", 6)); + return (VEC_PUSH_STR(&d->vec, "double")); case 'r': ++d->p; - return (vector_str_push(&d->vec, "long double", 11)); + return (VEC_PUSH_STR(&d->vec, "long double")); case 'e': ++d->p; - return (vector_str_push(&d->vec, "...", 3)); + return (VEC_PUSH_STR(&d->vec, "...")); default: return (false); }; Modified: head/contrib/elftoolchain/libelftc/libelftc_dem_gnu2.c ============================================================================== --- head/contrib/elftoolchain/libelftc/libelftc_dem_gnu2.c Mon Apr 17 23:30:21 2017 (r317074) +++ head/contrib/elftoolchain/libelftc/libelftc_dem_gnu2.c Mon Apr 17 23:56:48 2017 (r317075) @@ -37,7 +37,7 @@ #include "_libelftc.h" -ELFTC_VCSID("$Id: libelftc_dem_gnu2.c 3447 2016-05-03 13:32:23Z emaste $"); +ELFTC_VCSID("$Id: libelftc_dem_gnu2.c 3513 2016-12-29 07:04:22Z kaiwang27 $"); /** * @file cpp_demangle_gnu2.c @@ -66,6 +66,7 @@ struct demangle_data { }; #define SIMPLE_HASH(x,y) (64 * x + y) +#define VEC_PUSH_STR(d,s) vector_str_push((d), (s), strlen((s))) #define CPP_DEMANGLE_GNU2_TRY 128 static void dest_cstring(struct cstring *); @@ -126,7 +127,7 @@ cpp_demangle_gnu2(const char *org) if (push_CTDT("::~", 3, &d.vec) == false) goto clean; - if (vector_str_push(&d.vec, "(void)", 6) == false) + if (VEC_PUSH_STR(&d.vec, "(void)") == false) goto clean; goto flat; @@ -141,7 +142,7 @@ cpp_demangle_gnu2(const char *org) ++d.p; else if (*d.p == '\0') { if (d.class_name == true) { - if (vector_str_push(&d.vec, "(void)", 6) == false) + if (VEC_PUSH_STR(&d.vec, "(void)") == false) goto clean; goto flat; @@ -150,7 +151,7 @@ cpp_demangle_gnu2(const char *org) } /* start argument types */ - if (vector_str_push(&d.vec, "(", 1) == false) + if (VEC_PUSH_STR(&d.vec, "(") == false) goto clean; for (;;) { @@ -182,21 +183,21 @@ cpp_demangle_gnu2(const char *org) goto clean; if (d.ptr == true) { - if (vector_str_push(&d.vec, "*", 1) == false) + if (VEC_PUSH_STR(&d.vec, "*") == false) goto clean; d.ptr = false; } if (d.ref == true) { - if (vector_str_push(&d.vec, "&", 1) == false) + if (VEC_PUSH_STR(&d.vec, "&") == false) goto clean; d.ref = false; } if (d.cnst == true) { - if (vector_str_push(&d.vec, " const", 6) == false) + if (VEC_PUSH_STR(&d.vec, " const") == false) goto clean; d.cnst = false; @@ -223,7 +224,7 @@ cpp_demangle_gnu2(const char *org) free(arg); - if (vector_str_push(&d.vec, ", ", 2) == false) + if (VEC_PUSH_STR(&d.vec, ", ") == false) goto clean; if (++try > CPP_DEMANGLE_GNU2_TRY) @@ -231,10 +232,10 @@ cpp_demangle_gnu2(const char *org) } *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Mon Apr 17 23:57:44 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 36337D425E7; Mon, 17 Apr 2017 23:57:44 +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 mx1.freebsd.org (Postfix) with ESMTPS id 069761D86; Mon, 17 Apr 2017 23:57:43 +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 v3HNvh7Y079399; Mon, 17 Apr 2017 23:57:43 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3HNvhrm079398; Mon, 17 Apr 2017 23:57:43 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201704172357.v3HNvhrm079398@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 17 Apr 2017 23:57:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317076 - head/lib/libelftc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 17 Apr 2017 23:57:44 -0000 Author: emaste Date: Mon Apr 17 23:57:42 2017 New Revision: 317076 URL: https://svnweb.freebsd.org/changeset/base/317076 Log: libelftc: bump version number for r317075 Modified: head/lib/libelftc/elftc_version.c Modified: head/lib/libelftc/elftc_version.c ============================================================================== --- head/lib/libelftc/elftc_version.c Mon Apr 17 23:56:48 2017 (r317075) +++ head/lib/libelftc/elftc_version.c Mon Apr 17 23:57:42 2017 (r317076) @@ -6,5 +6,5 @@ const char * elftc_version(void) { - return "elftoolchain r3490M"; + return "elftoolchain r3520M"; } From owner-svn-src-head@freebsd.org Tue Apr 18 03:40:38 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 224F6D432E8; Tue, 18 Apr 2017 03:40:38 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E6A966D2; Tue, 18 Apr 2017 03:40:37 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3I3ebDT069925; Tue, 18 Apr 2017 03:40:37 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3I3eb5L069924; Tue, 18 Apr 2017 03:40:37 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201704180340.v3I3eb5L069924@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Tue, 18 Apr 2017 03:40:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317077 - head/etc/rc.d X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 18 Apr 2017 03:40:38 -0000 Author: jhibbits Date: Tue Apr 18 03:40:36 2017 New Revision: 317077 URL: https://svnweb.freebsd.org/changeset/base/317077 Log: Add 32-bit caching to ldconfig script for powerpc64 Reported by: ian@ Modified: head/etc/rc.d/ldconfig Modified: head/etc/rc.d/ldconfig ============================================================================== --- head/etc/rc.d/ldconfig Mon Apr 17 23:57:42 2017 (r317076) +++ head/etc/rc.d/ldconfig Tue Apr 18 03:40:36 2017 (r317077) @@ -41,7 +41,7 @@ ldconfig_start() ${ldconfig} -elf ${_ins} ${_LDC} case `sysctl -n hw.machine_arch` in - amd64) + amd64|powerpc64) for i in ${ldconfig_local32_dirs}; do if [ -d "${i}" ]; then _files=`find ${i} -type f` From owner-svn-src-head@freebsd.org Tue Apr 18 06:58:05 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B5406D43E5E; Tue, 18 Apr 2017 06:58:05 +0000 (UTC) (envelope-from ganbold@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 85619844; Tue, 18 Apr 2017 06:58:05 +0000 (UTC) (envelope-from ganbold@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3I6w4F0050232; Tue, 18 Apr 2017 06:58:04 GMT (envelope-from ganbold@FreeBSD.org) Received: (from ganbold@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3I6w4Ak050231; Tue, 18 Apr 2017 06:58:04 GMT (envelope-from ganbold@FreeBSD.org) Message-Id: <201704180658.v3I6w4Ak050231@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ganbold set sender to ganbold@FreeBSD.org using -f From: Ganbold Tsagaankhuu Date: Tue, 18 Apr 2017 06:58:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317078 - head/sys/arm/allwinner X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 18 Apr 2017 06:58:05 -0000 Author: ganbold Date: Tue Apr 18 06:58:04 2017 New Revision: 317078 URL: https://svnweb.freebsd.org/changeset/base/317078 Log: Remove function declaration that doesn't exist. Modified: head/sys/arm/allwinner/a10_gpio.h Modified: head/sys/arm/allwinner/a10_gpio.h ============================================================================== --- head/sys/arm/allwinner/a10_gpio.h Tue Apr 18 03:40:36 2017 (r317077) +++ head/sys/arm/allwinner/a10_gpio.h Tue Apr 18 06:58:04 2017 (r317078) @@ -32,6 +32,4 @@ #define A10_GPIO_FUNC_MII 2 #define A10_GPIO_FUNC_RGMII 5 -int a10_gpio_ethernet_activate(uint32_t); - #endif From owner-svn-src-head@freebsd.org Tue Apr 18 07:02:13 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E130ED4305B; Tue, 18 Apr 2017 07:02: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 mx1.freebsd.org (Postfix) with ESMTPS id 938FFC65; Tue, 18 Apr 2017 07:02: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 v3I72CTo053932; Tue, 18 Apr 2017 07:02:12 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3I72CjH053930; Tue, 18 Apr 2017 07:02:12 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201704180702.v3I72CjH053930@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Tue, 18 Apr 2017 07:02:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317079 - head/contrib/llvm/lib/Target/X86 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 18 Apr 2017 07:02:14 -0000 Author: dim Date: Tue Apr 18 07:02:12 2017 New Revision: 317079 URL: https://svnweb.freebsd.org/changeset/base/317079 Log: Pull in r300429 from upstream llvm trunk (by Benjamin Kramer): [X86] Remove special handling for 16 bit for A asm constraints. Our 16 bit support is assembler-only + the terrible hack that is .code16gcc. Simply using 32 bit registers does the right thing for the latter. Fixes PR32681. This fixes some cases of assembling 16 bit code (i.e. SeaBIOS) that uses the 'A' inline asm constraint, after r316989. MFC after: 3 days X-MFC-With: r316989 Modified: head/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp head/contrib/llvm/lib/Target/X86/X86RegisterInfo.td Modified: head/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp ============================================================================== --- head/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp Tue Apr 18 06:58:04 2017 (r317078) +++ head/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp Tue Apr 18 07:02:12 2017 (r317079) @@ -34722,14 +34722,11 @@ X86TargetLowering::getRegForInlineAsmCon if (Subtarget.is64Bit()) { Res.first = X86::RAX; Res.second = &X86::GR64_ADRegClass; - } else if (Subtarget.is32Bit()) { + } else { + assert((Subtarget.is32Bit() || Subtarget.is16Bit()) && + "Expecting 64, 32 or 16 bit subtarget"); Res.first = X86::EAX; Res.second = &X86::GR32_ADRegClass; - } else if (Subtarget.is16Bit()) { - Res.first = X86::AX; - Res.second = &X86::GR16_ADRegClass; - } else { - llvm_unreachable("Expecting 64, 32 or 16 bit subtarget"); } return Res; } Modified: head/contrib/llvm/lib/Target/X86/X86RegisterInfo.td ============================================================================== --- head/contrib/llvm/lib/Target/X86/X86RegisterInfo.td Tue Apr 18 06:58:04 2017 (r317078) +++ head/contrib/llvm/lib/Target/X86/X86RegisterInfo.td Tue Apr 18 07:02:12 2017 (r317079) @@ -438,7 +438,6 @@ def LOW32_ADDR_ACCESS_RBP : RegisterClas (add LOW32_ADDR_ACCESS, RBP)>; // A class to support the 'A' assembler constraint: [ER]AX then [ER]DX. -def GR16_AD : RegisterClass<"X86", [i16], 16, (add AX, DX)>; def GR32_AD : RegisterClass<"X86", [i32], 32, (add EAX, EDX)>; def GR64_AD : RegisterClass<"X86", [i64], 64, (add RAX, RDX)>; From owner-svn-src-head@freebsd.org Tue Apr 18 08:04:17 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5B4C6D43A63; Tue, 18 Apr 2017 08:04:17 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 388AB7FD; Tue, 18 Apr 2017 08:04:17 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3I84GgW078402; Tue, 18 Apr 2017 08:04:16 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3I84GdG078399; Tue, 18 Apr 2017 08:04:16 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201704180804.v3I84GdG078399@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 18 Apr 2017 08:04:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317080 - head/sys/dev/ahci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 18 Apr 2017 08:04:17 -0000 Author: mav Date: Tue Apr 18 08:04:15 2017 New Revision: 317080 URL: https://svnweb.freebsd.org/changeset/base/317080 Log: Block FPDMA TRIM for ASMedia HBAs. Experiments show FPDMA TRIM command timeouts on ASMedia HBAs, while the same SSDs working fine on Intel HBAs. MFC after: 2 weeks Modified: head/sys/dev/ahci/ahci.c head/sys/dev/ahci/ahci.h head/sys/dev/ahci/ahci_pci.c Modified: head/sys/dev/ahci/ahci.c ============================================================================== --- head/sys/dev/ahci/ahci.c Tue Apr 18 07:02:12 2017 (r317079) +++ head/sys/dev/ahci/ahci.c Tue Apr 18 08:04:15 2017 (r317080) @@ -2692,7 +2692,9 @@ ahciaction(struct cam_sim *sim, union cc if (ch->caps & AHCI_CAP_SPM) cpi->hba_inquiry |= PI_SATAPM; cpi->target_sprt = 0; - cpi->hba_misc = PIM_SEQSCAN | PIM_UNMAPPED | PIM_ATA_EXT; + cpi->hba_misc = PIM_SEQSCAN | PIM_UNMAPPED; + if ((ch->quirks & AHCI_Q_NOAUX) == 0) + cpi->hba_misc |= PIM_ATA_EXT; cpi->hba_eng_cnt = 0; if (ch->caps & AHCI_CAP_SPM) cpi->max_target = 15; Modified: head/sys/dev/ahci/ahci.h ============================================================================== --- head/sys/dev/ahci/ahci.h Tue Apr 18 07:02:12 2017 (r317079) +++ head/sys/dev/ahci/ahci.h Tue Apr 18 08:04:15 2017 (r317080) @@ -600,6 +600,7 @@ enum ahci_err_type { #define AHCI_Q_NOMSIX 0x00100000 #define AHCI_Q_MRVL_SR_DEL 0x00200000 #define AHCI_Q_NOCCS 0x00400000 +#define AHCI_Q_NOAUX 0x00800000 #define AHCI_Q_BIT_STRING \ "\020" \ @@ -625,7 +626,8 @@ enum ahci_err_type { "\024RESTORE_CAP" \ "\025NOMSIX" \ "\026MRVL_SR_DEL" \ - "\027NOCCS" + "\027NOCCS" \ + "\030NOAUX" int ahci_attach(device_t dev); int ahci_detach(device_t dev); Modified: head/sys/dev/ahci/ahci_pci.c ============================================================================== --- head/sys/dev/ahci/ahci_pci.c Tue Apr 18 07:02:12 2017 (r317079) +++ head/sys/dev/ahci/ahci_pci.c Tue Apr 18 08:04:15 2017 (r317080) @@ -73,15 +73,15 @@ static const struct { {0x78021022, 0x00, "AMD Hudson-2", 0}, {0x78031022, 0x00, "AMD Hudson-2", 0}, {0x78041022, 0x00, "AMD Hudson-2", 0}, - {0x06011b21, 0x00, "ASMedia ASM1060", AHCI_Q_NOCCS}, - {0x06021b21, 0x00, "ASMedia ASM1060", AHCI_Q_NOCCS}, - {0x06111b21, 0x00, "ASMedia ASM1061", AHCI_Q_NOCCS}, - {0x06121b21, 0x00, "ASMedia ASM1062", AHCI_Q_NOCCS}, - {0x06201b21, 0x00, "ASMedia ASM106x", AHCI_Q_NOCCS}, - {0x06211b21, 0x00, "ASMedia ASM106x", AHCI_Q_NOCCS}, - {0x06221b21, 0x00, "ASMedia ASM106x", AHCI_Q_NOCCS}, - {0x06241b21, 0x00, "ASMedia ASM106x", AHCI_Q_NOCCS}, - {0x06251b21, 0x00, "ASMedia ASM106x", AHCI_Q_NOCCS}, + {0x06011b21, 0x00, "ASMedia ASM1060", AHCI_Q_NOCCS|AHCI_Q_NOAUX}, + {0x06021b21, 0x00, "ASMedia ASM1060", AHCI_Q_NOCCS|AHCI_Q_NOAUX}, + {0x06111b21, 0x00, "ASMedia ASM1061", AHCI_Q_NOCCS|AHCI_Q_NOAUX}, + {0x06121b21, 0x00, "ASMedia ASM1062", AHCI_Q_NOCCS|AHCI_Q_NOAUX}, + {0x06201b21, 0x00, "ASMedia ASM106x", AHCI_Q_NOCCS|AHCI_Q_NOAUX}, + {0x06211b21, 0x00, "ASMedia ASM106x", AHCI_Q_NOCCS|AHCI_Q_NOAUX}, + {0x06221b21, 0x00, "ASMedia ASM106x", AHCI_Q_NOCCS|AHCI_Q_NOAUX}, + {0x06241b21, 0x00, "ASMedia ASM106x", AHCI_Q_NOCCS|AHCI_Q_NOAUX}, + {0x06251b21, 0x00, "ASMedia ASM106x", AHCI_Q_NOCCS|AHCI_Q_NOAUX}, {0x26528086, 0x00, "Intel ICH6", AHCI_Q_NOFORCE}, {0x26538086, 0x00, "Intel ICH6M", AHCI_Q_NOFORCE}, {0x26818086, 0x00, "Intel ESB2", 0}, From owner-svn-src-head@freebsd.org Tue Apr 18 10:20:43 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7076FD4489C; Tue, 18 Apr 2017 10:20:43 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3D8DFCCC; Tue, 18 Apr 2017 10:20:43 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3IAKghT032198; Tue, 18 Apr 2017 10:20:42 GMT (envelope-from zbb@FreeBSD.org) Received: (from zbb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3IAKgno032197; Tue, 18 Apr 2017 10:20:42 GMT (envelope-from zbb@FreeBSD.org) Message-Id: <201704181020.v3IAKgno032197@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zbb set sender to zbb@FreeBSD.org using -f From: Zbigniew Bodek Date: Tue, 18 Apr 2017 10:20:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317084 - head/sys/arm/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 18 Apr 2017 10:20:43 -0000 Author: zbb Date: Tue Apr 18 10:20:42 2017 New Revision: 317084 URL: https://svnweb.freebsd.org/changeset/base/317084 Log: Reduce kmem_arena maximum size for Armada38x VM_KMEM_SIZE_MAX allows to limit kmem arena size. In our case this was necessary, as decreasing size of kmem_arena leaves more space for kernel_arena. kernel_arena is pool used for contigmalloc (in effect, DMA) allocations, which failed on Armada38x. This resulted in 'no memory errors' (e.g. USB_ERR_NOMEM errors) and failure of whole system. The need for greater size of kernel_arena probably comes from more peripherals making use of busdma. Value used as upper limit is half of the default value (0x1399a000). Submitted by: Wojciech Macek Obtained from: Semihalf Sponsored by: Stormshield Differential revision: https://reviews.freebsd.org/D10216 Modified: head/sys/arm/conf/ARMADA38X Modified: head/sys/arm/conf/ARMADA38X ============================================================================== --- head/sys/arm/conf/ARMADA38X Tue Apr 18 09:27:26 2017 (r317083) +++ head/sys/arm/conf/ARMADA38X Tue Apr 18 10:20:42 2017 (r317084) @@ -21,6 +21,8 @@ options ROOTDEVNAME=\"/dev/da0s1a\" options SCHED_ULE # ULE scheduler options SMP +options VM_KMEM_SIZE_MAX=0x9CCD000 + # Pseudo devices device random device pty From owner-svn-src-head@freebsd.org Tue Apr 18 10:26:00 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CE89BD449AA; Tue, 18 Apr 2017 10:26:00 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9BA9A27F; Tue, 18 Apr 2017 10:26:00 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3IAPxtF035424; Tue, 18 Apr 2017 10:25:59 GMT (envelope-from zbb@FreeBSD.org) Received: (from zbb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3IAPxpG035422; Tue, 18 Apr 2017 10:25:59 GMT (envelope-from zbb@FreeBSD.org) Message-Id: <201704181025.v3IAPxpG035422@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zbb set sender to zbb@FreeBSD.org using -f From: Zbigniew Bodek Date: Tue, 18 Apr 2017 10:25:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317085 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 18 Apr 2017 10:26:00 -0000 Author: zbb Date: Tue Apr 18 10:25:59 2017 New Revision: 317085 URL: https://svnweb.freebsd.org/changeset/base/317085 Log: Increase number of L2 tables required for kernel bootstrap Memory space reserved for pmap_kernel_l2dtable_kva and pmap_kernel_l2ptp_kva has not been taken into account in original code. All the memory reserved from kernel space by pmap_alloc_specials() function called in pmap_bootstrap() should be mapped initially by initarm(). To create initial mapping initarm() function reserves proper number of l2 page tables. However the number of the l2 page tables does not take into account memory for: pmap_kernel_l2ptp_kva, pmap_kernel_l2dtable_kva, crashdumpmap, etc. Submitted by: Grzegorz Bernacki Obtained from: Semihalf Sponsored by: Stormshield Reviewed by: meloun-miracle-cz Differential revision: https://reviews.freebsd.org/D10217 Modified: head/sys/arm/arm/machdep.c Modified: head/sys/arm/arm/machdep.c ============================================================================== --- head/sys/arm/arm/machdep.c Tue Apr 18 10:20:42 2017 (r317084) +++ head/sys/arm/arm/machdep.c Tue Apr 18 10:25:59 2017 (r317085) @@ -814,9 +814,10 @@ initarm(struct arm_boot_params *abp) /* * Add one table for end of kernel map, one for stacks, msgbuf and - * L1 and L2 tables map and one for vectors map. + * L1 and L2 tables map, one for vectors map and two for + * l2 structures from pmap_bootstrap. */ - l2size += 3; + l2size += 5; /* Make it divisible by 4 */ l2size = (l2size + 3) & ~3; From owner-svn-src-head@freebsd.org Tue Apr 18 10:32:22 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7DE70D44D22; Tue, 18 Apr 2017 10:32:22 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 590C6CFB; Tue, 18 Apr 2017 10:32:22 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3IAWLjX039601; Tue, 18 Apr 2017 10:32:21 GMT (envelope-from zbb@FreeBSD.org) Received: (from zbb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3IAWLip039599; Tue, 18 Apr 2017 10:32:21 GMT (envelope-from zbb@FreeBSD.org) Message-Id: <201704181032.v3IAWLip039599@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zbb set sender to zbb@FreeBSD.org using -f From: Zbigniew Bodek Date: Tue, 18 Apr 2017 10:32:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317086 - head/sys/arm/mv/armada38x X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 18 Apr 2017 10:32:22 -0000 Author: zbb Date: Tue Apr 18 10:32:21 2017 New Revision: 317086 URL: https://svnweb.freebsd.org/changeset/base/317086 Log: Add PL310 platform initialization for Armada 38x Introduce machine-dependent part of the arm/pl310 driver for Armada 38x SoCs. Add prefetch and power savings configuration. Submitted by: Obtained from: Stormshield Sponsored by: Stormshield Differential revision: https://reviews.freebsd.org/D10220 Added: head/sys/arm/mv/armada38x/armada38x_pl310.c (contents, props changed) Modified: head/sys/arm/mv/armada38x/files.armada38x Added: head/sys/arm/mv/armada38x/armada38x_pl310.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/mv/armada38x/armada38x_pl310.c Tue Apr 18 10:32:21 2017 (r317086) @@ -0,0 +1,74 @@ +/*- + * Copyright (c) 2017 Stormshield. + * 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 ``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. + */ + +#include +__FBSDID("$FreeBSD$"); + +/* + * The machine-dependent part of the arm/pl310 driver for Armada 38x SoCs. + */ + +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +void +platform_pl310_init(struct pl310_softc *sc) +{ + uint32_t reg; + + /* + * Enable power saving modes: + * - Dynamic Gating stops the clock when the controller is idle. + */ + reg = pl310_read4(sc, PL310_POWER_CTRL); + reg |= POWER_CTRL_ENABLE_GATING; + pl310_write4(sc, PL310_POWER_CTRL, reg); + + pl310_write4(sc, PL310_PREFETCH_CTRL, PREFETCH_CTRL_DL | + PREFETCH_CTRL_DATA_PREFETCH | PREFETCH_CTRL_INCR_DL | + PREFETCH_CTRL_DL_ON_WRAP); +} + +void +platform_pl310_write_ctrl(struct pl310_softc *sc, uint32_t val) +{ + + pl310_write4(sc, PL310_CTRL, val); +} + +void +platform_pl310_write_debug(struct pl310_softc *sc, uint32_t val) +{ + + pl310_write4(sc, PL310_DEBUG_CTRL, val); +} Modified: head/sys/arm/mv/armada38x/files.armada38x ============================================================================== --- head/sys/arm/mv/armada38x/files.armada38x Tue Apr 18 10:25:59 2017 (r317085) +++ head/sys/arm/mv/armada38x/files.armada38x Tue Apr 18 10:32:21 2017 (r317086) @@ -7,3 +7,4 @@ arm/mv/armada38x/armada38x.c standard arm/mv/armada38x/armada38x_mp.c optional smp arm/mv/armada38x/pmsu.c standard arm/mv/armada38x/rtc.c standard +arm/mv/armada38x/armada38x_pl310.c optional pl310 From owner-svn-src-head@freebsd.org Tue Apr 18 10:34:11 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D97E1D44E11; Tue, 18 Apr 2017 10:34:11 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A6C53106F; Tue, 18 Apr 2017 10:34:11 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3IAYAhZ039936; Tue, 18 Apr 2017 10:34:10 GMT (envelope-from zbb@FreeBSD.org) Received: (from zbb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3IAYAdV039935; Tue, 18 Apr 2017 10:34:10 GMT (envelope-from zbb@FreeBSD.org) Message-Id: <201704181034.v3IAYAdV039935@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zbb set sender to zbb@FreeBSD.org using -f From: Zbigniew Bodek Date: Tue, 18 Apr 2017 10:34:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317087 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 18 Apr 2017 10:34:12 -0000 Author: zbb Date: Tue Apr 18 10:34:10 2017 New Revision: 317087 URL: https://svnweb.freebsd.org/changeset/base/317087 Log: Execute PL310_ERRATA_727915 only for related revisions Part of PL310 erratum 727915 in pl310_wbinv_range() was executed uncoditionally for all possible controllers' revisions. This patch adds appropriate condition, since extra operations are required only for revisions between r2p0 and r3p0. Submitted by: Marcin Wojtas Obtained from: Semihalf Sponsored by: Stormshield Reviewed by: meloun-miracle-cz Differential revision: https://reviews.freebsd.org/D10221 Modified: head/sys/arm/arm/pl310.c Modified: head/sys/arm/arm/pl310.c ============================================================================== --- head/sys/arm/arm/pl310.c Tue Apr 18 10:32:21 2017 (r317086) +++ head/sys/arm/arm/pl310.c Tue Apr 18 10:34:10 2017 (r317087) @@ -272,7 +272,9 @@ pl310_wbinv_range(vm_paddr_t start, vm_s #ifdef PL310_ERRATA_727915 - platform_pl310_write_debug(pl310_softc, 3); + if (pl310_softc->sc_rtl_revision >= CACHE_ID_RELEASE_r2p0 && + pl310_softc->sc_rtl_revision < CACHE_ID_RELEASE_r3p1) + platform_pl310_write_debug(pl310_softc, 3); #endif while (size > 0) { #ifdef PL310_ERRATA_588369 @@ -293,7 +295,9 @@ pl310_wbinv_range(vm_paddr_t start, vm_s size -= g_l2cache_line_size; } #ifdef PL310_ERRATA_727915 - platform_pl310_write_debug(pl310_softc, 0); + if (pl310_softc->sc_rtl_revision >= CACHE_ID_RELEASE_r2p0 && + pl310_softc->sc_rtl_revision < CACHE_ID_RELEASE_r3p1) + platform_pl310_write_debug(pl310_softc, 0); #endif pl310_cache_sync(); From owner-svn-src-head@freebsd.org Tue Apr 18 10:35:31 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 860EBD44E89; Tue, 18 Apr 2017 10:35:31 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5694E1239; Tue, 18 Apr 2017 10:35:31 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3IAZUsl040033; Tue, 18 Apr 2017 10:35:30 GMT (envelope-from zbb@FreeBSD.org) Received: (from zbb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3IAZU6u040032; Tue, 18 Apr 2017 10:35:30 GMT (envelope-from zbb@FreeBSD.org) Message-Id: <201704181035.v3IAZU6u040032@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zbb set sender to zbb@FreeBSD.org using -f From: Zbigniew Bodek Date: Tue, 18 Apr 2017 10:35:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317088 - head/sys/arm/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 18 Apr 2017 10:35:31 -0000 Author: zbb Date: Tue Apr 18 10:35:30 2017 New Revision: 317088 URL: https://svnweb.freebsd.org/changeset/base/317088 Log: Add PL310 device in ARMADA38X config Submitted by: Arnaud Ysmal Obtained from: Stormshield Sponsored by: Stormshield Differential revision: https://reviews.freebsd.org/D10222 Modified: head/sys/arm/conf/ARMADA38X Modified: head/sys/arm/conf/ARMADA38X ============================================================================== --- head/sys/arm/conf/ARMADA38X Tue Apr 18 10:34:10 2017 (r317087) +++ head/sys/arm/conf/ARMADA38X Tue Apr 18 10:35:30 2017 (r317088) @@ -75,6 +75,9 @@ device cesa device crypto device cryptodev +# L2 Cache +device pl310 + #FDT options FDT options FDT_DTB_STATIC From owner-svn-src-head@freebsd.org Tue Apr 18 10:37:09 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4DBEDD44EEC; Tue, 18 Apr 2017 10:37:09 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1FF7513CE; Tue, 18 Apr 2017 10:37:09 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3IAb8Sl040128; Tue, 18 Apr 2017 10:37:08 GMT (envelope-from zbb@FreeBSD.org) Received: (from zbb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3IAb8V2040127; Tue, 18 Apr 2017 10:37:08 GMT (envelope-from zbb@FreeBSD.org) Message-Id: <201704181037.v3IAb8V2040127@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zbb set sender to zbb@FreeBSD.org using -f From: Zbigniew Bodek Date: Tue, 18 Apr 2017 10:37:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317089 - head/sys/arm/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 18 Apr 2017 10:37:09 -0000 Author: zbb Date: Tue Apr 18 10:37:08 2017 New Revision: 317089 URL: https://svnweb.freebsd.org/changeset/base/317089 Log: Fix bit assignment in PL310_POWER_CTRL Align to ARM specification: http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0246f/BEIEHICF.html Submitted by: Marcin Wojtas Obtained from: Semihalf Sponsored by: Stormshield Reviewed by: meloun-miracle-cz Differential revision: https://reviews.freebsd.org/D10223 Modified: head/sys/arm/include/pl310.h Modified: head/sys/arm/include/pl310.h ============================================================================== --- head/sys/arm/include/pl310.h Tue Apr 18 10:35:30 2017 (r317088) +++ head/sys/arm/include/pl310.h Tue Apr 18 10:37:08 2017 (r317089) @@ -134,8 +134,8 @@ #define PREFETCH_CTRL_INSTR_PREFETCH (1 << 29) #define PREFETCH_CTRL_DL (1 << 30) #define PL310_POWER_CTRL 0xF80 -#define POWER_CTRL_ENABLE_GATING (1 << 0) -#define POWER_CTRL_ENABLE_STANDBY (1 << 1) +#define POWER_CTRL_ENABLE_GATING (1 << 1) +#define POWER_CTRL_ENABLE_STANDBY (1 << 0) struct intr_config_hook; From owner-svn-src-head@freebsd.org Tue Apr 18 10:39:15 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D7ADED44F6D; Tue, 18 Apr 2017 10:39:15 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B316015CB; Tue, 18 Apr 2017 10:39:15 +0000 (UTC) (envelope-from zbb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3IAdE1K040245; Tue, 18 Apr 2017 10:39:14 GMT (envelope-from zbb@FreeBSD.org) Received: (from zbb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3IAdElp040242; Tue, 18 Apr 2017 10:39:14 GMT (envelope-from zbb@FreeBSD.org) Message-Id: <201704181039.v3IAdElp040242@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zbb set sender to zbb@FreeBSD.org using -f From: Zbigniew Bodek Date: Tue, 18 Apr 2017 10:39:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317090 - in head/sys/arm/mv: . armada38x X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 18 Apr 2017 10:39:15 -0000 Author: zbb Date: Tue Apr 18 10:39:14 2017 New Revision: 317090 URL: https://svnweb.freebsd.org/changeset/base/317090 Log: Optimize Armada38x low-level MBUS settings Add early init handler, which comprises various internal bus optimisations for Armada 38x SoC's. Magic values used due to undocumented registers. Submitted by: Marcin Wojtas , Arnaud Ysmal Obtained from: Semihalf, Stormshield Sponsored by: Stormshield Differential revision: https://reviews.freebsd.org/D10219 Modified: head/sys/arm/mv/armada38x/armada38x.c head/sys/arm/mv/mv_machdep.c head/sys/arm/mv/mvreg.h Modified: head/sys/arm/mv/armada38x/armada38x.c ============================================================================== --- head/sys/arm/mv/armada38x/armada38x.c Tue Apr 18 10:37:08 2017 (r317089) +++ head/sys/arm/mv/armada38x/armada38x.c Tue Apr 18 10:39:14 2017 (r317090) @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); int armada38x_open_bootrom_win(void); int armada38x_scu_enable(void); int armada38x_win_set_iosync_barrier(void); +int armada38x_mbus_optimization(void); uint32_t get_tclk(void) @@ -115,6 +116,50 @@ armada38x_open_bootrom_win(void) } int +armada38x_mbus_optimization(void) +{ + bus_space_handle_t vaddr_iowind; + int rv; + + rv = bus_space_map(fdtbus_bs_tag, (bus_addr_t)MV_MBUS_CTRL_BASE, + MV_MBUS_CTRL_REGS_LEN, 0, &vaddr_iowind); + if (rv != 0) + return (rv); + + /* + * MBUS Units Priority Control Register - Prioritize XOR, + * PCIe and GbEs (ID=4,6,3,7,8) DRAM access + * GbE is High and others are Medium. + */ + bus_space_write_4(fdtbus_bs_tag, vaddr_iowind, 0, 0x19180); + + /* + * Fabric Units Priority Control Register - + * Prioritize CPUs requests. + */ + bus_space_write_4(fdtbus_bs_tag, vaddr_iowind, 0x4, 0x3000A); + + /* + * MBUS Units Prefetch Control Register - + * Pre-fetch enable for all IO masters. + */ + bus_space_write_4(fdtbus_bs_tag, vaddr_iowind, 0x8, 0xFFFF); + + /* + * Fabric Units Prefetch Control Register - + * Enable the CPUs Instruction and Data prefetch. + */ + bus_space_write_4(fdtbus_bs_tag, vaddr_iowind, 0xc, 0x303); + + bus_space_barrier(fdtbus_bs_tag, vaddr_iowind, 0, MV_MBUS_CTRL_REGS_LEN, + BUS_SPACE_BARRIER_WRITE); + + bus_space_unmap(fdtbus_bs_tag, vaddr_iowind, MV_MBUS_CTRL_REGS_LEN); + + return (rv); +} + +int armada38x_scu_enable(void) { bus_space_handle_t vaddr_scu; Modified: head/sys/arm/mv/mv_machdep.c ============================================================================== --- head/sys/arm/mv/mv_machdep.c Tue Apr 18 10:37:08 2017 (r317089) +++ head/sys/arm/mv/mv_machdep.c Tue Apr 18 10:39:14 2017 (r317090) @@ -77,6 +77,7 @@ void armadaxp_l2_init(void); int armada38x_win_set_iosync_barrier(void); int armada38x_scu_enable(void); int armada38x_open_bootrom_win(void); +int armada38x_mbus_optimization(void); #endif #define MPP_PIN_MAX 68 @@ -259,6 +260,8 @@ platform_late_init(void) /* Set IO Sync Barrier bit for all Mbus devices */ if (armada38x_win_set_iosync_barrier() != 0) printf("WARNING: could not map CPU Subsystem registers\n"); + if (armada38x_mbus_optimization() != 0) + printf("WARNING: could not enable mbus optimization\n"); if (armada38x_scu_enable() != 0) printf("WARNING: could not enable SCU\n"); #ifdef SMP Modified: head/sys/arm/mv/mvreg.h ============================================================================== --- head/sys/arm/mv/mvreg.h Tue Apr 18 10:37:08 2017 (r317089) +++ head/sys/arm/mv/mvreg.h Tue Apr 18 10:39:14 2017 (r317090) @@ -447,4 +447,9 @@ #define CPU_RESET_ASSERT 0x1 #endif +#if defined(SOC_MV_ARMADA38X) +#define MV_MBUS_CTRL_BASE (MV_BASE + 0x20420) +#define MV_MBUS_CTRL_REGS_LEN 0x10 +#endif + #endif /* _MVREG_H_ */ From owner-svn-src-head@freebsd.org Tue Apr 18 12:41:17 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2F61DD42292; Tue, 18 Apr 2017 12:41:17 +0000 (UTC) (envelope-from decui@microsoft.com) Received: from APC01-HK2-obe.outbound.protection.outlook.com (mail-hk2apc01on0133.outbound.protection.outlook.com [104.47.124.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "Microsoft IT SSL SHA2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B0D603B4; Tue, 18 Apr 2017 12:41:15 +0000 (UTC) (envelope-from decui@microsoft.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=tfuZLnZJaSC/Xb6tOYgaDMMf6RYomWx8ZsnfoPe7B64=; b=LL5QP7iO0GhTXhfSPiJISCHHZR8zY18YWxxfd5TVZ/IKE9a6bh4TEX7bTFLqidmUTakqHrewFvURYrszq7FAmGg+sl1Gx/9+96AFL6xRbXvaAnCg40T2/hYS5kMiZkxaSS6y/A21ZWpAoHxYASBoutKdwWTEb1V+6sVJV/xAznU= Received: from HK2P15301MB0003.APCP153.PROD.OUTLOOK.COM (10.170.151.145) by HK2P15301MB0002.APCP153.PROD.OUTLOOK.COM (10.170.151.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1061.1; Tue, 18 Apr 2017 12:41:09 +0000 Received: from HK2P15301MB0003.APCP153.PROD.OUTLOOK.COM ([10.170.151.145]) by HK2P15301MB0003.APCP153.PROD.OUTLOOK.COM ([10.170.151.145]) with mapi id 15.01.1061.000; Tue, 18 Apr 2017 12:41:09 +0000 From: Dexuan Cui To: Konstantin Belousov , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" CC: Sepherosa Ziehau , Hongjiang Zhang Subject: RE: svn commit: r316767 - head/sys/amd64/amd64 Thread-Topic: svn commit: r316767 - head/sys/amd64/amd64 Thread-Index: AQHStG2iSg+v8T4ZWE2jvrgFLfQZk6HLFDPw Date: Tue, 18 Apr 2017 12:41:09 +0000 Message-ID: References: <201704131549.v3DFnt9I004050@repo.freebsd.org> In-Reply-To: <201704131549.v3DFnt9I004050@repo.freebsd.org> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: FreeBSD.org; dkim=none (message not signed) header.d=none;FreeBSD.org; dmarc=none action=none header.from=microsoft.com; x-originating-ip: [167.220.255.20] x-microsoft-exchange-diagnostics: 1; HK2P15301MB0002; 7:4GhIlL3Qh3pTjHsUAei9Ttarff0AczGjd38IDladTG9GuoyJGIPDfwoHrA5I7DrRGBJYtgxyAj9J3teBTy7ZL1rV1TkdMSgCp0rs3zbzvaGcD4amB9kaEW7WzPsnvR/HxxT2LSefgLyfqDLC76UhZUTKsmZuSPveoEM4nV5Wo2JmIGJvafX0ChFL9PyHQV8hmDMFPb5GZWEBFUg1peWCZCSwSscJUdpjNRGdJfroAza/e3/E8eaVfSDKjctXnWBexz9thdtjV0VD6YbpetZLEgs2lHNPni4n5fm+DZe0xobd7FMq2lcEdJ7QJ97l8AS8xeItiwFekviDDCtACn+rSO9Jx6N/Ag71t8ZOKYeiB5o= x-ms-office365-filtering-correlation-id: caffda02-1912-434d-9346-08d4865830c5 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254075)(48565401081)(201703131423075)(201703031133081)(201702281549075); SRVR:HK2P15301MB0002; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(61425038)(6040450)(2401047)(8121501046)(5005006)(10201501046)(93006095)(93001095)(3002001)(6055026)(61426038)(61427038)(6041248)(20161123564025)(20161123560025)(20161123555025)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(6072148); SRVR:HK2P15301MB0002; BCL:0; PCL:0; RULEID:; SRVR:HK2P15301MB0002; x-forefront-prvs: 028166BF91 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(6009001)(39450400003)(39860400002)(39410400002)(39850400002)(39400400002)(39840400002)(6506006)(107886003)(38730400002)(55016002)(4326008)(77096006)(74316002)(6436002)(66066001)(3846002)(9686003)(54356999)(76176999)(50986999)(6246003)(53936002)(25786009)(8676002)(5660300001)(81166006)(8936002)(7696004)(6116002)(229853002)(2900100001)(450100002)(305945005)(2950100002)(102836003)(7736002)(86362001)(10290500002)(5005710100001)(10090500001)(2201001)(8990500004)(33656002)(3280700002)(3660700001)(2906002)(122556002)(2501003)(189998001); DIR:OUT; SFP:1102; SCL:1; SRVR:HK2P15301MB0002; H:HK2P15301MB0003.APCP153.PROD.OUTLOOK.COM; FPR:; SPF:None; MLV:sfv; LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-originalarrivaltime: 18 Apr 2017 12:41:09.4507 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: HK2P15301MB0002 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 18 Apr 2017 12:41:17 -0000 > From: owner-svn-src-head@freebsd.org [mailto:owner-svn-src- > head@freebsd.org] On Behalf Of Konstantin Belousov > Sent: Thursday, April 13, 2017 23:50 >=20 > Author: kib > Date: Thu Apr 13 15:49:55 2017 > New Revision: 316767 > URL: >=20 > Log: > Map DMAP as nx. >=20 > Demotions preserve PG_NX, so it is enough to set nx bit for initial > lowest-level paging entries. >=20 > Modified: > head/sys/amd64/amd64/pmap.c =20 Hi kib, Unluckily this patch breaks Hyper-V VM: In dev/hyperv/vmbus/hyperv.c: hypercall_create() we allocate one page and pass its physical address to the hypervisor, which initializes the page with executable code. Later in dev/hyperv/vmbus/hyperv.c: hypercall_post_message(), we "call" the executable code in the above page. Now with NX, the "call" gets a fault and as a result FreeBSD VM can't boot on Hyper-V. It looks memory allocated by bus_dmamem_alloc() and malloc() is not executable now. What else can we use? I guess we can only use contigmalloc() or kmem_malloc() to get a page that can be executable and use vtophys() to get its physical address? Looking forward to your suggestion! Thanks! -- Dexuan From owner-svn-src-head@freebsd.org Tue Apr 18 13:46:02 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E5407D441DE; Tue, 18 Apr 2017 13:46:02 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5D466362; Tue, 18 Apr 2017 13:46:02 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id v3IDjuxI026851 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 18 Apr 2017 16:45:56 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua v3IDjuxI026851 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id v3IDjurb026849; Tue, 18 Apr 2017 16:45:56 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 18 Apr 2017 16:45:56 +0300 From: Konstantin Belousov To: Dexuan Cui Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Sepherosa Ziehau , Hongjiang Zhang Subject: Re: svn commit: r316767 - head/sys/amd64/amd64 Message-ID: <20170418134556.GY1788@kib.kiev.ua> References: <201704131549.v3DFnt9I004050@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.8.0 (2017-02-23) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 18 Apr 2017 13:46:03 -0000 On Tue, Apr 18, 2017 at 12:41:09PM +0000, Dexuan Cui wrote: > > From: owner-svn-src-head@freebsd.org [mailto:owner-svn-src- > > head@freebsd.org] On Behalf Of Konstantin Belousov > > Sent: Thursday, April 13, 2017 23:50 > > > > Author: kib > > Date: Thu Apr 13 15:49:55 2017 > > New Revision: 316767 > > URL: > > > > Log: > > Map DMAP as nx. > > > > Demotions preserve PG_NX, so it is enough to set nx bit for initial > > lowest-level paging entries. > > > > Modified: > > head/sys/amd64/amd64/pmap.c > > Hi kib, > Unluckily this patch breaks Hyper-V VM: > > In dev/hyperv/vmbus/hyperv.c: hypercall_create() we allocate one > page and pass its physical address to the hypervisor, which initializes > the page with executable code. > > Later in dev/hyperv/vmbus/hyperv.c: hypercall_post_message(), we > "call" the executable code in the above page. > > Now with NX, the "call" gets a fault and as a result FreeBSD VM > can't boot on Hyper-V. > > It looks memory allocated by bus_dmamem_alloc() and malloc() > is not executable now. > > What else can we use? > I guess we can only use contigmalloc() or kmem_malloc() to > get a page that can be executable and use vtophys() to get its > physical address? Yes, the kmem_malloc() is considered to be a suitable substitution for regular malloc(9) if the executable mapping is needed. See r317072 for a similar fix for the same issue. From owner-svn-src-head@freebsd.org Tue Apr 18 15:36:14 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9FAB8D4435E; Tue, 18 Apr 2017 15:36:14 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 71D3C64A; Tue, 18 Apr 2017 15:36:14 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3IFaD6r062434; Tue, 18 Apr 2017 15:36:13 GMT (envelope-from pluknet@FreeBSD.org) Received: (from pluknet@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3IFaDtD062433; Tue, 18 Apr 2017 15:36:13 GMT (envelope-from pluknet@FreeBSD.org) Message-Id: <201704181536.v3IFaDtD062433@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pluknet set sender to pluknet@FreeBSD.org using -f From: Sergey Kandaurov Date: Tue, 18 Apr 2017 15:36:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317091 - head/lib/libc/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 18 Apr 2017 15:36:14 -0000 Author: pluknet Date: Tue Apr 18 15:36:13 2017 New Revision: 317091 URL: https://svnweb.freebsd.org/changeset/base/317091 Log: Document kevent EVFILT_EMPTY. Reviewed by: hiren X-MFC with: r312277 Modified: head/lib/libc/sys/kqueue.2 Modified: head/lib/libc/sys/kqueue.2 ============================================================================== --- head/lib/libc/sys/kqueue.2 Tue Apr 18 10:39:14 2017 (r317090) +++ head/lib/libc/sys/kqueue.2 Tue Apr 18 15:36:13 2017 (r317091) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 15, 2017 +.Dd April 18, 2017 .Dt KQUEUE 2 .Os .Sh NAME @@ -332,6 +332,9 @@ For sockets, the low water mark and sock identical to the .Dv EVFILT_READ case. +.It Dv EVFILT_EMPTY +Takes a descriptor as the identifier, and returns whenever +there is no remaining data in the write buffer. .It Dv EVFILT_AIO The sigevent portion of the AIO request is filled in, with .Va sigev_notify_kqueue From owner-svn-src-head@freebsd.org Tue Apr 18 15:43:48 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A4014D4465B; Tue, 18 Apr 2017 15:43:48 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5A7E7C1D; Tue, 18 Apr 2017 15:43:48 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3IFhlQ3066344; Tue, 18 Apr 2017 15:43:47 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3IFhlkQ066343; Tue, 18 Apr 2017 15:43:47 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201704181543.v3IFhlkQ066343@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Tue, 18 Apr 2017 15:43:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317092 - head/sys/boot/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 18 Apr 2017 15:43:48 -0000 Author: tsoome Date: Tue Apr 18 15:43:47 2017 New Revision: 317092 URL: https://svnweb.freebsd.org/changeset/base/317092 Log: loader: zfs reader vdev_probe should check for minimum device size The smallest device we can have in the pool is 64MB, since we are trying to walk all four labels to find the most up to date uberblock, this limit will also give us good method to check if we even should attempt to probe. Enforcing the check also will make sure we are not getting wrapped while calculating the label offset. Also, after label check, we should verify if we actually got any UB or not. PR: 218473 Reported by: Masachika ISHIZUKA Reviewed by: allanjude Differential Revision: https://reviews.freebsd.org/D10381 Modified: head/sys/boot/zfs/zfsimpl.c Modified: head/sys/boot/zfs/zfsimpl.c ============================================================================== --- head/sys/boot/zfs/zfsimpl.c Tue Apr 18 15:36:13 2017 (r317091) +++ head/sys/boot/zfs/zfsimpl.c Tue Apr 18 15:43:47 2017 (r317092) @@ -929,7 +929,7 @@ vdev_probe(vdev_phys_read_t *_read, void { vdev_t vtmp; vdev_phys_t *vdev_label = (vdev_phys_t *) zap_scratch; - vdev_phys_t *tmp_label = zfs_alloc(sizeof(vdev_phys_t)); + vdev_phys_t *tmp_label; spa_t *spa; vdev_t *vdev, *top_vdev, *pool_vdev; off_t off; @@ -957,6 +957,12 @@ vdev_probe(vdev_phys_read_t *_read, void psize = P2ALIGN(ldi_get_size(read_priv), (uint64_t)sizeof (vdev_label_t)); + /* Test for minimum pool size. */ + if (psize < SPA_MINDEVSIZE) + return (EIO); + + tmp_label = zfs_alloc(sizeof(vdev_phys_t)); + for (l = 0; l < VDEV_LABELS; l++) { off = vdev_label_offset(psize, l, offsetof(vdev_label_t, vl_vdev_phys)); @@ -988,6 +994,9 @@ vdev_probe(vdev_phys_read_t *_read, void zfs_free(tmp_label, sizeof (vdev_phys_t)); + if (best_txg == 0) + return (EIO); + if (vdev_label->vp_nvlist[0] != NV_ENCODE_XDR) return (EIO); From owner-svn-src-head@freebsd.org Tue Apr 18 16:27:49 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 46E4ED43784; Tue, 18 Apr 2017 16:27:49 +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 mx1.freebsd.org (Postfix) with ESMTPS id 19149B26; Tue, 18 Apr 2017 16:27:49 +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 v3IGRmgH082878; Tue, 18 Apr 2017 16:27:48 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3IGRmNN082877; Tue, 18 Apr 2017 16:27:48 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201704181627.v3IGRmNN082877@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 18 Apr 2017 16:27:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317094 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 18 Apr 2017 16:27:49 -0000 Author: jhb Date: Tue Apr 18 16:27:48 2017 New Revision: 317094 URL: https://svnweb.freebsd.org/changeset/base/317094 Log: Disable in-tree GDB by default on x86, mips, and powerpc. GDB in ports contains all of the functionality as GDB in base (including kgdb) for these platforms along with additional functionality. In-tree GDB remains enabled on ARM and sparc64. GDB in ports does not currently support kernel debugging on arm, and ports GDB for sparc64 has not been tested (though it does include sparc64 support). Reviewed by: bdrewery, emaste, imp Relnotes: yes Sponsored by: DARPA / AFRL Differential Revision: https://reviews.freebsd.org/D10399 Modified: head/share/mk/src.opts.mk Modified: head/share/mk/src.opts.mk ============================================================================== --- head/share/mk/src.opts.mk Tue Apr 18 16:17:38 2017 (r317093) +++ head/share/mk/src.opts.mk Tue Apr 18 16:27:48 2017 (r317094) @@ -41,7 +41,7 @@ ____: # that haven't been converted over. # -# These options are used by src the builds +# These options are used by the src builds __DEFAULT_YES_OPTIONS = \ ACCT \ @@ -96,7 +96,6 @@ __DEFAULT_YES_OPTIONS = \ FTP \ GAMES \ GCOV \ - GDB \ GNU \ GNU_DIFF \ GNU_GREP \ @@ -263,6 +262,14 @@ __DEFAULT_NO_OPTIONS+=LLDB .if ${__T} == "arm" || ${__T} == "armeb" BROKEN_OPTIONS+=LLDB .endif +# GDB in base is generally less functional than GDB in ports. Ports GDB +# does not yet contain kernel support for arm, and sparc64 kernel support +# has not been tested. +.if ${__T:Marm*} != "" || ${__T} == "sparc64" +__DEFAULT_YES_OPTIONS+=GDB +.else +__DEFAULT_NO_OPTIONS+=GDB +.endif # Only doing soft float API stuff on armv6 .if ${__T} != "armv6" BROKEN_OPTIONS+=LIBSOFT From owner-svn-src-head@freebsd.org Tue Apr 18 17:05:54 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5E4DBD44820; Tue, 18 Apr 2017 17:05:54 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1E4D31A60; Tue, 18 Apr 2017 17:05:54 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1d0W17-0003lk-BC; Tue, 18 Apr 2017 19:30:13 +0300 Date: Tue, 18 Apr 2017 19:30:13 +0300 From: Slawa Olhovchenkov To: John Baldwin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r317094 - head/share/mk Message-ID: <20170418163013.GB83631@zxy.spb.ru> References: <201704181627.v3IGRmNN082877@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201704181627.v3IGRmNN082877@repo.freebsd.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 18 Apr 2017 17:05:54 -0000 On Tue, Apr 18, 2017 at 04:27:48PM +0000, John Baldwin wrote: > Author: jhb > Date: Tue Apr 18 16:27:48 2017 > New Revision: 317094 > URL: https://svnweb.freebsd.org/changeset/base/317094 > > Log: > Disable in-tree GDB by default on x86, mips, and powerpc. > > GDB in ports contains all of the functionality as GDB in base > (including kgdb) for these platforms along with additional > functionality. In-tree GDB remains enabled on ARM and sparc64. > GDB in ports does not currently support kernel debugging on arm, > and ports GDB for sparc64 has not been tested (though it does > include sparc64 support). > > Reviewed by: bdrewery, emaste, imp > Relnotes: yes > Sponsored by: DARPA / AFRL > Differential Revision: https://reviews.freebsd.org/D10399 Generating core.txt now complety broken? From owner-svn-src-head@freebsd.org Tue Apr 18 17:20:05 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 391CDD44F5F; Tue, 18 Apr 2017 17:20:05 +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 mx1.freebsd.org (Postfix) with ESMTPS id D97AC914; Tue, 18 Apr 2017 17:20:04 +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 v3IHK4t6003310; Tue, 18 Apr 2017 17:20:04 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3IHK3mJ003306; Tue, 18 Apr 2017 17:20:03 GMT (envelope-from br@FreeBSD.org) Message-Id: <201704181720.v3IHK3mJ003306@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Tue, 18 Apr 2017 17:20:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317095 - in head/sys: boot/fdt/dts/mips mips/beri mips/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 18 Apr 2017 17:20:05 -0000 Author: br Date: Tue Apr 18 17:20:03 2017 New Revision: 317095 URL: https://svnweb.freebsd.org/changeset/base/317095 Log: Switch BERI Programmable Interrupt Controller to INTRNG. Sponsored by: DARPA, AFRL Deleted: head/sys/mips/beri/beri_simplebus.c head/sys/mips/beri/fdt_ic_if.m Modified: head/sys/boot/fdt/dts/mips/beri-netfpga.dts head/sys/boot/fdt/dts/mips/beri-sim.dts head/sys/boot/fdt/dts/mips/beripad-de4.dts head/sys/boot/fdt/dts/mips/beripad-sockit.dts head/sys/mips/beri/beri_pic.c head/sys/mips/beri/files.beri head/sys/mips/conf/std.BERI Modified: head/sys/boot/fdt/dts/mips/beri-netfpga.dts ============================================================================== --- head/sys/boot/fdt/dts/mips/beri-netfpga.dts Tue Apr 18 16:27:48 2017 (r317094) +++ head/sys/boot/fdt/dts/mips/beri-netfpga.dts Tue Apr 18 17:20:03 2017 (r317095) @@ -87,30 +87,35 @@ reg = <0x0 0x0FFFFFFF>; // ~256M at 0x0 }; + cpuintc: cpuintc@0 { + #address-cells = <0>; + #interrupt-cells = <1>; + interrupt-controller; + compatible = "mti,cpu-interrupt-controller"; + }; + + beripic: beripic@7f804000 { + compatible = "sri-cambridge,beri-pic"; + interrupt-controller; + #address-cells = <0>; + #interrupt-cells = <1>; + reg = <0x7f804000 0x400 + 0x7f806000 0x10 + 0x7f806080 0x10 + 0x7f806100 0x10>; + interrupts = < 2 3 4 5 6 >; + hard-interrupt-sources = <64>; + soft-interrupt-sources = <64>; + interrupt-parent = <&cpuintc>; + }; + soc { #address-cells = <1>; #size-cells = <1>; #interrupt-cells = <1>; - /* - * Declare mips,mips4k since BERI doesn't (yet) have a PIC, so - * we use mips4k coprocessor 0 interrupt management directly. - */ compatible = "simple-bus", "mips,mips4k"; - - beripic: beripic@7f804000 { - compatible = "sri-cambridge,beri-pic"; - interrupt-controller; - #address-cells = <0>; - #interrupt-cells = <1>; - reg = <0x7f804000 0x400 - 0x7f806000 0x10 - 0x7f806080 0x10 - 0x7f806100 0x10>; - interrupts = <0 1 2 3 4>; - hard-interrupt-sources = <64>; - soft-interrupt-sources = <64>; - }; + ranges; serial0: serial@7f000000 { compatible = "altera,jtag_uart-11_0"; Modified: head/sys/boot/fdt/dts/mips/beri-sim.dts ============================================================================== --- head/sys/boot/fdt/dts/mips/beri-sim.dts Tue Apr 18 16:27:48 2017 (r317094) +++ head/sys/boot/fdt/dts/mips/beri-sim.dts Tue Apr 18 17:20:03 2017 (r317095) @@ -85,30 +85,35 @@ reg = <0x0 0x4000000>; // 64M at 0x0 }; + cpuintc: cpuintc@0 { + #address-cells = <0>; + #interrupt-cells = <1>; + interrupt-controller; + compatible = "mti,cpu-interrupt-controller"; + }; + + beripic0: beripic@7f804000 { + compatible = "sri-cambridge,beri-pic"; + interrupt-controller; + #address-cells = <0>; + #interrupt-cells = <1>; + reg = <0x7f804000 0x400 + 0x7f806000 0x10 + 0x7f806080 0x10 + 0x7f806100 0x10>; + interrupts = < 2 3 4 5 6 >; + hard-interrupt-sources = <64>; + soft-interrupt-sources = <64>; + interrupt-parent = <&cpuintc>; + }; + soc { #address-cells = <1>; #size-cells = <1>; #interrupt-cells = <1>; - /* - * Declare mips,mips4k since BERI doesn't (yet) have a PIC, so - * we use mips4k coprocessor 0 interrupt management directly. - */ compatible = "simple-bus", "mips,mips4k"; - - beripic0: beripic@7f804000 { - compatible = "sri-cambridge,beri-pic"; - interrupt-controller; - #address-cells = <0>; - #interrupt-cells = <1>; - reg = <0x7f804000 0x400 - 0x7f806000 0x10 - 0x7f806080 0x10 - 0x7f806100 0x10>; - interrupts = <0 1 2 3 4>; - hard-interrupt-sources = <64>; - soft-interrupt-sources = <64>; - }; + ranges; serial@7f000000 { compatible = "altera,jtag_uart-11_0"; Modified: head/sys/boot/fdt/dts/mips/beripad-de4.dts ============================================================================== --- head/sys/boot/fdt/dts/mips/beripad-de4.dts Tue Apr 18 16:27:48 2017 (r317094) +++ head/sys/boot/fdt/dts/mips/beripad-de4.dts Tue Apr 18 17:20:03 2017 (r317095) @@ -85,30 +85,35 @@ reg = <0x0 0x40000000>; // 1G at 0x0 }; + cpuintc: cpuintc@0 { + #address-cells = <0>; + #interrupt-cells = <1>; + interrupt-controller; + compatible = "mti,cpu-interrupt-controller"; + }; + + beripic0: beripic@7f804000 { + compatible = "sri-cambridge,beri-pic"; + interrupt-controller; + #address-cells = <0>; + #interrupt-cells = <1>; + reg = <0x7f804000 0x400 + 0x7f806000 0x10 + 0x7f806080 0x10 + 0x7f806100 0x10>; + interrupts = < 2 3 4 5 6 >; + hard-interrupt-sources = <64>; + soft-interrupt-sources = <64>; + interrupt-parent = <&cpuintc>; + }; + soc { #address-cells = <1>; #size-cells = <1>; #interrupt-cells = <1>; - /* - * Declare mips,mips4k since BERI doesn't (yet) have a PIC, so - * we use mips4k coprocessor 0 interrupt management directly. - */ compatible = "simple-bus", "mips,mips4k"; - - beripic0: beripic@7f804000 { - compatible = "sri-cambridge,beri-pic"; - interrupt-controller; - #address-cells = <0>; - #interrupt-cells = <1>; - reg = <0x7f804000 0x400 - 0x7f806000 0x10 - 0x7f806080 0x10 - 0x7f806100 0x10>; - interrupts = <0 1 2 3 4>; - hard-interrupt-sources = <64>; - soft-interrupt-sources = <64>; - }; + ranges; serial@7f002100 { compatible = "ns16550"; Modified: head/sys/boot/fdt/dts/mips/beripad-sockit.dts ============================================================================== --- head/sys/boot/fdt/dts/mips/beripad-sockit.dts Tue Apr 18 16:27:48 2017 (r317094) +++ head/sys/boot/fdt/dts/mips/beripad-sockit.dts Tue Apr 18 17:20:03 2017 (r317095) @@ -83,30 +83,35 @@ reg = <0x0 0x10000000>; /* 256MB at 0x0 */ }; + cpuintc: cpuintc@0 { + #address-cells = <0>; + #interrupt-cells = <1>; + interrupt-controller; + compatible = "mti,cpu-interrupt-controller"; + }; + + beripic0: beripic@7f804000 { + compatible = "sri-cambridge,beri-pic"; + interrupt-controller; + #address-cells = <0>; + #interrupt-cells = <1>; + reg = <0x0 0x7f804000 0x0 0x400 + 0x0 0x7f806000 0x0 0x10 + 0x0 0x7f806080 0x0 0x10 + 0x0 0x7f806100 0x0 0x10>; + interrupts = < 2 3 4 5 6 >; + hard-interrupt-sources = <64>; + soft-interrupt-sources = <64>; + interrupt-parent = <&cpuintc>; + }; + soc { #address-cells = <2>; #size-cells = <2>; #interrupt-cells = <1>; - /* - * Declare mips,mips4k since BERI doesn't (yet) have a PIC, so - * we use mips4k coprocessor 0 interrupt management directly. - */ compatible = "simple-bus", "mips,mips4k"; - - beripic0: beripic@7f804000 { - compatible = "sri-cambridge,beri-pic"; - interrupt-controller; - #address-cells = <0>; - #interrupt-cells = <1>; - reg = <0x0 0x7f804000 0x0 0x400 - 0x0 0x7f806000 0x0 0x10 - 0x0 0x7f806080 0x0 0x10 - 0x0 0x7f806100 0x0 0x10>; - interrupts = <0 1 2 3 4>; - hard-interrupt-sources = <64>; - soft-interrupt-sources = <64>; - }; + ranges; pio0: pio@7f020000 { compatible = "altr,pio"; Modified: head/sys/mips/beri/beri_pic.c ============================================================================== --- head/sys/mips/beri/beri_pic.c Tue Apr 18 16:27:48 2017 (r317094) +++ head/sys/mips/beri/beri_pic.c Tue Apr 18 17:20:03 2017 (r317095) @@ -1,4 +1,5 @@ /*- + * Copyright (c) 2017 Ruslan Bukin * Copyright (c) 2013 SRI International * All rights reserved. * @@ -28,6 +29,8 @@ * SUCH DAMAGE. */ +#include "opt_platform.h" + #include __FBSDID("$FreeBSD$"); @@ -37,221 +40,118 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include -#include +#include +#ifdef SMP +#include +#endif + +#include +#include #include #include -#include +#include "pic_if.h" -#include "fdt_ic_if.h" +#define BP_NUM_HARD_IRQS 5 +#define BP_NUM_IRQS 32 +/* We use hard irqs 15-31 as soft */ +#define BP_FIRST_SOFT 16 + +#define BP_CFG_IRQ_S 0 +#define BP_CFG_IRQ_M (0xf << BP_CFG_IRQ_S) +#define BP_CFG_TID_S 8 +#define BP_CFG_TID_M (0x7FFFFF << BP_CFG_TID_S) +#define BP_CFG_ENABLE (1 << 31) + +enum { + BP_CFG, + BP_IP_READ, + BP_IP_SET, + BP_IP_CLEAR +}; struct beripic_softc; -static uint64_t bp_read_cfg(struct beripic_softc *, int); -static void bp_write_cfg(struct beripic_softc *, int, uint64_t); -static void bp_detach_resources(device_t); -static char *bp_strconfig(uint64_t, char *, size_t); -static void bp_config_source(device_t, int, int, u_long, u_long); -#ifdef __mips__ -static void bp_set_counter_name(device_t, device_t, int); -#endif - -static int beripic_fdt_probe(device_t); -static int beripic_fdt_attach(device_t); - -static int beripic_activate_intr(device_t, struct resource *); -static struct resource * - beripic_alloc_intr(device_t, device_t, int *, u_long, u_int); -static int beripic_config_intr(device_t, int, enum intr_trigger, - enum intr_polarity); -static int beripic_release_intr(device_t, struct resource *); -static int beripic_setup_intr(device_t, device_t, struct resource *, - int, driver_filter_t *, driver_intr_t *, void *, void **); -static int beripic_teardown_intr(device_t, device_t, struct resource *, - void *); - -static int beripic_filter(void *); -static void beripic_intr(void *); - -#define BP_MAX_HARD_IRQS 6 -#define BP_FIRST_SOFT 64 - -struct beripic_softc { - device_t bp_dev; - struct resource *bp_cfg_res; - struct resource *bp_read_res; - struct resource *bp_set_res; - struct resource *bp_clear_res; - int bp_cfg_rid; - int bp_read_rid; - int bp_set_rid; - int bp_clear_rid; - bus_space_tag_t bp_cfg_bst; - bus_space_tag_t bp_read_bst; - bus_space_tag_t bp_set_bst; - bus_space_tag_t bp_clear_bst; - bus_space_handle_t bp_cfg_bsh; - bus_space_handle_t bp_read_bsh; - bus_space_handle_t bp_set_bsh; - bus_space_handle_t bp_clear_bsh; - - struct resource *bp_irqs[BP_MAX_HARD_IRQS]; - int bp_irq_rids[BP_MAX_HARD_IRQS]; - int bp_nirqs; - int bp_next_irq; - int bp_next_tid; - - int bp_nthreads; - - int bp_nhard; - int bp_nsoft; - int bp_nsrcs; - struct rman bp_src_rman; - -#ifdef __mips__ - mips_intrcnt_t *bp_counters; -#endif - - struct mtx bp_cfgmtx; +struct beri_pic_isrc { + struct intr_irqsrc isrc; + u_int irq; + uint32_t mips_hard_irq; }; -struct beripic_intr_arg { - driver_filter_t *filter; - driver_intr_t *intr; - void *arg; - struct resource *irq; -#ifdef __mips__ - mips_intrcnt_t counter; -#endif +struct hirq { + uint32_t irq; + struct beripic_softc *sc; }; -struct beripic_cookie { - struct beripic_intr_arg *bpia; - struct resource *hirq; - void *cookie; +struct beripic_softc { + device_t dev; + uint32_t nirqs; + struct beri_pic_isrc irqs[BP_NUM_IRQS]; + struct resource *res[4 + BP_NUM_HARD_IRQS]; + void *ih[BP_NUM_HARD_IRQS]; + struct hirq hirq[BP_NUM_HARD_IRQS]; + uint8_t mips_hard_irq_idx; }; -#define BP_CFG_MASK_E 0x80000000ull -#define BP_CFG_SHIFT_E 31 -#define BP_CFG_MASK_TID 0x7FFFFF00ull /* Depends on CPU */ -#define BP_CFG_SHIFT_TID 8 -#define BP_CFG_MASK_IRQ 0x0000000Full -#define BP_CFG_SHIFT_IRQ 0 -#define BP_CFG_VALID (BP_CFG_MASK_E|BP_CFG_MASK_TID|BP_CFG_MASK_IRQ) -#define BP_CFG_RESERVED ~BP_CFG_VALID - -#define BP_CFG_ENABLED(cfg) (((cfg) & BP_CFG_MASK_E) >> BP_CFG_SHIFT_E) -#define BP_CFG_TID(cfg) (((cfg) & BP_CFG_MASK_TID) >> BP_CFG_SHIFT_TID) -#define BP_CFG_IRQ(cfg) (((cfg) & BP_CFG_MASK_IRQ) >> BP_CFG_SHIFT_IRQ) - -MALLOC_DEFINE(M_BERIPIC, "beripic", "beripic memory"); - -static uint64_t -bp_read_cfg(struct beripic_softc *sc, int irq) -{ - - KASSERT((irq >= 0 && irq < sc->bp_nsrcs), - ("IRQ of of range %d (0-%d)", irq, sc->bp_nsrcs - 1)); - return (bus_space_read_8(sc->bp_cfg_bst, sc->bp_cfg_bsh, irq * 8)); -} - -static void -bp_write_cfg(struct beripic_softc *sc, int irq, uint64_t config) -{ - - KASSERT((irq >= 0 && irq < sc->bp_nsrcs), - ("IRQ of of range %d (0-%d)", irq, sc->bp_nsrcs - 1)); - bus_space_write_8(sc->bp_cfg_bst, sc->bp_cfg_bsh, irq * 8, config); -} +static struct resource_spec beri_pic_spec[] = { + { SYS_RES_MEMORY, 0, RF_ACTIVE }, + { SYS_RES_MEMORY, 1, RF_ACTIVE }, + { SYS_RES_MEMORY, 2, RF_ACTIVE }, + { SYS_RES_MEMORY, 3, RF_ACTIVE }, + { SYS_RES_IRQ, 0, RF_ACTIVE }, + { SYS_RES_IRQ, 1, RF_ACTIVE }, + { SYS_RES_IRQ, 2, RF_ACTIVE }, + { SYS_RES_IRQ, 3, RF_ACTIVE }, + { SYS_RES_IRQ, 4, RF_ACTIVE }, + { -1, 0 } +}; -static void -bp_detach_resources(device_t dev) +static int +beri_pic_intr(void *arg) { struct beripic_softc *sc; + struct intr_irqsrc *isrc; + struct hirq *h; + uint64_t intr; + uint64_t reg; int i; - sc = device_get_softc(dev); + h = arg; + sc = h->sc; - if (sc->bp_cfg_res != NULL) { - bus_release_resource(dev, SYS_RES_MEMORY, sc->bp_cfg_rid, - sc->bp_cfg_res); - sc->bp_cfg_res = NULL; - } - if (sc->bp_read_res != NULL) { - bus_release_resource(dev, SYS_RES_MEMORY, sc->bp_read_rid, - sc->bp_read_res); - sc->bp_read_res = NULL; - } - if (sc->bp_set_res != NULL) { - bus_release_resource(dev, SYS_RES_MEMORY, sc->bp_set_rid, - sc->bp_set_res); - sc->bp_set_res = NULL; - } - if (sc->bp_clear_res != NULL) { - bus_release_resource(dev, SYS_RES_MEMORY, sc->bp_clear_rid, - sc->bp_clear_res); - sc->bp_clear_res = NULL; - } - for (i = sc->bp_nirqs - 1; i >= 0; i--) { - bus_release_resource(dev, SYS_RES_IRQ, sc->bp_irq_rids[i], - sc->bp_irqs[i]); - } - sc->bp_nirqs = 0; -} + intr = bus_read_8(sc->res[BP_IP_READ], 0); + while ((i = fls(intr)) != 0) { + i--; + intr &= ~(1u << i); -static char * -bp_strconfig(uint64_t config, char *configstr, size_t len) -{ - - if (snprintf(configstr, len, "%s tid: %llu hardintr %llu", - BP_CFG_ENABLED(config) ? "enabled" : "disabled", - BP_CFG_TID(config), BP_CFG_IRQ(config)) > len - 1) - return (NULL); - return (configstr); -} + isrc = &sc->irqs[i].isrc; -static void -bp_config_source(device_t ic, int src, int enable, u_long tid, u_long irq) -{ - struct beripic_softc *sc; - uint64_t config; - - sc = device_get_softc(ic); - - config = 0; - config |= enable << BP_CFG_SHIFT_E; - config |= tid << BP_CFG_SHIFT_TID; - config |= irq << BP_CFG_SHIFT_IRQ; - - bp_write_cfg(sc, src, config); -} + reg = bus_read_8(sc->res[BP_CFG], i * 8); + if ((reg & BP_CFG_IRQ_M) != h->irq) { + continue; + } + if ((reg & (BP_CFG_ENABLE)) == 0) { + continue; + } -#ifdef __mips__ -static void -bp_set_counter_name(device_t ic, device_t child, int src) -{ - struct beripic_softc *sc; - char name[MAXCOMLEN + 1]; + if (intr_isrc_dispatch(isrc, curthread->td_intr_frame) != 0) { + device_printf(sc->dev, "Stray interrupt %u detected\n", i); + } - sc = device_get_softc(ic); + bus_write_8(sc->res[BP_IP_CLEAR], 0, (1 << i)); + } - if (snprintf(name, sizeof(name), "bp%dsrc%d%s%s%s", - device_get_unit(ic), src, src < sc->bp_nhard ? "" : "s", - child == NULL ? "" : " ", - child == NULL ? " " : device_get_nameunit(child)) >= sizeof(name)) - name[sizeof(name) - 2] = '+'; - - mips_intrcnt_setname(sc->bp_counters[src], name); + return (FILTER_HANDLED); } -#endif static int -beripic_fdt_probe(device_t dev) +beripic_probe(device_t dev) { if (!ofw_bus_status_okay(dev)) @@ -261,443 +161,208 @@ beripic_fdt_probe(device_t dev) return (ENXIO); device_set_desc(dev, "BERI Programmable Interrupt Controller"); + return (BUS_PROBE_DEFAULT); } static int -beripic_fdt_attach(device_t dev) +beripic_attach(device_t dev) { - char configstr[64]; struct beripic_softc *sc; - struct fdt_ic *fic; - pcell_t nhard, nsoft; - phandle_t ph; - int error, i, src; - uint64_t config; + struct beri_pic_isrc *pic_isrc; + const char *name; + struct intr_irqsrc *isrc; + intptr_t xref; + uint32_t unit; + int err; + int i; sc = device_get_softc(dev); - sc->bp_dev = dev; - - mtx_init(&sc->bp_cfgmtx, "beripic config lock", NULL, MTX_DEF); + sc->dev = dev; - /* - * FDT lists CONFIG, IP_READ, IP_SET, and IP_CLEAR registers as - * seperate memory regions in that order. - */ - sc->bp_cfg_rid = 0; - sc->bp_cfg_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, - &sc->bp_cfg_rid, RF_ACTIVE); - if (sc->bp_cfg_res == NULL) { - device_printf(dev, "failed to map config memory"); - error = ENXIO; - goto err; - } - if (bootverbose) - device_printf(sc->bp_dev, "config region at mem %p-%p\n", - (void *)rman_get_start(sc->bp_cfg_res), - (void *)(rman_get_start(sc->bp_cfg_res) + - rman_get_size(sc->bp_cfg_res))); - - sc->bp_read_rid = 1; - sc->bp_read_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, - &sc->bp_read_rid, RF_ACTIVE); - if (sc->bp_read_res == NULL) { - device_printf(dev, "failed to map IP read memory"); - error = ENXIO; - goto err; - } - if (bootverbose) - device_printf(sc->bp_dev, "IP read region at mem %p-%p\n", - (void *)rman_get_start(sc->bp_read_res), - (void *)(rman_get_start(sc->bp_read_res) + - rman_get_size(sc->bp_read_res))); - - sc->bp_set_rid = 2; - sc->bp_set_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, - &sc->bp_set_rid, RF_ACTIVE); - if (sc->bp_set_res == NULL) { - device_printf(dev, "failed to map IP read memory"); - error = ENXIO; - goto err; - } - if (bootverbose) - device_printf(sc->bp_dev, "IP set region at mem %p-%p\n", - (void *)rman_get_start(sc->bp_set_res), - (void *)(rman_get_start(sc->bp_set_res) + - rman_get_size(sc->bp_set_res))); - - sc->bp_clear_rid = 3; - sc->bp_clear_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, - &sc->bp_clear_rid, RF_ACTIVE); - if (sc->bp_clear_res == NULL) { - device_printf(dev, "failed to map IP read memory"); - error = ENXIO; - goto err; - } - if (bootverbose) - device_printf(sc->bp_dev, "IP clear region at mem %p-%p\n", - (void *)rman_get_start(sc->bp_clear_res), - (void *)(rman_get_start(sc->bp_clear_res) + - rman_get_size(sc->bp_clear_res))); - - i = 0; - for (i = 0; i < BP_MAX_HARD_IRQS; i++) { - sc->bp_irq_rids[i] = i; - sc->bp_irqs[i] = bus_alloc_resource_any(dev, SYS_RES_IRQ, - &sc->bp_irq_rids[i], RF_ACTIVE | RF_SHAREABLE); - if (sc->bp_irqs[i] == NULL) - break; - } - if (i == 0) { - device_printf(dev, "failed to allocate any parent IRQs!"); - error = ENXIO; - goto err; + if (bus_alloc_resources(dev, beri_pic_spec, sc->res)) { + device_printf(dev, "could not allocate resources\n"); + return (ENXIO); } - sc->bp_nirqs = i; - - ph = ofw_bus_gen_get_node(device_get_parent(dev), dev); -#ifndef SMP - sc->bp_nthreads = 1; -#else - sc->bp_nthreads = 1; - /* XXX: get nthreads from cpu(s) somehow */ -#endif + xref = OF_xref_from_node(ofw_bus_get_node(dev)); + name = device_get_nameunit(dev); + unit = device_get_unit(dev); + sc->nirqs = BP_NUM_IRQS; + + for (i = 0; i < sc->nirqs; i++) { + sc->irqs[i].irq = i; + isrc = &sc->irqs[i].isrc; + + /* Assign mips hard irq number. */ + pic_isrc = (struct beri_pic_isrc *)isrc; + pic_isrc->mips_hard_irq = sc->mips_hard_irq_idx++; + /* Last IRQ is used for IPIs. */ + if (sc->mips_hard_irq_idx >= (BP_NUM_HARD_IRQS - 1)) { + sc->mips_hard_irq_idx = 0; + } - if (OF_getprop(ph, "hard-interrupt-sources", &nhard, sizeof(nhard)) - <= 0) { - device_printf(dev, "failed to get number of hard sources"); - error = ENXIO; - goto err; - } - if (OF_getprop(ph, "soft-interrupt-sources", &nsoft, sizeof(nsoft)) - <= 0) { - device_printf(dev, "failed to get number of soft sources"); - error = ENXIO; - goto err; + err = intr_isrc_register(isrc, sc->dev, + 0, "pic%d,%d", unit, i); + bus_write_8(sc->res[BP_CFG], i * 8, 0); } - sc->bp_nhard = nhard; - sc->bp_nsoft = nsoft; - sc->bp_nsrcs = sc->bp_nhard + sc->bp_nsoft; - /* XXX: should deal with gap between hard and soft */ - KASSERT(sc->bp_nhard <= BP_FIRST_SOFT, - ("too many hard sources")); - KASSERT(rman_get_size(sc->bp_cfg_res) / 8 == sc->bp_nsrcs, - ("config space size does not match sources")); - KASSERT(sc->bp_nhard % 64 == 0, - ("Non-multiple of 64 intr counts not supported")); - KASSERT(sc->bp_nsoft % 64 == 0, - ("Non-multiple of 64 intr counts not supported")); - if (bootverbose) - device_printf(dev, "%d hard and %d soft sources\n", - sc->bp_nhard, sc->bp_nsoft); - -#ifdef __mips__ - sc->bp_counters = malloc(sizeof(*sc->bp_counters) * sc->bp_nsrcs, - M_BERIPIC, M_WAITOK|M_ZERO); - for (i = 0; i < sc->bp_nsrcs; i++) { - sc->bp_counters[i] = mips_intrcnt_create(""); - bp_set_counter_name(dev, NULL, i); - } -#endif - - sc->bp_src_rman.rm_start = 0; - sc->bp_src_rman.rm_end = sc->bp_nsrcs - 1; - sc->bp_src_rman.rm_type = RMAN_ARRAY; - sc->bp_src_rman.rm_descr = "Interrupt source"; - if (rman_init(&(sc->bp_src_rman)) != 0 || - rman_manage_region(&(sc->bp_src_rman), 0, sc->bp_nsrcs - 1) != 0) { - device_printf(dev, "Failed to set up sources rman"); - error = ENXIO; - goto err; + /* + * Now, when everything is initialized, it's right time to + * register interrupt controller to interrupt framefork. + */ + if (intr_pic_register(dev, xref) == NULL) { + device_printf(dev, "could not register PIC\n"); + return (ENXIO); } - sc->bp_cfg_bst = rman_get_bustag(sc->bp_cfg_res); - sc->bp_cfg_bsh = rman_get_bushandle(sc->bp_cfg_res); - sc->bp_read_bst = rman_get_bustag(sc->bp_read_res); - sc->bp_read_bsh = rman_get_bushandle(sc->bp_read_res); - sc->bp_set_bst = rman_get_bustag(sc->bp_set_res); - sc->bp_set_bsh = rman_get_bushandle(sc->bp_set_res); - sc->bp_clear_bst = rman_get_bustag(sc->bp_clear_res); - sc->bp_clear_bsh = rman_get_bushandle(sc->bp_clear_res); - - for (src = 0; src < sc->bp_nsrcs; src++) { - config = bp_read_cfg(sc, src); - if (config == 0) - continue; - - if (bootverbose) { - device_printf(dev, "initial config: src %d: %s\n", src, - bp_strconfig(config, configstr, sizeof(configstr))); - if (config & BP_CFG_RESERVED) - device_printf(dev, - "reserved bits not 0: 0x%016jx\n", - (uintmax_t) config); + /* Last IRQ is used for IPIs. */ + for (i = 0; i < (BP_NUM_HARD_IRQS - 1); i++) { + sc->hirq[i].sc = sc; + sc->hirq[i].irq = i; + if (bus_setup_intr(dev, sc->res[4+i], INTR_TYPE_CLK, + beri_pic_intr, NULL, &sc->hirq[i], sc->ih[i])) { + device_printf(dev, "could not setup irq handler\n"); + intr_pic_deregister(dev, xref); + return (ENXIO); } - - bp_config_source(dev, src, 0, 0, 0); } - fic = malloc(sizeof(*fic), M_BERIPIC, M_WAITOK|M_ZERO); - fic->iph = ph; - fic->dev = dev; - SLIST_INSERT_HEAD(&fdt_ic_list_head, fic, fdt_ics); - return (0); -err: - bp_detach_resources(dev); - - return (error); } -static struct resource * -beripic_alloc_intr(device_t ic, device_t child, int *rid, u_long irq, - u_int flags) +static void +beri_pic_enable_intr(device_t dev, struct intr_irqsrc *isrc) { + struct beri_pic_isrc *pic_isrc; struct beripic_softc *sc; - struct resource *rv; - - sc = device_get_softc(ic); + uint64_t reg; - rv = rman_reserve_resource(&(sc->bp_src_rman), irq, irq, 1, flags, - child); - if (rv == NULL) - printf("%s: could not reserve source interrupt for %s\n", - __func__, device_get_nameunit(child)); - rman_set_rid(rv, *rid); - - if ((flags & RF_ACTIVE) && - beripic_activate_intr(ic, rv) != 0) { - printf("%s: could not activate interrupt\n", __func__); - rman_release_resource(rv); - return (NULL); - } - - return (rv); -} - -static int -beripic_release_intr(device_t ic, struct resource *r) -{ - - return (rman_release_resource(r)); -} - -static int -beripic_activate_intr(device_t ic, struct resource *r) -{ - - return (rman_activate_resource(r)); -} + sc = device_get_softc(dev); + pic_isrc = (struct beri_pic_isrc *)isrc; -static int -beripic_deactivate_intr(device_t ic, struct resource *r) -{ - - return (rman_deactivate_resource(r)); + reg = BP_CFG_ENABLE; + reg |= (pic_isrc->mips_hard_irq << BP_CFG_IRQ_S); + bus_write_8(sc->res[BP_CFG], pic_isrc->irq * 8, reg); } -static int -beripic_config_intr(device_t dev, int irq, enum intr_trigger trig, - enum intr_polarity pol) +static void +beri_pic_disable_intr(device_t dev, struct intr_irqsrc *isrc) { + struct beri_pic_isrc *pic_isrc; + struct beripic_softc *sc; + uint64_t reg; - if (trig != INTR_TRIGGER_CONFORM || pol != INTR_POLARITY_CONFORM) - return (EINVAL); + sc = device_get_softc(dev); + pic_isrc = (struct beri_pic_isrc *)isrc; - return (0); + reg = bus_read_8(sc->res[BP_CFG], pic_isrc->irq * 8); + reg &= ~BP_CFG_ENABLE; + bus_write_8(sc->res[BP_CFG], pic_isrc->irq * 8, reg); } static int -beripic_setup_intr(device_t ic, device_t child, struct resource *irq, - int flags, driver_filter_t *filter, driver_intr_t *intr, void *arg, - void **cookiep) +beri_pic_map_intr(device_t dev, struct intr_map_data *data, + struct intr_irqsrc **isrcp) { struct beripic_softc *sc; - struct beripic_intr_arg *bpia; - struct beripic_cookie *bpc; - int error; - u_long hirq, src, tid; - - sc = device_get_softc(ic); - - src = rman_get_start(irq); - - KASSERT(src < sc->bp_nsrcs, ("source (%lu) out of range 0-%d", - src, sc->bp_nsrcs - 1)); - - bpia = malloc(sizeof(*bpia), M_BERIPIC, M_WAITOK|M_ZERO); - bpia->filter = filter; - bpia->intr = intr; - bpia->arg = arg; - bpia->irq = irq; -#ifdef __mips__ - bpia->counter = sc->bp_counters[src]; - bp_set_counter_name(ic, child, src); -#endif + struct intr_map_data_fdt *daf; + uint32_t irq; - bpc = malloc(sizeof(*bpc), M_BERIPIC, M_WAITOK|M_ZERO); - bpc->bpia = bpia; - - mtx_lock(&(sc->bp_cfgmtx)); - bpc->hirq = sc->bp_irqs[sc->bp_next_irq]; - hirq = rman_get_start(bpc->hirq); - tid = sc->bp_next_tid; - - error = BUS_SETUP_INTR(device_get_parent(ic), ic, bpc->hirq, flags, - beripic_filter, intr == NULL ? NULL : beripic_intr, bpia, - &(bpc->cookie)); - if (error != 0) - goto err; + sc = device_get_softc(dev); + daf = (struct intr_map_data_fdt *)data; -#ifdef NOTYET -#ifdef SMP - /* XXX: bind ithread to cpu */ - sc->bp_next_tid++; - if (sc->bp_next_tid >= sc->bp_nthreads) - sc->bp_next_tid = 0; -#endif -#endif - if (sc->bp_next_tid == 0) { - sc->bp_next_irq++; - if (sc->bp_next_irq >= sc->bp_nirqs) - sc->bp_next_irq = 0; - } - mtx_unlock(&(sc->bp_cfgmtx)); + if (data == NULL || data->type != INTR_MAP_DATA_FDT || + daf->ncells != 1 || daf->cells[0] >= sc->nirqs) + return (EINVAL); - *cookiep = bpc; + irq = daf->cells[0]; - bp_config_source(ic, rman_get_start(irq), 1, tid, hirq); + *isrcp = &sc->irqs[irq].isrc; return (0); -err: - free(bpc, M_BERIPIC); - free(bpia, M_BERIPIC); - - return (error); } -static int -beripic_teardown_intr(device_t dev, device_t child, struct resource *irq, - void *cookie) +static void +beri_pic_post_ithread(device_t dev, struct intr_irqsrc *isrc) { - struct beripic_cookie *bpc; - int error; - - bpc = cookie; - - bp_config_source(dev, rman_get_start(irq), 0, 0, 0); - - free(bpc->bpia, M_BERIPIC); - - error = BUS_TEARDOWN_INTR(device_get_parent(dev), dev, bpc->hirq, - bpc->cookie); - - free(bpc, M_BERIPIC); - return (error); -} - -static int -beripic_filter(void *arg) -{ - struct beripic_intr_arg *bpic; - - bpic = arg; - -#ifdef __mips__ - mips_intrcnt_inc(bpic->counter); -#endif - - /* XXX: Add a check that our source is high */ - - if (bpic->filter == NULL) - return (FILTER_SCHEDULE_THREAD); - - return (bpic->filter(bpic->arg)); + beri_pic_enable_intr(dev, isrc); } static void -beripic_intr(void *arg) +beri_pic_pre_ithread(device_t dev, struct intr_irqsrc *isrc) { - struct beripic_intr_arg *bpic; - - bpic = arg; - - KASSERT(bpic->intr != NULL, - ("%s installed, but no child intr", __func__)); - bpic->intr(bpic->arg); + beri_pic_disable_intr(dev, isrc); } *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Tue Apr 18 18:07:56 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 83288D4430E; Tue, 18 Apr 2017 18:07:56 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5DF8A8F2; Tue, 18 Apr 2017 18:07:56 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3II7tei023544; Tue, 18 Apr 2017 18:07:55 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3II7sJ4023532; Tue, 18 Apr 2017 18:07:54 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201704181807.v3II7sJ4023532@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Tue, 18 Apr 2017 18:07:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317097 - in head/sys/boot: common efi/libefi i386/libi386 mips/beri/loader powerpc/ps3 uboot/lib usb/storage userboot/userboot X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 18 Apr 2017 18:07:56 -0000 Author: tsoome Date: Tue Apr 18 18:07:54 2017 New Revision: 317097 URL: https://svnweb.freebsd.org/changeset/base/317097 Log: loader: F_READ/F_WRITE should be checked against masked flag The work to make it possible to avoid bcache via using F_NORA modifier did miss the fact that not all loader platforms are using the bcache, and so it is possible the modifier is not cleared, as bcache strategy function is not used. For fix, we make sure the checks are dont with masked flag. This patch does fix boot for platforms which do not use bcache. Reported by: emaste Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D10422 Modified: head/sys/boot/common/md.c head/sys/boot/efi/libefi/efipart.c head/sys/boot/i386/libi386/bioscd.c head/sys/boot/i386/libi386/biosdisk.c head/sys/boot/mips/beri/loader/beri_disk_cfi.c head/sys/boot/mips/beri/loader/beri_disk_sdcard.c head/sys/boot/powerpc/ps3/ps3cdrom.c head/sys/boot/powerpc/ps3/ps3disk.c head/sys/boot/uboot/lib/disk.c head/sys/boot/usb/storage/umass_loader.c head/sys/boot/userboot/userboot/userboot_disk.c Modified: head/sys/boot/common/md.c ============================================================================== --- head/sys/boot/common/md.c Tue Apr 18 17:39:20 2017 (r317096) +++ head/sys/boot/common/md.c Tue Apr 18 18:07:54 2017 (r317097) @@ -106,7 +106,7 @@ md_strategy(void *devdata, int rw, daddr if (rsize != NULL) *rsize = size; - switch (rw) { + switch (rw & F_MASK) { case F_READ: bcopy(md_image.start + ofs, buf, size); return (0); Modified: head/sys/boot/efi/libefi/efipart.c ============================================================================== --- head/sys/boot/efi/libefi/efipart.c Tue Apr 18 17:39:20 2017 (r317096) +++ head/sys/boot/efi/libefi/efipart.c Tue Apr 18 18:07:54 2017 (r317097) @@ -819,7 +819,7 @@ efipart_readwrite(EFI_BLOCK_IO *blkio, i if ((blk + nblks - 1) > blkio->Media->LastBlock) return (EIO); - switch (rw) { + switch (rw & F_MASK) { case F_READ: status = blkio->ReadBlocks(blkio, blkio->Media->MediaId, blk, nblks * blkio->Media->BlockSize, buf); Modified: head/sys/boot/i386/libi386/bioscd.c ============================================================================== --- head/sys/boot/i386/libi386/bioscd.c Tue Apr 18 17:39:20 2017 (r317096) +++ head/sys/boot/i386/libi386/bioscd.c Tue Apr 18 18:07:54 2017 (r317097) @@ -268,7 +268,7 @@ bc_realstrategy(void *devdata, int rw, d return (EINVAL); #endif - if (rw != F_READ) + if ((rw & F_MASK) != F_READ) return(EROFS); dev = (struct i386_devdesc *)devdata; unit = dev->d_unit; Modified: head/sys/boot/i386/libi386/biosdisk.c ============================================================================== --- head/sys/boot/i386/libi386/biosdisk.c Tue Apr 18 17:39:20 2017 (r317096) +++ head/sys/boot/i386/libi386/biosdisk.c Tue Apr 18 18:07:54 2017 (r317097) @@ -618,7 +618,7 @@ bd_realstrategy(void *devdata, int rw, d DEBUG("short read %d", blks); } - switch(rw){ + switch (rw & F_MASK) { case F_READ: DEBUG("read %d from %lld to %p", blks, dblk, buf); Modified: head/sys/boot/mips/beri/loader/beri_disk_cfi.c ============================================================================== --- head/sys/boot/mips/beri/loader/beri_disk_cfi.c Tue Apr 18 17:39:20 2017 (r317096) +++ head/sys/boot/mips/beri/loader/beri_disk_cfi.c Tue Apr 18 18:07:54 2017 (r317097) @@ -73,6 +73,7 @@ beri_cfi_disk_strategy(void *devdata, in { int error; + flag &= F_MASK; if (flag == F_WRITE) return (EROFS); if (flag != F_READ) Modified: head/sys/boot/mips/beri/loader/beri_disk_sdcard.c ============================================================================== --- head/sys/boot/mips/beri/loader/beri_disk_sdcard.c Tue Apr 18 17:39:20 2017 (r317096) +++ head/sys/boot/mips/beri/loader/beri_disk_sdcard.c Tue Apr 18 18:07:54 2017 (r317097) @@ -73,6 +73,7 @@ beri_sdcard_disk_strategy(void *devdata, { int error; + flag &= F_MASK; if (flag == F_WRITE) return (EROFS); if (flag != F_READ) Modified: head/sys/boot/powerpc/ps3/ps3cdrom.c ============================================================================== --- head/sys/boot/powerpc/ps3/ps3cdrom.c Tue Apr 18 17:39:20 2017 (r317096) +++ head/sys/boot/powerpc/ps3/ps3cdrom.c Tue Apr 18 18:07:54 2017 (r317097) @@ -83,6 +83,7 @@ static int ps3cdrom_strategy(void *devda DEBUG("d_unit=%u dblk=%llu size=%u", dev->d_unit, dblk, size); + flag &= F_MASK; if (flag != F_READ) { dev_printf(dev, "write operation is not supported!"); return EROFS; Modified: head/sys/boot/powerpc/ps3/ps3disk.c ============================================================================== --- head/sys/boot/powerpc/ps3/ps3disk.c Tue Apr 18 17:39:20 2017 (r317096) +++ head/sys/boot/powerpc/ps3/ps3disk.c Tue Apr 18 18:07:54 2017 (r317097) @@ -115,6 +115,7 @@ static int ps3disk_strategy(void *devdat struct open_dev *od = (struct open_dev *) dev->d_disk.data; int err; + flag &= F_MASK; if (flag != F_READ) { dev_printf(dev, "write operation is not supported!\n"); return EROFS; Modified: head/sys/boot/uboot/lib/disk.c ============================================================================== --- head/sys/boot/uboot/lib/disk.c Tue Apr 18 17:39:20 2017 (r317096) +++ head/sys/boot/uboot/lib/disk.c Tue Apr 18 18:07:54 2017 (r317097) @@ -149,6 +149,7 @@ stor_strategy(void *devdata, int rw, dad daddr_t bcount; int err; + rw &= F_MASK; if (rw != F_READ) { stor_printf("write attempt, operation not supported!\n"); return (EROFS); Modified: head/sys/boot/usb/storage/umass_loader.c ============================================================================== --- head/sys/boot/usb/storage/umass_loader.c Tue Apr 18 17:39:20 2017 (r317096) +++ head/sys/boot/usb/storage/umass_loader.c Tue Apr 18 18:07:54 2017 (r317097) @@ -92,6 +92,7 @@ umass_disk_strategy(void *devdata, int f if (rsizep != NULL) *rsizep = 0; + flag &= F_MASK; if (flag == F_WRITE) { if (usb_msc_write_10(umass_uaa.device, 0, dblk, size >> 9, buf) != 0) return (EINVAL); Modified: head/sys/boot/userboot/userboot/userboot_disk.c ============================================================================== --- head/sys/boot/userboot/userboot/userboot_disk.c Tue Apr 18 17:39:20 2017 (r317096) +++ head/sys/boot/userboot/userboot/userboot_disk.c Tue Apr 18 18:07:54 2017 (r317097) @@ -211,6 +211,7 @@ userdisk_realstrategy(void *devdata, int size_t resid; int rc; + rw &= F_MASK; if (rw == F_WRITE) return (EROFS); if (rw != F_READ) From owner-svn-src-head@freebsd.org Tue Apr 18 18:19:03 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 08ED9D4483A for ; Tue, 18 Apr 2017 18:19:03 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1b.ore.mailhop.org (outbound1b.ore.mailhop.org [54.200.247.200]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E0D47130F for ; Tue, 18 Apr 2017 18:19:02 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: 868047c8-2463-11e7-bfb5-0d159cd3c324 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 73.78.92.27 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [73.78.92.27]) by outbound1.ore.mailhop.org (Halon) with ESMTPSA id 868047c8-2463-11e7-bfb5-0d159cd3c324; Tue, 18 Apr 2017 18:19:14 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id v3IIIstG009242; Tue, 18 Apr 2017 12:18:54 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1492539534.96207.33.camel@freebsd.org> Subject: Re: svn commit: r317097 - in head/sys/boot: common efi/libefi i386/libi386 mips/beri/loader powerpc/ps3 uboot/lib usb/storage userboot/userboot From: Ian Lepore To: Toomas Soome , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Tue, 18 Apr 2017 12:18:54 -0600 In-Reply-To: <201704181807.v3II7sJ4023532@repo.freebsd.org> References: <201704181807.v3II7sJ4023532@repo.freebsd.org> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 18 Apr 2017 18:19:03 -0000 On Tue, 2017-04-18 at 18:07 +0000, Toomas Soome wrote: > Author: tsoome > Date: Tue Apr 18 18:07:54 2017 > New Revision: 317097 > URL: https://svnweb.freebsd.org/changeset/base/317097 > > Log: >   loader: F_READ/F_WRITE should be checked against masked flag >    >   The work to make it possible to avoid bcache via using F_NORA > modifier did >   miss the fact that not all loader platforms are using the bcache, > and so >   it is possible the modifier is not cleared, as bcache strategy > function is >   not used. >    >   For fix, we make sure the checks are dont with masked flag. >    >   This patch does fix boot for platforms which do not use bcache. >    >   Reported by: emaste >   Reviewed by: emaste >   Differential Revision: https://reviews.freebsd.org/D10422 > Now the boot fails on arm with: Found U-Boot device: disk   Checking unit=0 slice= partition=...disk0: real size != size -- Ian > Modified: >   head/sys/boot/common/md.c >   head/sys/boot/efi/libefi/efipart.c >   head/sys/boot/i386/libi386/bioscd.c >   head/sys/boot/i386/libi386/biosdisk.c >   head/sys/boot/mips/beri/loader/beri_disk_cfi.c >   head/sys/boot/mips/beri/loader/beri_disk_sdcard.c >   head/sys/boot/powerpc/ps3/ps3cdrom.c >   head/sys/boot/powerpc/ps3/ps3disk.c >   head/sys/boot/uboot/lib/disk.c >   head/sys/boot/usb/storage/umass_loader.c >   head/sys/boot/userboot/userboot/userboot_disk.c > > Modified: head/sys/boot/common/md.c > ===================================================================== > ========= > --- head/sys/boot/common/md.c Tue Apr 18 17:39:20 2017 > (r317096) > +++ head/sys/boot/common/md.c Tue Apr 18 18:07:54 2017 > (r317097) > @@ -106,7 +106,7 @@ md_strategy(void *devdata, int rw, daddr >   if (rsize != NULL) >   *rsize = size; >   > - switch (rw) { > + switch (rw & F_MASK) { >   case F_READ: >   bcopy(md_image.start + ofs, buf, size); >   return (0); > > Modified: head/sys/boot/efi/libefi/efipart.c > ===================================================================== > ========= > --- head/sys/boot/efi/libefi/efipart.c Tue Apr 18 17:39:20 > 2017 (r317096) > +++ head/sys/boot/efi/libefi/efipart.c Tue Apr 18 18:07:54 > 2017 (r317097) > @@ -819,7 +819,7 @@ efipart_readwrite(EFI_BLOCK_IO *blkio, i >   if ((blk + nblks - 1) > blkio->Media->LastBlock) >   return (EIO); >   > - switch (rw) { > + switch (rw & F_MASK) { >   case F_READ: >   status = blkio->ReadBlocks(blkio, blkio->Media- > >MediaId, blk, >       nblks * blkio->Media->BlockSize, buf); > > Modified: head/sys/boot/i386/libi386/bioscd.c > ===================================================================== > ========= > --- head/sys/boot/i386/libi386/bioscd.c Tue Apr 18 17:39:20 > 2017 (r317096) > +++ head/sys/boot/i386/libi386/bioscd.c Tue Apr 18 18:07:54 > 2017 (r317097) > @@ -268,7 +268,7 @@ bc_realstrategy(void *devdata, int rw, d >   return (EINVAL); >  #endif >   > - if (rw != F_READ) > + if ((rw & F_MASK) != F_READ) >   return(EROFS); >   dev = (struct i386_devdesc *)devdata; >   unit = dev->d_unit; > > Modified: head/sys/boot/i386/libi386/biosdisk.c > ===================================================================== > ========= > --- head/sys/boot/i386/libi386/biosdisk.c Tue Apr 18 17:39:20 > 2017 (r317096) > +++ head/sys/boot/i386/libi386/biosdisk.c Tue Apr 18 18:07:54 > 2017 (r317097) > @@ -618,7 +618,7 @@ bd_realstrategy(void *devdata, int rw, d >   DEBUG("short read %d", blks); >      } >   > -    switch(rw){ > +    switch (rw & F_MASK) { >      case F_READ: >   DEBUG("read %d from %lld to %p", blks, dblk, buf); >   > > Modified: head/sys/boot/mips/beri/loader/beri_disk_cfi.c > ===================================================================== > ========= > --- head/sys/boot/mips/beri/loader/beri_disk_cfi.c Tue Apr 18 > 17:39:20 2017 (r317096) > +++ head/sys/boot/mips/beri/loader/beri_disk_cfi.c Tue Apr 18 > 18:07:54 2017 (r317097) > @@ -73,6 +73,7 @@ beri_cfi_disk_strategy(void *devdata, in >  { >   int error; >   > + flag &= F_MASK; >   if (flag == F_WRITE) >   return (EROFS); >   if (flag != F_READ) > > Modified: head/sys/boot/mips/beri/loader/beri_disk_sdcard.c > ===================================================================== > ========= > --- head/sys/boot/mips/beri/loader/beri_disk_sdcard.c Tue Apr > 18 17:39:20 2017 (r317096) > +++ head/sys/boot/mips/beri/loader/beri_disk_sdcard.c Tue Apr > 18 18:07:54 2017 (r317097) > @@ -73,6 +73,7 @@ beri_sdcard_disk_strategy(void *devdata, >  { >   int error; >   > + flag &= F_MASK; >   if (flag == F_WRITE) >   return (EROFS); >   if (flag != F_READ) > > Modified: head/sys/boot/powerpc/ps3/ps3cdrom.c > ===================================================================== > ========= > --- head/sys/boot/powerpc/ps3/ps3cdrom.c Tue Apr 18 17:39:20 > 2017 (r317096) > +++ head/sys/boot/powerpc/ps3/ps3cdrom.c Tue Apr 18 18:07:54 > 2017 (r317097) > @@ -83,6 +83,7 @@ static int ps3cdrom_strategy(void *devda >   >   DEBUG("d_unit=%u dblk=%llu size=%u", dev->d_unit, dblk, > size); >   > + flag &= F_MASK; >   if (flag != F_READ) { >   dev_printf(dev, "write operation is not > supported!"); >   return EROFS; > > Modified: head/sys/boot/powerpc/ps3/ps3disk.c > ===================================================================== > ========= > --- head/sys/boot/powerpc/ps3/ps3disk.c Tue Apr 18 17:39:20 > 2017 (r317096) > +++ head/sys/boot/powerpc/ps3/ps3disk.c Tue Apr 18 18:07:54 > 2017 (r317097) > @@ -115,6 +115,7 @@ static int ps3disk_strategy(void *devdat >   struct open_dev *od = (struct open_dev *) dev->d_disk.data; >   int err; >   > + flag &= F_MASK; >   if (flag != F_READ) { >   dev_printf(dev, "write operation is not > supported!\n"); >   return EROFS; > > Modified: head/sys/boot/uboot/lib/disk.c > ===================================================================== > ========= > --- head/sys/boot/uboot/lib/disk.c Tue Apr 18 17:39:20 2017 > (r317096) > +++ head/sys/boot/uboot/lib/disk.c Tue Apr 18 18:07:54 2017 > (r317097) > @@ -149,6 +149,7 @@ stor_strategy(void *devdata, int rw, dad >   daddr_t bcount; >   int err; >   > + rw &= F_MASK; >   if (rw != F_READ) { >   stor_printf("write attempt, operation not > supported!\n"); >   return (EROFS); > > Modified: head/sys/boot/usb/storage/umass_loader.c > ===================================================================== > ========= > --- head/sys/boot/usb/storage/umass_loader.c Tue Apr 18 > 17:39:20 2017 (r317096) > +++ head/sys/boot/usb/storage/umass_loader.c Tue Apr 18 > 18:07:54 2017 (r317097) > @@ -92,6 +92,7 @@ umass_disk_strategy(void *devdata, int f >   if (rsizep != NULL) >   *rsizep = 0; >   > + flag &= F_MASK; >   if (flag == F_WRITE) { >   if (usb_msc_write_10(umass_uaa.device, 0, dblk, size > >> 9, buf) != 0) >   return (EINVAL); > > Modified: head/sys/boot/userboot/userboot/userboot_disk.c > ===================================================================== > ========= > --- head/sys/boot/userboot/userboot/userboot_disk.c Tue Apr 18 > 17:39:20 2017 (r317096) > +++ head/sys/boot/userboot/userboot/userboot_disk.c Tue Apr 18 > 18:07:54 2017 (r317097) > @@ -211,6 +211,7 @@ userdisk_realstrategy(void *devdata, int >   size_t resid; >   int rc; >   > + rw &= F_MASK; >   if (rw == F_WRITE) >   return (EROFS); >   if (rw != F_READ) > From owner-svn-src-head@freebsd.org Tue Apr 18 19:02:18 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 71D86D44A44; Tue, 18 Apr 2017 19:02:18 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-yb0-x22e.google.com (mail-yb0-x22e.google.com [IPv6:2607:f8b0:4002:c09::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 292BD88C; Tue, 18 Apr 2017 19:02:18 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-yb0-x22e.google.com with SMTP id m133so554633ybb.1; Tue, 18 Apr 2017 12:02:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=GnGlPZcrMm+F02SY/FGNf6lf+CAyXtp4PmG3kiL998U=; b=N+oP8l/dcqORy5+9kbeDfngxCMe/N8R/5PIOMEhyEZ/7alz25JA0UQyKYvGLGegdY8 uOqjl9oSbEuWtPBnWLmOkVnWlbBZ/fcX45itB9oGwABWodSYVda0XTsO6JWNkvhDnimH UP3w/kR+r8fWDQRLB9nESFgTdVskPQZYjOmjVZywoPoK2AB/FxqV4p/7L/JP74iETkDO TKU5u2xZsmMrGxloVK898GzRnvKG8ENx/4XGPmXeY8bt0iuZZOi5YB4O45J97kUYLMG3 JbhHbzF+RJwl1rc4PlSxO9pcKfkyH8OcGfzaAraTwk9QlAW32WsrBz79CRRlYKya2Q1S LCBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=GnGlPZcrMm+F02SY/FGNf6lf+CAyXtp4PmG3kiL998U=; b=YQmJmRjE8x5ofWVUV68KP34WovAqONquxqYGBI96ogWYYKzCVIH7ymDCYlWntxGwLV Vm+ZRy7WMHTnlbyqkey0oCNukT7ynFf1Bfn/eR/C6dywOL7T6aQqD0ueNe0T4n8upioa UuBSGGXYU3UMgv6r1Y4rTNFmy6RlGSgOVVmesfMz6CISD9ugB9bd4+wfbWguiHQ9Y4nK 3Vew5K4VEEitgGUwhdboNcpbCq2c5dy7E5y5vQWbDVSdztrEJPSOohyurrE2ssv5BjfR k1TRukYcbM7M/BiUx1Ie6CFBHu+sdnw8jyUv7wLQRJPzOdmXHMwDW7Phy9kdubNqe4ly tRhg== X-Gm-Message-State: AN3rC/4oT8Fn3C8D+MmPy6GZOZFbSEq1qqOMGSYpw3VfVFjFaEUUlXKE U1lPeMMAJc1xsTbMDPIW5ArIcbJvWA== X-Received: by 10.37.234.72 with SMTP id o8mr19957951ybe.34.1492542137031; Tue, 18 Apr 2017 12:02:17 -0700 (PDT) MIME-Version: 1.0 Sender: asomers@gmail.com Received: by 10.129.20.214 with HTTP; Tue, 18 Apr 2017 12:02:16 -0700 (PDT) In-Reply-To: <201610312309.u9VN9qGk027956@repo.freebsd.org> References: <201610312309.u9VN9qGk027956@repo.freebsd.org> From: Alan Somers Date: Tue, 18 Apr 2017 13:02:16 -0600 X-Google-Sender-Auth: kHPheU1Axr3_hEUfritvNI0WM9s Message-ID: Subject: Re: svn commit: r308155 - in head/sys: amd64/conf cam cam/scsi conf dev/mps geom geom/part kern sys vm To: "Conrad E. Meyer" 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.23 Precedence: list List-Id: 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, 18 Apr 2017 19:02:18 -0000 On Mon, Oct 31, 2016 at 5:09 PM, Conrad E. Meyer wrote: > Author: cem > Date: Mon Oct 31 23:09:52 2016 > New Revision: 308155 > URL: https://svnweb.freebsd.org/changeset/base/308155 > > Log: > Add BUF_TRACKING and FULL_BUF_TRACKING buffer debugging > > Upstream the BUF_TRACKING and FULL_BUF_TRACKING buffer debugging code. > This can be handy in tracking down what code touched hung bios and bufs > last. The full history is especially useful, but adds enough bloat that > it shouldn't be enabled in release builds. > > Function names (or arbitrary string constants) are tracked in a > fixed-size ring in bufs. Bios gain a pointer to the upper buf for > tracking. SCSI CCBs gain a pointer to the upper bio for tracking. > > Reviewed by: markj > Sponsored by: Dell EMC Isilon > Differential Revision: https://reviews.freebsd.org/D8366 > > Modified: > head/sys/amd64/conf/GENERIC > head/sys/amd64/conf/GENERIC-NODEBUG > head/sys/cam/cam_ccb.h > head/sys/cam/cam_periph.c > head/sys/cam/cam_xpt.c > head/sys/cam/scsi/scsi_da.c > head/sys/conf/options > head/sys/dev/mps/mps_sas.c > head/sys/geom/geom_dev.c > head/sys/geom/geom_disk.c > head/sys/geom/geom_io.c > head/sys/geom/geom_subr.c > head/sys/geom/geom_vfs.c > head/sys/geom/part/g_part.c > head/sys/kern/vfs_bio.c > head/sys/kern/vfs_cluster.c > head/sys/sys/bio.h > head/sys/sys/buf.h > head/sys/vm/vm_pager.c This change is causing panics when I try to create a zpool on an SSD. The SSD is obviously having problems; it fails UNMAP commands with ILLEGAL REQUEST, and then fails WRITE SAME with a timeout. The offending line is the biotrack call in scsi_da.c at line 4172; bp is apparently null. Could you please review this change and ensure that biotrack is appropriately guarded? -Alan From owner-svn-src-head@freebsd.org Tue Apr 18 19:15:24 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EC852D44FA0; Tue, 18 Apr 2017 19:15:24 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-wm0-f47.google.com (mail-wm0-f47.google.com [74.125.82.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 81B1E171; Tue, 18 Apr 2017 19:15:24 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-wm0-f47.google.com with SMTP id r190so11643635wme.1; Tue, 18 Apr 2017 12:15:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=y5khROLhd0BWHV2RSWuODWTQux+975iig3YwGcfKvpo=; b=DaGgUGjhcKVtDVSejrcVyK9JSM9N7r1JUrnfrtKdbkcD97rtJvqyjQxmnblBIUPD5B zHIKA9gJvGXm41ywhuHBfM0jQozjHcibG84Jw3O902Er8UBcXXsTxu15nWIe9UegCcYr uRYtxkIO3tcUCeOAC3raVDTeYeCydxowm+/y7fZniFGPS0IFPwpQtgx77Q+OLxPNuQxY 3dRD01KCuFQDkNAH7N/gYK7VRSr1T4TZWX5UOcjPDXUh/NmmDmvE7BlXTONPKJWaEaiX 7I/GDB0Gb1yE8wMx53PH4bbJjPgtKNVWOKlAnIpSb0/x0JOBKabAC80jiaLwoccNn38p 2XlQ== X-Gm-Message-State: AN3rC/7+JW+epPcUFLvKxOVTmiYOCm35q0WluKgNWP/bdIjGUXNkJcq6 tGUPb0ECVIzCnVC64T0= X-Received: by 10.28.209.204 with SMTP id i195mr14890499wmg.113.1492542922048; Tue, 18 Apr 2017 12:15:22 -0700 (PDT) Received: from mail-wr0-f177.google.com (mail-wr0-f177.google.com. [209.85.128.177]) by smtp.gmail.com with ESMTPSA id m83sm16198001wmc.7.2017.04.18.12.15.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 18 Apr 2017 12:15:21 -0700 (PDT) Received: by mail-wr0-f177.google.com with SMTP id z109so1497359wrb.1; Tue, 18 Apr 2017 12:15:21 -0700 (PDT) X-Received: by 10.223.160.214 with SMTP id n22mr26036844wrn.198.1492542921770; Tue, 18 Apr 2017 12:15:21 -0700 (PDT) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.80.169.4 with HTTP; Tue, 18 Apr 2017 12:15:21 -0700 (PDT) In-Reply-To: References: <201610312309.u9VN9qGk027956@repo.freebsd.org> From: Conrad Meyer Date: Tue, 18 Apr 2017 12:15:21 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r308155 - in head/sys: amd64/conf cam cam/scsi conf dev/mps geom geom/part kern sys vm To: Alan Somers 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.23 Precedence: list List-Id: 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, 18 Apr 2017 19:15:25 -0000 Hi Alan, On Tue, Apr 18, 2017 at 12:02 PM, Alan Somers wrote: > This change is causing panics when I try to create a zpool on an SSD. > > ... (reordered slightly) > > The > offending line is the biotrack call in scsi_da.c at line 4172; bp is > apparently null. Could you please review this change and ensure that > biotrack is appropriately guarded? If it is valid for bp to be NULL in that path, then of course a NULL guard needs to be added. I'm a little confused on why or if it is valid for bp to be NULL in that path. You are the only one who has reported this since October of last year. Is it possible some other issue is now resulting in a NULL bp? > The SSD is obviously having problems; it fails UNMAP commands with > ILLEGAL REQUEST, and then fails WRITE SAME with a timeout. Well, that could definitely explain a weird error case. Still, shouldn't the CCB keep the bp associated through CCB completion? Thanks, Conrad From owner-svn-src-head@freebsd.org Tue Apr 18 19:16:04 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EC41DD42024; Tue, 18 Apr 2017 19:16:04 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-io0-x229.google.com (mail-io0-x229.google.com [IPv6:2607:f8b0:4001:c06::229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B207E32C; Tue, 18 Apr 2017 19:16:04 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-io0-x229.google.com with SMTP id r16so7669250ioi.2; Tue, 18 Apr 2017 12:16:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=TarwUcLL3AlapwXD5iphAidPLfBXHZH+n1DKIpnVJPA=; b=tqoWbX+8Jo8NCtr1PIlIHXDfFHV9W53IY11wQdy0AAw0uNtfbEDw/gou8TsuW3joc+ 0XKpv24SPpspAzLeb566ZEZ6mkHP6yds8aCx4uFxDl2oRYCq6WHx6ZW05LPIp9Dyc3xM rN0RrtL48bCI0HiHIMTT9YRMLBz97SGVAL8NOPGTfjyDOYDzu8VC/aw6PqPfoeMRS+tH 14WDnX/L75GcT85avBAsX2J0oey1KUsaFVpHSrWynaXUXWMD4IqFUtUtuNszcgSkMOO3 9TZ7kMkK864Z7W5rc/KtQl0ZZLLtOPgllJAOmrCxYNCm64XJVOiEWUFhc906PDTflTBd SZ5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=TarwUcLL3AlapwXD5iphAidPLfBXHZH+n1DKIpnVJPA=; b=lzOMofQ60YbY5F0wAcPLKRmRZRZFt0+1LcpwYhGdv88444qEcyLfAU4A6I4go3sukB 2DLzExebwGVQIaQZ5bIec5LUOwkSXQm5gZjXLK0po0H6+9nE84LHeRanii48hlWcA9Wr 7j8SsER3mkSWQNSAhX5pavDaJHmSi9RJvyoyXx6nAP/delfJfOncJo/ZXmWyUf93LsA/ Q8k/KSqYWP+Dl/PFCjiUNuBvFOI3mSzcuhltUJkAtyWQB+zpKqId2JoAmxqpa3OQa/Dx 18CnfLDBf1K9iX2mOOLc9CFxszEoit8yIU0NeQUel0eIqdhuaBEPdR9bSqe5DEvggOZN g8Yg== X-Gm-Message-State: AN3rC/7w/2h+kQC2l5na0febni6+HY7tYlrglTIYmtQE+H7FZ450L2xx VdfTmemKB+3YGSmHzP3bhj4tsfwsBdYX X-Received: by 10.107.191.2 with SMTP id p2mr17219769iof.172.1492542963944; Tue, 18 Apr 2017 12:16:03 -0700 (PDT) MIME-Version: 1.0 Sender: carpeddiem@gmail.com Received: by 10.107.30.136 with HTTP; Tue, 18 Apr 2017 12:15:43 -0700 (PDT) In-Reply-To: <1492539534.96207.33.camel@freebsd.org> References: <201704181807.v3II7sJ4023532@repo.freebsd.org> <1492539534.96207.33.camel@freebsd.org> From: Ed Maste Date: Tue, 18 Apr 2017 15:15:43 -0400 X-Google-Sender-Auth: G06Vt1oAYm32Yepyky10H9rIPQI Message-ID: Subject: Re: svn commit: r317097 - in head/sys/boot: common efi/libefi i386/libi386 mips/beri/loader powerpc/ps3 uboot/lib usb/storage userboot/userboot To: Ian Lepore Cc: Toomas Soome , "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.23 Precedence: list List-Id: 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, 18 Apr 2017 19:16:05 -0000 On 18 April 2017 at 14:18, Ian Lepore wrote: > > Now the boot fails on arm with: > > Found U-Boot device: disk > Checking unit=0 slice= partition=...disk0: real size != size Hrmph. My BeagleBone Black booted with this change (and D10421). I built ubldr.bin with the changes, and copied it to the 20170413 BEAGLEBONE snapshot image. From owner-svn-src-head@freebsd.org Tue Apr 18 19:28:46 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8AEF4D425B1 for ; Tue, 18 Apr 2017 19:28:46 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1a.eu.mailhop.org (outbound1a.eu.mailhop.org [52.58.109.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 26B1CCBE for ; Tue, 18 Apr 2017 19:28:45 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: 39d10ecf-246d-11e7-b96e-2378c10e3beb X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 73.78.92.27 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [73.78.92.27]) by outbound1.eu.mailhop.org (Halon) with ESMTPSA id 39d10ecf-246d-11e7-b96e-2378c10e3beb; Tue, 18 Apr 2017 19:28:41 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id v3IJSaA4009361; Tue, 18 Apr 2017 13:28:36 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1492543716.96207.42.camel@freebsd.org> Subject: Re: svn commit: r317097 - in head/sys/boot: common efi/libefi i386/libi386 mips/beri/loader powerpc/ps3 uboot/lib usb/storage userboot/userboot From: Ian Lepore To: Ed Maste Cc: Toomas Soome , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Date: Tue, 18 Apr 2017 13:28:36 -0600 In-Reply-To: References: <201704181807.v3II7sJ4023532@repo.freebsd.org> <1492539534.96207.33.camel@freebsd.org> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 18 Apr 2017 19:28:46 -0000 On Tue, 2017-04-18 at 15:15 -0400, Ed Maste wrote: > On 18 April 2017 at 14:18, Ian Lepore wrote: > > > > > > Now the boot fails on arm with: > > > > Found U-Boot device: disk > >   Checking unit=0 slice= partition=...disk0: real size > > != size > Hrmph. My BeagleBone Black booted with this change (and D10421). I > built ubldr.bin with the changes, and copied it to the 20170413 > BEAGLEBONE snapshot image. > Yep, adding D10421 fixes it for me too. -- Ian From owner-svn-src-head@freebsd.org Tue Apr 18 19:31:55 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 02EADD427D5 for ; Tue, 18 Apr 2017 19:31:55 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x22c.google.com (mail-it0-x22c.google.com [IPv6:2607:f8b0:4001:c0b::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C6CC3F36 for ; Tue, 18 Apr 2017 19:31:54 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x22c.google.com with SMTP id b15so16401419iti.1 for ; Tue, 18 Apr 2017 12:31:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=dBG2HVQIhaB/OYwdkfY7z4N+52GdfizX0COHF9r07Mk=; b=diP2UE93u0l31TGaFlU1XYnpQ+mo0cuUH8rc3lmx929LOM7I1tTZ8Om1yVAVs6UyTV IuMmY2c7qIT02TjetVwVyH3u2ygRuKOM/4eTOEyG4zRAwh34sPNp3apOVt7RG75tOBfm kDv+Bv+RoycRPOI4T901EE4CAGNt84xz4IPm8fZsLyO1Clx13/46F7A+/tj2riYjTrSu pK5F8txTSDNmXrfpZNFSMPtn06EDVPqi/OP01Et/qOnlmimShTTSekVgHemQI3tPNY2e GMcPD77nkNrRORcDh/Ukx4zz5veNxYC+Uli8e8iTXa4Ho3/hBlZYOcESKZaWyw8W16c+ AvXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=dBG2HVQIhaB/OYwdkfY7z4N+52GdfizX0COHF9r07Mk=; b=QMcVS6e3QoH5KEzI78mhhbhOErEuzt+1N1JzJbgIKNByosdBPo094eFAjSV3TsvMEO QvG98IVZHRbYXfy/uJQEux6E9DcPS3CFcY7+QrDwUh2gsGTlJf4zB60bthApxWTo9HUw LqpVz6P8zPqCiorlPnyeD09NTRlTGRG2i+KsFoVd10vbLQoEbH90ohirz4LzgL6Xequw DO+6qjXUZzlKsJoahxxBxgY18KSlM+tjxcVZTEtVsa66/yFEZFZyn+8+qiiKOWEz1sbz Sl3Mg5x2QlyMnaxZwgIx4go0kQUpwCAwFoYqyJx1m6DFmaCT3jYlJTj2evJrh+zaBSxg VNnw== X-Gm-Message-State: AN3rC/7YqgnauGHH6hfijFyJMbXxHaVdtUjRcueXmIsWNaHDs0nV+Mnf 6fztB+Phzf5VQEHzzOydC2xoeETEzg== X-Received: by 10.36.31.200 with SMTP id d191mr15375104itd.85.1492543913942; Tue, 18 Apr 2017 12:31:53 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.146.69 with HTTP; Tue, 18 Apr 2017 12:31:53 -0700 (PDT) X-Originating-IP: [2607:fb10:7021:1::fb3e] In-Reply-To: References: <201610312309.u9VN9qGk027956@repo.freebsd.org> From: Warner Losh Date: Tue, 18 Apr 2017 13:31:53 -0600 X-Google-Sender-Auth: 9Ju4leGsU1RYOi9HJB1pb9r5I1I Message-ID: Subject: Re: svn commit: r308155 - in head/sys: amd64/conf cam cam/scsi conf dev/mps geom geom/part kern sys vm To: "Conrad E. Meyer" Cc: Alan Somers , "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.23 Precedence: list List-Id: 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, 18 Apr 2017 19:31:55 -0000 On Tue, Apr 18, 2017 at 1:15 PM, Conrad Meyer wrote: > Hi Alan, > > On Tue, Apr 18, 2017 at 12:02 PM, Alan Somers wrote: >> This change is causing panics when I try to create a zpool on an SSD. >> >> ... (reordered slightly) >> >> The >> offending line is the biotrack call in scsi_da.c at line 4172; bp is >> apparently null. Could you please review this change and ensure that >> biotrack is appropriately guarded? > > If it is valid for bp to be NULL in that path, then of course a NULL > guard needs to be added. > > I'm a little confused on why or if it is valid for bp to be NULL in > that path. You are the only one who has reported this since October > of last year. Is it possible some other issue is now resulting in a > NULL bp? > >> The SSD is obviously having problems; it fails UNMAP commands with >> ILLEGAL REQUEST, and then fails WRITE SAME with a timeout. > > Well, that could definitely explain a weird error case. Still, > shouldn't the CCB keep the bp associated through CCB completion? The NULL test is needed. We keep a list of TRIM BIOs that we collapse down into one CCB. We'll have already completed it and set bp to NULL in that case, so we need to test at the end of the loop to see if bp is NULL or not. We only have to collapse TRIMs occasionally, which may explain the rarity of the crash. Warner From owner-svn-src-head@freebsd.org Tue Apr 18 19:36:59 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8DD5ED42AC0; Tue, 18 Apr 2017 19:36:59 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5FA2C159C; Tue, 18 Apr 2017 19:36:59 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3IJawO2060672; Tue, 18 Apr 2017 19:36:58 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3IJawY6060671; Tue, 18 Apr 2017 19:36:58 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201704181936.v3IJawY6060671@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Tue, 18 Apr 2017 19:36:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317099 - head/sys/boot/uboot/lib X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 18 Apr 2017 19:36:59 -0000 Author: tsoome Date: Tue Apr 18 19:36:58 2017 New Revision: 317099 URL: https://svnweb.freebsd.org/changeset/base/317099 Log: loader: uboot disk ioctl should call disk_ioctl As the uboot disk interface is using common/disk.c API, we also should use disk_ioctl() call, this will give us chance to read partition sizes and have feature parity with UEFI and BIOS implementations. This does also fix arm boot issue on some systems, reported/tested by Ian, thanks. Reported by: ian Reviewed by: ian Differential Revision: https://reviews.freebsd.org/D10421 Modified: head/sys/boot/uboot/lib/disk.c Modified: head/sys/boot/uboot/lib/disk.c ============================================================================== --- head/sys/boot/uboot/lib/disk.c Tue Apr 18 19:15:06 2017 (r317098) +++ head/sys/boot/uboot/lib/disk.c Tue Apr 18 19:36:58 2017 (r317099) @@ -275,8 +275,13 @@ static int stor_ioctl(struct open_file *f, u_long cmd, void *data) { struct disk_devdesc *dev; + int rc; dev = (struct disk_devdesc *)f->f_devdata; + rc = disk_ioctl(dev, cmd, data); + if (rc != ENOTTY) + return (rc); + switch (cmd) { case DIOCGSECTORSIZE: *(u_int *)data = SI(dev).bsize; From owner-svn-src-head@freebsd.org Tue Apr 18 19:44:35 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 81C74D444A6; Tue, 18 Apr 2017 19:44:35 +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 mx1.freebsd.org (Postfix) with ESMTPS id 525561246; Tue, 18 Apr 2017 19:44:35 +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 v3IJiYsV066884; Tue, 18 Apr 2017 19:44:34 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3IJiYEN066883; Tue, 18 Apr 2017 19:44:34 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201704181944.v3IJiYEN066883@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 18 Apr 2017 19:44:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317100 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 18 Apr 2017 19:44:35 -0000 Author: gjb Date: Tue Apr 18 19:44:34 2017 New Revision: 317100 URL: https://svnweb.freebsd.org/changeset/base/317100 Log: Use relative symlink for 'latest' to allow repo to work after being moved. Submitted by: woodsb02 MFC after: 3 days PR: 217197 Sponsored by: The FreeBSD Foundation Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Tue Apr 18 19:36:58 2017 (r317099) +++ head/Makefile.inc1 Tue Apr 18 19:44:34 2017 (r317100) @@ -1522,8 +1522,8 @@ sign-packages: _pkgbootstrap .PHONY -o ${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION} \ ${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION} \ ${PKGSIGNKEY} ; \ - ln -s ${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION} \ - ${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/latest + cd ${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI); \ + ln -s ${PKG_VERSION} latest # # From owner-svn-src-head@freebsd.org Tue Apr 18 19:54:05 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7529BD448AA; Tue, 18 Apr 2017 19:54:05 +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 mx1.freebsd.org (Postfix) with ESMTPS id 4C17F1AC1; Tue, 18 Apr 2017 19:54:05 +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 v3IJs4l1070887; Tue, 18 Apr 2017 19:54:04 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3IJs49I070886; Tue, 18 Apr 2017 19:54:04 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201704181954.v3IJs49I070886@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 18 Apr 2017 19:54:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317101 - head/share/man/man5 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 18 Apr 2017 19:54:05 -0000 Author: jhb Date: Tue Apr 18 19:54:04 2017 New Revision: 317101 URL: https://svnweb.freebsd.org/changeset/base/317101 Log: Regenerate to note that GDB is now off by default on most platforms. Note that this commit also adds the default riscv settings for all options since riscv was added to 'make targets' since the last time this was generated. Reminded by: emaste Modified: head/share/man/man5/src.conf.5 Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Tue Apr 18 19:44:34 2017 (r317100) +++ head/share/man/man5/src.conf.5 Tue Apr 18 19:54:04 2017 (r317101) @@ -1,6 +1,6 @@ .\" DO NOT EDIT-- this file is automatically generated. .\" $FreeBSD$ -.Dd April 10, 2017 +.Dd April 18, 2017 .Dt SRC.CONF 5 .Os .Sh NAME @@ -150,7 +150,7 @@ of the normal system build. The resulting system cannot build programs from source. .Pp This is a default setting on -arm64/aarch64. +arm64/aarch64, riscv/riscv64 and riscv/riscv64sf. When set, it enforces these options: .Pp .Bl -item -compact @@ -172,7 +172,7 @@ toolchain is provided. .Ef .Pp This is a default setting on -arm64/aarch64. +arm64/aarch64, riscv/riscv64 and riscv/riscv64sf. .It Va WITH_BINUTILS_BOOTSTRAP Set build binutils (as, ld, objcopy and objdump) as part of the bootstrap process. @@ -302,7 +302,7 @@ When set, it enforces these options: Set to not build the Clang C/C++ compiler during the regular phase of the build. .Pp This is a default setting on -sparc64/sparc64. +riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. When set, it enforces these options: .Pp .Bl -item -compact @@ -323,7 +323,7 @@ To be able to build the system, either g enabled unless an alternate compiler is provided via XCC. .Pp This is a default setting on -mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe and sparc64/sparc64. +mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. .It Va WITH_CLANG_BOOTSTRAP Set to build the Clang C/C++ compiler during the bootstrap phase of the build. .Pp @@ -336,7 +336,7 @@ Set to avoid building the ARCMigrate, Re the Clang C/C++ compiler. .Pp This is a default setting on -sparc64/sparc64. +riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. .It Va WITH_CLANG_FULL Set to build the ARCMigrate, Rewriter and StaticAnalyzer components of the Clang C/C++ compiler. @@ -351,7 +351,7 @@ and .Pa /usr/bin/cpp . .Pp This is a default setting on -mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe and sparc64/sparc64. +mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. .It Va WITH_CLANG_IS_CC Set to install the Clang C/C++ compiler as .Pa /usr/bin/cc , @@ -427,7 +427,7 @@ Set to not build .Xr cxgbetool 8 .Pp This is a default setting on -arm/arm, arm/armeb, arm/armv6, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc and powerpc/powerpcspe. +arm/arm, arm/armeb, arm/armv6, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpcspe, riscv/riscv64 and riscv/riscv64sf. .It Va WITH_CXGBETOOL Set to build .Xr cxgbetool 8 @@ -442,6 +442,9 @@ It will also prevent building of .Xr gperf 1 and .Xr devd 8 . +.Pp +This is a default setting on +riscv/riscv64 and riscv/riscv64sf. When set, it enforces these options: .Pp .Bl -item -compact @@ -598,7 +601,7 @@ and .Xr efivar 8 . .Pp This is a default setting on -mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe and sparc64/sparc64. +mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. .It Va WITH_EFI Set to build .Xr efivar 3 @@ -662,7 +665,7 @@ Set to not build games. Set to not build and install gcc and g++ as part of the normal build process. .Pp This is a default setting on -amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm64/aarch64 and i386/i386. +amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm64/aarch64, i386/i386, riscv/riscv64 and riscv/riscv64sf. .It Va WITH_GCC Set to build and install gcc and g++. .Pp @@ -675,7 +678,7 @@ unless an alternative compiler is provid XCC. .Pp This is a default setting on -amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm64/aarch64 and i386/i386. +amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm64/aarch64, i386/i386, riscv/riscv64 and riscv/riscv64sf. .It Va WITH_GCC_BOOTSTRAP Set to build gcc and g++ as part of the bootstrap process. .Pp @@ -690,13 +693,13 @@ Set to not build .Xr gdb 1 . .Pp This is a default setting on -arm64/aarch64. +amd64/amd64, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64 and riscv/riscv64sf. .It Va WITH_GDB Set to build .Xr gdb 1 . .Pp This is a default setting on -amd64/amd64, arm/arm, arm/armeb, arm/armv6, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe and sparc64/sparc64. +arm/arm, arm/armeb, arm/armv6 and sparc64/sparc64. .It Va WITHOUT_GNU Set to not build contributed GNU software as a part of the base system. This option can be useful if the system built must not contain any code @@ -715,7 +718,7 @@ Do not build the GNU C++ stack (g++, lib This is the default on platforms where clang is the system compiler. .Pp This is a default setting on -amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm64/aarch64 and i386/i386. +amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm64/aarch64, i386/i386, riscv/riscv64 and riscv/riscv64sf. .It Va WITH_GNUCXX Build the GNU C++ stack (g++, libstdc++). This is the default on platforms where gcc is the system compiler. @@ -749,6 +752,9 @@ and .Xr vgrind 1 . You should consider installing the textproc/groff port to not break .Xr man 1 . +.Pp +This is a default setting on +riscv/riscv64 and riscv/riscv64sf. .It Va WITHOUT_GSSAPI Set to not build libgssapi. .It Va WITHOUT_HAST @@ -930,7 +936,7 @@ library. Set to not build LLVM's lld linker. .Pp This is a default setting on -mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe and sparc64/sparc64. +mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. When set, it enforces these options: .Pp .Bl -item -compact @@ -946,7 +952,7 @@ amd64/amd64, arm/arm, arm/armeb, arm/arm Set to not build the LLDB debugger. .Pp This is a default setting on -arm/arm, arm/armeb, arm/armv6, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe and sparc64/sparc64. +arm/arm, arm/armeb, arm/armv6, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. .It Va WITH_LLDB Set to build the LLDB debugger. .Pp @@ -959,7 +965,7 @@ To be able to build the system, either B enabled unless an alternate linker is provided via XLD. .Pp This is a default setting on -amd64/amd64, arm/arm, arm/armeb, arm/armv6, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe and sparc64/sparc64. +amd64/amd64, arm/arm, arm/armeb, arm/armv6, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. .It Va WITH_LLD_BOOTSTRAP Set to build the LLD linker during the bootstrap phase of the build. .Pp @@ -969,7 +975,7 @@ arm64/aarch64. Set to use GNU binutils ld as the system linker, instead of LLVM's LLD. .Pp This is a default setting on -amd64/amd64, arm/arm, arm/armeb, arm/armv6, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe and sparc64/sparc64. +amd64/amd64, arm/arm, arm/armeb, arm/armv6, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. .It Va WITH_LLD_IS_LD Set to use LLVM's LLD as the system linker, instead of GNU binutils ld. .Pp @@ -992,7 +998,7 @@ arm/arm, arm/armeb, arm/armv6, mips/mips Set to use LLVM's libunwind stack unwinder (instead of GCC's unwinder). .Pp This is a default setting on -amd64/amd64, arm64/aarch64 and i386/i386. +amd64/amd64, arm64/aarch64, i386/i386, riscv/riscv64 and riscv/riscv64sf. .It Va WITHOUT_LOCALES Set to not build localization files; see .Xr locale 1 . @@ -1232,6 +1238,9 @@ Set to not build and related programs. .It Va WITHOUT_PROFILE Set to avoid compiling profiled libraries. +.Pp +This is a default setting on +riscv/riscv64 and riscv/riscv64sf. .It Va WITHOUT_QUOTAS Set to not build .Xr quota 1 @@ -1319,7 +1328,7 @@ mips/mipsel, mips/mips, mips/mips64el, m Set to build world with propolice stack smashing protection. .Pp This is a default setting on -amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm64/aarch64, i386/i386, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe and sparc64/sparc64. +amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm64/aarch64, i386/i386, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. .It Va WITH_STAGING Enable staging of files to a stage tree. This can be best thought of as auto-install to @@ -1403,7 +1412,7 @@ and options control those. .Pp This is a default setting on -amd64/amd64, arm/arm, arm/armeb, arm/armv6, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe and sparc64/sparc64. +amd64/amd64, arm/arm, arm/armeb, arm/armv6, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe, riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. .It Va WITHOUT_TALK Set to not build or install .Xr talk 1 @@ -1431,6 +1440,9 @@ See .Xr tests 7 for more details. This also disables the build of all test-related dependencies, including ATF. +.Pp +This is a default setting on +riscv/riscv64 and riscv/riscv64sf. When set, it enforces these options: .Pp .Bl -item -compact @@ -1441,6 +1453,9 @@ When set, it enforces these options: .El .It Va WITHOUT_TESTS_SUPPORT Set to disables the build of all test-related dependencies, including ATF. +.Pp +This is a default setting on +riscv/riscv64 and riscv/riscv64sf. .It Va WITHOUT_TEXTPROC Set to not build programs used for text processing. From owner-svn-src-head@freebsd.org Tue Apr 18 19:58:37 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 31013D44C89; Tue, 18 Apr 2017 19:58:37 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-yb0-x233.google.com (mail-yb0-x233.google.com [IPv6:2607:f8b0:4002:c09::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E2A1A1FB4; Tue, 18 Apr 2017 19:58:36 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-yb0-x233.google.com with SMTP id s22so898552ybe.3; Tue, 18 Apr 2017 12:58:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=lpknUgpP3l6FQMxhyRaZMtujjwHEuPDoItk497Exv9c=; b=aFD6fEWYs50J05Pr+z6V0sm3nsS93zfx0Y/s9BAcEU+rmLrgETpgvs9+lhjrZxVfgz poadnFbLs7GOKCiFttzCJbjm0pccGhj9KlQY6QED3ittdR+tOi+F0B11S3q74n4eTBGf uEfkARO12f7uJMHHWp6t5M0MIOiCq+ViccseJk2HXQuTF7wyS1u5QufnXDfvhuLgbNdZ GvnbWUfgi53RvtuKiew1D5/frlBtkrMZXKwox9bj+082Ki10nQY6FkHhlHcNTSAKfFnR A54SJhukpLKEk10ivLD54kaqagsX61iFP4WGr8BinRYqvNR58L6e09gmmYDZh6OlX6Fw Z3AA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=lpknUgpP3l6FQMxhyRaZMtujjwHEuPDoItk497Exv9c=; b=jli8d+IwsPm2QAtNNlT9ssWnioIy2xLho+F5AMUpH+oge7vCyk8bU9bMtFlEsTH2kH z1gT+AIuoH6VkEfH17QBXrfJaY84yRKwXGYZLyM4bC9SOekoPSW99W3UAbRVQfLnFL4k RdLHxmCzYI7tB6iJr1c6Fdlw78d89jeo/wEC4bZiInCrlhP8o+nFjkj65UzjqgzNPCfO gf/kEJNZl+ld8vz9YRECsCEbNjV2pAdI+21jbyRvK22afVh6Gt5E38XfN9KgedtLxAEG Oy7JTiZr+y+FTicUrlTGQGRyOvC9jqC78K65ErpviexAmztDVa4vuv6+mR1MYMCyouix 31lA== X-Gm-Message-State: AN3rC/5j9UVi9vz6lmZ4QOYhyZOSUHGlxW//bGJfDcbMTPnX2Avv2oPT Q7AAQvJSoGdxUvi66kXJvD8edz6KXg== X-Received: by 10.37.234.72 with SMTP id o8mr20128670ybe.34.1492545515777; Tue, 18 Apr 2017 12:58:35 -0700 (PDT) MIME-Version: 1.0 Sender: asomers@gmail.com Received: by 10.129.20.214 with HTTP; Tue, 18 Apr 2017 12:58:35 -0700 (PDT) In-Reply-To: <201704171734.v3HHYlf5022945@repo.freebsd.org> References: <201704171734.v3HHYlf5022945@repo.freebsd.org> From: Alan Somers Date: Tue, 18 Apr 2017 13:58:35 -0600 X-Google-Sender-Auth: Lx3jDKG8zQPwIAM5U5c8b-EjZvM Message-ID: Subject: Re: svn commit: r317061 - in head: libexec/rpc.rstatd sys/amd64/amd64 sys/amd64/include sys/arm/arm sys/arm/include sys/arm64/include sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/compat/linprocfs... To: Gleb Smirnoff 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.23 Precedence: list List-Id: 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, 18 Apr 2017 19:58:37 -0000 On Mon, Apr 17, 2017 at 11:34 AM, Gleb Smirnoff wrote: > Author: glebius > Date: Mon Apr 17 17:34:47 2017 > New Revision: 317061 > URL: https://svnweb.freebsd.org/changeset/base/317061 > > Log: > - Remove 'struct vmmeter' from 'struct pcpu', leaving only global vmmeter > in place. To do per-cpu stats, convert all fields that previously were > maintained in the vmmeters that sit in pcpus to counter(9). > - Since some vmmeter stats may be touched at very early stages of boot, > before we have set up UMA and we can do counter_u64_alloc(), provide an > early counter mechanism: > o Leave one spare uint64_t in struct pcpu, named pc_early_dummy_counter. > o Point counter(9) fields of vmmeter to pcpu[0].pc_early_dummy_counter, > so that at early stages of boot, before counters are allocated we already > point to a counter that can be safely written to. > o For sparc64 that required a whole dummy pcpu[MAXCPU] array. > > Further related changes: > - Don't include vmmeter.h into pcpu.h. > - vm.stats.vm.v_swappgsout and vm.stats.vm.v_swappgsin changed to 64-bit, > to match kernel representation. > - struct vmmeter hidden under _KERNEL, and only vmstat(1) is an exclusion. > > This is based on benno@'s 4-year old patch: > https://lists.freebsd.org/pipermail/freebsd-arch/2013-July/014471.html > > Reviewed by: kib, gallatin, marius, lidl > Differential Revision: https://reviews.freebsd.org/D10156 > > Modified: > head/libexec/rpc.rstatd/rstat_proc.c > head/sys/amd64/amd64/trap.c > head/sys/amd64/include/atomic.h > head/sys/amd64/include/counter.h > head/sys/amd64/include/pcpu.h > head/sys/arm/arm/intr.c > head/sys/arm/arm/trap-v4.c > head/sys/arm/arm/trap-v6.c > head/sys/arm/arm/undefined.c > head/sys/arm/include/counter.h > head/sys/arm/include/pcpu.h > head/sys/arm64/include/counter.h > head/sys/arm64/include/pcpu.h > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c > head/sys/compat/linprocfs/linprocfs.c > head/sys/fs/fuse/fuse_vnops.c > head/sys/fs/nfsclient/nfs_clbio.c > head/sys/fs/smbfs/smbfs_io.c > head/sys/i386/i386/trap.c > head/sys/i386/include/atomic.h > head/sys/i386/include/counter.h > head/sys/i386/include/pcpu.h > head/sys/kern/kern_fork.c > head/sys/kern/kern_intr.c > head/sys/kern/kern_synch.c > head/sys/kern/kern_thread.c > head/sys/kern/subr_intr.c > head/sys/kern/subr_syscall.c > head/sys/kern/subr_trap.c > head/sys/kern/vfs_bio.c > head/sys/mips/include/counter.h > head/sys/mips/include/intr_machdep.h > head/sys/mips/include/pcpu.h > head/sys/powerpc/include/counter.h > head/sys/powerpc/include/pcpu.h > head/sys/powerpc/powerpc/trap.c > head/sys/sparc64/include/counter.h > head/sys/sparc64/include/pcpu.h > head/sys/sparc64/sparc64/exception.S > head/sys/sparc64/sparc64/genassym.c > head/sys/sparc64/sparc64/intr_machdep.c > head/sys/sparc64/sparc64/machdep.c > head/sys/sparc64/sparc64/trap.c > head/sys/sys/pcpu.h > head/sys/sys/vmmeter.h > head/sys/vm/swap_pager.c > head/sys/vm/vm_fault.c > head/sys/vm/vm_meter.c > head/sys/vm/vm_object.c > head/sys/vm/vm_page.c > head/sys/vm/vm_pageout.c > head/sys/vm/vnode_pager.c > head/sys/x86/acpica/srat.c > head/sys/x86/x86/intr_machdep.c > head/usr.bin/top/machine.c > head/usr.bin/vmstat/vmstat.c This change broke backwards compatibility with old top binaries. When I use a kernel at version 317094 but a top from 14-April, I get the error "top: sysctl(vm.stats.vm.v_swappgsin...) failed: Cannot allocate memory". I get the same error when running top from an 11.0-RELEASE jail. Can you please add backward compatibility shims? -Alan From owner-svn-src-head@freebsd.org Tue Apr 18 20:05:52 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 59BA8D44099; Tue, 18 Apr 2017 20:05:52 +0000 (UTC) (envelope-from ler@lerctr.org) Received: from thebighonker.lerctr.org (thebighonker.lerctr.org [IPv6:2001:470:1f0f:3ad:223:7dff:fe9e:6e8a]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "thebighonker.lerctr.org", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2A698811; Tue, 18 Apr 2017 20:05:52 +0000 (UTC) (envelope-from ler@lerctr.org) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lerctr.org; s=lerami; h=Content-transfer-encoding:Content-type:Mime-version:In-Reply-To: References:Message-ID:CC:To:From:Subject:Date:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=VMs5fDnENkFwCREX8o86ZcmQ+GZ9JYY9oE5uvo5xys0=; b=HXM5E+BqYuWMlgPbSrsIvZz7ao pMnatnenQwAjrCrl52Up7bdagDQQDMAUrOzpHj80T1DLqGYetx0pCLOMSfIaGsqjlWUs2Eq4yVsEH 0/ShZJNyLooEl/vyUASaIoUpaTTv0tg+QdZQlsCQo9gOA8IrvhbO9y7mdPNFyilxbRKw=; Received: from [198.61.62.18] (port=1418 helo=[10.11.226.101]) by thebighonker.lerctr.org with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89 (FreeBSD)) (envelope-from ) id 1d0ZNn-000Gem-3M; Tue, 18 Apr 2017 15:05:51 -0500 User-Agent: Microsoft-MacOutlook/f.21.0.170409 Date: Tue, 18 Apr 2017 15:05:17 -0500 Subject: Re: svn commit: r317061 - in head: libexec/rpc.rstatd sys/amd64/amd64 sys/amd64/include sys/arm/arm sys/arm/include sys/arm64/include sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/compat/linprocfs... From: Larry Rosenman To: Alan Somers , Gleb Smirnoff CC: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" Message-ID: Thread-Topic: svn commit: r317061 - in head: libexec/rpc.rstatd sys/amd64/amd64 sys/amd64/include sys/arm/arm sys/arm/include sys/arm64/include sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/compat/linprocfs... References: <201704171734.v3HHYlf5022945@repo.freebsd.org> In-Reply-To: Mime-version: 1.0 Content-type: text/plain; charset="UTF-8" Content-transfer-encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 18 Apr 2017 20:05:52 -0000 On 4/18/17, 2:58 PM, "Alan Somers" wrote: On Mon, Apr 17, 2017 at 11:34 AM, Gleb Smirnoff wrote: > Author: glebius > Date: Mon Apr 17 17:34:47 2017 > New Revision: 317061 > URL: https://svnweb.freebsd.org/changeset/base/317061 > > Log: > - Remove 'struct vmmeter' from 'struct pcpu', leaving only global vmmeter > in place. To do per-cpu stats, convert all fields that previously were > maintained in the vmmeters that sit in pcpus to counter(9). > - Since some vmmeter stats may be touched at very early stages of boot, > before we have set up UMA and we can do counter_u64_alloc(), provide an > early counter mechanism: > o Leave one spare uint64_t in struct pcpu, named pc_early_dummy_counter. > o Point counter(9) fields of vmmeter to pcpu[0].pc_early_dummy_counter, > so that at early stages of boot, before counters are allocated we already > point to a counter that can be safely written to. > o For sparc64 that required a whole dummy pcpu[MAXCPU] array. > > Further related changes: > - Don't include vmmeter.h into pcpu.h. > - vm.stats.vm.v_swappgsout and vm.stats.vm.v_swappgsin changed to 64-bit, > to match kernel representation. > - struct vmmeter hidden under _KERNEL, and only vmstat(1) is an exclusion. > > This is based on benno@'s 4-year old patch: > https://lists.freebsd.org/pipermail/freebsd-arch/2013-July/014471.html > > Reviewed by: kib, gallatin, marius, lidl > Differential Revision: https://reviews.freebsd.org/D10156 > This change broke backwards compatibility with old top binaries. When I use a kernel at version 317094 but a top from 14-April, I get the error "top: sysctl(vm.stats.vm.v_swappgsin...) failed: Cannot allocate memory". I get the same error when running top from an 11.0-RELEASE jail. Can you please add backward compatibility shims? -Alan It also broke emulators/virtualbox-ose-kmod From owner-svn-src-head@freebsd.org Tue Apr 18 20:07:24 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6254BD442AA; Tue, 18 Apr 2017 20:07:24 +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 mx1.freebsd.org (Postfix) with ESMTPS id 27F0FA2E; Tue, 18 Apr 2017 20:07:23 +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 v3IK7Mlo075156; Tue, 18 Apr 2017 20:07:22 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3IK7Mq7075155; Tue, 18 Apr 2017 20:07:22 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201704182007.v3IK7Mq7075155@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Tue, 18 Apr 2017 20:07:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317102 - head/sys/netpfil/pf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 18 Apr 2017 20:07:24 -0000 Author: kp Date: Tue Apr 18 20:07:21 2017 New Revision: 317102 URL: https://svnweb.freebsd.org/changeset/base/317102 Log: pf: Also clear limit counters The "pfctl -F info" command didn't clear the limit counters ( as shown in the "pfctl -vsi" output). Submitted by: Max Modified: head/sys/netpfil/pf/pf_ioctl.c Modified: head/sys/netpfil/pf/pf_ioctl.c ============================================================================== --- head/sys/netpfil/pf/pf_ioctl.c Tue Apr 18 19:54:04 2017 (r317101) +++ head/sys/netpfil/pf/pf_ioctl.c Tue Apr 18 20:07:21 2017 (r317102) @@ -1852,6 +1852,8 @@ DIOCGETSTATES_full: counter_u64_zero(V_pf_status.fcounters[i]); for (int i = 0; i < SCNT_MAX; i++) counter_u64_zero(V_pf_status.scounters[i]); + for (int i = 0; i < LCNT_MAX; i++) + counter_u64_zero(V_pf_status.lcounters[i]); V_pf_status.since = time_second; if (*V_pf_status.ifname) pfi_update_status(V_pf_status.ifname, NULL); From owner-svn-src-head@freebsd.org Tue Apr 18 20:10:51 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EBDE2D444EC; Tue, 18 Apr 2017 20:10:51 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) by mx1.freebsd.org (Postfix) with ESMTP id 045BBC95; Tue, 18 Apr 2017 20:10:50 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Subject: Re: svn commit: r317061 - in head: libexec/rpc.rstatd sys/amd64/amd64 sys/amd64/include sys/arm/arm sys/arm/include sys/arm64/include sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/compat/linprocfs... To: Larry Rosenman , Alan Somers , Gleb Smirnoff Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" References: <201704171734.v3HHYlf5022945@repo.freebsd.org> From: Jung-uk Kim Message-ID: Date: Tue, 18 Apr 2017 16:10:45 -0400 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="qAedvP919HHrE21Rbe7xcsRUUWgCqpORB" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 18 Apr 2017 20:10:52 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --qAedvP919HHrE21Rbe7xcsRUUWgCqpORB Content-Type: multipart/mixed; boundary="uXAjQ36dFWv0KCKdvQmrTdt09c1v2uqFt"; protected-headers="v1" From: Jung-uk Kim To: Larry Rosenman , Alan Somers , Gleb Smirnoff Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" Message-ID: Subject: Re: svn commit: r317061 - in head: libexec/rpc.rstatd sys/amd64/amd64 sys/amd64/include sys/arm/arm sys/arm/include sys/arm64/include sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/compat/linprocfs... References: <201704171734.v3HHYlf5022945@repo.freebsd.org> In-Reply-To: --uXAjQ36dFWv0KCKdvQmrTdt09c1v2uqFt Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: quoted-printable On 04/18/2017 16:05, Larry Rosenman wrote: > On 4/18/17, 2:58 PM, "Alan Somers" wrote: >=20 > On Mon, Apr 17, 2017 at 11:34 AM, Gleb Smirnoff wrote: > > Author: glebius > > Date: Mon Apr 17 17:34:47 2017 > > New Revision: 317061 > > URL: https://svnweb.freebsd.org/changeset/base/317061 > > > > Log: > > - Remove 'struct vmmeter' from 'struct pcpu', leaving only glob= al vmmeter > > in place. To do per-cpu stats, convert all fields that previ= ously were > > maintained in the vmmeters that sit in pcpus to counter(9). > > - Since some vmmeter stats may be touched at very early stages = of boot, > > before we have set up UMA and we can do counter_u64_alloc(), = provide an > > early counter mechanism: > > o Leave one spare uint64_t in struct pcpu, named pc_early_dum= my_counter. > > o Point counter(9) fields of vmmeter to pcpu[0].pc_early_dumm= y_counter, > > so that at early stages of boot, before counters are alloca= ted we already > > point to a counter that can be safely written to. > > o For sparc64 that required a whole dummy pcpu[MAXCPU] array.= > > > > Further related changes: > > - Don't include vmmeter.h into pcpu.h. > > - vm.stats.vm.v_swappgsout and vm.stats.vm.v_swappgsin changed = to 64-bit, > > to match kernel representation. > > - struct vmmeter hidden under _KERNEL, and only vmstat(1) is an= exclusion. > > > > This is based on benno@'s 4-year old patch: > > https://lists.freebsd.org/pipermail/freebsd-arch/2013-July/0144= 71.html > > > > Reviewed by: kib, gallatin, marius, lidl > > Differential Revision: https://reviews.freebsd.org/D1015= 6 > > > This change broke backwards compatibility with old top binaries. When > I use a kernel at version 317094 but a top from 14-April, I get the= > error "top: sysctl(vm.stats.vm.v_swappgsin...) failed: Cannot alloc= ate > memory". I get the same error when running top from an 11.0-RELEAS= E > jail. Can you please add backward compatibility shims? > =20 > -Alan > It also broke emulators/virtualbox-ose-kmod True but it is not a big deal. A patch will be committed with VirtualBox 5.1.20 soon. Jung-uk Kim --uXAjQ36dFWv0KCKdvQmrTdt09c1v2uqFt-- --qAedvP919HHrE21Rbe7xcsRUUWgCqpORB Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEl1bqgKaRyqfWXu/CfJ+WJvzb8UYFAlj2csoACgkQfJ+WJvzb 8UY3/Af8C7KB2038a0aFtZtpjXLFayP2TCXxYyqhgsld2HubTr47xSH5tDpJabS6 KVgXqfbcp/sibIgTq/m+AXUAZ9m2ntjToGI+7H7NsuCTTY4yzH+Arc2Z1RGRlfox rmH5QIreEZRh26ykeQ4Ee9u1tn/sMdrmL4KydN4fR4V3L7rm4Rx11ZUjBksCn6+d jU/zHovGs6KPE+zTj6tO0wrgRCu6KXvI0GlYRtJ5UH6xytnOgEdWRngSGSUIg8BW vWSb+DPN8NsrwhRdXq7PhupwmizKv/TBYKeppLHWbW778OAUx5HTRoaftmg15e0R OUKezAFFvy0F4+ZQzlYmmx2624CY/A== =36S3 -----END PGP SIGNATURE----- --qAedvP919HHrE21Rbe7xcsRUUWgCqpORB-- From owner-svn-src-head@freebsd.org Tue Apr 18 21:05:06 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7F94BD44576; Tue, 18 Apr 2017 21:05:06 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4FFD3C7; Tue, 18 Apr 2017 21:05:06 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3IL55GH099546; Tue, 18 Apr 2017 21:05:05 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3IL559C099545; Tue, 18 Apr 2017 21:05:05 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201704182105.v3IL559C099545@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Tue, 18 Apr 2017 21:05:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317104 - head/sys/cam/scsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 18 Apr 2017 21:05:06 -0000 Author: cem Date: Tue Apr 18 21:05:05 2017 New Revision: 317104 URL: https://svnweb.freebsd.org/changeset/base/317104 Log: da(4): Fix a TRIM regression introduced in r308155 According to Warner, multiple TRIM BIOs are collapsed into a single CCB with NULL bp. It is invalid to biotrack() NULL, and results in a fault. So, don't do that. Reported by: asomers@ Sponsored by: Dell EMC Isilon Modified: head/sys/cam/scsi/scsi_da.c Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Tue Apr 18 20:31:02 2017 (r317103) +++ head/sys/cam/scsi/scsi_da.c Tue Apr 18 21:05:05 2017 (r317104) @@ -4169,7 +4169,8 @@ dadone(struct cam_periph *periph, union } } - biotrack(bp, __func__); + if (bp != NULL) + biotrack(bp, __func__); LIST_REMOVE(&done_ccb->ccb_h, periph_links.le); if (LIST_EMPTY(&softc->pending_ccbs)) softc->flags |= DA_FLAG_WAS_OTAG; From owner-svn-src-head@freebsd.org Tue Apr 18 22:19:46 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E39A8D4408F; Tue, 18 Apr 2017 22:19:46 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C3D6C1051; Tue, 18 Apr 2017 22:19:46 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by mail.baldwin.cx (Postfix) with ESMTPSA id 1E17410A82D; Tue, 18 Apr 2017 18:19:45 -0400 (EDT) From: John Baldwin To: Slawa Olhovchenkov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r317094 - head/share/mk Date: Tue, 18 Apr 2017 12:45:25 -0700 Message-ID: <8690993.EKcl9tcFpB@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.0-STABLE; KDE/4.14.10; amd64; ; ) In-Reply-To: <20170418163013.GB83631@zxy.spb.ru> References: <201704181627.v3IGRmNN082877@repo.freebsd.org> <20170418163013.GB83631@zxy.spb.ru> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Tue, 18 Apr 2017 18:19:45 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 18 Apr 2017 22:19:47 -0000 On Tuesday, April 18, 2017 07:30:13 PM Slawa Olhovchenkov wrote: > On Tue, Apr 18, 2017 at 04:27:48PM +0000, John Baldwin wrote: > > > Author: jhb > > Date: Tue Apr 18 16:27:48 2017 > > New Revision: 317094 > > URL: https://svnweb.freebsd.org/changeset/base/317094 > > > > Log: > > Disable in-tree GDB by default on x86, mips, and powerpc. > > > > GDB in ports contains all of the functionality as GDB in base > > (including kgdb) for these platforms along with additional > > functionality. In-tree GDB remains enabled on ARM and sparc64. > > GDB in ports does not currently support kernel debugging on arm, > > and ports GDB for sparc64 has not been tested (though it does > > include sparc64 support). > > > > Reviewed by: bdrewery, emaste, imp > > Relnotes: yes > > Sponsored by: DARPA / AFRL > > Differential Revision: https://reviews.freebsd.org/D10399 > > Generating core.txt now complety broken? No. crashinfo has supported gdb from ports for quite a while now. If you 'pkg install gdb' crashinfo defaults to using the ports gdb over the base one already. -- John Baldwin From owner-svn-src-head@freebsd.org Tue Apr 18 22:28:40 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 15B3ED44607; Tue, 18 Apr 2017 22:28:40 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CD532182B; Tue, 18 Apr 2017 22:28:39 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1d0bbx-000AZc-9j; Wed, 19 Apr 2017 01:28:37 +0300 Date: Wed, 19 Apr 2017 01:28:37 +0300 From: Slawa Olhovchenkov To: John Baldwin Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r317094 - head/share/mk Message-ID: <20170418222837.GC83631@zxy.spb.ru> References: <201704181627.v3IGRmNN082877@repo.freebsd.org> <20170418163013.GB83631@zxy.spb.ru> <8690993.EKcl9tcFpB@ralph.baldwin.cx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8690993.EKcl9tcFpB@ralph.baldwin.cx> User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 18 Apr 2017 22:28:40 -0000 On Tue, Apr 18, 2017 at 12:45:25PM -0700, John Baldwin wrote: > On Tuesday, April 18, 2017 07:30:13 PM Slawa Olhovchenkov wrote: > > On Tue, Apr 18, 2017 at 04:27:48PM +0000, John Baldwin wrote: > > > > > Author: jhb > > > Date: Tue Apr 18 16:27:48 2017 > > > New Revision: 317094 > > > URL: https://svnweb.freebsd.org/changeset/base/317094 > > > > > > Log: > > > Disable in-tree GDB by default on x86, mips, and powerpc. > > > > > > GDB in ports contains all of the functionality as GDB in base > > > (including kgdb) for these platforms along with additional > > > functionality. In-tree GDB remains enabled on ARM and sparc64. > > > GDB in ports does not currently support kernel debugging on arm, > > > and ports GDB for sparc64 has not been tested (though it does > > > include sparc64 support). > > > > > > Reviewed by: bdrewery, emaste, imp > > > Relnotes: yes > > > Sponsored by: DARPA / AFRL > > > Differential Revision: https://reviews.freebsd.org/D10399 > > > > Generating core.txt now complety broken? > > No. crashinfo has supported gdb from ports for quite a while now. > If you 'pkg install gdb' crashinfo defaults to using the ports gdb over > the base one already. I am about clean install, w/o ports. Also, how to generate core.txt after crash, reboot and install gdb from ports? (port instaled after crash) From owner-svn-src-head@freebsd.org Tue Apr 18 23:59:17 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1F74ED45CB4; Tue, 18 Apr 2017 23:59:17 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E3F541F2; Tue, 18 Apr 2017 23:59:16 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3INxGcq070388; Tue, 18 Apr 2017 23:59:16 GMT (envelope-from sjg@FreeBSD.org) Received: (from sjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3INxGQF070387; Tue, 18 Apr 2017 23:59:16 GMT (envelope-from sjg@FreeBSD.org) Message-Id: <201704182359.v3INxGQF070387@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sjg set sender to sjg@FreeBSD.org using -f From: "Simon J. Gerraty" Date: Tue, 18 Apr 2017 23:59:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317106 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 18 Apr 2017 23:59:17 -0000 Author: sjg Date: Tue Apr 18 23:59:15 2017 New Revision: 317106 URL: https://svnweb.freebsd.org/changeset/base/317106 Log: If MAKEOBJDIRPREFIX is a prefix match for .CURDIR, then __objdir is .CURDIR Reviewed by: bdrewery Modified: head/share/mk/auto.obj.mk Modified: head/share/mk/auto.obj.mk ============================================================================== --- head/share/mk/auto.obj.mk Tue Apr 18 21:21:31 2017 (r317105) +++ head/share/mk/auto.obj.mk Tue Apr 18 23:59:15 2017 (r317106) @@ -42,6 +42,10 @@ MKOBJDIRS= auto # Use __objdir here so it is easier to tweak without impacting # the logic. .if !empty(MAKEOBJDIRPREFIX) +.if ${.CURDIR:M${MAKEOBJDIRPREFIX}/*} != "" +# we are already in obj tree! +__objdir?= ${.CURDIR} +.endif __objdir?= ${MAKEOBJDIRPREFIX}${.CURDIR} .endif __objdir?= ${MAKEOBJDIR:Uobj} From owner-svn-src-head@freebsd.org Wed Apr 19 00:12:37 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4A589D43138; Wed, 19 Apr 2017 00:12:37 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 17AFBD88; Wed, 19 Apr 2017 00:12:37 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (unknown [127.0.1.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by freefall.freebsd.org (Postfix) with ESMTPS id 35715138C; Wed, 19 Apr 2017 00:12:36 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 054935829; Wed, 19 Apr 2017 00:12:34 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id x0dxp3-OkY_D; Wed, 19 Apr 2017 00:12:31 +0000 (UTC) Subject: Re: svn commit: r317106 - head/share/mk DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com B8CE65824 To: "Simon J. Gerraty" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201704182359.v3INxGQF070387@repo.freebsd.org> From: Bryan Drewery Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Organization: FreeBSD Message-ID: Date: Tue, 18 Apr 2017 17:12:30 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <201704182359.v3INxGQF070387@repo.freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Kgt3bLkE2sqLfp9KaWr9vRgFWnRoWfOFl" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 19 Apr 2017 00:12:37 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --Kgt3bLkE2sqLfp9KaWr9vRgFWnRoWfOFl Content-Type: multipart/mixed; boundary="loChCidBQ8BR4U1eqJtWgPMvJ4PuVxQpn"; protected-headers="v1" From: Bryan Drewery To: "Simon J. Gerraty" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: Subject: Re: svn commit: r317106 - head/share/mk References: <201704182359.v3INxGQF070387@repo.freebsd.org> In-Reply-To: <201704182359.v3INxGQF070387@repo.freebsd.org> --loChCidBQ8BR4U1eqJtWgPMvJ4PuVxQpn Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 4/18/2017 4:59 PM, Simon J. Gerraty wrote: > Author: sjg > Date: Tue Apr 18 23:59:15 2017 > New Revision: 317106 > URL: https://svnweb.freebsd.org/changeset/base/317106 >=20 > Log: > If MAKEOBJDIRPREFIX is a prefix match for .CURDIR, then __objdir is .= CURDIR > =20 Thanks! --=20 Regards, Bryan Drewery --loChCidBQ8BR4U1eqJtWgPMvJ4PuVxQpn-- --Kgt3bLkE2sqLfp9KaWr9vRgFWnRoWfOFl Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJY9qtuAAoJEDXXcbtuRpfPFeYH/2uBVsQyTqgx4bAQ1f/PXO/d 6SOze1Lu6ufpN2qk4v5hjO6v7CaX1q6PaqbJMwfxVzHQwuw0qHUtPI258phXzfD2 GK/e1+QZBQOGBFVaCAS8o08ZA90PCmkLrJCu7RklCDjkUwfz58yHqI5Dm7b8l0VA rKVDhoN2w5DImcqH0Qz8rzGtJaMZsKaYIFz4mnY+ziJNCXZhDYHGHYvjBrzN4dvl SbY7vfxl/IVzQLVp4IwE/EaZEfam4xPvyHAZV216/g+kloDwhCL2LV3BELgKkVb0 SGgPdHNr2Fbmd1JP6gRO/9c9uXVnN2ycSWF2TAzOwY5/1KqjPcF0ed8eOD9dMsU= =huYQ -----END PGP SIGNATURE----- --Kgt3bLkE2sqLfp9KaWr9vRgFWnRoWfOFl-- From owner-svn-src-head@freebsd.org Wed Apr 19 02:39:50 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 06A11D44CCB; Wed, 19 Apr 2017 02:39:50 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B00BAE7A; Wed, 19 Apr 2017 02:39:49 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3J2dmA4034648; Wed, 19 Apr 2017 02:39:48 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3J2dmcI034647; Wed, 19 Apr 2017 02:39:48 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201704190239.v3J2dmcI034647@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 19 Apr 2017 02:39:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317107 - head/sys/dev/hyperv/vmbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 19 Apr 2017 02:39:50 -0000 Author: sephe Date: Wed Apr 19 02:39:48 2017 New Revision: 317107 URL: https://svnweb.freebsd.org/changeset/base/317107 Log: hyperv: Use kmem_malloc for hypercall memory due to NX bit change. Reported by: dexuan@ MFC after: now Sponsored by: Microsoft Modified: head/sys/dev/hyperv/vmbus/hyperv.c Modified: head/sys/dev/hyperv/vmbus/hyperv.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hyperv.c Tue Apr 18 23:59:15 2017 (r317106) +++ head/sys/dev/hyperv/vmbus/hyperv.c Wed Apr 19 02:39:48 2017 (r317107) @@ -34,9 +34,15 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include +#include +#include +#include +#include + #include #include #include @@ -64,7 +70,7 @@ __FBSDID("$FreeBSD$"); struct hypercall_ctx { void *hc_addr; - struct hyperv_dma hc_dma; + vm_paddr_t hc_paddr; }; static u_int hyperv_get_timecount(struct timecounter *); @@ -255,8 +261,8 @@ SYSINIT(hyperv_initialize, SI_SUB_HYPERV static void hypercall_memfree(void) { - hyperv_dmamem_free(&hypercall_context.hc_dma, - hypercall_context.hc_addr); + kmem_free(kernel_arena, (vm_offset_t)hypercall_context.hc_addr, + PAGE_SIZE); hypercall_context.hc_addr = NULL; } @@ -268,14 +274,15 @@ hypercall_create(void *arg __unused) if (vm_guest != VM_GUEST_HV) return; - hypercall_context.hc_addr = hyperv_dmamem_alloc(NULL, PAGE_SIZE, 0, - PAGE_SIZE, &hypercall_context.hc_dma, BUS_DMA_WAITOK); - if (hypercall_context.hc_addr == NULL) { - printf("hyperv: Hypercall page allocation failed\n"); - /* Can't perform any Hyper-V specific actions */ - vm_guest = VM_GUEST_VM; - return; - } + /* + * NOTE: + * - busdma(9), i.e. hyperv_dmamem APIs, can _not_ be used due to + * the NX bit. + * - Assume kmem_malloc() returns properly aligned memory. + */ + hypercall_context.hc_addr = (void *)kmem_malloc(kernel_arena, PAGE_SIZE, + M_WAITOK); + hypercall_context.hc_paddr = vtophys(hypercall_context.hc_addr); /* Get the 'reserved' bits, which requires preservation. */ hc_orig = rdmsr(MSR_HV_HYPERCALL); @@ -285,7 +292,7 @@ hypercall_create(void *arg __unused) * * NOTE: 'reserved' bits MUST be preserved. */ - hc = ((hypercall_context.hc_dma.hv_paddr >> PAGE_SHIFT) << + hc = ((hypercall_context.hc_paddr >> PAGE_SHIFT) << MSR_HV_HYPERCALL_PGSHIFT) | (hc_orig & MSR_HV_HYPERCALL_RSVD_MASK) | MSR_HV_HYPERCALL_ENABLE; From owner-svn-src-head@freebsd.org Wed Apr 19 03:50:07 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3F738D44A3B; Wed, 19 Apr 2017 03:50:07 +0000 (UTC) (envelope-from decui@microsoft.com) Received: from APC01-PU1-obe.outbound.protection.outlook.com (mail-pu1apc01on0110.outbound.protection.outlook.com [104.47.126.110]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "Microsoft IT SSL SHA2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A98BBD4C; Wed, 19 Apr 2017 03:50:06 +0000 (UTC) (envelope-from decui@microsoft.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=fmf04cXQ62OzGpX2CR9B5515Q17eEdjszQV/C2Dh058=; b=LKF6xtSpjyESPFSLueDoV3sclTq+V1J03ZUxRSD/nNOqMv3hT4jqH7KB4e2T3BXVyF9lQ0tu4jkufFcxuyJyD7ceiRxYVn4k4UpeSqMWvIrk0Hr9gWwc12cJ7aIEhT3pdIDh3Pi5EsQNDzkpRdIAU3AGAl+UBp2tw92YMRfZmHY= Received: from HK2P15301MB0003.APCP153.PROD.OUTLOOK.COM (10.170.151.145) by HK2P15301MB0003.APCP153.PROD.OUTLOOK.COM (10.170.151.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1061.1; Wed, 19 Apr 2017 03:49:51 +0000 Received: from HK2P15301MB0003.APCP153.PROD.OUTLOOK.COM ([10.170.151.145]) by HK2P15301MB0003.APCP153.PROD.OUTLOOK.COM ([10.170.151.145]) with mapi id 15.01.1061.003; Wed, 19 Apr 2017 03:49:51 +0000 From: Dexuan Cui To: Konstantin Belousov CC: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Sepherosa Ziehau , Hongjiang Zhang Subject: RE: svn commit: r316767 - head/sys/amd64/amd64 Thread-Topic: svn commit: r316767 - head/sys/amd64/amd64 Thread-Index: AQHStG2iSg+v8T4ZWE2jvrgFLfQZk6HLFDPwgAAXJgCAAAC2YA== Date: Wed, 19 Apr 2017 03:49:50 +0000 Message-ID: References: <201704131549.v3DFnt9I004050@repo.freebsd.org> <20170418134556.GY1788@kib.kiev.ua> In-Reply-To: <20170418134556.GY1788@kib.kiev.ua> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: gmail.com; dkim=none (message not signed) header.d=none;gmail.com; dmarc=none action=none header.from=microsoft.com; x-originating-ip: [167.220.255.48] x-microsoft-exchange-diagnostics: 1; HK2P15301MB0003; 7:O6GznFTfn2ObwluVmF/QfDzFjUisOya3MZZ/gSYLTf+78wyn9Lw+I+8rRbqCJQtog5BMqHT1TIZaQfesZlekKno7NVEktICIIfMMnKYoDo79vNQ5TaFng+26TnXZKGluDOtFoFmrSKEsneqmnNostv8DWX8xgxJ5PEvB6LAxtBOf/dyYpbZ5nI203avmesaFygfEQtd5ul+Xx0yz9WHeDCnY917l9KpxOkp90r8WNmTUXoLcl/EbNX/SL8SP5xK7T83bpxCN8I8VOZVKnTPyfQ/YzzGcyhQcfrLB6Gdm37HN9iZu6O8DAzc8Nc5brF5qU1xnWpOCFQ996baKqtBE/8uM6O+85/asrgO6SIMA+Xw= x-ms-office365-filtering-correlation-id: 9f10021f-9f2d-44b1-06f7-08d486d72247 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254075)(48565401081)(201703131423075)(201703031133081)(201702281549075); SRVR:HK2P15301MB0003; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(61425038)(6040450)(2401047)(8121501046)(5005006)(93006095)(93001095)(10201501046)(3002001)(6055026)(61426038)(61427038)(6041248)(201703131423075)(201702281528075)(201703061421075)(20161123564025)(20161123560025)(20161123555025)(20161123562025)(6072148); SRVR:HK2P15301MB0003; BCL:0; PCL:0; RULEID:; SRVR:HK2P15301MB0003; x-forefront-prvs: 028256169F x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(6009001)(39840400002)(39450400003)(39860400002)(39850400002)(39410400002)(39400400002)(8990500004)(305945005)(3280700002)(74316002)(6436002)(2906002)(7696004)(86362001)(76176999)(8676002)(7736002)(81166006)(54356999)(6506006)(50986999)(86612001)(3846002)(53936002)(102836003)(6116002)(77096006)(3660700001)(1411001)(110136004)(107886003)(38730400002)(229853002)(39060400002)(2900100001)(66066001)(6246003)(122556002)(33656002)(10090500001)(189998001)(55016002)(54906002)(5005710100001)(10290500002)(4326008)(9686003)(6916009)(25786009)(2950100002)(8936002)(5660300001); DIR:OUT; SFP:1102; SCL:1; SRVR:HK2P15301MB0003; H:HK2P15301MB0003.APCP153.PROD.OUTLOOK.COM; FPR:; SPF:None; MLV:ovrnspm; PTR:InfoNoRecords; LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Apr 2017 03:49:50.9917 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: HK2P15301MB0003 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 19 Apr 2017 03:50:07 -0000 > From: Konstantin Belousov > > It looks memory allocated by bus_dmamem_alloc() and malloc() > > is not executable now. > > > > What else can we use? > > I guess we can only use contigmalloc() or kmem_malloc() to > > get a page that can be executable and use vtophys() to get its > > physical address? > Yes, the kmem_malloc() is considered to be a suitable substitution for > regular malloc(9) if the executable mapping is needed. See r317072 > for a similar fix for the same issue. Thanks, kib! We have fixed Hyper-V drivers with kmem_malloc(). Thanks, -- Dexuan From owner-svn-src-head@freebsd.org Wed Apr 19 04:10:02 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E5001D44F3E; Wed, 19 Apr 2017 04:10:02 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail108.syd.optusnet.com.au (mail108.syd.optusnet.com.au [211.29.132.59]) by mx1.freebsd.org (Postfix) with ESMTP id 919FE926; Wed, 19 Apr 2017 04:10:02 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from besplex.bde.org (c122-106-153-191.carlnfd1.nsw.optusnet.com.au [122.106.153.191]) by mail108.syd.optusnet.com.au (Postfix) with ESMTPS id AF7A41A5E5E; Wed, 19 Apr 2017 14:09:59 +1000 (AEST) Date: Wed, 19 Apr 2017 14:09:58 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Alan Somers cc: Gleb Smirnoff , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r317061 - in head: libexec/rpc.rstatd sys/amd64/amd64 sys/amd64/include sys/arm/arm sys/arm/include sys/arm64/include sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/compat/linprocfs... In-Reply-To: Message-ID: <20170419130428.J956@besplex.bde.org> References: <201704171734.v3HHYlf5022945@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=KeqiiUQD c=1 sm=1 tr=0 a=Tj3pCpwHnMupdyZSltBt7Q==:117 a=Tj3pCpwHnMupdyZSltBt7Q==:17 a=kj9zAlcOel0A:10 a=6I5d2MoRAAAA:8 a=4wcEti7meZBUi9NaIXUA:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 19 Apr 2017 04:10:03 -0000 On Tue, 18 Apr 2017, Alan Somers wrote: > On Mon, Apr 17, 2017 at 11:34 AM, Gleb Smirnoff wrote: Please trim quotes. [... 5 lines of quotes trimmed] >> Log: >> - Remove 'struct vmmeter' from 'struct pcpu', leaving only global vmmeter >> in place. To do per-cpu stats, convert all fields that previously were >> maintained in the vmmeters that sit in pcpus to counter(9). [... 21 lines of quotes trimmed] [... more than 50 lines of quotes trimmed] >> head/usr.bin/top/machine.c >> head/usr.bin/vmstat/vmstat.c The previous 2 lines turn out to be relevant. I missed the update to vmstat and checked a wrong version in my bug report described below I checked an updated top, but the change seemed too small to help. systat was not updated. > This change broke backwards compatibility with old top binaries. When > I use a kernel at version 317094 but a top from 14-April, I get the > error "top: sysctl(vm.stats.vm.v_swappgsin...) failed: Cannot allocate > memory". I get the same error when running top from an 11.0-RELEASE > jail. Can you please add backward compatibility shims? I sent a much longer (30 times longer) bug report to the author of the bug. Most or all statistics utilities that use vmmeter are broken. vmstat is too broken to even notice the bug -- it silently ignores the error, an has type errors which prevent other errors which it doesn't ignore. The result is silently truncating to 32 bits, like a quick fix would do intentionally. systat -v detects the errors but prints warning messages to the status line where they overwrite each other so make the problem look smaller than it is. The result is unsilently truncating to 32 bits. I've never seen any backwards compatibility shims added for sysctls. None should be needed, but there are few or no utilities other than sysctl(8) which use sysctl(3) in a portable way. Utilities tend to hard-code types and thus break when the types are expanded or shrunk. Especially broken ones like vmstat even ignore the error for their size being too small. There is no error for the size being too small, so callers must check if the size returned is the size supplied. vmstat is too broken to check this too. systat -v does check. Note that using the types in the system header is a form of hard-coding. This gives binaries that only work when run on the same system as the headers. Using the "any" type is best done using a smart wrapper or perhaps a smarter sysctl(3), and many utilities already have dumb wrappers. The one in vmstat() shows how not to do it: X static int X mysysctl(const char *name, void *oldp, size_t *oldlenp, X void *newp, size_t newlen) X { X int error; X X error = sysctlbyname(name, oldp, oldlenp, newp, newlen); X if (error != 0 && errno != ENOMEM) X xo_err(1, "sysctl(%s)", name); X return (error); X } ENOMEM here means that our variable is too small. It is not easy to expand correctly, but it is easy to check if it is small enough to cause a problem. Something like: // Zero-extend in case our variable is larger than the // system's. We only support unsigned variables. bzero(oldp, *oldlenp); // Don't use our garbage new* variables. All calls are // read-only since we are a stats utility, and this wrapper // doesn't support writing. if (sysctlbyname(name, oldp, oldlenp, NULL, 0) == 0) return (0) u_char buf[640 * 1024]; // should be enough for anyint size_t buflen; size_t off; buflen = sizeof(buf); error = sysctlbyname(name, buf, buflen, NULL, 0); if (error != 0) xo_err(1, "sysctl(%s)", name); for (off = *oldlenp; buf < bufsize; off++) { // Check for zero-extension. // This version only supports unsigned types. if (buf[off] != 0) { errno = EOVERFLOW; #ifdef CALLERS_PROBLEM // sysctl(3) should always have done this // too. That is, return EOVERFLOW instead // of ENOMEM when the result is too large // to fit, and don't return an error if // it does fit. return (-1); #else // Now a useful error message. xo_err(1, "sysctl(%s)", name); #endif } } Then expand sizes in the caller if necessary. u_int would work in most cases, and so would u_char for small and boolean variables. CALLERS_PROBLEM allows use of small types when only differences are needed, as for some cases in vmstat. uintmax_t would work in more cases. But it is still a form of hard-coding -- it will break when the system uintmax_t is increased to {128, 256, 512, ...} bits while the user uintmax_t remains uint64_t, and the extra bits are actually used. 64-bit types rarely overflow, but if the system type is larger then 64 bytes was not enough for anyint. The bugs in vmstat now go in the other direction. It now hard-codes uint64_t instead of u_int for the expanded types. Its missing error handling is now a more serious problem. When run on an old kernel, sysctl() returns 32 bits into the 64-bit variables and the error is not detected. Perhaps the variables are initially zero so this is not a problem, but the zeroing should be more intentional. It is very easy to add to the sysctl wrapper, as above. Bruce From owner-svn-src-head@freebsd.org Wed Apr 19 04:58:21 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0EF11D45A6C; Wed, 19 Apr 2017 04:58:21 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf0-x244.google.com (mail-pf0-x244.google.com [IPv6:2607:f8b0:400e:c00::244]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D0E6FCA; Wed, 19 Apr 2017 04:58:20 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf0-x244.google.com with SMTP id c198so2033737pfc.0; Tue, 18 Apr 2017 21:58:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=ZjdTEGhKPaclhRqiYLx6CYx1FePLNjPpXONCqNEuDLk=; b=igZzo2dboSSERefD8dLf3NnGgfUVYxPwNux95qJ8zU5FlCWHA7XAoHO9JcbseJ41ak ETQ/OEckQKNENaIDE4Qh4/6alILx8SzHbasO45ztb4aU3S4diU8mYQST2gkJ/N2JyEU9 GEQ1s4oXvQtpyqEvLmiK4QwlBWoNULfw9jOqcUtLj4HR2yqlZQy1gTIO8gIljTjEQ5Gl KO0iUiYHf9//A8rZB4RyGCBIzNgmX1ZqhxPW7TmbzE1FOfXA07h3opDbwFk29vKpX9cp 40jrB4EYipUuCWv0WTtzl8+eQea4H1IRNLi10oUdukWLSuQDCr2yYr9eBQvvzcisBckQ nXiA== 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=ZjdTEGhKPaclhRqiYLx6CYx1FePLNjPpXONCqNEuDLk=; b=XypaAoz3DvXIeIZOR0HRYCiwV7e9+g5KyE+chbzIIOTc9v00//rIhHmhtu72AQgCEy KTMpzFOhpcl+cd/YnFt5XQ6XJzSMNhOTGUD56e7Y3EZzdcvsjkmy4noShyX29viXh7RH ne0TehsFOhNLfxdhd5xa2xIfXC8AtBOqpA8xvv0D4x2AuhfZIYWB/WdjjzEnQe2HeJNm 5FvPJYVoHPnhgwC1Mu/zzk0CKdErLqFGW0+1HziwFCw2BkVBToH08FHPCBaRVq3Qne8Y jLk0xsGLRp8NfA8EQHdaS7R3KyCAlwXPCStIK9qNbu4f/IW0Fvo5RH9ZWkiSra6xNszL 9LJQ== X-Gm-Message-State: AN3rC/5n4zG8pCRB1OLO60iqAUZnbSaDQgLuBwJQS4IEXOw5aLr/rxpo M0031NXVrmWgOUz28LSP5Q== X-Received: by 10.99.140.67 with SMTP id q3mr1104588pgn.210.1492577900243; Tue, 18 Apr 2017 21:58:20 -0700 (PDT) Received: from ?IPv6:2607:fb90:837b:f5b8:d0dc:fd2b:3c38:9525? ([2607:fb90:837b:f5b8:d0dc:fd2b:3c38:9525]) by smtp.gmail.com with ESMTPSA id r73sm1449956pfa.65.2017.04.18.21.58.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 18 Apr 2017 21:58:19 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r317106 - head/share/mk From: Ngie Cooper X-Mailer: iPhone Mail (14E304) In-Reply-To: <201704182359.v3INxGQF070387@repo.freebsd.org> Date: Tue, 18 Apr 2017 21:58:18 -0700 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <3C0031CD-B9D5-4B6C-A6CE-7D08843D714A@gmail.com> References: <201704182359.v3INxGQF070387@repo.freebsd.org> To: "Simon J. Gerraty" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 19 Apr 2017 04:58:21 -0000 > On Apr 18, 2017, at 16:59, Simon J. Gerraty wrote: >=20 > Author: sjg > Date: Tue Apr 18 23:59:15 2017 > New Revision: 317106 > URL: https://svnweb.freebsd.org/changeset/base/317106 >=20 > Log: > If MAKEOBJDIRPREFIX is a prefix match for .CURDIR, then __objdir is .CURD= IR >=20 > Reviewed by: bdrewery Thank you!! -Ngie= From owner-svn-src-head@freebsd.org Wed Apr 19 05:59:01 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AC0C6D45EB2; Wed, 19 Apr 2017 05:59:01 +0000 (UTC) (envelope-from ganbold@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6AD6932B; Wed, 19 Apr 2017 05:59:01 +0000 (UTC) (envelope-from ganbold@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3J5x0IA017172; Wed, 19 Apr 2017 05:59:00 GMT (envelope-from ganbold@FreeBSD.org) Received: (from ganbold@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3J5x0Nv017171; Wed, 19 Apr 2017 05:59:00 GMT (envelope-from ganbold@FreeBSD.org) Message-Id: <201704190559.v3J5x0Nv017171@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ganbold set sender to ganbold@FreeBSD.org using -f From: Ganbold Tsagaankhuu Date: Wed, 19 Apr 2017 05:59:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317126 - head/sys/arm/allwinner X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 19 Apr 2017 05:59:01 -0000 Author: ganbold Date: Wed Apr 19 05:59:00 2017 New Revision: 317126 URL: https://svnweb.freebsd.org/changeset/base/317126 Log: Use hwreset_get_by_ofw_idx() function instead, since there is no reset-names dts property defined for IR in case of H3 SoC. That way IR works on H3 SoC based board. Tested on Orangepi mini 2 board. Modified: head/sys/arm/allwinner/aw_cir.c Modified: head/sys/arm/allwinner/aw_cir.c ============================================================================== --- head/sys/arm/allwinner/aw_cir.c Wed Apr 19 05:28:21 2017 (r317125) +++ head/sys/arm/allwinner/aw_cir.c Wed Apr 19 05:59:00 2017 (r317126) @@ -419,7 +419,7 @@ aw_ir_attach(device_t dev) } /* De-assert reset */ - if (hwreset_get_by_ofw_name(dev, 0, "apb", &rst_apb) == 0) { + if (hwreset_get_by_ofw_idx(dev, 0, 0, &rst_apb) == 0) { err = hwreset_deassert(rst_apb); if (err != 0) { device_printf(dev, "cannot de-assert reset\n"); From owner-svn-src-head@freebsd.org Wed Apr 19 11:38:08 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C05FFD45EFF; Wed, 19 Apr 2017 11:38:08 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8CDBD19D4; Wed, 19 Apr 2017 11:38:08 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3JBc7NN056616; Wed, 19 Apr 2017 11:38:07 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3JBc7Up056615; Wed, 19 Apr 2017 11:38:07 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201704191138.v3JBc7Up056615@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 19 Apr 2017 11:38:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317135 - head/sys/compat/linuxkpi/common/src X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 19 Apr 2017 11:38:08 -0000 Author: hselasky Date: Wed Apr 19 11:38:07 2017 New Revision: 317135 URL: https://svnweb.freebsd.org/changeset/base/317135 Log: Zero number of CPUs should be translated into the default number of CPUs when allocating a LinuxKPI workqueue. This also ensures that the created taskqueue always have a non-zero number of worker threads. MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/src/linux_work.c Modified: head/sys/compat/linuxkpi/common/src/linux_work.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_work.c Wed Apr 19 11:13:32 2017 (r317134) +++ head/sys/compat/linuxkpi/common/src/linux_work.c Wed Apr 19 11:38:07 2017 (r317135) @@ -57,6 +57,8 @@ struct workqueue_struct *system_long_wq; struct workqueue_struct *system_unbound_wq; struct workqueue_struct *system_power_efficient_wq; +static int linux_default_wq_cpus = 4; + static void linux_delayed_work_timer_fn(void *); /* @@ -497,6 +499,12 @@ linux_create_workqueue_common(const char { struct workqueue_struct *wq; + /* + * If zero CPUs are specified use the default number of CPUs: + */ + if (cpus == 0) + cpus = linux_default_wq_cpus; + wq = kmalloc(sizeof(*wq), M_WAITOK | M_ZERO); wq->taskqueue = taskqueue_create(name, M_WAITOK, taskqueue_thread_enqueue, &wq->taskqueue); @@ -537,6 +545,9 @@ linux_work_init(void *arg) if (max_wq_cpus < 4) max_wq_cpus = 4; + /* set default number of CPUs */ + linux_default_wq_cpus = max_wq_cpus; + linux_system_short_wq = alloc_workqueue("linuxkpi_short_wq", 0, max_wq_cpus); linux_system_long_wq = alloc_workqueue("linuxkpi_long_wq", 0, max_wq_cpus); From owner-svn-src-head@freebsd.org Wed Apr 19 12:26:22 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3D1C0D45FB2; Wed, 19 Apr 2017 12:26:22 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [IPv6:2a01:4f8:c17:6c4b::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 09A711BE7; Wed, 19 Apr 2017 12:26:22 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [62.141.129.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id EE71F1FE022; Wed, 19 Apr 2017 14:26:18 +0200 (CEST) Subject: Re: svn commit: r316811 - head/sys/contrib/ipfilter/netinet To: Cy Schubert , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201704140513.v3E5Dp7v039091@repo.freebsd.org> From: Hans Petter Selasky Message-ID: <45d50d78-239a-8d9a-286f-310513c3b8a4@selasky.org> Date: Wed, 19 Apr 2017 14:24:29 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.7.1 MIME-Version: 1.0 In-Reply-To: <201704140513.v3E5Dp7v039091@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 19 Apr 2017 12:26:22 -0000 On 04/14/17 07:13, Cy Schubert wrote: > Author: cy > Date: Fri Apr 14 05:13:50 2017 > New Revision: 316811 > URL: https://svnweb.freebsd.org/changeset/base/316811 > > Log: > Add missing free()'s after calls to randomize(). > > PR: NetBSD PR/50559 > Obtained from: Netbsd radix_ipf.c r1.6 > MFC after: 1 week > > Modified: > head/sys/contrib/ipfilter/netinet/radix_ipf.c > > Modified: head/sys/contrib/ipfilter/netinet/radix_ipf.c > ============================================================================== > --- head/sys/contrib/ipfilter/netinet/radix_ipf.c Fri Apr 14 05:12:01 2017 (r316810) > +++ head/sys/contrib/ipfilter/netinet/radix_ipf.c Fri Apr 14 05:13:50 2017 (r316811) > @@ -38,7 +38,7 @@ static void buildnodes __P((addrfamily_t > static ipf_rdx_node_t *ipf_rx_find_addr __P((ipf_rdx_node_t *, u_32_t *)); > static ipf_rdx_node_t *ipf_rx_lookup __P((ipf_rdx_head_t *, addrfamily_t *, > addrfamily_t *)); > -static ipf_rdx_node_t *ipf_rx_match __P((ipf_rdx_head_t *, addrfamily_t *)); > +/* $NetBSD: radix_ipf.c,v 1.6 2015/12/15 12:30:34 christos Exp $ */ > > /* > * Foreword. > @@ -1509,6 +1509,8 @@ random_add(rnh) > add_addr(rnh, i, order[i]); > checktree(rnh); > } > + > + free(order); > } > > > @@ -1526,5 +1528,7 @@ random_delete(rnh) > delete_addr(rnh, i); > checktree(rnh); > } > + > + free(order); > } > #endif /* RDX_DEBUG */ > > I'm seeing this compilation warning: freebsd/sys/contrib/ipfilter/netinet/radix_ipf.c:184: warning: function declaration isn't a prototype [-Wstrict-prototypes] *** [radix_ipf.o] Error code 1 --HPS From owner-svn-src-head@freebsd.org Wed Apr 19 12:33:57 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 44646D4454E; Wed, 19 Apr 2017 12:33:57 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [IPv6:2a01:4f8:c17:6c4b::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0746E398; Wed, 19 Apr 2017 12:33:57 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [62.141.129.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 4ABAE1FE022; Wed, 19 Apr 2017 14:33:55 +0200 (CEST) Subject: Re: svn commit: r316811 - head/sys/contrib/ipfilter/netinet To: Cy Schubert , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201704140513.v3E5Dp7v039091@repo.freebsd.org> <45d50d78-239a-8d9a-286f-310513c3b8a4@selasky.org> From: Hans Petter Selasky Message-ID: Date: Wed, 19 Apr 2017 14:32:05 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.7.1 MIME-Version: 1.0 In-Reply-To: <45d50d78-239a-8d9a-286f-310513c3b8a4@selasky.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 19 Apr 2017 12:33:57 -0000 On 04/19/17 14:24, Hans Petter Selasky wrote: > -static ipf_rdx_node_t *ipf_rx_match __P((ipf_rdx_head_t *, addrfamily_t ^^^ was removal of this prototype intended? > *)); > +/* $NetBSD: radix_ipf.c,v 1.6 2015/12/15 12:30:34 christos Exp $ */ --HPS From owner-svn-src-head@freebsd.org Wed Apr 19 12:39:47 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 04837D448D1; Wed, 19 Apr 2017 12:39:47 +0000 (UTC) (envelope-from n_hibma@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AED4BA45; Wed, 19 Apr 2017 12:39:46 +0000 (UTC) (envelope-from n_hibma@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3JCdjm5080807; Wed, 19 Apr 2017 12:39:45 GMT (envelope-from n_hibma@FreeBSD.org) Received: (from n_hibma@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3JCdjCJ080806; Wed, 19 Apr 2017 12:39:45 GMT (envelope-from n_hibma@FreeBSD.org) Message-Id: <201704191239.v3JCdjCJ080806@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: n_hibma set sender to n_hibma@FreeBSD.org using -f From: Nick Hibma Date: Wed, 19 Apr 2017 12:39:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317136 - head/tools/tools/nanobsd/embedded X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 19 Apr 2017 12:39:47 -0000 Author: n_hibma Date: Wed Apr 19 12:39:45 2017 New Revision: 317136 URL: https://svnweb.freebsd.org/changeset/base/317136 Log: A test was moved but without the definition of $d. The test however always succeeds because 'test -d' always returns true. Also some speling fixes. Modified: head/tools/tools/nanobsd/embedded/common Modified: head/tools/tools/nanobsd/embedded/common ============================================================================== --- head/tools/tools/nanobsd/embedded/common Wed Apr 19 11:38:07 2017 (r317135) +++ head/tools/tools/nanobsd/embedded/common Wed Apr 19 12:39:45 2017 (r317136) @@ -65,7 +65,7 @@ # Long Term # o common tooling for creating images for odd-ball platforms # o support for boot loaders other than uboot in the image -# or via special insturctions +# or via special instructions # o No pony support. Sadly, you cannot have a pony. # @@ -343,8 +343,8 @@ die( ) { # Automatically include the packaging port here so it is always first so it # builds the port and adds the package so we can add other packages. #XXX Doesn't work for cross build, so punting until I can integreate qemu-static -#XXX or poudere, both of which require priv'd execution. Or qemu-system, which -#XXX is super, super slow. +#XXX or poudriere, both of which require priv'd execution. Or qemu-system, +#XXX which is super, super slow. #add_port ports-mgmt/pkg #add_port security/sudo #add_port ftp/curl @@ -480,6 +480,7 @@ dos_boot_part ( ) ( ) if [ -n "$NANO_BOOT_PKG" ]; then + local d=/usr/local/share/u-boot/${NANO_BOOT_PKG} if [ ! -d ${d} ]; then echo ${NANO_BOOT_PKG} not installed. Sadly, it must be. exit 1 @@ -492,7 +493,7 @@ if [ -n "$NANO_BOOT_PKG" ]; then fi product_custom ( ) ( - # not quie ready to tweak these in nopriv build + # not quite ready to tweak these in nopriv build if [ -z ${NANO_NOPRIV_BUILD} ]; then # Last second tweaks -- generally not needed chown -R root:wheel ${NANO_WORLDDIR}/root From owner-svn-src-head@freebsd.org Wed Apr 19 13:03:31 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6AEC5D453D1; Wed, 19 Apr 2017 13:03:31 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2F76818E1; Wed, 19 Apr 2017 13:03:31 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3JD3UVv093316; Wed, 19 Apr 2017 13:03:30 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3JD3UZV093313; Wed, 19 Apr 2017 13:03:30 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201704191303.v3JD3UZV093313@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 19 Apr 2017 13:03:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317137 - in head/sys/compat/linuxkpi/common: include/linux src X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 19 Apr 2017 13:03:31 -0000 Author: hselasky Date: Wed Apr 19 13:03:29 2017 New Revision: 317137 URL: https://svnweb.freebsd.org/changeset/base/317137 Log: Fix problem regarding priority inversion when using the concurrency kit, CK, in the LinuxKPI. When threads are pinned to a CPU core or when there is only one CPU, it can happen that a higher priority thread can call the CK synchronize function while a lower priority thread holds the read lock. Because the CK's synchronize is a simple wait loop this can lead to a deadlock situation. To solve this problem use the recently introduced CK's wait callback function. When detecting a CK blocking condition figure out the lowest priority among the blockers and update the calling thread's priority and yield. If another CPU core is holding the read lock, pin the thread to the blocked CPU core and update the priority. The calling threads priority and CPU bindings are restored before return. If a thread holding a CK read lock is detected to be sleeping, pause() will be used instead of yield(). MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/sched.h head/sys/compat/linuxkpi/common/include/linux/srcu.h head/sys/compat/linuxkpi/common/src/linux_rcu.c Modified: head/sys/compat/linuxkpi/common/include/linux/sched.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/sched.h Wed Apr 19 12:39:45 2017 (r317136) +++ head/sys/compat/linuxkpi/common/include/linux/sched.h Wed Apr 19 13:03:29 2017 (r317137) @@ -37,7 +37,7 @@ #include #include -#include +#include #include #include #include @@ -72,6 +72,8 @@ struct task_struct { unsigned bsd_ioctl_len; struct completion parked; struct completion exited; + TAILQ_ENTRY(task_struct) rcu_entry; + int rcu_recurse; }; #define current ({ \ Modified: head/sys/compat/linuxkpi/common/include/linux/srcu.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/srcu.h Wed Apr 19 12:39:45 2017 (r317136) +++ head/sys/compat/linuxkpi/common/include/linux/srcu.h Wed Apr 19 13:03:29 2017 (r317137) @@ -29,9 +29,7 @@ #ifndef _LINUX_SRCU_H_ #define _LINUX_SRCU_H_ -struct srcu_epoch_record; struct srcu_struct { - struct srcu_epoch_record *ss_epoch_record; }; #define srcu_dereference(ptr,srcu) ((__typeof(*(ptr)) *)(ptr)) Modified: head/sys/compat/linuxkpi/common/src/linux_rcu.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_rcu.c Wed Apr 19 12:39:45 2017 (r317136) +++ head/sys/compat/linuxkpi/common/src/linux_rcu.c Wed Apr 19 13:03:29 2017 (r317137) @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include @@ -45,26 +46,34 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include -struct callback_head; -struct writer_epoch_record { - ck_epoch_record_t epoch_record; - struct mtx head_lock; - struct mtx sync_lock; - struct task task; - STAILQ_HEAD(, callback_head) head; -} __aligned(CACHE_LINE_SIZE); +/* + * By defining CONFIG_NO_RCU_SKIP LinuxKPI RCU locks and asserts will + * not be skipped during panic(). + */ +#ifdef CONFIG_NO_RCU_SKIP +#define RCU_SKIP(void) 0 +#else +#define RCU_SKIP(void) unlikely(SCHEDULER_STOPPED() || kdb_active) +#endif struct callback_head { STAILQ_ENTRY(callback_head) entry; rcu_callback_t func; }; -struct srcu_epoch_record { +struct linux_epoch_head { + STAILQ_HEAD(, callback_head) cb_head; + struct mtx lock; + struct task task; +} __aligned(CACHE_LINE_SIZE); + +struct linux_epoch_record { ck_epoch_record_t epoch_record; - struct mtx read_lock; - struct mtx sync_lock; -}; + TAILQ_HEAD(, task_struct) ts_head; + int cpuid; +} __aligned(CACHE_LINE_SIZE); /* * Verify that "struct rcu_head" is big enough to hold "struct @@ -72,57 +81,42 @@ struct srcu_epoch_record { * compile flags for including ck_epoch.h to all clients of the * LinuxKPI. */ -CTASSERT(sizeof(struct rcu_head) >= sizeof(struct callback_head)); +CTASSERT(sizeof(struct rcu_head) == sizeof(struct callback_head)); /* * Verify that "epoch_record" is at beginning of "struct - * writer_epoch_record": + * linux_epoch_record": */ -CTASSERT(offsetof(struct writer_epoch_record, epoch_record) == 0); - -/* - * Verify that "epoch_record" is at beginning of "struct - * srcu_epoch_record": - */ -CTASSERT(offsetof(struct srcu_epoch_record, epoch_record) == 0); +CTASSERT(offsetof(struct linux_epoch_record, epoch_record) == 0); static ck_epoch_t linux_epoch; -static MALLOC_DEFINE(M_LRCU, "lrcu", "Linux RCU"); -static DPCPU_DEFINE(ck_epoch_record_t *, linux_reader_epoch_record); -static DPCPU_DEFINE(struct writer_epoch_record *, linux_writer_epoch_record); +static struct linux_epoch_head linux_epoch_head; +static DPCPU_DEFINE(struct linux_epoch_record, linux_epoch_record); static void linux_rcu_cleaner_func(void *, int); static void linux_rcu_runtime_init(void *arg __unused) { + struct linux_epoch_head *head; int i; ck_epoch_init(&linux_epoch); - /* setup reader records */ - CPU_FOREACH(i) { - ck_epoch_record_t *record; - - record = malloc(sizeof(*record), M_LRCU, M_WAITOK | M_ZERO); - ck_epoch_register(&linux_epoch, record, NULL); + head = &linux_epoch_head; - DPCPU_ID_SET(i, linux_reader_epoch_record, record); - } + mtx_init(&head->lock, "LRCU-HEAD", NULL, MTX_DEF); + TASK_INIT(&head->task, 0, linux_rcu_cleaner_func, NULL); + STAILQ_INIT(&head->cb_head); - /* setup writer records */ CPU_FOREACH(i) { - struct writer_epoch_record *record; + struct linux_epoch_record *record; - record = malloc(sizeof(*record), M_LRCU, M_WAITOK | M_ZERO); + record = &DPCPU_ID_GET(i, linux_epoch_record); + record->cpuid = i; ck_epoch_register(&linux_epoch, &record->epoch_record, NULL); - mtx_init(&record->head_lock, "LRCU-HEAD", NULL, MTX_DEF); - mtx_init(&record->sync_lock, "LRCU-SYNC", NULL, MTX_DEF); - TASK_INIT(&record->task, 0, linux_rcu_cleaner_func, record); - STAILQ_INIT(&record->head); - - DPCPU_ID_SET(i, linux_writer_epoch_record, record); + TAILQ_INIT(&record->ts_head); } } SYSINIT(linux_rcu_runtime, SI_SUB_LOCK, SI_ORDER_SECOND, linux_rcu_runtime_init, NULL); @@ -130,91 +124,40 @@ SYSINIT(linux_rcu_runtime, SI_SUB_LOCK, static void linux_rcu_runtime_uninit(void *arg __unused) { - ck_stack_entry_t *cursor; - ck_stack_entry_t *next; - int i; + struct linux_epoch_head *head; - /* make sure all callbacks have been called */ - linux_rcu_barrier(); + head = &linux_epoch_head; - /* destroy all writer record mutexes */ - CPU_FOREACH(i) { - struct writer_epoch_record *record; - - record = DPCPU_ID_GET(i, linux_writer_epoch_record); - - mtx_destroy(&record->head_lock); - mtx_destroy(&record->sync_lock); - } - - /* free all registered reader and writer records */ - CK_STACK_FOREACH_SAFE(&linux_epoch.records, cursor, next) { - ck_epoch_record_t *record; - - record = container_of(cursor, - struct ck_epoch_record, record_next); - free(record, M_LRCU); - } + /* destroy head lock */ + mtx_destroy(&head->lock); } SYSUNINIT(linux_rcu_runtime, SI_SUB_LOCK, SI_ORDER_SECOND, linux_rcu_runtime_uninit, NULL); -static inline struct srcu_epoch_record * -linux_srcu_get_record(void) -{ - struct srcu_epoch_record *record; - - WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, - "linux_srcu_get_record() might sleep"); - - /* - * NOTE: The only records that are unregistered and can be - * recycled are srcu_epoch_records. - */ - record = (struct srcu_epoch_record *)ck_epoch_recycle(&linux_epoch, NULL); - if (__predict_true(record != NULL)) - return (record); - - record = malloc(sizeof(*record), M_LRCU, M_WAITOK | M_ZERO); - mtx_init(&record->read_lock, "SRCU-READ", NULL, MTX_DEF | MTX_NOWITNESS); - mtx_init(&record->sync_lock, "SRCU-SYNC", NULL, MTX_DEF | MTX_NOWITNESS); - ck_epoch_register(&linux_epoch, &record->epoch_record, NULL); - - return (record); -} - -static inline void -linux_rcu_synchronize_sub(struct writer_epoch_record *record) -{ - - /* protect access to epoch_record */ - mtx_lock(&record->sync_lock); - ck_epoch_synchronize(&record->epoch_record); - mtx_unlock(&record->sync_lock); -} - static void -linux_rcu_cleaner_func(void *context, int pending __unused) +linux_rcu_cleaner_func(void *context __unused, int pending __unused) { - struct writer_epoch_record *record; + struct linux_epoch_head *head; struct callback_head *rcu; - STAILQ_HEAD(, callback_head) head; + STAILQ_HEAD(, callback_head) tmp_head; + + linux_set_current(curthread); - record = context; + head = &linux_epoch_head; /* move current callbacks into own queue */ - mtx_lock(&record->head_lock); - STAILQ_INIT(&head); - STAILQ_CONCAT(&head, &record->head); - mtx_unlock(&record->head_lock); + mtx_lock(&head->lock); + STAILQ_INIT(&tmp_head); + STAILQ_CONCAT(&tmp_head, &head->cb_head); + mtx_unlock(&head->lock); /* synchronize */ - linux_rcu_synchronize_sub(record); + linux_synchronize_rcu(); /* dispatch all callbacks, if any */ - while ((rcu = STAILQ_FIRST(&head)) != NULL) { + while ((rcu = STAILQ_FIRST(&tmp_head)) != NULL) { uintptr_t offset; - STAILQ_REMOVE_HEAD(&head, entry); + STAILQ_REMOVE_HEAD(&tmp_head, entry); offset = (uintptr_t)rcu->func; @@ -228,148 +171,217 @@ linux_rcu_cleaner_func(void *context, in void linux_rcu_read_lock(void) { - ck_epoch_record_t *record; + struct linux_epoch_record *record; + struct task_struct *ts; + + if (RCU_SKIP()) + return; /* * Pin thread to current CPU so that the unlock code gets the - * same per-CPU reader epoch record: + * same per-CPU epoch record: */ sched_pin(); - record = DPCPU_GET(linux_reader_epoch_record); + record = &DPCPU_GET(linux_epoch_record); + ts = current; /* * Use a critical section to prevent recursion inside * ck_epoch_begin(). Else this function supports recursion. */ critical_enter(); - ck_epoch_begin(record, NULL); + ck_epoch_begin(&record->epoch_record, NULL); + ts->rcu_recurse++; + if (ts->rcu_recurse == 1) + TAILQ_INSERT_TAIL(&record->ts_head, ts, rcu_entry); critical_exit(); } void linux_rcu_read_unlock(void) { - ck_epoch_record_t *record; + struct linux_epoch_record *record; + struct task_struct *ts; + + if (RCU_SKIP()) + return; - record = DPCPU_GET(linux_reader_epoch_record); + record = &DPCPU_GET(linux_epoch_record); + ts = current; /* * Use a critical section to prevent recursion inside * ck_epoch_end(). Else this function supports recursion. */ critical_enter(); - ck_epoch_end(record, NULL); + ck_epoch_end(&record->epoch_record, NULL); + ts->rcu_recurse--; + if (ts->rcu_recurse == 0) + TAILQ_REMOVE(&record->ts_head, ts, rcu_entry); critical_exit(); sched_unpin(); } +static void +linux_synchronize_rcu_cb(ck_epoch_t *epoch __unused, ck_epoch_record_t *epoch_record, void *arg __unused) +{ + struct linux_epoch_record *record = + container_of(epoch_record, struct linux_epoch_record, epoch_record); + struct thread *td = curthread; + struct task_struct *ts; + + /* check if blocked on the current CPU */ + if (record->cpuid == PCPU_GET(cpuid)) { + bool is_sleeping = 0; + u_char prio = 0; + u_char old_prio; + + /* + * Find the lowest priority or sleeping thread which + * is blocking synchronization on this CPU core. All + * the threads in the queue are CPU-pinned and cannot + * go anywhere while the current thread is locked. + */ + TAILQ_FOREACH(ts, &record->ts_head, rcu_entry) { + if (ts->task_thread->td_priority > prio) + prio = ts->task_thread->td_priority; + is_sleeping |= (ts->task_thread->td_inhibitors != 0); + } + + if (is_sleeping) { + thread_unlock(td); + pause("W", 1); + thread_lock(td); + } else { + old_prio = td->td_priority; + /* set new thread priority */ + sched_prio(td, prio); + /* task switch */ + mi_switch(SW_VOL | SWT_RELINQUISH, NULL); + /* restore thread priority */ + sched_prio(td, old_prio); + } + } else { + /* + * To avoid spinning move execution to the other CPU + * which is blocking synchronization. Set highest + * thread priority so that code gets run. The thread + * priority will be restored later. + */ + sched_prio(td, 0); + sched_bind(td, record->cpuid); + } +} + void linux_synchronize_rcu(void) { - linux_rcu_synchronize_sub(DPCPU_GET(linux_writer_epoch_record)); + struct thread *td; + int was_bound; + int old_cpu; + int old_pinned; + + if (RCU_SKIP()) + return; + + WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, + "linux_synchronize_rcu() can sleep"); + + td = curthread; + + DROP_GIANT(); + + /* + * Synchronizing RCU might change the CPU core this function + * is running on. Save current values: + */ + thread_lock(td); + + old_cpu = PCPU_GET(cpuid); + old_pinned = td->td_pinned; + td->td_pinned = 0; + was_bound = sched_is_bound(td); + sched_bind(td, old_cpu); + + ck_epoch_synchronize_wait(&linux_epoch, + &linux_synchronize_rcu_cb, NULL); + + /* restore CPU binding, if any */ + if (was_bound != 0) { + sched_bind(td, old_cpu); + } else { + /* get thread back to initial CPU, if any */ + if (old_pinned != 0) + sched_bind(td, old_cpu); + sched_unbind(td); + } + /* restore pinned after bind */ + td->td_pinned = old_pinned; + thread_unlock(td); + + PICKUP_GIANT(); } void linux_rcu_barrier(void) { - int i; - - CPU_FOREACH(i) { - struct writer_epoch_record *record; + struct linux_epoch_head *head; - record = DPCPU_ID_GET(i, linux_writer_epoch_record); + linux_synchronize_rcu(); - linux_rcu_synchronize_sub(record); + head = &linux_epoch_head; - /* wait for callbacks to complete */ - taskqueue_drain(taskqueue_fast, &record->task); - } + /* wait for callbacks to complete */ + taskqueue_drain(taskqueue_fast, &head->task); } void linux_call_rcu(struct rcu_head *context, rcu_callback_t func) { struct callback_head *rcu = (struct callback_head *)context; - struct writer_epoch_record *record; - - record = DPCPU_GET(linux_writer_epoch_record); + struct linux_epoch_head *head = &linux_epoch_head; - mtx_lock(&record->head_lock); + mtx_lock(&head->lock); rcu->func = func; - STAILQ_INSERT_TAIL(&record->head, rcu, entry); - taskqueue_enqueue(taskqueue_fast, &record->task); - mtx_unlock(&record->head_lock); + STAILQ_INSERT_TAIL(&head->cb_head, rcu, entry); + taskqueue_enqueue(taskqueue_fast, &head->task); + mtx_unlock(&head->lock); } int init_srcu_struct(struct srcu_struct *srcu) { - struct srcu_epoch_record *record; - - record = linux_srcu_get_record(); - srcu->ss_epoch_record = record; return (0); } void cleanup_srcu_struct(struct srcu_struct *srcu) { - struct srcu_epoch_record *record; - - record = srcu->ss_epoch_record; - srcu->ss_epoch_record = NULL; - - ck_epoch_unregister(&record->epoch_record); } int srcu_read_lock(struct srcu_struct *srcu) { - struct srcu_epoch_record *record; - - record = srcu->ss_epoch_record; - - mtx_lock(&record->read_lock); - ck_epoch_begin(&record->epoch_record, NULL); - mtx_unlock(&record->read_lock); - + linux_rcu_read_lock(); return (0); } void srcu_read_unlock(struct srcu_struct *srcu, int key __unused) { - struct srcu_epoch_record *record; - - record = srcu->ss_epoch_record; - - mtx_lock(&record->read_lock); - ck_epoch_end(&record->epoch_record, NULL); - mtx_unlock(&record->read_lock); + linux_rcu_read_unlock(); } void synchronize_srcu(struct srcu_struct *srcu) { - struct srcu_epoch_record *record; - - record = srcu->ss_epoch_record; - - mtx_lock(&record->sync_lock); - ck_epoch_synchronize(&record->epoch_record); - mtx_unlock(&record->sync_lock); + linux_synchronize_rcu(); } void srcu_barrier(struct srcu_struct *srcu) { - struct srcu_epoch_record *record; - - record = srcu->ss_epoch_record; - - mtx_lock(&record->sync_lock); - ck_epoch_barrier(&record->epoch_record); - mtx_unlock(&record->sync_lock); + linux_rcu_barrier(); } From owner-svn-src-head@freebsd.org Wed Apr 19 13:04:36 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3F885D4543D; Wed, 19 Apr 2017 13:04:36 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0E42F1A53; Wed, 19 Apr 2017 13:04:35 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3JD4Z5f093395; Wed, 19 Apr 2017 13:04:35 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3JD4ZeN093394; Wed, 19 Apr 2017 13:04:35 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201704191304.v3JD4ZeN093394@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 19 Apr 2017 13:04:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317138 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 19 Apr 2017 13:04:36 -0000 Author: hselasky Date: Wed Apr 19 13:04:34 2017 New Revision: 317138 URL: https://svnweb.freebsd.org/changeset/base/317138 Log: Use __typeof() instead of typeof() in some RCU related macros in the LinuxKPI. MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/rcupdate.h Modified: head/sys/compat/linuxkpi/common/include/linux/rcupdate.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/rcupdate.h Wed Apr 19 13:03:29 2017 (r317137) +++ head/sys/compat/linuxkpi/common/include/linux/rcupdate.h Wed Apr 19 13:04:34 2017 (r317138) @@ -36,7 +36,7 @@ #define LINUX_KFREE_RCU_OFFSET_MAX 4096 /* exclusive */ #define RCU_INITIALIZER(v) \ - ((typeof(*(v)) __force __rcu *)(v)) + ((__typeof(*(v)) *)(v)) #define RCU_INIT_POINTER(p, v) do { \ (p) = (v); \ @@ -74,10 +74,10 @@ } while (0) #define rcu_access_pointer(p) \ - ((typeof(*p) __force __kernel *)(READ_ONCE(p))) + ((__typeof(*p) *)(READ_ONCE(p))) #define rcu_dereference_protected(p, c) \ - ((typeof(*p) __force __kernel *)(p)) + ((__typeof(*p) *)(p)) #define rcu_dereference(p) \ rcu_dereference_protected(p, 0) From owner-svn-src-head@freebsd.org Wed Apr 19 13:24:33 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5BD5FD45B40; Wed, 19 Apr 2017 13:24:33 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2C3D27FC; Wed, 19 Apr 2017 13:24:33 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3JDOW0K001393; Wed, 19 Apr 2017 13:24:32 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3JDOWYo001392; Wed, 19 Apr 2017 13:24:32 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201704191324.v3JDOWYo001392@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Wed, 19 Apr 2017 13:24:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317139 - head/sys/contrib/ipfilter/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 19 Apr 2017 13:24:33 -0000 Author: cy Date: Wed Apr 19 13:24:32 2017 New Revision: 317139 URL: https://svnweb.freebsd.org/changeset/base/317139 Log: Restore prototype accidently removed by r316811. Also remove $NetBSD$ accidentally added. Reported by: hps, lwhsu Modified: head/sys/contrib/ipfilter/netinet/radix_ipf.c Modified: head/sys/contrib/ipfilter/netinet/radix_ipf.c ============================================================================== --- head/sys/contrib/ipfilter/netinet/radix_ipf.c Wed Apr 19 13:04:34 2017 (r317138) +++ head/sys/contrib/ipfilter/netinet/radix_ipf.c Wed Apr 19 13:24:32 2017 (r317139) @@ -38,7 +38,7 @@ static void buildnodes __P((addrfamily_t static ipf_rdx_node_t *ipf_rx_find_addr __P((ipf_rdx_node_t *, u_32_t *)); static ipf_rdx_node_t *ipf_rx_lookup __P((ipf_rdx_head_t *, addrfamily_t *, addrfamily_t *)); -/* $NetBSD: radix_ipf.c,v 1.6 2015/12/15 12:30:34 christos Exp $ */ +static ipf_rdx_node_t *ipf_rx_match __P((ipf_rdx_head_t *, addrfamily_t *)); /* * Foreword. From owner-svn-src-head@freebsd.org Wed Apr 19 13:27:17 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BEE07D45C54; Wed, 19 Apr 2017 13:27:17 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 78A1CA73; Wed, 19 Apr 2017 13:27:17 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from spqr.komquats.com ([96.50.22.10]) by shaw.ca with SMTP id 0pdYdYLpJoUq60pdZdDRxJ; Wed, 19 Apr 2017 07:27:15 -0600 X-Authority-Analysis: v=2.2 cv=JLpLi4Cb c=1 sm=1 tr=0 a=jvE2nwUzI0ECrNeyr98KWA==:117 a=jvE2nwUzI0ECrNeyr98KWA==:17 a=kj9zAlcOel0A:10 a=AzvcPWV-tVgA:10 a=ndaoGXS1AAAA:8 a=YxBL1-UpAAAA:8 a=6I5d2MoRAAAA:8 a=GCBpw9OTSTnOxHl-IPYA:9 a=CjuIK1q_8ugA:10 a=mFeOnlTyF09QQMGr2mMI:22 a=Ia-lj3WSrqcvXOmTRaiG:22 a=IjZwj45LgO3ly-622nXo:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id 792F110DC; Sun, 16 Apr 2017 02:37:25 -0700 (PDT) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id v3JDRCOu013203; Wed, 19 Apr 2017 06:27:12 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201704191327.v3JDRCOu013203@slippy.cwsent.com> X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.6 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Hans Petter Selasky cc: Cy Schubert , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r316811 - head/sys/contrib/ipfilter/netinet In-Reply-To: Message from Hans Petter Selasky of "Wed, 19 Apr 2017 14:32:05 +0200." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Wed, 19 Apr 2017 06:27:12 -0700 X-CMAE-Envelope: MS4wfASIvQHeu8nabV9p+jh+Ob+tFt15uJlCJ/vgK3I2k01fObH0b0mqzCudqQZocYaoveyvwckxLr0FtFDC60a3wKPaMX06O/I3DCeBFA5wUk91L1SecLlj 4RFQUhZhh5XDWhDNtG9TBGLIVevLlLn1nElAM06Q9SJ9n+SvvcBwaA7DWJqtFSJY56v0gPq3Tp82/as3KKuIJzbNjortCZYr3DXgCwWMVmPa2Hau9xer+vha zou38y2taXxezajZ5EgDO9OFsrYpmY2J2LR8euZl558bMoPSh7tcLIynVAjnUislW/x1iZ5Ja3+hSRvC/B2SXA== X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 19 Apr 2017 13:27:17 -0000 In message , Hans Petter Sela sky writes: > On 04/19/17 14:24, Hans Petter Selasky wrote: > > -static ipf_rdx_node_t *ipf_rx_match __P((ipf_rdx_head_t *, addrfamily_t > ^^^ was removal of this prototype intended? > > > *)); > > +/* $NetBSD: radix_ipf.c,v 1.6 2015/12/15 12:30:34 christos Exp $ */ Both lines were inadvertently added. It's been fixed now. -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-head@freebsd.org Wed Apr 19 14:24:23 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 037CDD45096; Wed, 19 Apr 2017 14:24:23 +0000 (UTC) (envelope-from rb743@hermes.cam.ac.uk) Received: from ppsw-40.csi.cam.ac.uk (ppsw-40.csi.cam.ac.uk [131.111.8.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B73E112FD; Wed, 19 Apr 2017 14:24:22 +0000 (UTC) (envelope-from rb743@hermes.cam.ac.uk) X-Cam-AntiVirus: no malware found X-Cam-ScannerInfo: http://help.uis.cam.ac.uk/email-scanner-virus Received: from sc1.bsdpad.com ([163.172.212.18]:61583) by ppsw-40.csi.cam.ac.uk (smtp.hermes.cam.ac.uk [131.111.8.158]:587) with esmtpsa (LOGIN:rb743) (TLSv1:ECDHE-RSA-AES256-SHA:256) id 1d0qWp-000HSt-lT (Exim 4.89) (return-path ); Wed, 19 Apr 2017 15:24:19 +0100 Date: Wed, 19 Apr 2017 14:21:06 +0000 From: Ruslan Bukin To: Baptiste Daroussin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r316978 - in head: contrib/zstd etc/mtree lib lib/libzstd share/mk usr.bin usr.bin/zstd Message-ID: <20170419142106.GA59031@bsdpad.com> References: <201704152005.v3FK5M2j002459@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <201704152005.v3FK5M2j002459@repo.freebsd.org> User-Agent: Mutt/1.6.1 (2016-04-27) Sender: "R. Bukin" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 19 Apr 2017 14:24:23 -0000 This break RISC-V world build: /home/br/obj//riscv.riscv64/usr/home/br/dev/freebsd-head/tmp/usr/lib/libprivatezstd.so: undefined reference to `__bswap si2' /home/br/obj//riscv.riscv64/usr/home/br/dev/freebsd-head/tmp/usr/lib/libprivatezstd.so: undefined reference to `__bswap di2' Here is patch that makes it compilable: diff --git a/contrib/zstd/lib/common/xxhash.c b/contrib/zstd/lib/common/xxhash.c index eb44222c5fc..d59a22a0638 100644 --- a/contrib/zstd/lib/common/xxhash.c +++ b/contrib/zstd/lib/common/xxhash.c @@ -206,7 +206,7 @@ static U64 XXH_read64(const void* memPtr) #if defined(_MSC_VER) /* Visual Studio */ # define XXH_swap32 _byteswap_ulong # define XXH_swap64 _byteswap_uint64 -#elif GCC_VERSION >= 403 +#elif (GCC_VERSION >= 403 && !defined(__riscv__)) # define XXH_swap32 __builtin_bswap32 # define XXH_swap64 __builtin_bswap64 #else Ruslan On Sat, Apr 15, 2017 at 08:05:22PM +0000, Baptiste Daroussin wrote: > Author: bapt > Date: Sat Apr 15 20:05:22 2017 > New Revision: 316978 > URL: https://svnweb.freebsd.org/changeset/base/316978 > > Log: > Import zstandard 1.1.4 in base > > zstandard is a new compression library/tool which is very fast at > compression/decompression > > For now import as a private library > > Added: > head/contrib/zstd/ > - copied from r316976, vendor/zstd/dist/ > head/lib/libzstd/ > head/lib/libzstd/Makefile (contents, props changed) > head/usr.bin/zstd/ > head/usr.bin/zstd/Makefile (contents, props changed) > Modified: > head/etc/mtree/BSD.usr.dist > head/lib/Makefile > head/share/mk/src.libnames.mk > head/usr.bin/Makefile > > Modified: head/etc/mtree/BSD.usr.dist > ============================================================================== > --- head/etc/mtree/BSD.usr.dist Sat Apr 15 20:03:50 2017 (r316977) > +++ head/etc/mtree/BSD.usr.dist Sat Apr 15 20:05:22 2017 (r316978) > @@ -17,6 +17,8 @@ > .. > ucl > .. > + zstd > + .. > .. > .. > lib > > Modified: head/lib/Makefile > ============================================================================== > --- head/lib/Makefile Sat Apr 15 20:03:50 2017 (r316977) > +++ head/lib/Makefile Sat Apr 15 20:05:22 2017 (r316978) > @@ -90,6 +90,7 @@ SUBDIR= ${SUBDIR_BOOTSTRAP} \ > libxo \ > liby \ > libz \ > + libzstd \ > ncurses > > # Inter-library dependencies. When the makefile for a library contains LDADD > > Added: head/lib/libzstd/Makefile > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/lib/libzstd/Makefile Sat Apr 15 20:05:22 2017 (r316978) > @@ -0,0 +1,34 @@ > +# $FreeBSD$ > + > +LIB= zstd > +SRCS= entropy_common.c \ > + error_private.c \ > + fse_decompress.c \ > + pool.c \ > + threading.c \ > + xxhash.c \ > + zstd_common.c \ > + fse_compress.c \ > + huf_compress.c \ > + zstd_compress.c \ > + zstdmt_compress.c \ > + huf_decompress.c \ > + zstd_decompress.c \ > + zbuff_common.c \ > + zbuff_compress.c \ > + zbuff_decompress.c \ > + cover.c \ > + divsufsort.c \ > + zdict.c > +WARNS= 2 > +INCS= zstd.h > +CFLAGS+= -I${ZSTDDIR}/lib -I${ZSTDDIR}/lib/common -DXXH_NAMESPACE=ZSTD_ > + > +PRIVATELIB= yes > + > +ZSTDDIR= ${SRCTOP}/contrib/zstd > +.PATH: ${ZSTDDIR}/lib/common ${ZSTDDIR}/lib/compress \ > + ${ZSTDDIR}/lib/decompress ${ZSTDDIR}/lib/deprecated \ > + ${ZSTDDIR}/lib/dictBuilder ${ZSTDDIR}/lib > + > +.include > > Modified: head/share/mk/src.libnames.mk > ============================================================================== > --- head/share/mk/src.libnames.mk Sat Apr 15 20:03:50 2017 (r316977) > +++ head/share/mk/src.libnames.mk Sat Apr 15 20:05:22 2017 (r316978) > @@ -24,7 +24,8 @@ _PRIVATELIBS= \ > sqlite3 \ > ssh \ > ucl \ > - unbound > + unbound \ > + zstd > > _INTERNALLIBS= \ > amu \ > > Modified: head/usr.bin/Makefile > ============================================================================== > --- head/usr.bin/Makefile Sat Apr 15 20:03:50 2017 (r316977) > +++ head/usr.bin/Makefile Sat Apr 15 20:05:22 2017 (r316978) > @@ -189,7 +189,8 @@ SUBDIR= alias \ > xo \ > xz \ > xzdec \ > - yes > + yes \ > + zstd > > # NB: keep these sorted by MK_* knobs > > > Added: head/usr.bin/zstd/Makefile > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/usr.bin/zstd/Makefile Sat Apr 15 20:05:22 2017 (r316978) > @@ -0,0 +1,21 @@ > +# $FreeBSD$ > + > +PROG= zstd > +SRCS= bench.c \ > + datagen.c \ > + dibio.c \ > + fileio.c \ > + zstdcli.c > + > +CFLAGS+= -I${SRCTOP}/contrib/zstd/programs \ > + -I${SRCTOP}/contrib/zstd/lib/common \ > + -I${SRCTOP}/contrib/zstd/lib/compress \ > + -I${SRCTOP}/contrib/zstd/lib/dictBuilder \ > + -I${SRCTOP}/contrib/zstd/lib \ > + -DXXH_NAMESPACE=ZSTD_ > + > +WARNS= 2 > +LIBADD= zstd > +.PATH: ${SRCTOP}/contrib/zstd/programs > + > +.include > From owner-svn-src-head@freebsd.org Wed Apr 19 14:43:52 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A8603D450DF; Wed, 19 Apr 2017 14:43:52 +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 mx1.freebsd.org (Postfix) with ESMTPS id 8590B1EF2; Wed, 19 Apr 2017 14:43:52 +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 v3JEhpmd039007; Wed, 19 Apr 2017 14:43:51 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3JEhpt1039006; Wed, 19 Apr 2017 14:43:51 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201704191443.v3JEhpt1039006@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 19 Apr 2017 14:43:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317141 - head/contrib/elftoolchain/readelf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 19 Apr 2017 14:43:52 -0000 Author: emaste Date: Wed Apr 19 14:43:51 2017 New Revision: 317141 URL: https://svnweb.freebsd.org/changeset/base/317141 Log: readelf: dump MIPS abiflags section This is not fully fleshed out but is sufficient to dump the SHT_MIPS_ABIFLAGS used in FreeBSD. Reviewed by: imp MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D8241 Modified: head/contrib/elftoolchain/readelf/readelf.c Modified: head/contrib/elftoolchain/readelf/readelf.c ============================================================================== --- head/contrib/elftoolchain/readelf/readelf.c Wed Apr 19 14:07:35 2017 (r317140) +++ head/contrib/elftoolchain/readelf/readelf.c Wed Apr 19 14:43:51 2017 (r317141) @@ -296,6 +296,7 @@ static void dump_elf(struct readelf *re) static void dump_dyn_val(struct readelf *re, GElf_Dyn *dyn, uint32_t stab); static void dump_dynamic(struct readelf *re); static void dump_liblist(struct readelf *re); +static void dump_mips_abiflags(struct readelf *re, struct section *s); static void dump_mips_attributes(struct readelf *re, uint8_t *p, uint8_t *pe); static void dump_mips_odk_reginfo(struct readelf *re, uint8_t *p, size_t sz); static void dump_mips_options(struct readelf *re, struct section *s); @@ -325,6 +326,7 @@ static const char *dwarf_regname(struct static struct dumpop *find_dumpop(struct readelf *re, size_t si, const char *sn, int op, int t); static int get_ent_count(struct section *s, int *ent_count); +static int get_mips_register_size(uint8_t flag); static char *get_regoff_str(struct readelf *re, Dwarf_Half reg, Dwarf_Addr off); static const char *get_string(struct readelf *re, int strtab, size_t off); @@ -4111,6 +4113,10 @@ dump_mips_specific_info(struct readelf * } } + if (s->name != NULL && (!strcmp(s->name, ".MIPS.abiflags") || + (s->type == SHT_MIPS_ABIFLAGS))) + dump_mips_abiflags(re, s); + /* * Dump .reginfo if present (although it will be ignored by an OS if a * .MIPS.options section is present, according to SGI mips64 spec). @@ -4124,6 +4130,82 @@ dump_mips_specific_info(struct readelf * } static void +dump_mips_abiflags(struct readelf *re, struct section *s) +{ + Elf_Data *d; + uint8_t *p; + int elferr; + uint32_t isa_ext, ases, flags1, flags2; + uint16_t version; + uint8_t isa_level, isa_rev, gpr_size, cpr1_size, cpr2_size, fp_abi; + + if ((d = elf_rawdata(s->scn, NULL)) == NULL) { + elferr = elf_errno(); + if (elferr != 0) + warnx("elf_rawdata failed: %s", + elf_errmsg(elferr)); + return; + } + if (d->d_size != 24) { + warnx("invalid MIPS abiflags section size"); + return; + } + + p = d->d_buf; + version = re->dw_decode(&p, 2); + printf("MIPS ABI Flags Version: %u", version); + if (version != 0) { + printf(" (unknown)\n\n"); + return; + } + printf("\n\n"); + + isa_level = re->dw_decode(&p, 1); + isa_rev = re->dw_decode(&p, 1); + gpr_size = re->dw_decode(&p, 1); + cpr1_size = re->dw_decode(&p, 1); + cpr2_size = re->dw_decode(&p, 1); + fp_abi = re->dw_decode(&p, 1); + isa_ext = re->dw_decode(&p, 4); + ases = re->dw_decode(&p, 4); + flags1 = re->dw_decode(&p, 4); + flags2 = re->dw_decode(&p, 4); + + printf("ISA: "); + if (isa_rev <= 1) + printf("MIPS%u\n", isa_level); + else + printf("MIPS%ur%u\n", isa_level, isa_rev); + printf("GPR size: %d\n", get_mips_register_size(gpr_size)); + printf("CPR1 size: %d\n", get_mips_register_size(cpr1_size)); + printf("CPR2 size: %d\n", get_mips_register_size(cpr2_size)); + printf("FP ABI: "); + switch (fp_abi) { + case 3: + printf("Soft float"); + break; + default: + printf("%u", fp_abi); + break; + } + printf("\nISA Extension: %u\n", isa_ext); + printf("ASEs: %u\n", ases); + printf("FLAGS 1: %08x\n", flags1); + printf("FLAGS 2: %08x\n", flags2); +} + +static int +get_mips_register_size(uint8_t flag) +{ + switch (flag) { + case 0: return 0; + case 1: return 32; + case 2: return 64; + case 3: return 128; + default: return -1; + } +} +static void dump_mips_reginfo(struct readelf *re, struct section *s) { Elf_Data *d; From owner-svn-src-head@freebsd.org Wed Apr 19 14:49:20 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5B4A5D45217; Wed, 19 Apr 2017 14:49:20 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 11E6485B; Wed, 19 Apr 2017 14:49:20 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3JEnJTw039275; Wed, 19 Apr 2017 14:49:19 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3JEnJl1039274; Wed, 19 Apr 2017 14:49:19 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201704191449.v3JEnJl1039274@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Wed, 19 Apr 2017 14:49:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317142 - head/sys/dev/fb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 19 Apr 2017 14:49:20 -0000 Author: bde Date: Wed Apr 19 14:49:18 2017 New Revision: 317142 URL: https://svnweb.freebsd.org/changeset/base/317142 Log: When we don't use the parameter table in the BIOS, also don't use most of our tweaked modes based on it. In practice, this means limiting the tweaked modes to at most 80x50 based on 80x25, so there are no 90-column, 80x30 or 80x60 modes. This happens when the the initial mode is is not in the parameter table. We always detected this case, but assumed that the (necessarily nonstandard) parameters of the initial mode could be tweaked just as blindly as the probably-standard parameters of initial modes in the table. On 1 laptop system with near-VGA where the initial mode is nonstandard, this is because the hardware apparently doesn't support 9-bit mode, but otherwise has standard timing. The initial mode has 8-bit mode CRTC horizontal parameters similar to those in syscons' 90-column modes and in EGA modes. Tweaking these values for the 90-column modes has little effect except to print the extra 10 columns off the screen. Tweaking from 80x25 to 80x30 requires changing from 400 scan lines to 480. This can probably be made to work, but syscons blindly applies values based on standard timing. This gives blank output. Tweaking from 80x25 to 80x50 doesn't change the CRTC timing and works. Modified: head/sys/dev/fb/vga.c Modified: head/sys/dev/fb/vga.c ============================================================================== --- head/sys/dev/fb/vga.c Wed Apr 19 14:43:51 2017 (r317141) +++ head/sys/dev/fb/vga.c Wed Apr 19 14:49:18 2017 (r317142) @@ -939,7 +939,7 @@ probe_adapters(void) #if !defined(VGA_NO_BIOS) && !defined(VGA_NO_MODE_CHANGE) u_char *mp; #endif - int i; + int height, i, width; /* do this test only once */ if (vga_init_done) @@ -1134,15 +1134,34 @@ probe_adapters(void) case COMP_DIFFERENT: default: /* - * Don't use the parameter table in BIOS. It doesn't - * look familiar to us. Video mode switching is allowed - * only if the new mode is the same as or based on - * the initial mode. + * Don't use the parameter table in the BIOS, since + * even the BIOS doesn't use it for the initial mode. + * Restrict the tweaked modes to (in practice) 80x50 + * from 80x25 with 400 scan lines, since the only safe + * tweak is changing the characters from 8x16 to 8x8. */ video_mode_ptr = NULL; bzero(mode_map, sizeof(mode_map)); mode_map[adp->va_initial_mode] = adpstate.regs; rows_offset = 1; + + width = height = -1; + for (i = 0; i < nitems(bios_vmode); ++i) { + if (bios_vmode[i].vi_mode == adp->va_initial_mode) { + width = bios_vmode[i].vi_width; + height = bios_vmode[i].vi_height; + break; + } + } + for (i = 0; i < nitems(bios_vmode); ++i) { + if (bios_vmode[i].vi_mode != adp->va_initial_mode && + map_mode_num(bios_vmode[i].vi_mode) == + adp->va_initial_mode && + (bios_vmode[i].vi_width != width || + bios_vmode[i].vi_height != 2 * height)) { + bios_vmode[i].vi_mode = NA; + } + } break; } } From owner-svn-src-head@freebsd.org Wed Apr 19 14:53:26 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A5B87D45467; Wed, 19 Apr 2017 14:53:26 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 85E1BDB7; Wed, 19 Apr 2017 14:53:26 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: by freefall.freebsd.org (Postfix, from userid 1235) id AFE8F5E76; Wed, 19 Apr 2017 14:53:25 +0000 (UTC) Date: Wed, 19 Apr 2017 16:53:25 +0200 From: Baptiste Daroussin To: Ruslan Bukin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r316978 - in head: contrib/zstd etc/mtree lib lib/libzstd share/mk usr.bin usr.bin/zstd Message-ID: <20170419145325.zjvo3hq2z3egcp26@ivaldir.net> References: <201704152005.v3FK5M2j002459@repo.freebsd.org> <20170419142106.GA59031@bsdpad.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="mefsnsm53xpgretk" Content-Disposition: inline In-Reply-To: <20170419142106.GA59031@bsdpad.com> User-Agent: NeoMutt/20170306 (1.8.0) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 19 Apr 2017 14:53:26 -0000 --mefsnsm53xpgretk Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Apr 19, 2017 at 02:21:06PM +0000, Ruslan Bukin wrote: > This break RISC-V world build: > /home/br/obj//riscv.riscv64/usr/home/br/dev/freebsd-head/tmp/usr/lib/libp= rivatezstd.so: undefined reference to `__bswap > si2' > /home/br/obj//riscv.riscv64/usr/home/br/dev/freebsd-head/tmp/usr/lib/libp= rivatezstd.so: undefined reference to `__bswap > di2' >=20 > Here is patch that makes it compilable: >=20 > diff --git a/contrib/zstd/lib/common/xxhash.c b/contrib/zstd/lib/common/x= xhash.c > index eb44222c5fc..d59a22a0638 100644 > --- a/contrib/zstd/lib/common/xxhash.c > +++ b/contrib/zstd/lib/common/xxhash.c > @@ -206,7 +206,7 @@ static U64 XXH_read64(const void* memPtr) > #if defined(_MSC_VER) /* Visual Studio */ > # define XXH_swap32 _byteswap_ulong > # define XXH_swap64 _byteswap_uint64 > -#elif GCC_VERSION >=3D 403 > +#elif (GCC_VERSION >=3D 403 && !defined(__riscv__)) > # define XXH_swap32 __builtin_bswap32 > # define XXH_swap64 __builtin_bswap64 > #else >=20 > Ruslan Thank you, can you please commit it? Have you upstreamed it, do you want me= to do it? (I have already signed the facebook agreement) Best regards, Bapt --mefsnsm53xpgretk Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEgOTj3suS2urGXVU3Y4mL3PG3PloFAlj3eeIACgkQY4mL3PG3 Ploygg//T+gs26GtRD54jUx/CnUKZTjisQwKHHFB1KdnK2Pi+L5auL+drZdHOUw3 9hnYLglz2zxsZ2fY47VQKDKVyBemi0fUd/Xuc0jVNaKCikUWMCr9vUk89kF9coWJ wxtr8ARiSv8KpILz9NlzdvmJR7DjLd1P2qDfRMHWWBCSOcl3mNoO99rRmr3q7q9l LMbN/GJlwEYj80eK0XT96Ysstzojp3pBn6hf2jueHxehXMRyQY+E7ovM7JithiEI aOX17SyBJlorcWalprz9IXo6Z3wjmFaSbvBv5vBE7xQypQru5zJQd7wnDwmTQ7kr NneO+gjN9OFar8+Eu5B8ko5KYkBXdk4rw1ltL6XBNzeVj0eGPFgH5xs5XpcMUM7w 6fInLmc136q9u0Qiq6B3uxRpv9ENUgGzSSLHIIOtzz/F4zOrxWjLO7QPb2dFZAj4 FTtIbhGGFMzBz7ic3PGVJmSdW7qhd36WlFmaV6lVtSQkLxIBTdneAOmoGSeU+MAu 97q2G5FJOPoQ8PHKsahDEaw/rtmi+BWUcZFzy+srWjio6zH8wW8FTkioP0qOTYMi teNk11Qk5P40nIYJg08zPN42XjChp9Nli6JEGPMY6i6LNKoOp+ztpUh22zGxu4HU JX7IKXWfpfJ9FrfgZCUSJSlIJ+qjSjGT5N7QG3ddJBQBR7omOq8= =jo56 -----END PGP SIGNATURE----- --mefsnsm53xpgretk-- From owner-svn-src-head@freebsd.org Wed Apr 19 15:04:55 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5AAD5D45AA9; Wed, 19 Apr 2017 15:04:55 +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 mx1.freebsd.org (Postfix) with ESMTPS id F1D891D4F; Wed, 19 Apr 2017 15:04:54 +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 v3JF4sST050485; Wed, 19 Apr 2017 15:04:54 GMT (envelope-from scottl@FreeBSD.org) Received: (from scottl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3JF4r5T050468; Wed, 19 Apr 2017 15:04:53 GMT (envelope-from scottl@FreeBSD.org) Message-Id: <201704191504.v3JF4r5T050468@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: scottl set sender to scottl@FreeBSD.org using -f From: Scott Long Date: Wed, 19 Apr 2017 15:04:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317143 - in head/sys/cam: . ata scsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 19 Apr 2017 15:04:55 -0000 Author: scottl Date: Wed Apr 19 15:04:52 2017 New Revision: 317143 URL: https://svnweb.freebsd.org/changeset/base/317143 Log: Add infrastructure to the ATA and SCSI transports that supports using a driver-supplied sbuf for printing device discovery announcements. This helps ensure that messages to the console will be properly serialized (through sbuf_putbuf) and not be truncated and interleaved with other messages. The infrastructure mirrors the existing xpt_announce_periph() entry point and is opt-in for now. No content or formatting changes are visible to the operator other than the new coherency. While here, eliminate the stack usage of the temporary announcement buffer in some of the drivers. It's moved to the softc for now, but future work will eliminate it entirely by making the code flow more linear. Future work will also address locking so that the sbufs can be dynamically sized. The scsi_da, scs_cd, scsi_ses, and ata_da drivers are converted at this point, other drivers can be converted at a later date. A tunable+sysctl, kern.cam.announce_nosbuf, exists for testing purposes but will be removed later. TODO: Eliminate all of the code duplication and temporary buffers. The old printf-based methods will be retired, and xpt_announce_periph() will just be a wrapper that uses a dynamically sized sbuf. This requires that the register and deregister paths be made malloc-safe, which they aren't currently. Sponsored by: Netflix Modified: head/sys/cam/ata/ata_all.c head/sys/cam/ata/ata_all.h head/sys/cam/ata/ata_da.c head/sys/cam/ata/ata_xpt.c head/sys/cam/cam_periph.c head/sys/cam/cam_xpt.c head/sys/cam/cam_xpt_internal.h head/sys/cam/cam_xpt_periph.h head/sys/cam/scsi/scsi_all.c head/sys/cam/scsi/scsi_all.h head/sys/cam/scsi/scsi_cd.c head/sys/cam/scsi/scsi_da.c head/sys/cam/scsi/scsi_enc.c head/sys/cam/scsi/scsi_enc_internal.h head/sys/cam/scsi/scsi_xpt.c Modified: head/sys/cam/ata/ata_all.c ============================================================================== --- head/sys/cam/ata/ata_all.c Wed Apr 19 14:49:18 2017 (r317142) +++ head/sys/cam/ata/ata_all.c Wed Apr 19 15:04:52 2017 (r317143) @@ -382,12 +382,10 @@ void ata_print_ident(struct ata_params *ident_data) { const char *proto; - char product[48], revision[16], ata[12], sata[12]; + char ata[12], sata[12]; + + ata_print_ident_short(ident_data); - cam_strvis(product, ident_data->model, sizeof(ident_data->model), - sizeof(product)); - cam_strvis(revision, ident_data->revision, sizeof(ident_data->revision), - sizeof(revision)); proto = (ident_data->config == ATA_PROTO_CFA) ? "CFA" : (ident_data->config & ATA_PROTO_ATAPI) ? "ATAPI" : "ATA"; if (ata_version(ident_data->version_major) == 0) { @@ -412,7 +410,55 @@ ata_print_ident(struct ata_params *ident snprintf(sata, sizeof(sata), " SATA"); } else sata[0] = 0; - printf("<%s %s> %s%s device\n", product, revision, ata, sata); + printf(" %s%s device\n", ata, sata); +} + +void +ata_print_ident_sbuf(struct ata_params *ident_data, struct sbuf *sb) +{ + const char *proto, *sata; + int version; + + ata_print_ident_short_sbuf(ident_data, sb); + sbuf_printf(sb, " "); + + proto = (ident_data->config == ATA_PROTO_CFA) ? "CFA" : + (ident_data->config & ATA_PROTO_ATAPI) ? "ATAPI" : "ATA"; + version = ata_version(ident_data->version_major); + + switch (version) { + case 0: + sbuf_printf(sb, "%s", proto); + break; + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + sbuf_printf(sb, "%s-%d", proto, version); + break; + case 8: + sbuf_printf(sb, "%s8-ACS", proto); + break; + default: + sbuf_printf(sb, "ACS-%d %s", version - 7, proto); + break; + } + + if (ident_data->satacapabilities && ident_data->satacapabilities != 0xffff) { + if (ident_data->satacapabilities & ATA_SATA_GEN3) + sata = " SATA 3.x"; + else if (ident_data->satacapabilities & ATA_SATA_GEN2) + sata = " SATA 2.x"; + else if (ident_data->satacapabilities & ATA_SATA_GEN1) + sata = " SATA 1.x"; + else + sata = " SATA"; + } else + sata = ""; + sbuf_printf(sb, "%s device\n", sata); } void @@ -428,18 +474,38 @@ ata_print_ident_short(struct ata_params } void +ata_print_ident_short_sbuf(struct ata_params *ident_data, struct sbuf *sb) +{ + + sbuf_printf(sb, "<"); + cam_strvis_sbuf(sb, ident_data->model, sizeof(ident_data->model), 0); + sbuf_printf(sb, " "); + cam_strvis_sbuf(sb, ident_data->revision, sizeof(ident_data->revision), 0); + sbuf_printf(sb, ">"); +} + +void semb_print_ident(struct sep_identify_data *ident_data) { - char vendor[9], product[17], revision[5], fw[5], in[7], ins[5]; + char in[7], ins[5]; - cam_strvis(vendor, ident_data->vendor_id, 8, sizeof(vendor)); - cam_strvis(product, ident_data->product_id, 16, sizeof(product)); - cam_strvis(revision, ident_data->product_rev, 4, sizeof(revision)); - cam_strvis(fw, ident_data->firmware_rev, 4, sizeof(fw)); + semb_print_ident_short(ident_data); cam_strvis(in, ident_data->interface_id, 6, sizeof(in)); cam_strvis(ins, ident_data->interface_rev, 4, sizeof(ins)); - printf("<%s %s %s %s> SEMB %s %s device\n", - vendor, product, revision, fw, in, ins); + printf(" SEMB %s %s device\n", in, ins); +} + +void +semb_print_ident_sbuf(struct sep_identify_data *ident_data, struct sbuf *sb) +{ + + semb_print_ident_short_sbuf(ident_data, sb); + + sbuf_printf(sb, " SEMB "); + cam_strvis_sbuf(sb, ident_data->interface_id, 6, 0); + sbuf_printf(sb, " "); + cam_strvis_sbuf(sb, ident_data->interface_rev, 4, 0); + sbuf_printf(sb, " device\n"); } void @@ -454,6 +520,21 @@ semb_print_ident_short(struct sep_identi printf("<%s %s %s %s>", vendor, product, revision, fw); } +void +semb_print_ident_short_sbuf(struct sep_identify_data *ident_data, struct sbuf *sb) +{ + + sbuf_printf(sb, "<"); + cam_strvis_sbuf(sb, ident_data->vendor_id, 8, 0); + sbuf_printf(sb, " "); + cam_strvis_sbuf(sb, ident_data->product_id, 16, 0); + sbuf_printf(sb, " "); + cam_strvis_sbuf(sb, ident_data->product_rev, 4, 0); + sbuf_printf(sb, " "); + cam_strvis_sbuf(sb, ident_data->firmware_rev, 4, 0); + sbuf_printf(sb, ">"); +} + uint32_t ata_logical_sector_size(struct ata_params *ident_data) { Modified: head/sys/cam/ata/ata_all.h ============================================================================== --- head/sys/cam/ata/ata_all.h Wed Apr 19 14:49:18 2017 (r317142) +++ head/sys/cam/ata/ata_all.h Wed Apr 19 15:04:52 2017 (r317143) @@ -110,7 +110,9 @@ int ata_status_sbuf(struct ccb_ataio *at int ata_res_sbuf(struct ata_res *res, struct sbuf *sb); void ata_print_ident(struct ata_params *ident_data); +void ata_print_ident_sbuf(struct ata_params *ident_data, struct sbuf *sb); void ata_print_ident_short(struct ata_params *ident_data); +void ata_print_ident_short_sbuf(struct ata_params *ident_data, struct sbuf *sb); uint32_t ata_logical_sector_size(struct ata_params *ident_data); uint64_t ata_physical_sector_size(struct ata_params *ident_data); @@ -150,7 +152,9 @@ int ata_identify_match(caddr_t identbuff int ata_static_identify_match(caddr_t identbuffer, caddr_t table_entry); void semb_print_ident(struct sep_identify_data *ident_data); +void semb_print_ident_sbuf(struct sep_identify_data *ident_data, struct sbuf *sb); void semb_print_ident_short(struct sep_identify_data *ident_data); +void semb_print_ident_short_sbuf(struct sep_identify_data *ident_data, struct sbuf *sb); void semb_receive_diagnostic_results(struct ccb_ataio *ataio, u_int32_t retries, void (*cbfcnp)(struct cam_periph *, union ccb*), Modified: head/sys/cam/ata/ata_da.c ============================================================================== --- head/sys/cam/ata/ata_da.c Wed Apr 19 14:49:18 2017 (r317142) +++ head/sys/cam/ata/ata_da.c Wed Apr 19 15:04:52 2017 (r317143) @@ -256,6 +256,10 @@ struct ada_softc { u_int errors; u_int invalidations; #endif +#define ADA_ANNOUNCETMP_SZ 80 + char announce_temp[ADA_ANNOUNCETMP_SZ]; +#define ADA_ANNOUNCE_SZ 400 + char announce_buffer[ADA_ANNOUNCE_SZ]; }; struct ada_quirk_entry { @@ -1659,8 +1663,9 @@ adaregister(struct cam_periph *periph, v struct ada_softc *softc; struct ccb_pathinq cpi; struct ccb_getdev *cgd; - char announce_buf[80]; struct disk_params *dp; + struct sbuf sb; + char *announce_buf; caddr_t match; u_int maxio; int quirks; @@ -1680,6 +1685,9 @@ adaregister(struct cam_periph *periph, v return(CAM_REQ_CMP_ERR); } + announce_buf = softc->announce_temp; + bzero(announce_buf, ADA_ANNOUNCETMP_SZ); + if (cam_iosched_init(&softc->cam_iosched, periph) != 0) { printf("adaregister: Unable to probe new device. " "Unable to allocate iosched memory\n"); @@ -1713,17 +1721,17 @@ adaregister(struct cam_periph *periph, v */ (void)cam_periph_hold(periph, PRIBIO); cam_periph_unlock(periph); - snprintf(announce_buf, sizeof(announce_buf), + snprintf(announce_buf, ADA_ANNOUNCETMP_SZ, "kern.cam.ada.%d.quirks", periph->unit_number); quirks = softc->quirks; TUNABLE_INT_FETCH(announce_buf, &quirks); softc->quirks = quirks; softc->read_ahead = -1; - snprintf(announce_buf, sizeof(announce_buf), + snprintf(announce_buf, ADA_ANNOUNCETMP_SZ, "kern.cam.ada.%d.read_ahead", periph->unit_number); TUNABLE_INT_FETCH(announce_buf, &softc->read_ahead); softc->write_cache = -1; - snprintf(announce_buf, sizeof(announce_buf), + snprintf(announce_buf, ADA_ANNOUNCETMP_SZ, "kern.cam.ada.%d.write_cache", periph->unit_number); TUNABLE_INT_FETCH(announce_buf, &softc->write_cache); @@ -1829,12 +1837,16 @@ adaregister(struct cam_periph *periph, v cam_periph_lock(periph); dp = &softc->params; - snprintf(announce_buf, sizeof(announce_buf), + snprintf(announce_buf, ADA_ANNOUNCETMP_SZ, "%juMB (%ju %u byte sectors)", ((uintmax_t)dp->secsize * dp->sectors) / (1024 * 1024), (uintmax_t)dp->sectors, dp->secsize); - xpt_announce_periph(periph, announce_buf); - xpt_announce_quirks(periph, softc->quirks, ADA_Q_BIT_STRING); + + sbuf_new(&sb, softc->announce_buffer, ADA_ANNOUNCE_SZ, SBUF_FIXEDLEN); + xpt_announce_periph_sbuf(periph, &sb, announce_buf); + xpt_announce_quirks_sbuf(periph, &sb, softc->quirks, ADA_Q_BIT_STRING); + sbuf_finish(&sb); + sbuf_putbuf(&sb); /* * Create our sysctl variables, now that we know Modified: head/sys/cam/ata/ata_xpt.c ============================================================================== --- head/sys/cam/ata/ata_xpt.c Wed Apr 19 14:49:18 2017 (r317142) +++ head/sys/cam/ata/ata_xpt.c Wed Apr 19 15:04:52 2017 (r317143) @@ -189,11 +189,16 @@ static void ata_dev_async(u_int32_t asy void *async_arg); static void ata_action(union ccb *start_ccb); static void ata_announce_periph(struct cam_periph *periph); +static void ata_announce_periph_sbuf(struct cam_periph *periph, struct sbuf *sb); static void ata_proto_announce(struct cam_ed *device); +static void ata_proto_announce_sbuf(struct cam_ed *device, struct sbuf *sb); static void ata_proto_denounce(struct cam_ed *device); +static void ata_proto_denounce_sbuf(struct cam_ed *device, struct sbuf *sb); static void ata_proto_debug_out(union ccb *ccb); static void semb_proto_announce(struct cam_ed *device); +static void semb_proto_announce_sbuf(struct cam_ed *device, struct sbuf *sb); static void semb_proto_denounce(struct cam_ed *device); +static void semb_proto_denounce_sbuf(struct cam_ed *device, struct sbuf *sb); static int ata_dma = 1; static int atapi_dma = 1; @@ -206,6 +211,7 @@ static struct xpt_xport_ops ata_xport_op .action = ata_action, .async = ata_dev_async, .announce = ata_announce_periph, + .announce_sbuf = ata_announce_periph_sbuf, }; #define ATA_XPT_XPORT(x, X) \ static struct xpt_xport ata_xport_ ## x = { \ @@ -222,7 +228,9 @@ ATA_XPT_XPORT(sata, SATA); static struct xpt_proto_ops ata_proto_ops_ata = { .announce = ata_proto_announce, + .announce_sbuf = ata_proto_announce_sbuf, .denounce = ata_proto_denounce, + .denounce_sbuf = ata_proto_denounce_sbuf, .debug_out = ata_proto_debug_out, }; static struct xpt_proto ata_proto_ata = { @@ -233,7 +241,9 @@ static struct xpt_proto ata_proto_ata = static struct xpt_proto_ops ata_proto_ops_satapm = { .announce = ata_proto_announce, + .announce_sbuf = ata_proto_announce_sbuf, .denounce = ata_proto_denounce, + .denounce_sbuf = ata_proto_denounce_sbuf, .debug_out = ata_proto_debug_out, }; static struct xpt_proto ata_proto_satapm = { @@ -244,7 +254,9 @@ static struct xpt_proto ata_proto_satapm static struct xpt_proto_ops ata_proto_ops_semb = { .announce = semb_proto_announce, + .announce_sbuf = semb_proto_announce_sbuf, .denounce = semb_proto_denounce, + .denounce_sbuf = semb_proto_denounce_sbuf, .debug_out = ata_proto_debug_out, }; static struct xpt_proto ata_proto_semb = { @@ -2072,42 +2084,51 @@ ata_dev_async(u_int32_t async_code, stru } static void -ata_announce_periph(struct cam_periph *periph) +_ata_announce_periph(struct cam_periph *periph, struct ccb_trans_settings *cts, u_int *speed) { struct ccb_pathinq cpi; - struct ccb_trans_settings cts; struct cam_path *path = periph->path; - u_int speed; - u_int mb; cam_periph_assert(periph, MA_OWNED); - xpt_setup_ccb(&cts.ccb_h, path, CAM_PRIORITY_NORMAL); - cts.ccb_h.func_code = XPT_GET_TRAN_SETTINGS; - cts.type = CTS_TYPE_CURRENT_SETTINGS; - xpt_action((union ccb*)&cts); - if ((cts.ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) + xpt_setup_ccb(&cts->ccb_h, path, CAM_PRIORITY_NORMAL); + cts->ccb_h.func_code = XPT_GET_TRAN_SETTINGS; + cts->type = CTS_TYPE_CURRENT_SETTINGS; + xpt_action((union ccb*)cts); + if ((cts->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) return; /* Ask the SIM for its base transfer speed */ xpt_setup_ccb(&cpi.ccb_h, path, CAM_PRIORITY_NORMAL); cpi.ccb_h.func_code = XPT_PATH_INQ; xpt_action((union ccb *)&cpi); /* Report connection speed */ - speed = cpi.base_transfer_speed; - if (cts.ccb_h.status == CAM_REQ_CMP && cts.transport == XPORT_ATA) { + *speed = cpi.base_transfer_speed; + if (cts->transport == XPORT_ATA) { struct ccb_trans_settings_pata *pata = - &cts.xport_specific.ata; + &cts->xport_specific.ata; if (pata->valid & CTS_ATA_VALID_MODE) - speed = ata_mode2speed(pata->mode); + *speed = ata_mode2speed(pata->mode); } - if (cts.ccb_h.status == CAM_REQ_CMP && cts.transport == XPORT_SATA) { + if (cts->transport == XPORT_SATA) { struct ccb_trans_settings_sata *sata = - &cts.xport_specific.sata; + &cts->xport_specific.sata; if (sata->valid & CTS_SATA_VALID_REVISION) - speed = ata_revision2speed(sata->revision); + *speed = ata_revision2speed(sata->revision); } +} + +static void +ata_announce_periph(struct cam_periph *periph) +{ + struct ccb_trans_settings cts; + u_int speed, mb; + + _ata_announce_periph(periph, &cts, &speed); + if ((cts.ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) + return; + mb = speed / 1000; if (mb > 0) printf("%s%d: %d.%03dMB/s transfers", @@ -2117,7 +2138,7 @@ ata_announce_periph(struct cam_periph *p printf("%s%d: %dKB/s transfers", periph->periph_name, periph->unit_number, speed); /* Report additional information about connection */ - if (cts.ccb_h.status == CAM_REQ_CMP && cts.transport == XPORT_ATA) { + if (cts.transport == XPORT_ATA) { struct ccb_trans_settings_pata *pata = &cts.xport_specific.ata; @@ -2130,7 +2151,7 @@ ata_announce_periph(struct cam_periph *p printf("PIO %dbytes", pata->bytecount); printf(")"); } - if (cts.ccb_h.status == CAM_REQ_CMP && cts.transport == XPORT_SATA) { + if (cts.transport == XPORT_SATA) { struct ccb_trans_settings_sata *sata = &cts.xport_specific.sata; @@ -2151,6 +2172,64 @@ ata_announce_periph(struct cam_periph *p } static void +ata_announce_periph_sbuf(struct cam_periph *periph, struct sbuf *sb) +{ + struct ccb_trans_settings cts; + u_int speed, mb; + + _ata_announce_periph(periph, &cts, &speed); + if ((cts.ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) + return; + + mb = speed / 1000; + if (mb > 0) + sbuf_printf(sb, "%s%d: %d.%03dMB/s transfers", + periph->periph_name, periph->unit_number, + mb, speed % 1000); + else + sbuf_printf(sb, "%s%d: %dKB/s transfers", periph->periph_name, + periph->unit_number, speed); + /* Report additional information about connection */ + if (cts.transport == XPORT_ATA) { + struct ccb_trans_settings_pata *pata = + &cts.xport_specific.ata; + + sbuf_printf(sb, " ("); + if (pata->valid & CTS_ATA_VALID_MODE) + sbuf_printf(sb, "%s, ", ata_mode2string(pata->mode)); + if ((pata->valid & CTS_ATA_VALID_ATAPI) && pata->atapi != 0) + sbuf_printf(sb, "ATAPI %dbytes, ", pata->atapi); + if (pata->valid & CTS_ATA_VALID_BYTECOUNT) + sbuf_printf(sb, "PIO %dbytes", pata->bytecount); + sbuf_printf(sb, ")"); + } + if (cts.transport == XPORT_SATA) { + struct ccb_trans_settings_sata *sata = + &cts.xport_specific.sata; + + sbuf_printf(sb, " ("); + if (sata->valid & CTS_SATA_VALID_REVISION) + sbuf_printf(sb, "SATA %d.x, ", sata->revision); + else + sbuf_printf(sb, "SATA, "); + if (sata->valid & CTS_SATA_VALID_MODE) + sbuf_printf(sb, "%s, ", ata_mode2string(sata->mode)); + if ((sata->valid & CTS_ATA_VALID_ATAPI) && sata->atapi != 0) + sbuf_printf(sb, "ATAPI %dbytes, ", sata->atapi); + if (sata->valid & CTS_SATA_VALID_BYTECOUNT) + sbuf_printf(sb, "PIO %dbytes", sata->bytecount); + sbuf_printf(sb, ")"); + } + sbuf_printf(sb, "\n"); +} + +static void +ata_proto_announce_sbuf(struct cam_ed *device, struct sbuf *sb) +{ + ata_print_ident_sbuf(&device->ident_data, sb); +} + +static void ata_proto_announce(struct cam_ed *device) { ata_print_ident(&device->ident_data); @@ -2163,6 +2242,18 @@ ata_proto_denounce(struct cam_ed *device } static void +ata_proto_denounce_sbuf(struct cam_ed *device, struct sbuf *sb) +{ + ata_print_ident_short_sbuf(&device->ident_data, sb); +} + +static void +semb_proto_announce_sbuf(struct cam_ed *device, struct sbuf *sb) +{ + semb_print_ident_sbuf((struct sep_identify_data *)&device->ident_data, sb); +} + +static void semb_proto_announce(struct cam_ed *device) { semb_print_ident((struct sep_identify_data *)&device->ident_data); @@ -2175,6 +2266,12 @@ semb_proto_denounce(struct cam_ed *devic } static void +semb_proto_denounce_sbuf(struct cam_ed *device, struct sbuf *sb) +{ + semb_print_ident_short_sbuf((struct sep_identify_data *)&device->ident_data, sb); +} + +static void ata_proto_debug_out(union ccb *ccb) { char cdb_str[(sizeof(struct ata_cmd) * 3) + 1]; Modified: head/sys/cam/cam_periph.c ============================================================================== --- head/sys/cam/cam_periph.c Wed Apr 19 14:49:18 2017 (r317142) +++ head/sys/cam/cam_periph.c Wed Apr 19 15:04:52 2017 (r317143) @@ -641,8 +641,14 @@ cam_periph_invalidate(struct cam_periph return; CAM_DEBUG(periph->path, CAM_DEBUG_INFO, ("Periph invalidated\n")); - if ((periph->flags & CAM_PERIPH_ANNOUNCED) && !rebooting) - xpt_denounce_periph(periph); + if ((periph->flags & CAM_PERIPH_ANNOUNCED) && !rebooting) { + struct sbuf sb; + + sbuf_new(&sb, NULL, 160, SBUF_FIXEDLEN); + xpt_denounce_periph_sbuf(periph, &sb); + sbuf_finish(&sb); + sbuf_putbuf(&sb); + } periph->flags |= CAM_PERIPH_INVALID; periph->flags &= ~CAM_PERIPH_NEW_DEV_FOUND; if (periph->periph_oninval != NULL) Modified: head/sys/cam/cam_xpt.c ============================================================================== --- head/sys/cam/cam_xpt.c Wed Apr 19 14:49:18 2017 (r317142) +++ head/sys/cam/cam_xpt.c Wed Apr 19 15:04:52 2017 (r317143) @@ -116,6 +116,7 @@ struct xpt_softc { TAILQ_HEAD(, ccb_hdr) ccb_scanq; int buses_to_config; int buses_config_done; + int announce_nosbuf; /* * Registered buses @@ -174,6 +175,8 @@ SYSCTL_INT(_kern_cam, OID_AUTO, boot_del &xsoftc.boot_delay, 0, "Bus registration wait time"); SYSCTL_UINT(_kern_cam, OID_AUTO, xpt_generation, CTLFLAG_RD, &xsoftc.xpt_generation, 0, "CAM peripheral generation count"); +SYSCTL_INT(_kern_cam, OID_AUTO, announce_nosbuf, CTLFLAG_RWTUN, + &xsoftc.announce_nosbuf, 0, "Don't use sbuf for announcements"); struct cam_doneq { struct mtx_padalign cam_doneq_mtx; @@ -1094,6 +1097,64 @@ xpt_announce_periph(struct cam_periph *p } void +xpt_announce_periph_sbuf(struct cam_periph *periph, struct sbuf *sb, + char *announce_string) +{ + struct cam_path *path = periph->path; + struct xpt_proto *proto; + + cam_periph_assert(periph, MA_OWNED); + periph->flags |= CAM_PERIPH_ANNOUNCED; + + /* Fall back to the non-sbuf method if necessary */ + if (xsoftc.announce_nosbuf != 0) { + xpt_announce_periph(periph, announce_string); + return; + } + proto = xpt_proto_find(path->device->protocol); + if (((proto != NULL) && (proto->ops->announce_sbuf == NULL)) || + (path->bus->xport->ops->announce_sbuf == NULL)) { + xpt_announce_periph(periph, announce_string); + return; + } + + sbuf_printf(sb, "%s%d at %s%d bus %d scbus%d target %d lun %jx\n", + periph->periph_name, periph->unit_number, + path->bus->sim->sim_name, + path->bus->sim->unit_number, + path->bus->sim->bus_id, + path->bus->path_id, + path->target->target_id, + (uintmax_t)path->device->lun_id); + sbuf_printf(sb, "%s%d: ", periph->periph_name, periph->unit_number); + + if (proto) + proto->ops->announce_sbuf(path->device, sb); + else + sbuf_printf(sb, "%s%d: Unknown protocol device %d\n", + periph->periph_name, periph->unit_number, + path->device->protocol); + if (path->device->serial_num_len > 0) { + /* Don't wrap the screen - print only the first 60 chars */ + sbuf_printf(sb, "%s%d: Serial Number %.60s\n", + periph->periph_name, periph->unit_number, + path->device->serial_num); + } + /* Announce transport details. */ + path->bus->xport->ops->announce_sbuf(periph, sb); + /* Announce command queueing. */ + if (path->device->inq_flags & SID_CmdQue + || path->device->flags & CAM_DEV_TAG_AFTER_COUNT) { + sbuf_printf(sb, "%s%d: Command Queueing enabled\n", + periph->periph_name, periph->unit_number); + } + /* Announce caller's details if they've passed in. */ + if (announce_string != NULL) + sbuf_printf(sb, "%s%d: %s\n", periph->periph_name, + periph->unit_number, announce_string); +} + +void xpt_announce_quirks(struct cam_periph *periph, int quirks, char *bit_string) { if (quirks != 0) { @@ -1103,6 +1164,21 @@ xpt_announce_quirks(struct cam_periph *p } void +xpt_announce_quirks_sbuf(struct cam_periph *periph, struct sbuf *sb, + int quirks, char *bit_string) +{ + if (xsoftc.announce_nosbuf != 0) { + xpt_announce_quirks(periph, quirks, bit_string); + return; + } + + if (quirks != 0) { + sbuf_printf(sb, "%s%d: quirks=0x%b\n", periph->periph_name, + periph->unit_number, quirks, bit_string); + } +} + +void xpt_denounce_periph(struct cam_periph *periph) { struct cam_path *path = periph->path; @@ -1130,6 +1206,45 @@ xpt_denounce_periph(struct cam_periph *p printf(" detached\n"); } +void +xpt_denounce_periph_sbuf(struct cam_periph *periph, struct sbuf *sb) +{ + struct cam_path *path = periph->path; + struct xpt_proto *proto; + + cam_periph_assert(periph, MA_OWNED); + + /* Fall back to the non-sbuf method if necessary */ + if (xsoftc.announce_nosbuf != 0) { + xpt_denounce_periph(periph); + return; + } + proto = xpt_proto_find(path->device->protocol); + if ((proto != NULL) && (proto->ops->denounce_sbuf == NULL)) { + xpt_denounce_periph(periph); + return; + } + + sbuf_printf(sb, "%s%d at %s%d bus %d scbus%d target %d lun %jx\n", + periph->periph_name, periph->unit_number, + path->bus->sim->sim_name, + path->bus->sim->unit_number, + path->bus->sim->bus_id, + path->bus->path_id, + path->target->target_id, + (uintmax_t)path->device->lun_id); + sbuf_printf(sb, "%s%d: ", periph->periph_name, periph->unit_number); + + if (proto) + proto->ops->denounce_sbuf(path->device, sb); + else + sbuf_printf(sb, "%s%d: Unknown protocol device %d\n", + periph->periph_name, periph->unit_number, + path->device->protocol); + if (path->device->serial_num_len > 0) + sbuf_printf(sb, " s/n %.60s", path->device->serial_num); + sbuf_printf(sb, " detached\n"); +} int xpt_getattr(char *buf, size_t len, const char *attr, struct cam_path *path) Modified: head/sys/cam/cam_xpt_internal.h ============================================================================== --- head/sys/cam/cam_xpt_internal.h Wed Apr 19 14:49:18 2017 (r317142) +++ head/sys/cam/cam_xpt_internal.h Wed Apr 19 15:04:52 2017 (r317143) @@ -47,6 +47,7 @@ typedef void (*xpt_dev_async_func)(u_int struct cam_ed *device, void *async_arg); typedef void (*xpt_announce_periph_func)(struct cam_periph *periph); +typedef void (*xpt_announce_periph_sbuf_func)(struct cam_periph *periph, struct sbuf *sbuf); struct xpt_xport_ops { xpt_alloc_device_func alloc_device; @@ -54,6 +55,7 @@ struct xpt_xport_ops { xpt_action_func action; xpt_dev_async_func async; xpt_announce_periph_func announce; + xpt_announce_periph_sbuf_func announce_sbuf; }; struct xpt_xport { @@ -67,11 +69,14 @@ SET_DECLARE(cam_xpt_xport_set, struct xp DATA_SET(cam_xpt_xport_set, data) typedef void (*xpt_proto_announce_func)(struct cam_ed *); +typedef void (*xpt_proto_announce_sbuf_func)(struct cam_ed *, struct sbuf *); typedef void (*xpt_proto_debug_out_func)(union ccb *); struct xpt_proto_ops { xpt_proto_announce_func announce; + xpt_proto_announce_sbuf_func announce_sbuf; xpt_proto_announce_func denounce; + xpt_proto_announce_sbuf_func denounce_sbuf; xpt_proto_debug_out_func debug_out; }; Modified: head/sys/cam/cam_xpt_periph.h ============================================================================== --- head/sys/cam/cam_xpt_periph.h Wed Apr 19 14:49:18 2017 (r317142) +++ head/sys/cam/cam_xpt_periph.h Wed Apr 19 15:04:52 2017 (r317143) @@ -45,9 +45,16 @@ int32_t xpt_add_periph(struct cam_perip void xpt_remove_periph(struct cam_periph *periph); void xpt_announce_periph(struct cam_periph *periph, char *announce_string); +void xpt_announce_periph_sbuf(struct cam_periph *periph, + struct sbuf *sb, + char *announce_string); void xpt_announce_quirks(struct cam_periph *periph, int quirks, char *bit_string); +void xpt_announce_quirks_sbuf(struct cam_periph *periph, + struct sbuf *sb, + int quirks, char *bit_string); void xpt_denounce_periph(struct cam_periph *periph); +void xpt_denounce_periph_sbuf(struct cam_periph *periph, struct sbuf *sb); #endif #endif /* _CAM_CAM_XPT_PERIPH_H */ Modified: head/sys/cam/scsi/scsi_all.c ============================================================================== --- head/sys/cam/scsi/scsi_all.c Wed Apr 19 14:49:18 2017 (r317142) +++ head/sys/cam/scsi/scsi_all.c Wed Apr 19 15:04:52 2017 (r317143) @@ -5169,7 +5169,7 @@ scsi_sense_print(struct ccb_scsiio *csio sbuf_finish(&sb); - printf("%s", sbuf_data(&sb)); + sbuf_putbuf(&sb); } #else /* !_KERNEL */ @@ -5361,11 +5361,10 @@ scsi_get_ascq(struct scsi_sense_data *se * for this routine to function properly. */ void -scsi_print_inquiry(struct scsi_inquiry_data *inq_data) +scsi_print_inquiry_sbuf(struct sbuf *sb, struct scsi_inquiry_data *inq_data) { u_int8_t type; char *dtype, *qtype; - char vendor[16], product[48], revision[16], rstr[12]; type = SID_TYPE(inq_data); @@ -5454,41 +5453,55 @@ scsi_print_inquiry(struct scsi_inquiry_d break; } - cam_strvis(vendor, inq_data->vendor, sizeof(inq_data->vendor), - sizeof(vendor)); - cam_strvis(product, inq_data->product, sizeof(inq_data->product), - sizeof(product)); - cam_strvis(revision, inq_data->revision, sizeof(inq_data->revision), - sizeof(revision)); + scsi_print_inquiry_short_sbuf(sb, inq_data); + + sbuf_printf(sb, "%s %s ", SID_IS_REMOVABLE(inq_data) ? "Removable" : "Fixed", dtype); if (SID_ANSI_REV(inq_data) == SCSI_REV_0) - snprintf(rstr, sizeof(rstr), "SCSI"); + sbuf_printf(sb, "SCSI "); else if (SID_ANSI_REV(inq_data) <= SCSI_REV_SPC) { - snprintf(rstr, sizeof(rstr), "SCSI-%d", - SID_ANSI_REV(inq_data)); + sbuf_printf(sb, "SCSI-%d ", SID_ANSI_REV(inq_data)); } else { - snprintf(rstr, sizeof(rstr), "SPC-%d SCSI", - SID_ANSI_REV(inq_data) - 2); + sbuf_printf(sb, "SPC-%d SCSI ", SID_ANSI_REV(inq_data) - 2); } - printf("<%s %s %s> %s %s %s device%s\n", - vendor, product, revision, - SID_IS_REMOVABLE(inq_data) ? "Removable" : "Fixed", - dtype, rstr, qtype); + sbuf_printf(sb, "device%s\n", qtype); } void -scsi_print_inquiry_short(struct scsi_inquiry_data *inq_data) +scsi_print_inquiry(struct scsi_inquiry_data *inq_data) +{ + struct sbuf sb; + char buffer[120]; + + sbuf_new(&sb, buffer, 120, SBUF_FIXEDLEN); + scsi_print_inquiry_sbuf(&sb, inq_data); + sbuf_finish(&sb); + sbuf_putbuf(&sb); +} + +void +scsi_print_inquiry_short_sbuf(struct sbuf *sb, struct scsi_inquiry_data *inq_data) { - char vendor[16], product[48], revision[16]; - cam_strvis(vendor, inq_data->vendor, sizeof(inq_data->vendor), - sizeof(vendor)); - cam_strvis(product, inq_data->product, sizeof(inq_data->product), - sizeof(product)); - cam_strvis(revision, inq_data->revision, sizeof(inq_data->revision), - sizeof(revision)); + sbuf_printf(sb, "<"); + cam_strvis_sbuf(sb, inq_data->vendor, sizeof(inq_data->vendor), 0); + sbuf_printf(sb, " "); + cam_strvis_sbuf(sb, inq_data->product, sizeof(inq_data->product), 0); + sbuf_printf(sb, " "); + cam_strvis_sbuf(sb, inq_data->revision, sizeof(inq_data->revision), 0); + sbuf_printf(sb, "> "); +} + +void +scsi_print_inquiry_short(struct scsi_inquiry_data *inq_data) +{ + struct sbuf sb; + char buffer[84]; - printf("<%s %s %s>", vendor, product, revision); + sbuf_new(&sb, buffer, 84, SBUF_FIXEDLEN); + scsi_print_inquiry_short_sbuf(&sb, inq_data); + sbuf_finish(&sb); + sbuf_putbuf(&sb); } /* Modified: head/sys/cam/scsi/scsi_all.h ============================================================================== --- head/sys/cam/scsi/scsi_all.h Wed Apr 19 14:49:18 2017 (r317142) +++ head/sys/cam/scsi/scsi_all.h Wed Apr 19 15:04:52 2017 (r317143) @@ -3820,7 +3820,11 @@ char * scsi_cdb_string(u_int8_t *cdb_pt void scsi_cdb_sbuf(u_int8_t *cdb_ptr, struct sbuf *sb); void scsi_print_inquiry(struct scsi_inquiry_data *inq_data); +void scsi_print_inquiry_sbuf(struct sbuf *sb, + struct scsi_inquiry_data *inq_data); void scsi_print_inquiry_short(struct scsi_inquiry_data *inq_data); +void scsi_print_inquiry_short_sbuf(struct sbuf *sb, + struct scsi_inquiry_data *inq_data); u_int scsi_calc_syncsrate(u_int period_factor); u_int scsi_calc_syncparam(u_int period); Modified: head/sys/cam/scsi/scsi_cd.c ============================================================================== --- head/sys/cam/scsi/scsi_cd.c Wed Apr 19 14:49:18 2017 (r317142) +++ head/sys/cam/scsi/scsi_cd.c Wed Apr 19 15:04:52 2017 (r317143) @@ -61,6 +61,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -158,6 +159,11 @@ struct cd_softc { struct cd_tocdata toc; struct disk *disk; struct callout mediapoll_c; + +#define CD_ANNOUNCETMP_SZ 120 + char announce_temp[CD_ANNOUNCETMP_SZ]; +#define CD_ANNOUNCE_SZ 400 + char announce_buf[CD_ANNOUNCE_SZ]; }; struct cd_page_sizes { @@ -1046,28 +1052,12 @@ cddone(struct cam_periph *periph, union case CD_CCB_PROBE: { struct scsi_read_capacity_data *rdcap; - char announce_buf[120]; /* - * Currently (9/30/97) the - * longest possible announce - * buffer is 108 bytes, for the - * first error case below. - * That is 39 bytes for the - * basic string, 16 bytes for the - * biggest sense key (hardware - * error), 52 bytes for the - * text of the largest sense - * qualifier valid for a CDROM, - * (0x72, 0x03 or 0x04, - * 0x03), and one byte for the - * null terminating character. - * To allow for longer strings, - * the announce buffer is 120 - * bytes. - */ + char *announce_buf; struct cd_params *cdp; int error; cdp = &softc->params; + announce_buf = softc->announce_temp; rdcap = (struct scsi_read_capacity_data *)csio->data_ptr; @@ -1081,7 +1071,7 @@ cddone(struct cam_periph *periph, union if ((csio->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP || (error = cderror(done_ccb, CAM_RETRY_SELTO, SF_RETRY_UA | SF_NO_PRINT)) == 0) { - snprintf(announce_buf, sizeof(announce_buf), + snprintf(announce_buf, CD_ANNOUNCETMP_SZ, "%juMB (%ju %u byte sectors)", ((uintmax_t)cdp->disksize * cdp->blksize) / (1024 * 1024), @@ -1186,22 +1176,29 @@ cddone(struct cam_periph *periph, union */ cam_periph_invalidate(periph); - announce_buf[0] = '\0'; + announce_buf = NULL; } else { /* * Invalidate this peripheral. */ cam_periph_invalidate(periph); - announce_buf[0] = '\0'; + announce_buf = NULL; } } } free(rdcap, M_SCSICD); - if (announce_buf[0] != '\0') { - xpt_announce_periph(periph, announce_buf); - xpt_announce_quirks(periph, softc->quirks, + if (announce_buf != NULL) { + struct sbuf sb; + + sbuf_new(&sb, softc->announce_buf, CD_ANNOUNCE_SZ, + SBUF_FIXEDLEN); + xpt_announce_periph_sbuf(periph, &sb, announce_buf); + xpt_announce_quirks_sbuf(periph, &sb, softc->quirks, CD_Q_BIT_STRING); + sbuf_finish(&sb); + sbuf_putbuf(&sb); + /* * Create our sysctl variables, now that we know * we have successfully attached. Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Wed Apr 19 14:49:18 2017 (r317142) +++ head/sys/cam/scsi/scsi_da.c Wed Apr 19 15:04:52 2017 (r317143) @@ -338,6 +338,10 @@ struct da_softc { u_int timeouts; u_int invalidations; #endif +#define DA_ANNOUNCETMP_SZ 80 + char announce_temp[DA_ANNOUNCETMP_SZ]; +#define DA_ANNOUNCE_SZ 400 + char announcebuf[DA_ANNOUNCE_SZ]; }; #define dadeleteflag(softc, delete_method, enable) \ @@ -4219,12 +4223,16 @@ dadone(struct cam_periph *periph, union { struct scsi_read_capacity_data *rdcap; struct scsi_read_capacity_data_long *rcaplong; - char announce_buf[80]; + char *announce_buf; int lbp; lbp = 0; rdcap = NULL; rcaplong = NULL; + /* XXX TODO: can this be a malloc? */ + announce_buf = softc->announce_temp; + bzero(announce_buf, DA_ANNOUNCETMP_SZ); + if (state == DA_CCB_PROBE_RC) rdcap =(struct scsi_read_capacity_data *)csio->data_ptr; else @@ -4277,7 +4285,7 @@ dadone(struct cam_periph *periph, union xpt_print(periph->path, "unsupportable block size %ju\n", (uintmax_t) block_size); - announce_buf[0] = '\0'; + announce_buf = NULL; cam_periph_invalidate(periph); } else { /* @@ -4289,7 +4297,7 @@ dadone(struct cam_periph *periph, union rcaplong, sizeof(*rcaplong)); lbp = (lalba & SRC16_LBPME_A); dp = &softc->params; - snprintf(announce_buf, sizeof(announce_buf), + snprintf(announce_buf, DA_ANNOUNCETMP_SZ, "%juMB (%ju %u byte sectors)", ((uintmax_t)dp->secsize * dp->sectors) / (1024 * 1024), @@ -4298,8 +4306,6 @@ dadone(struct cam_periph *periph, union } else { int error; - announce_buf[0] = '\0'; - /* * Retry any UNIT ATTENTION type errors. They * are expected at boot. @@ -4383,11 +4389,10 @@ dadone(struct cam_periph *periph, union &sense_key_desc, &asc_desc); snprintf(announce_buf, - sizeof(announce_buf), - "Attempt to query device " - "size failed: %s, %s", - sense_key_desc, - asc_desc); + DA_ANNOUNCETMP_SZ, + "Attempt to query device " + "size failed: %s, %s", + sense_key_desc, asc_desc); } else { if (have_sense) scsi_sense_print( @@ -4401,6 +4406,8 @@ dadone(struct cam_periph *periph, union xpt_print(periph->path, "fatal error, " "failed to attach to device\n"); + announce_buf = NULL; + /* * Free up resources. *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Wed Apr 19 15:24:35 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 42418D4648A; Wed, 19 Apr 2017 15:24:35 +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 mx1.freebsd.org (Postfix) with ESMTPS id 12A37DB0; Wed, 19 Apr 2017 15:24:35 +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 v3JFOYoW061288; Wed, 19 Apr 2017 15:24:34 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3JFOYiK061287; Wed, 19 Apr 2017 15:24:34 GMT (envelope-from br@FreeBSD.org) Message-Id: <201704191524.v3JFOYiK061287@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Wed, 19 Apr 2017 15:24:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317144 - head/contrib/zstd/lib/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 19 Apr 2017 15:24:35 -0000 Author: br Date: Wed Apr 19 15:24:33 2017 New Revision: 317144 URL: https://svnweb.freebsd.org/changeset/base/317144 Log: Don't use __builtin_bswap for RISC-V due to undefined reference in compiler. This unbreaks RISC-V world build. Sponsored by: DARPA, AFRL Modified: head/contrib/zstd/lib/common/xxhash.c Modified: head/contrib/zstd/lib/common/xxhash.c ============================================================================== --- head/contrib/zstd/lib/common/xxhash.c Wed Apr 19 15:04:52 2017 (r317143) +++ head/contrib/zstd/lib/common/xxhash.c Wed Apr 19 15:24:33 2017 (r317144) @@ -206,7 +206,7 @@ static U64 XXH_read64(const void* memPtr #if defined(_MSC_VER) /* Visual Studio */ # define XXH_swap32 _byteswap_ulong # define XXH_swap64 _byteswap_uint64 -#elif GCC_VERSION >= 403 +#elif (GCC_VERSION >= 403 && !defined(__riscv__)) # define XXH_swap32 __builtin_bswap32 # define XXH_swap64 __builtin_bswap64 #else From owner-svn-src-head@freebsd.org Wed Apr 19 15:26:14 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8B5EED4654F; Wed, 19 Apr 2017 15:26:14 +0000 (UTC) (envelope-from rb743@hermes.cam.ac.uk) Received: from ppsw-41.csi.cam.ac.uk (ppsw-41.csi.cam.ac.uk [131.111.8.141]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 54AEDF49; Wed, 19 Apr 2017 15:26:13 +0000 (UTC) (envelope-from rb743@hermes.cam.ac.uk) X-Cam-AntiVirus: no malware found X-Cam-ScannerInfo: http://help.uis.cam.ac.uk/email-scanner-virus Received: from sc1.bsdpad.com ([163.172.212.18]:54423) by ppsw-41.csi.cam.ac.uk (smtp.hermes.cam.ac.uk [131.111.8.159]:587) with esmtpsa (LOGIN:rb743) (TLSv1:ECDHE-RSA-AES256-SHA:256) id 1d0rUh-0000xb-QB (Exim 4.89) (return-path ); Wed, 19 Apr 2017 16:26:11 +0100 Date: Wed, 19 Apr 2017 15:22:57 +0000 From: Ruslan Bukin To: Baptiste Daroussin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r316978 - in head: contrib/zstd etc/mtree lib lib/libzstd share/mk usr.bin usr.bin/zstd Message-ID: <20170419152257.GA59527@bsdpad.com> References: <201704152005.v3FK5M2j002459@repo.freebsd.org> <20170419142106.GA59031@bsdpad.com> <20170419145325.zjvo3hq2z3egcp26@ivaldir.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20170419145325.zjvo3hq2z3egcp26@ivaldir.net> User-Agent: Mutt/1.6.1 (2016-04-27) Sender: "R. Bukin" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 19 Apr 2017 15:26:14 -0000 On Wed, Apr 19, 2017 at 04:53:25PM +0200, Baptiste Daroussin wrote: > On Wed, Apr 19, 2017 at 02:21:06PM +0000, Ruslan Bukin wrote: > > This break RISC-V world build: > > /home/br/obj//riscv.riscv64/usr/home/br/dev/freebsd-head/tmp/usr/lib/libprivatezstd.so: undefined reference to `__bswap > > si2' > > /home/br/obj//riscv.riscv64/usr/home/br/dev/freebsd-head/tmp/usr/lib/libprivatezstd.so: undefined reference to `__bswap > > di2' > > > > Here is patch that makes it compilable: > > > > diff --git a/contrib/zstd/lib/common/xxhash.c b/contrib/zstd/lib/common/xxhash.c > > index eb44222c5fc..d59a22a0638 100644 > > --- a/contrib/zstd/lib/common/xxhash.c > > +++ b/contrib/zstd/lib/common/xxhash.c > > @@ -206,7 +206,7 @@ static U64 XXH_read64(const void* memPtr) > > #if defined(_MSC_VER) /* Visual Studio */ > > # define XXH_swap32 _byteswap_ulong > > # define XXH_swap64 _byteswap_uint64 > > -#elif GCC_VERSION >= 403 > > +#elif (GCC_VERSION >= 403 && !defined(__riscv__)) > > # define XXH_swap32 __builtin_bswap32 > > # define XXH_swap64 __builtin_bswap64 > > #else > > > > Ruslan > > Thank you, can you please commit it? Have you upstreamed it, do you want me to > do it? (I have already signed the facebook agreement) > I committed. Please upstream that. thanks Ruslan From owner-svn-src-head@freebsd.org Wed Apr 19 16:12:03 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9D285D45738; Wed, 19 Apr 2017 16:12:03 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 51C4A150A; Wed, 19 Apr 2017 16:12:03 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3JGC2E7081757; Wed, 19 Apr 2017 16:12:02 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3JGC2j1081756; Wed, 19 Apr 2017 16:12:02 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201704191612.v3JGC2j1081756@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 19 Apr 2017 16:12:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317148 - head/sys/compat/linuxkpi/common/src X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 19 Apr 2017 16:12:03 -0000 Author: markj Date: Wed Apr 19 16:12:02 2017 New Revision: 317148 URL: https://svnweb.freebsd.org/changeset/base/317148 Log: Drop Giant before sleeping in linux_wait_for_{timeout_,}common(). Reported and tested by: Pete Wright Reviewed by: hselasky (previous version) MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D10414 Modified: head/sys/compat/linuxkpi/common/src/linux_compat.c Modified: head/sys/compat/linuxkpi/common/src/linux_compat.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_compat.c Wed Apr 19 15:59:16 2017 (r317147) +++ head/sys/compat/linuxkpi/common/src/linux_compat.c Wed Apr 19 16:12:02 2017 (r317148) @@ -1321,28 +1321,38 @@ linux_complete_common(struct completion long linux_wait_for_common(struct completion *c, int flags) { + long error; + if (SCHEDULER_STOPPED()) return (0); + DROP_GIANT(); + if (flags != 0) flags = SLEEPQ_INTERRUPTIBLE | SLEEPQ_SLEEP; else flags = SLEEPQ_SLEEP; + error = 0; for (;;) { sleepq_lock(c); if (c->done) break; sleepq_add(c, NULL, "completion", flags, 0); if (flags & SLEEPQ_INTERRUPTIBLE) { - if (sleepq_wait_sig(c, 0) != 0) - return (-ERESTARTSYS); + if (sleepq_wait_sig(c, 0) != 0) { + error = -ERESTARTSYS; + goto intr; + } } else sleepq_wait(c, 0); } c->done--; sleepq_release(c); - return (0); +intr: + PICKUP_GIANT(); + + return (error); } /* @@ -1351,18 +1361,22 @@ linux_wait_for_common(struct completion long linux_wait_for_timeout_common(struct completion *c, long timeout, int flags) { - long end = jiffies + timeout; + long end = jiffies + timeout, error; + int ret; if (SCHEDULER_STOPPED()) return (0); + DROP_GIANT(); + if (flags != 0) flags = SLEEPQ_INTERRUPTIBLE | SLEEPQ_SLEEP; else flags = SLEEPQ_SLEEP; - for (;;) { - int ret; + error = 0; + ret = 0; + for (;;) { sleepq_lock(c); if (c->done) break; @@ -1375,16 +1389,20 @@ linux_wait_for_timeout_common(struct com if (ret != 0) { /* check for timeout or signal */ if (ret == EWOULDBLOCK) - return (0); + error = 0; else - return (-ERESTARTSYS); + error = -ERESTARTSYS; + goto intr; } } c->done--; sleepq_release(c); +intr: + PICKUP_GIANT(); + /* return how many jiffies are left */ - return (linux_timer_jiffies_until(end)); + return (ret != 0 ? error : linux_timer_jiffies_until(end)); } int From owner-svn-src-head@freebsd.org Wed Apr 19 16:20:03 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4263ED45A9B; Wed, 19 Apr 2017 16:20:03 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 226B31BCC; Wed, 19 Apr 2017 16:20:03 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by mail.baldwin.cx (Postfix) with ESMTPSA id 9C38310A82D; Wed, 19 Apr 2017 12:20:01 -0400 (EDT) From: John Baldwin To: Slawa Olhovchenkov Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r317094 - head/share/mk Date: Wed, 19 Apr 2017 09:10:53 -0700 Message-ID: <1709565.BYcnqjiFaR@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.0-STABLE; KDE/4.14.10; amd64; ; ) In-Reply-To: <20170418222837.GC83631@zxy.spb.ru> References: <201704181627.v3IGRmNN082877@repo.freebsd.org> <8690993.EKcl9tcFpB@ralph.baldwin.cx> <20170418222837.GC83631@zxy.spb.ru> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Wed, 19 Apr 2017 12:20:01 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 19 Apr 2017 16:20:03 -0000 On Wednesday, April 19, 2017 01:28:37 AM Slawa Olhovchenkov wrote: > On Tue, Apr 18, 2017 at 12:45:25PM -0700, John Baldwin wrote: > > > On Tuesday, April 18, 2017 07:30:13 PM Slawa Olhovchenkov wrote: > > > On Tue, Apr 18, 2017 at 04:27:48PM +0000, John Baldwin wrote: > > > > > > > Author: jhb > > > > Date: Tue Apr 18 16:27:48 2017 > > > > New Revision: 317094 > > > > URL: https://svnweb.freebsd.org/changeset/base/317094 > > > > > > > > Log: > > > > Disable in-tree GDB by default on x86, mips, and powerpc. > > > > > > > > GDB in ports contains all of the functionality as GDB in base > > > > (including kgdb) for these platforms along with additional > > > > functionality. In-tree GDB remains enabled on ARM and sparc64. > > > > GDB in ports does not currently support kernel debugging on arm, > > > > and ports GDB for sparc64 has not been tested (though it does > > > > include sparc64 support). > > > > > > > > Reviewed by: bdrewery, emaste, imp > > > > Relnotes: yes > > > > Sponsored by: DARPA / AFRL > > > > Differential Revision: https://reviews.freebsd.org/D10399 > > > > > > Generating core.txt now complety broken? > > > > No. crashinfo has supported gdb from ports for quite a while now. > > If you 'pkg install gdb' crashinfo defaults to using the ports gdb over > > the base one already. > > I am about clean install, w/o ports. Until we get some sort of klldb support that will not work. However, we already have platforms now where /usr/bin/gdb doesn't work for that. riscv and aarch64 aren't supported in ancient gdb, and the MIPS /usr/bin/gdb didn't really work for me in my testing. > Also, how to generate core.txt after crash, reboot and install gdb > from ports? (port instaled after crash) You can always run crashinfo by hand. -- John Baldwin From owner-svn-src-head@freebsd.org Wed Apr 19 16:24:52 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 784D5D38232; Wed, 19 Apr 2017 16:24:52 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 55716403; Wed, 19 Apr 2017 16:24:52 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3JGOp1K086845; Wed, 19 Apr 2017 16:24:51 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3JGOpNZ086844; Wed, 19 Apr 2017 16:24:51 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201704191624.v3JGOpNZ086844@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Wed, 19 Apr 2017 16:24:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317150 - head/sys/dev/syscons X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 19 Apr 2017 16:24:52 -0000 Author: bde Date: Wed Apr 19 16:24:51 2017 New Revision: 317150 URL: https://svnweb.freebsd.org/changeset/base/317150 Log: Stop using a saveunder method for mouse cursor drawing in the vga direct mode renderer. I thought that reads were not much slower than writes, so that the method only tripled the time for the whole function, but I recently measured that video memory reads can be up to 53 times slower than writes in tighter loops than here. Loop overheap here reduces the multiplier to only 16-20 on Haswell. Start cleaning up and fixing larger bugs in this function. Only replace the 22-line removal loop by a 3-line one for now, since adjusting the old loop would have required many palette calculations which are better done in the DRAW_PIXEL() macro. This also fixes missing support for depth 24, but only for removal. Removal is currently sloppy at the right bottom corner. It sometimes leaks border color into the text window. This is soon cleaned up by the caller. The planar renderer has complications to clip at the corner. Modified: head/sys/dev/syscons/scvgarndr.c Modified: head/sys/dev/syscons/scvgarndr.c ============================================================================== --- head/sys/dev/syscons/scvgarndr.c Wed Apr 19 16:16:41 2017 (r317149) +++ head/sys/dev/syscons/scvgarndr.c Wed Apr 19 16:24:51 2017 (r317150) @@ -238,12 +238,6 @@ static uint16_t vga_palette15[16] = { 0x0000, 0x0016, 0x02c0, 0x02d6, 0x5800, 0x5816, 0x5940, 0x5ad6, 0x294a, 0x295f, 0x2bea, 0x2bff, 0x7d4a, 0x7d5f, 0x7fea, 0x7fff }; - -#ifndef SC_NO_CUTPASTE -static uint32_t mouse_buf32[256]; -static uint16_t mouse_buf16[256]; -static uint8_t mouse_buf8[256]; -#endif #endif static void @@ -1132,8 +1126,6 @@ vga_pxlmouse_direct(scr_stat *scp, int x vm_offset_t p; int line_width, pixel_size; int xend, yend; - static int x_old = 0, xend_old = 0; - static int y_old = 0, yend_old = 0; int i, j; uint32_t *u32; uint16_t *u16; @@ -1163,39 +1155,12 @@ vga_pxlmouse_direct(scr_stat *scp, int x if (on) goto do_on; - /* - * Repaint overlap with the border and nearby. Unlike in the planar - * case, we kept track of everything under the cursor so can restore - * it all, but we don't completely trust the saved state to be still - * relevant, so do nothing if it is obviously stale. - */ - if (x != x_old || y != y_old || xend != xend_old || yend != yend_old) - return; - - p = scp->sc->adp->va_window + y_old * line_width + x_old * pixel_size; - - for (i = 0; i < (yend_old - y_old); i++) { - for (j = (xend_old - x_old - 1); j >= 0; j--) { - switch (bpp) { - case 32: - u32 = (uint32_t*)(p + j * pixel_size); - writel(u32, mouse_buf32[i * 16 + j]); - break; - case 16: - /* FALLTHROUGH */ - case 15: - u16 = (uint16_t*)(p + j * pixel_size); - writew(u16, mouse_buf16[i * 16 + j]); - break; - case 8: - u8 = (uint8_t*)(p + j * pixel_size); - writeb(u8, mouse_buf8[i * 16 + j]); - break; - } - } + /* Repaint overlap with the border (mess up the corner a little). */ + p = scp->sc->adp->va_window + y * line_width + x * pixel_size; + for (i = 0; i < yend - y; i++, p += line_width) + for (j = xend - x - 1; j >= 0; j--) + DRAW_PIXEL(scp, p + j * pixel_size, scp->border); - p += line_width; - } return; do_on: @@ -1206,7 +1171,6 @@ do_on: switch (bpp) { case 32: u32 = (uint32_t*)(p + j * pixel_size); - mouse_buf32[i * 16 + j] = *u32; if (mdp->md_interior[i] & (1 << (15 - j))) writel(u32, vga_palette32[15]); else if (mdp->md_border[i] & (1 << (15 - j))) @@ -1214,7 +1178,6 @@ do_on: break; case 16: u16 = (uint16_t*)(p + j * pixel_size); - mouse_buf16[i * 16 + j] = *u16; if (mdp->md_interior[i] & (1 << (15 - j))) writew(u16, vga_palette16[15]); else if (mdp->md_border[i] & (1 << (15 - j))) @@ -1222,7 +1185,6 @@ do_on: break; case 15: u16 = (uint16_t*)(p + j * pixel_size); - mouse_buf16[i * 16 + j] = *u16; if (mdp->md_interior[i] & (1 << (15 - j))) writew(u16, vga_palette15[15]); else if (mdp->md_border[i] & (1 << (15 - j))) @@ -1230,7 +1192,6 @@ do_on: break; case 8: u8 = (uint8_t*)(p + j * pixel_size); - mouse_buf8[i * 16 + j] = *u8; if (mdp->md_interior[i] & (1 << (15 - j))) writeb(u8, 15); else if (mdp->md_border[i] & (1 << (15 - j))) @@ -1241,11 +1202,6 @@ do_on: p += line_width; } - - x_old = x; - y_old = y; - xend_old = xend; - yend_old = yend; } static void From owner-svn-src-head@freebsd.org Wed Apr 19 17:06:34 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 35898D45274; Wed, 19 Apr 2017 17:06:34 +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 mx1.freebsd.org (Postfix) with ESMTPS id E1EE494; Wed, 19 Apr 2017 17:06:33 +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 v3JH6XAP003443; Wed, 19 Apr 2017 17:06:33 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3JH6WLK003439; Wed, 19 Apr 2017 17:06:32 GMT (envelope-from br@FreeBSD.org) Message-Id: <201704191706.v3JH6WLK003439@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Wed, 19 Apr 2017 17:06:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317151 - in head/sys/riscv: include riscv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 19 Apr 2017 17:06:34 -0000 Author: br Date: Wed Apr 19 17:06:32 2017 New Revision: 317151 URL: https://svnweb.freebsd.org/changeset/base/317151 Log: Follow r317061 "Remove struct vmmeter from struct pcpu" with MD changes for RISC-V. This unbreaks RISC-V build. Sponsored by: DARPA, AFRL Modified: head/sys/riscv/include/counter.h head/sys/riscv/include/pcpu.h head/sys/riscv/riscv/intr_machdep.c head/sys/riscv/riscv/minidump_machdep.c Modified: head/sys/riscv/include/counter.h ============================================================================== --- head/sys/riscv/include/counter.h Wed Apr 19 16:24:51 2017 (r317150) +++ head/sys/riscv/include/counter.h Wed Apr 19 17:06:32 2017 (r317151) @@ -34,6 +34,10 @@ #include #endif +extern struct pcpu __pcpu[]; + +#define EARLY_COUNTER &__pcpu[0].pc_early_dummy_counter + #define counter_enter() critical_enter() #define counter_exit() critical_exit() Modified: head/sys/riscv/include/pcpu.h ============================================================================== --- head/sys/riscv/include/pcpu.h Wed Apr 19 16:24:51 2017 (r317150) +++ head/sys/riscv/include/pcpu.h Wed Apr 19 17:06:32 2017 (r317151) @@ -46,7 +46,7 @@ #define PCPU_MD_FIELDS \ uint32_t pc_pending_ipis; /* IPIs pending to this CPU */ \ - char __pad[125] + char __pad[61] #ifdef _KERNEL Modified: head/sys/riscv/riscv/intr_machdep.c ============================================================================== --- head/sys/riscv/riscv/intr_machdep.c Wed Apr 19 16:24:51 2017 (r317150) +++ head/sys/riscv/riscv/intr_machdep.c Wed Apr 19 17:06:32 2017 (r317151) @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -231,7 +232,7 @@ riscv_cpu_intr(struct trapframe *frame) event = intr_events[active_irq]; /* Update counters */ atomic_add_long(riscv_intr_counters[active_irq], 1); - PCPU_INC(cnt.v_intr); + VM_CNT_INC(v_intr); break; default: event = NULL; Modified: head/sys/riscv/riscv/minidump_machdep.c ============================================================================== --- head/sys/riscv/riscv/minidump_machdep.c Wed Apr 19 16:24:51 2017 (r317150) +++ head/sys/riscv/riscv/minidump_machdep.c Wed Apr 19 17:06:32 2017 (r317151) @@ -37,11 +37,14 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include + #include #include #include #include #include + #include #include #include From owner-svn-src-head@freebsd.org Wed Apr 19 17:40:54 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4277ED4685D; Wed, 19 Apr 2017 17:40:54 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 05CB31D47; Wed, 19 Apr 2017 17:40:54 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1d0tav-0007sX-Ff; Wed, 19 Apr 2017 20:40:45 +0300 Date: Wed, 19 Apr 2017 20:40:45 +0300 From: Slawa Olhovchenkov To: Scott Long Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r317143 - in head/sys/cam: . ata scsi Message-ID: <20170419174045.GD83631@zxy.spb.ru> References: <201704191504.v3JF4r5T050468@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201704191504.v3JF4r5T050468@repo.freebsd.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 19 Apr 2017 17:40:54 -0000 On Wed, Apr 19, 2017 at 03:04:53PM +0000, Scott Long wrote: > Author: scottl > Date: Wed Apr 19 15:04:52 2017 > New Revision: 317143 > URL: https://svnweb.freebsd.org/changeset/base/317143 > > Log: > Add infrastructure to the ATA and SCSI transports that supports > using a driver-supplied sbuf for printing device discovery > announcements. This helps ensure that messages to the console > will be properly serialized (through sbuf_putbuf) and not be > truncated and interleaved with other messages. The > infrastructure mirrors the existing xpt_announce_periph() > entry point and is opt-in for now. No content or formatting > changes are visible to the operator other than the new coherency. > > While here, eliminate the stack usage of the temporary > announcement buffer in some of the drivers. It's moved to the > softc for now, but future work will eliminate it entirely by > making the code flow more linear. Future work will also address > locking so that the sbufs can be dynamically sized. > > The scsi_da, scs_cd, scsi_ses, and ata_da drivers are converted > at this point, other drivers can be converted at a later date. > A tunable+sysctl, kern.cam.announce_nosbuf, exists for testing > purposes but will be removed later. > > TODO: > Eliminate all of the code duplication and temporary buffers. The > old printf-based methods will be retired, and xpt_announce_periph() > will just be a wrapper that uses a dynamically sized sbuf. This > requires that the register and deregister paths be made malloc-safe, > which they aren't currently. Thanks! MFC planed? From owner-svn-src-head@freebsd.org Wed Apr 19 17:47:22 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E261DD46A18; Wed, 19 Apr 2017 17:47:22 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C29AF350; Wed, 19 Apr 2017 17:47:22 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by mail.baldwin.cx (Postfix) with ESMTPSA id 4E12310A7B9; Wed, 19 Apr 2017 13:47:21 -0400 (EDT) From: John Baldwin To: Ruslan Bukin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r317144 - head/contrib/zstd/lib/common Date: Wed, 19 Apr 2017 09:59:02 -0700 Message-ID: <3162397.lBpeitT6v2@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.0-STABLE; KDE/4.14.10; amd64; ; ) In-Reply-To: <201704191524.v3JFOYiK061287@repo.freebsd.org> References: <201704191524.v3JFOYiK061287@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Wed, 19 Apr 2017 13:47:21 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 19 Apr 2017 17:47:23 -0000 On Wednesday, April 19, 2017 03:24:34 PM Ruslan Bukin wrote: > Author: br > Date: Wed Apr 19 15:24:33 2017 > New Revision: 317144 > URL: https://svnweb.freebsd.org/changeset/base/317144 > > Log: > Don't use __builtin_bswap for RISC-V due to undefined reference > in compiler. > > This unbreaks RISC-V world build. > > Sponsored by: DARPA, AFRL We should probably add an implementation of __bswapdi2() for riscv to libcompiler_rt instead? -- John Baldwin From owner-svn-src-head@freebsd.org Wed Apr 19 17:51:33 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5B9DAD46CF7; Wed, 19 Apr 2017 17:51:33 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 28137A25; Wed, 19 Apr 2017 17:51:33 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3JHpW2J021033; Wed, 19 Apr 2017 17:51:32 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3JHpWBr021032; Wed, 19 Apr 2017 17:51:32 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201704191751.v3JHpWBr021032@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Wed, 19 Apr 2017 17:51:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317154 - head/usr.sbin/rpcbind X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 19 Apr 2017 17:51:33 -0000 Author: ngie Date: Wed Apr 19 17:51:32 2017 New Revision: 317154 URL: https://svnweb.freebsd.org/changeset/base/317154 Log: Print out the signal number on exit in terminate(..) if WARMSTART is compiled into rpcbind. The signal number can provide helpful diagnostic info. MFC after: 1 week Obtained from: Isilon OneFS Sponsored by: Dell EMC Isilon Modified: head/usr.sbin/rpcbind/rpcbind.c Modified: head/usr.sbin/rpcbind/rpcbind.c ============================================================================== --- head/usr.sbin/rpcbind/rpcbind.c Wed Apr 19 17:32:32 2017 (r317153) +++ head/usr.sbin/rpcbind/rpcbind.c Wed Apr 19 17:51:32 2017 (r317154) @@ -757,12 +757,13 @@ rbllist_add(rpcprog_t prog, rpcvers_t ve * Catch the signal and die */ static void -terminate(int dummy __unused) +terminate(int signum __unused) { close(rpcbindlockfd); #ifdef WARMSTART syslog(LOG_ERR, - "rpcbind terminating on signal. Restart with \"rpcbind -w\""); + "rpcbind terminating on signal %d. Restart with \"rpcbind -w\"", + signum); write_warmstart(); /* Dump yourself */ #endif exit(2); From owner-svn-src-head@freebsd.org Wed Apr 19 18:01:54 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BA6B3D44021; Wed, 19 Apr 2017 18:01:54 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7FEDB33B; Wed, 19 Apr 2017 18:01:54 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3JI1rgn026142; Wed, 19 Apr 2017 18:01:53 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3JI1r7Y026141; Wed, 19 Apr 2017 18:01:53 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201704191801.v3JI1r7Y026141@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Wed, 19 Apr 2017 18:01:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317155 - head/usr.sbin/rpcbind X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 19 Apr 2017 18:01:54 -0000 Author: ngie Date: Wed Apr 19 18:01:53 2017 New Revision: 317155 URL: https://svnweb.freebsd.org/changeset/base/317155 Log: rpcbind(8): wordsmith -h description and mention -W in the SYNOPSIS section -W was already documented in the OPTIONS section. MFC after: 7 weeks Reported by: igor (-h wordsmith'ing) Sponsored by: Dell EMC Isilon Modified: head/usr.sbin/rpcbind/rpcbind.8 Modified: head/usr.sbin/rpcbind/rpcbind.8 ============================================================================== --- head/usr.sbin/rpcbind/rpcbind.8 Wed Apr 19 17:51:32 2017 (r317154) +++ head/usr.sbin/rpcbind/rpcbind.8 Wed Apr 19 18:01:53 2017 (r317155) @@ -2,7 +2,7 @@ .\" Copyright 1989 AT&T .\" Copyright 1991 Sun Microsystems, Inc. .\" $FreeBSD$ -.Dd March 6, 2014 +.Dd April 19, 2017 .Dt RPCBIND 8 .Os .Sh NAME @@ -10,7 +10,7 @@ .Nd universal addresses to RPC program number mapper .Sh SYNOPSIS .Nm -.Op Fl 6adiLls +.Op Fl 6adiLlsW .Op Fl h Ar bindip .Sh DESCRIPTION The @@ -85,7 +85,7 @@ is also specified. With this option, the name-to-address translation consistency checks are shown in detail. .It Fl h Ar bindip -Specify specific IP addresses to bind to for TCP and UDP requests. +IP addresses to bind to when servicing TCP and UDP requests. This option may be specified multiple times and is typically necessary when running on a multi-homed host. From owner-svn-src-head@freebsd.org Wed Apr 19 18:02:41 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E117FD440B4; Wed, 19 Apr 2017 18:02:41 +0000 (UTC) (envelope-from antoine.brodin.freebsd@gmail.com) Received: from mail-io0-x242.google.com (mail-io0-x242.google.com [IPv6:2607:f8b0:4001:c06::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B8BAF785; Wed, 19 Apr 2017 18:02:41 +0000 (UTC) (envelope-from antoine.brodin.freebsd@gmail.com) Received: by mail-io0-x242.google.com with SMTP id x86so5744626ioe.3; Wed, 19 Apr 2017 11:02:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=lVxQsimqzRHxFFsMC8RIbbrBrhzQOqCGnpmmcpEiys8=; b=qnmjz2ungZH8gZJvBgECMaPijanSj0FoNq2yD58T0LY8euRmYMLJAMv1fw/TpFWliB CQOD7iNCHPLhlHGeBxkN8AmLkXKnfIK6/jM/E4Ooc+gMDel1RaCaSWT4LwRZiwqeYc9R wTM1xY+4EfT1gCEs8UePq1gNEml68HRkkGs59yWyVXqJ2Cfuvfxz8p+LY6ME4ZBXtuJz juPZ9Pwo0kzJtUFHAeu1RMFbyi4nG98nwRhre0dIrOOQSxToZM+LpmWipWj6IeY2cp1k RouOlGjm0WOeyG6Av+OfZeQ0BYhcXRfi4xmaHXlVAoNdPu+xJLrtOfIRh2nhrFvpoCqh oYgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=lVxQsimqzRHxFFsMC8RIbbrBrhzQOqCGnpmmcpEiys8=; b=ZJa0qDxDGvPimeVTgkSbLfu/rntdJGb2EcCiR+61d87c+9ln8/w6kOf2bAcBJrHdnE UT2WY7kA65QMSTlJEuosIEgUxc5VCmWklVmZHR7yUfIUiJV9IgtGHTihwTZOLz5v4vbn chiV17DmCt7Fmn/bktMpSGlnAnvAXSL47T3viXQcEvUz+J0s5olycePK6jFfrTuhKqwn hS2sEZxQNg+wRbMuwpkdIiLqmZ2kFfF9zkzYL6Uwjoy+1BZS2oJ27Ii8aE8fS9/62ERU qhSfDetixpYbZGgvkWATIVEXCB/l9de+De3mYYoWQa1CewMaE8ABL+GM02TXVelePTGL 0Vtw== X-Gm-Message-State: AN3rC/5ZCo49CsjDAcmSzxQlPbyxR2fZDBpYvQBO7kcxVSeYsaOWuTYU ow6gqpIB4Eatkx5IPulny2CzPLuWkoH0 X-Received: by 10.107.147.135 with SMTP id v129mr4238340iod.233.1492624960582; Wed, 19 Apr 2017 11:02:40 -0700 (PDT) MIME-Version: 1.0 Sender: antoine.brodin.freebsd@gmail.com Received: by 10.107.33.209 with HTTP; Wed, 19 Apr 2017 11:02:40 -0700 (PDT) In-Reply-To: <201704171734.v3HHYlf5022945@repo.freebsd.org> References: <201704171734.v3HHYlf5022945@repo.freebsd.org> From: Antoine Brodin Date: Wed, 19 Apr 2017 20:02:40 +0200 X-Google-Sender-Auth: IL24ywxGQ3o9pTE8owztbHvk2UQ Message-ID: Subject: Re: svn commit: r317061 - in head: libexec/rpc.rstatd sys/amd64/amd64 sys/amd64/include sys/arm/arm sys/arm/include sys/arm64/include sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/compat/linprocfs... To: Gleb Smirnoff Cc: src-committers , 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.23 Precedence: list List-Id: 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, 19 Apr 2017 18:02:42 -0000 On Mon, Apr 17, 2017 at 7:34 PM, Gleb Smirnoff wrote: > Author: glebius > Date: Mon Apr 17 17:34:47 2017 > New Revision: 317061 > URL: https://svnweb.freebsd.org/changeset/base/317061 > > Log: > - Remove 'struct vmmeter' from 'struct pcpu', leaving only global vmmeter > in place. To do per-cpu stats, convert all fields that previously were > maintained in the vmmeters that sit in pcpus to counter(9). > - Since some vmmeter stats may be touched at very early stages of boot, > before we have set up UMA and we can do counter_u64_alloc(), provide an > early counter mechanism: > o Leave one spare uint64_t in struct pcpu, named pc_early_dummy_counter. > o Point counter(9) fields of vmmeter to pcpu[0].pc_early_dummy_counter, > so that at early stages of boot, before counters are allocated we already > point to a counter that can be safely written to. > o For sparc64 that required a whole dummy pcpu[MAXCPU] array. Hi, This seems to break a few ports, the most important ones: http://gohan2.ysv.freebsd.org/data/head-amd64-default-baseline/p438755_s317076/logs/errors/net-snmp-5.7.3_15.log http://gohan2.ysv.freebsd.org/data/head-amd64-default-baseline/p438755_s317076/logs/errors/sigar-1.7.3_2.log Cheers, Antoine From owner-svn-src-head@freebsd.org Wed Apr 19 18:11:09 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B93DED443DE; Wed, 19 Apr 2017 18:11:09 +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 mx1.freebsd.org (Postfix) with ESMTPS id 88BA2C83; Wed, 19 Apr 2017 18:11:09 +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 v3JIB8NN030852; Wed, 19 Apr 2017 18:11:08 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3JIB8NS030851; Wed, 19 Apr 2017 18:11:08 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201704191811.v3JIB8NS030851@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 19 Apr 2017 18:11:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317156 - head/tools/build/options X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 19 Apr 2017 18:11:09 -0000 Author: emaste Date: Wed Apr 19 18:11:08 2017 New Revision: 317156 URL: https://svnweb.freebsd.org/changeset/base/317156 Log: makeman: add a comment describing purpose and invocation Reviewed by: jhb, ngie MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D10389 Modified: head/tools/build/options/makeman Modified: head/tools/build/options/makeman ============================================================================== --- head/tools/build/options/makeman Wed Apr 19 18:01:53 2017 (r317155) +++ head/tools/build/options/makeman Wed Apr 19 18:11:08 2017 (r317156) @@ -1,8 +1,22 @@ #!/bin/sh # # This file is in the public domain. -# # $FreeBSD$ +# +# This script is used to create the src.conf.5 man page, using template text +# contained herein and the contents of the WITH_* and WITHOUT_* files in the +# same directory. Each WITH_* and WITHOUT_* file documents the effect of the +# /etc/src.conf knob with the same name. +# +# This script invokes "make showconfig" for each supported architecture in +# order to determine, for each option, whether the default setting is always +# WITH, always WITHOUT, or is architecture-dependent. It also determines +# and describes dependencies between options. +# +# Usage: +# +# cd tools/build/options +# sh makeman > ../../../share/man/man5/src.conf.5 set -o errexit export LC_ALL=C @@ -128,7 +142,7 @@ main() fbsdid='$'FreeBSD'$' cat < Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C9DD0D44E85; Wed, 19 Apr 2017 18:35:35 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A4FF31E3A; Wed, 19 Apr 2017 18:35:35 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3JIZY5W040823; Wed, 19 Apr 2017 18:35:34 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3JIZYk2040822; Wed, 19 Apr 2017 18:35:34 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201704191835.v3JIZYk2040822@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Wed, 19 Apr 2017 18:35:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317157 - head/sys/dev/syscons X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 19 Apr 2017 18:35:35 -0000 Author: bde Date: Wed Apr 19 18:35:34 2017 New Revision: 317157 URL: https://svnweb.freebsd.org/changeset/base/317157 Log: Fix missing support for drawing the mouse cursor in depth 24 of direct mode. Use the general DRAWPIXEL() macro with its bigger case statement (twice) instead of our big case statement (once). DRAWPIXEL() is more complicated since it is not missing support for depth 24 or complications for colors in depth 16 (we currently hard-code black and white so the complications for colors are not needed). DRAWPIXEL() also does the bpp calculation in the inner loop. Compilers optimize DRAWPIXEL() well enough, and the main text drawing method always depended on this. In direct mode, mouse cursor drawing is now similar to normal text drawing except it draws in 2 hard-coded colors instead of 1 variable color. This also fixes a nested hard-coding of colors. DRAWPIXEL() uses the palette in all cases, but the direct code didn't use the palette for its hard-coded black. This only had an effect in depth 8, since changing the palette is not supported in other depths. Modified: head/sys/dev/syscons/scvgarndr.c Modified: head/sys/dev/syscons/scvgarndr.c ============================================================================== --- head/sys/dev/syscons/scvgarndr.c Wed Apr 19 18:11:08 2017 (r317156) +++ head/sys/dev/syscons/scvgarndr.c Wed Apr 19 18:35:34 2017 (r317157) @@ -1127,10 +1127,6 @@ vga_pxlmouse_direct(scr_stat *scp, int x int line_width, pixel_size; int xend, yend; int i, j; - uint32_t *u32; - uint16_t *u16; - uint8_t *u8; - int bpp; mdp = (scp->font_size < 14) ? &mouse9x13 : &mouse10x16; @@ -1144,11 +1140,6 @@ vga_pxlmouse_direct(scr_stat *scp, int x yend <= (scp->yoff + scp->ysize) * scp->font_size) return; - bpp = scp->sc->adp->va_info.vi_depth; - - if ((bpp == 16) && (scp->sc->adp->va_info.vi_pixel_fsizes[1] == 5)) - bpp = 15; - line_width = scp->sc->adp->va_line_width; pixel_size = scp->sc->adp->va_info.vi_pixel_size; @@ -1165,43 +1156,12 @@ vga_pxlmouse_direct(scr_stat *scp, int x do_on: p = scp->sc->adp->va_window + y * line_width + x * pixel_size; - - for (i = 0; i < (yend - y); i++) { - for (j = (xend - x - 1); j >= 0; j--) { - switch (bpp) { - case 32: - u32 = (uint32_t*)(p + j * pixel_size); - if (mdp->md_interior[i] & (1 << (15 - j))) - writel(u32, vga_palette32[15]); - else if (mdp->md_border[i] & (1 << (15 - j))) - writel(u32, 0); - break; - case 16: - u16 = (uint16_t*)(p + j * pixel_size); - if (mdp->md_interior[i] & (1 << (15 - j))) - writew(u16, vga_palette16[15]); - else if (mdp->md_border[i] & (1 << (15 - j))) - writew(u16, 0); - break; - case 15: - u16 = (uint16_t*)(p + j * pixel_size); - if (mdp->md_interior[i] & (1 << (15 - j))) - writew(u16, vga_palette15[15]); - else if (mdp->md_border[i] & (1 << (15 - j))) - writew(u16, 0); - break; - case 8: - u8 = (uint8_t*)(p + j * pixel_size); - if (mdp->md_interior[i] & (1 << (15 - j))) - writeb(u8, 15); - else if (mdp->md_border[i] & (1 << (15 - j))) - writeb(u8, 0); - break; - } - } - - p += line_width; - } + for (i = 0; i < yend - y; i++, p += line_width) + for (j = xend - x - 1; j >= 0; j--) + if (mdp->md_interior[i] & (1 << (15 - j))) + DRAW_PIXEL(scp, p + j * pixel_size, 15); + else if (mdp->md_border[i] & (1 << (15 - j))) + DRAW_PIXEL(scp, p + j * pixel_size, 0); } static void From owner-svn-src-head@freebsd.org Wed Apr 19 18:39:54 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 19B63D44FAF; Wed, 19 Apr 2017 18:39:54 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D44D4B1; Wed, 19 Apr 2017 18:39:53 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id v3JIdkDt031883; Wed, 19 Apr 2017 11:39:46 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id v3JGXWmu031427; Wed, 19 Apr 2017 09:33:32 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201704191633.v3JGXWmu031427@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r317094 - head/share/mk In-Reply-To: <1709565.BYcnqjiFaR@ralph.baldwin.cx> To: John Baldwin Date: Wed, 19 Apr 2017 09:33:32 -0700 (PDT) CC: Slawa Olhovchenkov , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 19 Apr 2017 18:39:54 -0000 > On Wednesday, April 19, 2017 01:28:37 AM Slawa Olhovchenkov wrote: > > On Tue, Apr 18, 2017 at 12:45:25PM -0700, John Baldwin wrote: > > > > > On Tuesday, April 18, 2017 07:30:13 PM Slawa Olhovchenkov wrote: > > > > On Tue, Apr 18, 2017 at 04:27:48PM +0000, John Baldwin wrote: > > > > > > > > > Author: jhb > > > > > Date: Tue Apr 18 16:27:48 2017 > > > > > New Revision: 317094 > > > > > URL: https://svnweb.freebsd.org/changeset/base/317094 > > > > > > > > > > Log: > > > > > Disable in-tree GDB by default on x86, mips, and powerpc. > > > > > > > > > > GDB in ports contains all of the functionality as GDB in base > > > > > (including kgdb) for these platforms along with additional > > > > > functionality. In-tree GDB remains enabled on ARM and sparc64. > > > > > GDB in ports does not currently support kernel debugging on arm, > > > > > and ports GDB for sparc64 has not been tested (though it does > > > > > include sparc64 support). > > > > > > > > > > Reviewed by: bdrewery, emaste, imp > > > > > Relnotes: yes > > > > > Sponsored by: DARPA / AFRL > > > > > Differential Revision: https://reviews.freebsd.org/D10399 > > > > > > > > Generating core.txt now complety broken? > > > > > > No. crashinfo has supported gdb from ports for quite a while now. > > > If you 'pkg install gdb' crashinfo defaults to using the ports gdb over > > > the base one already. > > > > I am about clean install, w/o ports. > > Until we get some sort of klldb support that will not work. However, > we already have platforms now where /usr/bin/gdb doesn't work for that. > riscv and aarch64 aren't supported in ancient gdb, and the MIPS > /usr/bin/gdb didn't really work for me in my testing. So we break what worked on a Tier1 Platform? With my "user" hat on these are the exact kind of breakages that send me looking for another platform to run on. We far to often just go oh you can do X y and Z to get around what we broke forgetting that the user 6 months from now when this hits a release isnt gona come ask, he may just go down the road to something else. Remove gdb WHEN klldb can replace it, not a day before. Using "oh its broken on aarch64 and mips" is not a reason to break things on i386/amd64. Yes, I know we want to get gnu stuff out of the tree, but that needs to come AFTER a proper replacement is avaliable. > > > Also, how to generate core.txt after crash, reboot and install gdb > > from ports? (port instaled after crash) > > You can always run crashinfo by hand. /me starts to look for a new OS, this one is not very good at user support. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Wed Apr 19 18:59:39 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B0528D45D16; Wed, 19 Apr 2017 18:59:39 +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 mx1.freebsd.org (Postfix) with ESMTPS id 655691E4; Wed, 19 Apr 2017 18:59:39 +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 v3JIxcTi048810; Wed, 19 Apr 2017 18:59:38 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3JIxc57048808; Wed, 19 Apr 2017 18:59:38 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201704191859.v3JIxc57048808@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 19 Apr 2017 18:59:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317158 - in head: share/man/man5 share/mk tools/build/options X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 19 Apr 2017 18:59:39 -0000 Author: emaste Date: Wed Apr 19 18:59:38 2017 New Revision: 317158 URL: https://svnweb.freebsd.org/changeset/base/317158 Log: Remove WITHOUT_GNU and WITHOUT_GNU_SUPPORT src.conf.knobs These have no effect (and WITHOUT_GNU is documented as having no effect). I intend to later introduce a WITHOUT_GPL knob to serve a similar purpose as WITHOUT_GNU's previously documented intent, but with a more accurate name. To avoid confusion over the transition though just remove the existing, nonfunctional ones. Deleted: head/tools/build/options/WITHOUT_GNU head/tools/build/options/WITHOUT_GNU_SUPPORT Modified: head/share/man/man5/src.conf.5 head/share/mk/src.opts.mk Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Wed Apr 19 18:35:34 2017 (r317157) +++ head/share/man/man5/src.conf.5 Wed Apr 19 18:59:38 2017 (r317158) @@ -1,6 +1,6 @@ -.\" DO NOT EDIT-- this file is automatically generated. +.\" DO NOT EDIT-- this file is generated by tools/build/options/makeman. .\" $FreeBSD$ -.Dd April 18, 2017 +.Dd April 19, 2017 .Dt SRC.CONF 5 .Os .Sh NAME @@ -700,19 +700,6 @@ Set to build .Pp This is a default setting on arm/arm, arm/armeb, arm/armv6 and sparc64/sparc64. -.It Va WITHOUT_GNU -Set to not build contributed GNU software as a part of the base system. -This option can be useful if the system built must not contain any code -covered by the GNU Public License due to legal reasons. -.Bf -symbolic -The option has no effect yet. -.Ef -When set, it enforces these options: -.Pp -.Bl -item -compact -.It -.Va WITHOUT_GNU_SUPPORT -.El .It Va WITHOUT_GNUCXX Do not build the GNU C++ stack (g++, libstdc++). This is the default on platforms where clang is the system compiler. @@ -736,8 +723,6 @@ Set to not build GNU .It Va WITHOUT_GNU_GREP_COMPAT Set this option to omit the gnu extensions to grep from being included in BSD grep. -.It Va WITHOUT_GNU_SUPPORT -Set to build some programs without optional GNU support. .It Va WITHOUT_GPIO Set to not build .Xr gpioctl 8 Modified: head/share/mk/src.opts.mk ============================================================================== --- head/share/mk/src.opts.mk Wed Apr 19 18:35:34 2017 (r317157) +++ head/share/mk/src.opts.mk Wed Apr 19 18:59:38 2017 (r317158) @@ -96,7 +96,6 @@ __DEFAULT_YES_OPTIONS = \ FTP \ GAMES \ GCOV \ - GNU \ GNU_DIFF \ GNU_GREP \ GNU_GREP_COMPAT \ @@ -450,7 +449,6 @@ MK_${vv:H}:= ${MK_${vv:T}} .for var in \ BLACKLIST \ BZIP2 \ - GNU \ INET \ INET6 \ KERBEROS \ From owner-svn-src-head@freebsd.org Wed Apr 19 19:01:32 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3D08BD45EDC; Wed, 19 Apr 2017 19:01:32 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-io0-x230.google.com (mail-io0-x230.google.com [IPv6:2607:f8b0:4001:c06::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 04F9465B; Wed, 19 Apr 2017 19:01:32 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-io0-x230.google.com with SMTP id k87so32937238ioi.0; Wed, 19 Apr 2017 12:01:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to; bh=vGCNaxI8bGVRWuk/RpQ0g8mb6NsSo4960lRXNzQHOwU=; b=L69QrAsEkNDKEOiTxjFN2QsGD1GSA1L70V0rJRCeUQWmQKz8vBUP8u9Gq4ZTlGddFu BD1K9jkEfpRUXkSJGxsoYX6dA0B07Ho8FG7I55K3wIU8TNuw4piM2M1jkzl7G7kSBikl N5n+OQNd+wnE8mHzwA7XYC26V02BG0dO1pSnbS317/IUDt5r98ClTdTHqOnatLuNsFdQ 2oAfKJle+uHCdgvQGwM9O9wYEn6kSL8bq4su8NN4YN3bP12B3x1BftalK/AsDSALYW7E +VMnH+IEfJrbSxes9jNr1GIflm40eXBG3chfSgClWDXW6UTiWKVKN7Yq1OVWgwk8QwEZ 4xrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to; bh=vGCNaxI8bGVRWuk/RpQ0g8mb6NsSo4960lRXNzQHOwU=; b=GCKXIJlvEk0tV8X3K/FrH2oDK0L9gvJRetayz7q2cwqYaPNxFctJmBJ4bB1aigtKV1 FsOdLSvNuQDNonJZZ2mDGR4P1/n2rWsHevU7hjNlYqTeV6oMSq4RzWbM78UvMTKhrW84 7nYI16XTpnIiDqrmjYgJqNU/yRBVpI1giJlKXGTgxj17OQhZ107UN/iomwkunwACGqxm zs6zdGcBvSA5NtZB2MtkE0gxNXJObM7KyQRCSsknkFah554VTt8IjMEyaOLTqqYMFsEk v1vRy3th5RyQJq6+xfcu7FyXyl2k2iyHJ06va8uOoiwTNkyoe95qb7SL++K9ZoCEfeze GddA== X-Gm-Message-State: AN3rC/4/3AmcmGXeAvG/LGJR9J3NbFd59VufB2xTiRjQXM1SN5m/bUA7 h4OIjpmuzfgWHCe6jqwhkfHxxRSPOdznG7U= X-Received: by 10.107.34.21 with SMTP id i21mr5061782ioi.52.1492628489651; Wed, 19 Apr 2017 12:01:29 -0700 (PDT) MIME-Version: 1.0 Sender: carpeddiem@gmail.com Received: by 10.107.30.136 with HTTP; Wed, 19 Apr 2017 12:01:09 -0700 (PDT) In-Reply-To: <201704191859.v3JIxc57048808@repo.freebsd.org> References: <201704191859.v3JIxc57048808@repo.freebsd.org> From: Ed Maste Date: Wed, 19 Apr 2017 15:01:09 -0400 X-Google-Sender-Auth: 8xxFl2rk8VEgzdAfBx5MsiF8Wr4 Message-ID: Subject: Re: svn commit: r317158 - in head: share/man/man5 share/mk tools/build/options To: "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.23 Precedence: list List-Id: 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, 19 Apr 2017 19:01:32 -0000 On 19 April 2017 at 14:59, Ed Maste wrote: > Author: emaste > Date: Wed Apr 19 18:59:38 2017 > New Revision: 317158 > URL: https://svnweb.freebsd.org/changeset/base/317158 > > Log: > Remove WITHOUT_GNU and WITHOUT_GNU_SUPPORT src.conf.knobs > > These have no effect (and WITHOUT_GNU is documented as having no > effect). I intend to later introduce a WITHOUT_GPL knob to serve a > similar purpose as WITHOUT_GNU's previously documented intent, but with > a more accurate name. To avoid confusion over the transition though just > remove the existing, nonfunctional ones. Closed the editor too early: Reviewed by: jhb, bapt Differential Revision: https://reviews.freebsd.org/D10418 From owner-svn-src-head@freebsd.org Wed Apr 19 19:06:49 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 178A3D46005; Wed, 19 Apr 2017 19:06:49 +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 mx1.freebsd.org (Postfix) with ESMTPS id C3586B54; Wed, 19 Apr 2017 19:06:48 +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 v3JJ6lGm053050; Wed, 19 Apr 2017 19:06:47 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3JJ6lcl053049; Wed, 19 Apr 2017 19:06:47 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201704191906.v3JJ6lcl053049@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 19 Apr 2017 19:06:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317159 - head/contrib/libstdc++/config/abi/pre X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 19 Apr 2017 19:06:49 -0000 Author: emaste Date: Wed Apr 19 19:06:47 2017 New Revision: 317159 URL: https://svnweb.freebsd.org/changeset/base/317159 Log: libstdc++: fix symbol version script for LLD LLD is less tolerant of inconsistencies in the symbol version script. - Add a ; on the last entry in a version block - Remove duplicated symbols, retaining those in the earliest block Reviewed by: bdrewery MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D10428 Modified: head/contrib/libstdc++/config/abi/pre/gnu.ver Modified: head/contrib/libstdc++/config/abi/pre/gnu.ver ============================================================================== --- head/contrib/libstdc++/config/abi/pre/gnu.ver Wed Apr 19 18:59:38 2017 (r317158) +++ head/contrib/libstdc++/config/abi/pre/gnu.ver Wed Apr 19 19:06:47 2017 (r317159) @@ -121,7 +121,7 @@ GLIBCXX_3.4 { std::__moneypunct_cache*; std::__numpunct_cache*; std::__timepunct_cache*; - __gnu_debug::_Error_formatter* + __gnu_debug::_Error_formatter*; }; # Names not in an 'extern' block are mangled names. @@ -604,34 +604,6 @@ GLIBCXX_3.4.4 { } GLIBCXX_3.4.3; GLIBCXX_3.4.5 { - - # std::string - _ZNKSs11_M_disjunctEPKc; - _ZNKSs15_M_check_lengthE[jm][jm]PKc; - _ZNSs4_Rep26_M_set_length_and_sharableE*; - _ZNSs7_M_copyEPcPKc[jm]; - _ZNSs7_M_moveEPcPKc[jm]; - _ZNSs9_M_assignEPc[jm]c; - - # std::wstring - _ZNKSbIwSt11char_traitsIwESaIwEE11_M_disjunctEPKw; - _ZNKSbIwSt11char_traitsIwESaIwEE15_M_check_lengthE[jm][jm]PKc; - _ZNSbIwSt11char_traitsIwESaIwEE4_Rep26_M_set_length_and_sharableE*; - _ZNSbIwSt11char_traitsIwESaIwEE7_M_copyEPwPKw[jm]; - _ZNSbIwSt11char_traitsIwESaIwEE7_M_moveEPwPKw[jm]; - _ZNSbIwSt11char_traitsIwESaIwEE9_M_assignEPw[jm]w; - - _ZNKSt13basic_fstreamI[cw]St11char_traitsI[cw]EE7is_openEv; - _ZNKSt14basic_ifstreamI[cw]St11char_traitsI[cw]EE7is_openEv; - _ZNKSt14basic_ofstreamI[cw]St11char_traitsI[cw]EE7is_openEv; - - _ZNSi6ignoreE[ilv]; - _ZNSt13basic_istreamIwSt11char_traitsIwEE6ignoreE[ilv]; - - _ZNSt11char_traitsI[cw]E2eqERK[cw]S2_; - - _ZNSt19istreambuf_iteratorI[cw]St11char_traitsI[cw]EEppEv; - } GLIBCXX_3.4.4; GLIBCXX_3.4.6 { @@ -643,8 +615,6 @@ GLIBCXX_3.4.6 { _ZNSt15basic_stringbufI[cw]St11char_traitsI[cw]ESaI[cw]EE9showmanycEv; - _ZNKSt15basic_stringbufIwSt11char_traitsIwESaIwEE3strEv; - _ZN9__gnu_cxx6__poolILb1EE13_M_initializeEv; } GLIBCXX_3.4.5; From owner-svn-src-head@freebsd.org Wed Apr 19 19:13:08 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 27AEAD46385; Wed, 19 Apr 2017 19:13:08 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: from mail-qt0-x22f.google.com (mail-qt0-x22f.google.com [IPv6:2607:f8b0:400d:c0d::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E7B241295; Wed, 19 Apr 2017 19:13:07 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: by mail-qt0-x22f.google.com with SMTP id m36so28145026qtb.0; Wed, 19 Apr 2017 12:13:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=gDZXbDJ3mQ6J4+1V8xgDKYVn3Y4WVsdTefsMMCEcpyc=; b=nIr1TW7F58CxFvVmdOLKt28b9YY0ohingeFYC9+Md3t3lRVF+T+q0c+BilSakYSzX1 3JraUaDKVkJ2IaEFfFZJOcVGHFjGlpjbHeQxkidq0LeMcTJEGlt31ogQq9mK78EJJ2BB FrLqQp6THCwB9QjQLyFYfScsVrwTc3+CQ2dD/Cr7y6T3031rhexfJOy1okRsoatEQzQk ZR6CwwyZh80E63ORfZylgNv5gN0k/BR5yjlcHgyRJ1kTxuaqdXEK20qEA+ZxqwxUtPMt sEwHHZd/y62+lOQGmS9/HYWxTrw2oETHWKonp455LIwmGxbqAPqnWl56MahJs2gFn3o1 Xl/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=gDZXbDJ3mQ6J4+1V8xgDKYVn3Y4WVsdTefsMMCEcpyc=; b=HNHFfW1co/0EsqWhv0QLwJVCjUVnruASHZrUpa684izhMbJfXXiPBl/XvvuC5Cqmos u/GlEMWVDk64do6vqesf3SZe3W5P5PFcMPVcCvYGc2bE7GehSx3/xfwT3i9l0c9oHfNp MvHo0pjBwQbVmSUHcbDz+rMvcclqhYuMBAGZg9B5CXhGlkLXRzrIOBgyfX04Dp4i/dKs 4FCGVLcXWPvXhevQoOaJ6CuIJIAfcz/M2gJqrGrwheVWnJvMnN1qNlk7l1q/TI3E39sI Ye/yd4KAPTdh9ODMo3IFPuEPFGdQzMT84a8rVWJV/c+XFwe9Df0RQqxFP0esnC4bBaLf k1fA== X-Gm-Message-State: AN3rC/62MYNvfhxv3FNdztz7VAGRuUcE/agyCGLs4nJ/DKw2ypDPmalI 5YPX1bZ/jBd/anl+4cprkco8N7LvhA== X-Received: by 10.200.36.139 with SMTP id s11mr4503544qts.19.1492629186692; Wed, 19 Apr 2017 12:13:06 -0700 (PDT) MIME-Version: 1.0 Sender: chmeeedalf@gmail.com Received: by 10.12.178.219 with HTTP; Wed, 19 Apr 2017 12:13:06 -0700 (PDT) In-Reply-To: <201704191633.v3JGXWmu031427@pdx.rh.CN85.dnsmgr.net> References: <1709565.BYcnqjiFaR@ralph.baldwin.cx> <201704191633.v3JGXWmu031427@pdx.rh.CN85.dnsmgr.net> From: Justin Hibbits Date: Wed, 19 Apr 2017 14:13:06 -0500 X-Google-Sender-Auth: 8PtatbvLJJizda8i07x3dRET1rM Message-ID: Subject: Re: svn commit: r317094 - head/share/mk To: rgrimes@freebsd.org Cc: John Baldwin , Slawa Olhovchenkov , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , src-committers Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 19 Apr 2017 19:13:08 -0000 On Wed, Apr 19, 2017 at 11:33 AM, Rodney W. Grimes wrote: >> On Wednesday, April 19, 2017 01:28:37 AM Slawa Olhovchenkov wrote: >> > On Tue, Apr 18, 2017 at 12:45:25PM -0700, John Baldwin wrote: >> > >> > > On Tuesday, April 18, 2017 07:30:13 PM Slawa Olhovchenkov wrote: >> > > > On Tue, Apr 18, 2017 at 04:27:48PM +0000, John Baldwin wrote: >> > > > >> > > > > Author: jhb >> > > > > Date: Tue Apr 18 16:27:48 2017 >> > > > > New Revision: 317094 >> > > > > URL: https://svnweb.freebsd.org/changeset/base/317094 >> > > > > >> > > > > Log: >> > > > > Disable in-tree GDB by default on x86, mips, and powerpc. >> > > > > >> > > > > GDB in ports contains all of the functionality as GDB in base >> > > > > (including kgdb) for these platforms along with additional >> > > > > functionality. In-tree GDB remains enabled on ARM and sparc64. >> > > > > GDB in ports does not currently support kernel debugging on arm, >> > > > > and ports GDB for sparc64 has not been tested (though it does >> > > > > include sparc64 support). >> > > > > >> > > > > Reviewed by: bdrewery, emaste, imp >> > > > > Relnotes: yes >> > > > > Sponsored by: DARPA / AFRL >> > > > > Differential Revision: https://reviews.freebsd.org/D10399 >> > > > >> > > > Generating core.txt now complety broken? >> > > >> > > No. crashinfo has supported gdb from ports for quite a while now. >> > > If you 'pkg install gdb' crashinfo defaults to using the ports gdb over >> > > the base one already. >> > >> > I am about clean install, w/o ports. >> >> Until we get some sort of klldb support that will not work. However, >> we already have platforms now where /usr/bin/gdb doesn't work for that. >> riscv and aarch64 aren't supported in ancient gdb, and the MIPS >> /usr/bin/gdb didn't really work for me in my testing. > > So we break what worked on a Tier1 Platform? With my "user" hat on > these are the exact kind of breakages that send me looking for another > platform to run on. We far to often just go oh you can do X y and Z > to get around what we broke forgetting that the user 6 months from now > when this hits a release isnt gona come ask, he may just go down the > road to something else. > > Remove gdb WHEN klldb can replace it, not a day before. Using "oh its > broken on aarch64 and mips" is not a reason to break things on i386/amd64. > It's not removed, it's disabled by default now. As the commit message states, gdb in ports is much more feature filled than gdb in base > Yes, I know we want to get gnu stuff out of the tree, but that needs > to come AFTER a proper replacement is avaliable. > >> >> > Also, how to generate core.txt after crash, reboot and install gdb >> > from ports? (port instaled after crash) >> >> You can always run crashinfo by hand. > > /me starts to look for a new OS, this one is not very good at user support. I'd say this more warrants a set of "blessed" packages to include on install disks so we get this functionality without the extra step. - Justin > > > -- > Rod Grimes rgrimes@freebsd.org > From owner-svn-src-head@freebsd.org Wed Apr 19 19:28:29 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D9CA2D4675D; Wed, 19 Apr 2017 19:28:29 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-io0-x234.google.com (mail-io0-x234.google.com [IPv6:2607:f8b0:4001:c06::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AA72B1A03; Wed, 19 Apr 2017 19:28:29 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-io0-x234.google.com with SMTP id k87so33966221ioi.0; Wed, 19 Apr 2017 12:28:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=rB3773XPGQFFnLMNWpqnH0YQ0Ft9VoliFSCixADb3ZA=; b=sD+Vr0e78Fj5LpCtRb3uWep83WwKQRo/g4ssnchhCqBYPnssZZspZ62JReKpdxEZwh +DLej3UlSphblbAqfCqNEv4A1Z8/tFemqNzseW10oLom4NJoxa82q+XU8lQKPmsNQ9eG IAmYcv4W0XR3aAs+WAmW28fpEimKgYxnmqsB6Q6R5BtyA8azBmkfvUjCGndhKmD7/lYC UOGpj0/LtMXOhmJzenfT1Y40tyMqHBUDLZ4StgVeT6DMbNahGR35fNqtplsBcmeFKYRl LI3Oj0TJ5KhcHqbGqWpz7wLPBGygjU7awj7gBWQXDBRv/es8Ic54AQ2gstUcsbky3JdJ ZPXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=rB3773XPGQFFnLMNWpqnH0YQ0Ft9VoliFSCixADb3ZA=; b=Gda5Il0ubBSlQBQHBaGQc0TF89pj+H7xCS8cUsuwHVHuyUsj4IfSI+EiNIuQ9bgtok y2tbAHgx/oxilZBHD/WX1gFgifJjNFDOMgUPuB+bK4rrWCgj0Qs8YzV8NMeGXTgDDzUF fIuWxObvQbfYRYBzDMGoyJYTd9CHW8f0caPCsEjsK5sdRL3jetenavXHu5IgHL+1uxFS K9BQRl5g5e+UcgFJT3oWvfaxw8lHi6lfzC2gvORkH4wTWdqsHKmQdU6Qb4Jt+iG4Khwe M0q2/TxVMrdsr5KcsJ1cgaMysr0+7wZNaWPf8xOWBtLBI3rmQGHdYjNFJQ8DpQsTQhB3 tQug== X-Gm-Message-State: AN3rC/7tvFUcgy2H3nbRug8zBbOEPrvdqa/Tn/Po5mc93VNy8pKkoy6O eVdvqMkylqK/IdXepZboYihlaIt3iA== X-Received: by 10.36.172.106 with SMTP id m42mr5117167iti.82.1492630108979; Wed, 19 Apr 2017 12:28:28 -0700 (PDT) MIME-Version: 1.0 Sender: carpeddiem@gmail.com Received: by 10.107.30.136 with HTTP; Wed, 19 Apr 2017 12:28:08 -0700 (PDT) In-Reply-To: <20170419152257.GA59527@bsdpad.com> References: <201704152005.v3FK5M2j002459@repo.freebsd.org> <20170419142106.GA59031@bsdpad.com> <20170419145325.zjvo3hq2z3egcp26@ivaldir.net> <20170419152257.GA59527@bsdpad.com> From: Ed Maste Date: Wed, 19 Apr 2017 15:28:08 -0400 X-Google-Sender-Auth: asTOYtpwYi-5ZZ1eeTybqoGALaI Message-ID: Subject: Re: svn commit: r316978 - in head: contrib/zstd etc/mtree lib lib/libzstd share/mk usr.bin usr.bin/zstd To: Ruslan Bukin Cc: Baptiste Daroussin , "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.23 Precedence: list List-Id: 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, 19 Apr 2017 19:28:30 -0000 On 19 April 2017 at 11:22, Ruslan Bukin wrote: > > I committed. Please upstream that. As jhb pointed out we should probably add __bswapdi2 to compiler-rt (it's already there for ARM). I would assume that libgcc also has it, and this is a workaround for our slightly unusual case of GCC w/ a compiler-rt patched for RISC-V. If so this should not be sent upstream. From owner-svn-src-head@freebsd.org Wed Apr 19 19:52:41 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 91B03D462DF; Wed, 19 Apr 2017 19:52:41 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 61372E93; Wed, 19 Apr 2017 19:52:41 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3JJqeOf073607; Wed, 19 Apr 2017 19:52:40 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3JJqeft073606; Wed, 19 Apr 2017 19:52:40 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201704191952.v3JJqeft073606@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Wed, 19 Apr 2017 19:52:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317160 - head/usr.bin/which X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 19 Apr 2017 19:52:41 -0000 Author: ngie Date: Wed Apr 19 19:52:40 2017 New Revision: 317160 URL: https://svnweb.freebsd.org/changeset/base/317160 Log: Clean up trailing whitespace No functional changes MFC after: 1 week Sponsored by: Dell EMC Isilon Modified: head/usr.bin/which/which.c Modified: head/usr.bin/which/which.c ============================================================================== --- head/usr.bin/which/which.c Wed Apr 19 19:06:47 2017 (r317159) +++ head/usr.bin/which/which.c Wed Apr 19 19:52:40 2017 (r317160) @@ -39,7 +39,7 @@ __FBSDID("$FreeBSD$"); static void usage(void); static int print_matches(char *, char *); - + static int silent; static int allpaths; @@ -81,7 +81,7 @@ main(int argc, char **argv) while (argc > 0) { memcpy(path, p, pathlen); - + if (strlen(*argv) >= FILENAME_MAX || print_matches(path, *argv) == -1) status = EXIT_FAILURE; From owner-svn-src-head@freebsd.org Wed Apr 19 19:55:39 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AD6DDD4637F; Wed, 19 Apr 2017 19:55:39 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 74BFC8B; Wed, 19 Apr 2017 19:55:39 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3JJtc5q073779; Wed, 19 Apr 2017 19:55:38 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3JJtc04073778; Wed, 19 Apr 2017 19:55:38 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201704191955.v3JJtc04073778@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Wed, 19 Apr 2017 19:55:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317161 - head/usr.bin/which X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 19 Apr 2017 19:55:39 -0000 Author: ngie Date: Wed Apr 19 19:55:38 2017 New Revision: 317161 URL: https://svnweb.freebsd.org/changeset/base/317161 Log: which(1): sort #includes No functional change [intended]. MFC after: 7 weeks Sponsored by: Dell EMC Isilon Modified: head/usr.bin/which/which.c Modified: head/usr.bin/which/which.c ============================================================================== --- head/usr.bin/which/which.c Wed Apr 19 19:52:40 2017 (r317160) +++ head/usr.bin/which/which.c Wed Apr 19 19:55:38 2017 (r317161) @@ -28,9 +28,8 @@ __FBSDID("$FreeBSD$"); -#include #include - +#include #include #include #include From owner-svn-src-head@freebsd.org Wed Apr 19 20:04:47 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 40272D4666F; Wed, 19 Apr 2017 20:04:47 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0FBC09D7; Wed, 19 Apr 2017 20:04:46 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3JK4kdM077975; Wed, 19 Apr 2017 20:04:46 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3JK4ktw077974; Wed, 19 Apr 2017 20:04:46 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201704192004.v3JK4ktw077974@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Wed, 19 Apr 2017 20:04:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317162 - head/usr.sbin/rpcbind X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 19 Apr 2017 20:04:47 -0000 Author: ngie Date: Wed Apr 19 20:04:45 2017 New Revision: 317162 URL: https://svnweb.freebsd.org/changeset/base/317162 Log: rpcbind(8): add a description for /var/run/rpcbind.sock under the FILES section MFC after: 7 weeks Sponsored by: Dell EMC Isilon Modified: head/usr.sbin/rpcbind/rpcbind.8 Modified: head/usr.sbin/rpcbind/rpcbind.8 ============================================================================== --- head/usr.sbin/rpcbind/rpcbind.8 Wed Apr 19 19:55:38 2017 (r317161) +++ head/usr.sbin/rpcbind/rpcbind.8 Wed Apr 19 20:04:45 2017 (r317162) @@ -143,6 +143,7 @@ is restarted. .Sh FILES .Bl -tag -width /var/run/rpcbind.sock -compact .It Pa /var/run/rpcbind.sock +socket used for local connections. .El .Sh SEE ALSO .Xr rpcbind 3 , From owner-svn-src-head@freebsd.org Wed Apr 19 20:09:58 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5BA36D4678E; Wed, 19 Apr 2017 20:09:58 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from smtp.vangyzen.net (hotblack.vangyzen.net [IPv6:2607:fc50:1000:7400:216:3eff:fe72:314f]) by mx1.freebsd.org (Postfix) with ESMTP id 3ADD0D20; Wed, 19 Apr 2017 20:09:58 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from sweettea.beer.town (unknown [76.164.8.130]) by smtp.vangyzen.net (Postfix) with ESMTPSA id 805FA56678; Wed, 19 Apr 2017 15:09:57 -0500 (CDT) Subject: Re: svn commit: r317094 - head/share/mk To: rgrimes@freebsd.org, John Baldwin References: <201704191633.v3JGXWmu031427@pdx.rh.CN85.dnsmgr.net> Cc: Slawa Olhovchenkov , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org From: Eric van Gyzen Message-ID: Date: Wed, 19 Apr 2017 15:09:56 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 In-Reply-To: <201704191633.v3JGXWmu031427@pdx.rh.CN85.dnsmgr.net> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 19 Apr 2017 20:09:58 -0000 >>>>> Generating core.txt now complety broken? >>>> >>>> No. crashinfo has supported gdb from ports for quite a while now. >>>> If you 'pkg install gdb' crashinfo defaults to using the ports gdb over >>>> the base one already. >>> >>> I am about clean install, w/o ports. >> >> Until we get some sort of klldb support that will not work. However, >> we already have platforms now where /usr/bin/gdb doesn't work for that. >> riscv and aarch64 aren't supported in ancient gdb, and the MIPS >> /usr/bin/gdb didn't really work for me in my testing. > > So we break what worked on a Tier1 Platform? With my "user" hat on > these are the exact kind of breakages that send me looking for another > platform to run on. We far to often just go oh you can do X y and Z > to get around what we broke forgetting that the user 6 months from now > when this hits a release isnt gona come ask, he may just go down the > road to something else. > > Remove gdb WHEN klldb can replace it, not a day before. Using "oh its > broken on aarch64 and mips" is not a reason to break things on i386/amd64. > > Yes, I know we want to get gnu stuff out of the tree, but that needs > to come AFTER a proper replacement is avaliable. > >> >>> Also, how to generate core.txt after crash, reboot and install gdb >>> from ports? (port instaled after crash) >> >> You can always run crashinfo by hand. > > /me starts to look for a new OS, this one is not very good at user support. # crashinfo Please install GDB and run 'crashinfo' again. The easiest way to install GDB is: pkg install gdb Unable to find matching kernel for /var/crash/vmcore.1 https://reviews.freebsd.org/D10429 This should be good enough to keep the user from looking for a new OS. It also gets a much better version of GDB onto the box, which will make the user happier than giving them an ancient one and letting them flail around with it for a while before learning that they should install a newer one. Eric From owner-svn-src-head@freebsd.org Wed Apr 19 20:23:28 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 71835D46C23; Wed, 19 Apr 2017 20:23:28 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3D6AA18AD; Wed, 19 Apr 2017 20:23:28 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3JKNRw6086799; Wed, 19 Apr 2017 20:23:27 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3JKNRuZ086798; Wed, 19 Apr 2017 20:23:27 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201704192023.v3JKNRuZ086798@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Wed, 19 Apr 2017 20:23:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317163 - head/usr.sbin/rpcbind X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 19 Apr 2017 20:23:28 -0000 Author: ngie Date: Wed Apr 19 20:23:27 2017 New Revision: 317163 URL: https://svnweb.freebsd.org/changeset/base/317163 Log: rpcbind(8): post-humously document -w (warmstart) support added in r74462 warmstart support saves portmap/rpcbind(8) registration state on exit and restores the saved registration state on restart. MFC after: 7 weeks Sponsored by: Dell EMC Isilon Modified: head/usr.sbin/rpcbind/rpcbind.8 Modified: head/usr.sbin/rpcbind/rpcbind.8 ============================================================================== --- head/usr.sbin/rpcbind/rpcbind.8 Wed Apr 19 20:04:45 2017 (r317162) +++ head/usr.sbin/rpcbind/rpcbind.8 Wed Apr 19 20:23:27 2017 (r317163) @@ -10,7 +10,7 @@ .Nd universal addresses to RPC program number mapper .Sh SYNOPSIS .Nm -.Op Fl 6adiLlsW +.Op Fl 6adiLlswW .Op Fl h Ar bindip .Sh DESCRIPTION The @@ -135,6 +135,22 @@ clients from using to connect to services from a privileged port. .It Fl W Enable libwrap (TCP wrappers) support. +.It Fl w +Enable the warmstart feature. +.Pp +The warmstart feature saves RPC registrations on termination. +Any saved RPC registrations are restored on restart if +.Fl w +is specified. +This feature helps avoid RPC service interruption when restarting +.Nm . +warmstart support must be compiled in to +.Nm . +Portmap registrations are stored in +.Pa /tmp/portmap.file . +.Nm +registrations are stored in +.Pa /tmp/rpcbind.file . .El .Sh NOTES All RPC servers must be restarted if @@ -142,6 +158,12 @@ All RPC servers must be restarted if is restarted. .Sh FILES .Bl -tag -width /var/run/rpcbind.sock -compact +.It Pa /tmp/portmap.file +saved portmap registrations file. +.It Pa /tmp/rpcbind.file +saved +.Nm +registrations file. .It Pa /var/run/rpcbind.sock socket used for local connections. .El From owner-svn-src-head@freebsd.org Wed Apr 19 20:27:15 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 32C64D46CE8; Wed, 19 Apr 2017 20:27:15 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ED0911A48; Wed, 19 Apr 2017 20:27:14 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3JKRE2M086971; Wed, 19 Apr 2017 20:27:14 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3JKREdh086970; Wed, 19 Apr 2017 20:27:14 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201704192027.v3JKREdh086970@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Wed, 19 Apr 2017 20:27:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317164 - head/usr.sbin/rpcbind X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 19 Apr 2017 20:27:15 -0000 Author: ngie Date: Wed Apr 19 20:27:13 2017 New Revision: 317164 URL: https://svnweb.freebsd.org/changeset/base/317164 Log: Fix indentation per style.Makefile(5) MFC after: 7 weeks Sponsored by: Dell EMC Isilon Modified: head/usr.sbin/rpcbind/Makefile Modified: head/usr.sbin/rpcbind/Makefile ============================================================================== --- head/usr.sbin/rpcbind/Makefile Wed Apr 19 20:23:27 2017 (r317163) +++ head/usr.sbin/rpcbind/Makefile Wed Apr 19 20:27:13 2017 (r317164) @@ -15,12 +15,12 @@ CFLAGS+= -DINET6 .endif .if ${MK_TCP_WRAPPERS} != "no" -CFLAGS+= -DLIBWRAP -LIBADD+= wrap +CFLAGS+= -DLIBWRAP +LIBADD+= wrap .endif .if ${MK_TESTS} != "no" -SUBDIR+= tests +SUBDIR+= tests .endif WARNS?= 1 From owner-svn-src-head@freebsd.org Wed Apr 19 20:27:50 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 38F05D46D4C; Wed, 19 Apr 2017 20:27:50 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0961E1BC2; Wed, 19 Apr 2017 20:27:49 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3JKRnrW087042; Wed, 19 Apr 2017 20:27:49 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3JKRnOa087041; Wed, 19 Apr 2017 20:27:49 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201704192027.v3JKRnOa087041@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Wed, 19 Apr 2017 20:27:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317165 - head/usr.bin/pom X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 19 Apr 2017 20:27:50 -0000 Author: manu Date: Wed Apr 19 20:27:48 2017 New Revision: 317165 URL: https://svnweb.freebsd.org/changeset/base/317165 Log: Capsicumize pom Since pom is the only binary that can save lives, capsicumize it to be sure that it's safe to run it. Reviewed by: bapt Modified: head/usr.bin/pom/pom.c Modified: head/usr.bin/pom/pom.c ============================================================================== --- head/usr.bin/pom/pom.c Wed Apr 19 20:27:13 2017 (r317164) +++ head/usr.bin/pom/pom.c Wed Apr 19 20:27:48 2017 (r317165) @@ -53,6 +53,11 @@ __FBSDID("$FreeBSD$"); * */ +#include +#include + +#include +#include #include #include #include @@ -81,6 +86,7 @@ static void usage(char *progname); int main(int argc, char **argv) { + cap_rights_t rights; time_t tt; struct tm GMT, tmd; double days, today, tomorrow; @@ -88,6 +94,14 @@ main(int argc, char **argv) char *odate = NULL, *otime = NULL; char *progname = argv[0]; + if (caph_limit_stdio() < 0) + err(1, "unable to limit capabitilities for stdio"); + cap_rights_init(&rights, CAP_WRITE); + + caph_cache_catpages(); + if (cap_enter() < 0 && errno != ENOSYS) + err(1, "unable to enter capability mode"); + while ((ch = getopt(argc, argv, "d:pt:")) != -1) switch (ch) { case 'd': From owner-svn-src-head@freebsd.org Wed Apr 19 20:35:05 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CE4C3D4602A; Wed, 19 Apr 2017 20:35:05 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9E7F9279; Wed, 19 Apr 2017 20:35:05 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3JKZ4sC091187; Wed, 19 Apr 2017 20:35:04 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3JKZ4kY091186; Wed, 19 Apr 2017 20:35:04 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201704192035.v3JKZ4kY091186@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Wed, 19 Apr 2017 20:35:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317166 - head/usr.bin/pom X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 19 Apr 2017 20:35:05 -0000 Author: manu Date: Wed Apr 19 20:35:04 2017 New Revision: 317166 URL: https://svnweb.freebsd.org/changeset/base/317166 Log: pom: Remove useless cap_rights_init Pointy-Hat: manu Reported by: bapt Modified: head/usr.bin/pom/pom.c Modified: head/usr.bin/pom/pom.c ============================================================================== --- head/usr.bin/pom/pom.c Wed Apr 19 20:27:48 2017 (r317165) +++ head/usr.bin/pom/pom.c Wed Apr 19 20:35:04 2017 (r317166) @@ -86,7 +86,6 @@ static void usage(char *progname); int main(int argc, char **argv) { - cap_rights_t rights; time_t tt; struct tm GMT, tmd; double days, today, tomorrow; @@ -96,7 +95,6 @@ main(int argc, char **argv) if (caph_limit_stdio() < 0) err(1, "unable to limit capabitilities for stdio"); - cap_rights_init(&rights, CAP_WRITE); caph_cache_catpages(); if (cap_enter() < 0 && errno != ENOSYS) From owner-svn-src-head@freebsd.org Wed Apr 19 20:35:48 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9BFEBD4608D; Wed, 19 Apr 2017 20:35:48 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6C69F5EE; Wed, 19 Apr 2017 20:35:48 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3JKZl76091262; Wed, 19 Apr 2017 20:35:47 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3JKZlCa091261; Wed, 19 Apr 2017 20:35:47 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201704192035.v3JKZlCa091261@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Wed, 19 Apr 2017 20:35:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317167 - head/tools/build/options X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 19 Apr 2017 20:35:48 -0000 Author: ngie Date: Wed Apr 19 20:35:47 2017 New Revision: 317167 URL: https://svnweb.freebsd.org/changeset/base/317167 Log: Add WITH_CXX to complement WITHOUT_CXX and placate makeman's complaints MFC after: 7 weeks Sponsored by: Dell EMC Isilon Added: head/tools/build/options/WITH_CXX - copied, changed from r317153, head/tools/build/options/WITHOUT_CXX Copied and modified: head/tools/build/options/WITH_CXX (from r317153, head/tools/build/options/WITHOUT_CXX) ============================================================================== --- head/tools/build/options/WITHOUT_CXX Wed Apr 19 17:32:32 2017 (r317153, copy source) +++ head/tools/build/options/WITH_CXX Wed Apr 19 20:35:47 2017 (r317167) @@ -1,8 +1,4 @@ .\" $FreeBSD$ -Set to not build +Set to build .Xr c++ 1 and related libraries. -It will also prevent building of -.Xr gperf 1 -and -.Xr devd 8 . From owner-svn-src-head@freebsd.org Wed Apr 19 20:45:47 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E59BCD463B9; Wed, 19 Apr 2017 20:45:47 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9BD16CF2; Wed, 19 Apr 2017 20:45:47 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3JKjkIZ095438; Wed, 19 Apr 2017 20:45:46 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3JKjkgh095435; Wed, 19 Apr 2017 20:45:46 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201704192045.v3JKjkgh095435@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Wed, 19 Apr 2017 20:45:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317168 - in head: share/mk tools/build/options usr.sbin/rpcbind X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 19 Apr 2017 20:45:48 -0000 Author: ngie Date: Wed Apr 19 20:45:46 2017 New Revision: 317168 URL: https://svnweb.freebsd.org/changeset/base/317168 Log: Add a knob, WITH*_RPCBIND_WARMSTART_SUPPORT, to allow the end-user to build rpcbind(8) with/without warmstart support. The knob defaults to off to preserve POLA for the feature. See rpcbind(8) for more details about the warmstart feature. MFC after: 7 weeks Relnotes: yes Sponsored by: Dell EMC Isilon Added: head/tools/build/options/WITH_RPCBIND_WARMSTART_SUPPORT (contents, props changed) Modified: head/share/mk/src.opts.mk head/usr.sbin/rpcbind/Makefile Modified: head/share/mk/src.opts.mk ============================================================================== --- head/share/mk/src.opts.mk Wed Apr 19 20:35:47 2017 (r317167) +++ head/share/mk/src.opts.mk Wed Apr 19 20:45:46 2017 (r317168) @@ -186,6 +186,7 @@ __DEFAULT_NO_OPTIONS = \ OFED \ OPENLDAP \ REPRODUCIBLE_BUILD \ + RPCBIND_WARMSTART_SUPPORT \ SHARED_TOOLCHAIN \ SORT_THREADS \ SVN \ Added: head/tools/build/options/WITH_RPCBIND_WARMSTART_SUPPORT ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITH_RPCBIND_WARMSTART_SUPPORT Wed Apr 19 20:45:46 2017 (r317168) @@ -0,0 +1,4 @@ +.\" $FreeBSD$ +Set to build +.Xr rpcbind 8 +with warmstart support. Modified: head/usr.sbin/rpcbind/Makefile ============================================================================== --- head/usr.sbin/rpcbind/Makefile Wed Apr 19 20:35:47 2017 (r317167) +++ head/usr.sbin/rpcbind/Makefile Wed Apr 19 20:45:46 2017 (r317168) @@ -14,6 +14,10 @@ CFLAGS+= -DPORTMAP CFLAGS+= -DINET6 .endif +.if ${MK_RPCBIND_WARMSTART_SUPPORT} != "no" +CFLAGS+= -DWARMSTART +.endif + .if ${MK_TCP_WRAPPERS} != "no" CFLAGS+= -DLIBWRAP LIBADD+= wrap From owner-svn-src-head@freebsd.org Wed Apr 19 21:18:08 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F38ABD46E9B; Wed, 19 Apr 2017 21:18:07 +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 mx1.freebsd.org (Postfix) with ESMTPS id C32D0117C; Wed, 19 Apr 2017 21:18:07 +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 v3JLI6Ij008075; Wed, 19 Apr 2017 21:18:06 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3JLI6QA008074; Wed, 19 Apr 2017 21:18:06 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201704192118.v3JLI6QA008074@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Wed, 19 Apr 2017 21:18:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317169 - head/release/tools X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 19 Apr 2017 21:18:08 -0000 Author: gjb Date: Wed Apr 19 21:18:06 2017 New Revision: 317169 URL: https://svnweb.freebsd.org/changeset/base/317169 Log: Trim trailing '/release/..' when setting _OBJDIR so arm64/aarch64 boot1.efifat is properly located when creating virtual machine images. Sponsored by: The FreeBSD Foundation Modified: head/release/tools/vmimage.subr Modified: head/release/tools/vmimage.subr ============================================================================== --- head/release/tools/vmimage.subr Wed Apr 19 20:45:46 2017 (r317168) +++ head/release/tools/vmimage.subr Wed Apr 19 21:18:06 2017 (r317169) @@ -15,6 +15,7 @@ write_partition_layout() { fi _OBJDIR="$(make -C ${WORLDDIR} -V .OBJDIR)" + _OBJDIR="$(realpath ${_OBJDIR})" if [ -d "${_OBJDIR%%/usr/src}/${TARGET}.${TARGET_ARCH}" ]; then BOOTFILES="/${_OBJDIR%%/usr/src}/${TARGET}.${TARGET_ARCH}/usr/src/sys/boot" else From owner-svn-src-head@freebsd.org Wed Apr 19 22:18:36 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7FA0BD46E57; Wed, 19 Apr 2017 22:18:36 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5242DF24; Wed, 19 Apr 2017 22:18:35 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id v3JMIYtM032775; Wed, 19 Apr 2017 15:18:34 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id v3JMIYtS032774; Wed, 19 Apr 2017 15:18:34 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201704192218.v3JMIYtS032774@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r317094 - head/share/mk In-Reply-To: To: Eric van Gyzen Date: Wed, 19 Apr 2017 15:18:34 -0700 (PDT) CC: rgrimes@FreeBSD.org, John Baldwin , Slawa Olhovchenkov , svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Reply-To: rgrimes@FreeBSD.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 19 Apr 2017 22:18:36 -0000 [ Charset windows-1252 unsupported, converting... ] > >>>>> Generating core.txt now complety broken? > >>>> > >>>> No. crashinfo has supported gdb from ports for quite a while now. > >>>> If you 'pkg install gdb' crashinfo defaults to using the ports gdb over > >>>> the base one already. > >>> > >>> I am about clean install, w/o ports. > >> > >> Until we get some sort of klldb support that will not work. However, > >> we already have platforms now where /usr/bin/gdb doesn't work for that. > >> riscv and aarch64 aren't supported in ancient gdb, and the MIPS > >> /usr/bin/gdb didn't really work for me in my testing. > > > > So we break what worked on a Tier1 Platform? With my "user" hat on > > these are the exact kind of breakages that send me looking for another > > platform to run on. We far to often just go oh you can do X y and Z > > to get around what we broke forgetting that the user 6 months from now > > when this hits a release isnt gona come ask, he may just go down the > > road to something else. > > > > Remove gdb WHEN klldb can replace it, not a day before. Using "oh its > > broken on aarch64 and mips" is not a reason to break things on i386/amd64. > > > > Yes, I know we want to get gnu stuff out of the tree, but that needs > > to come AFTER a proper replacement is avaliable. > > > >> > >>> Also, how to generate core.txt after crash, reboot and install gdb > >>> from ports? (port instaled after crash) > >> > >> You can always run crashinfo by hand. > > > > /me starts to look for a new OS, this one is not very good at user support. > > # crashinfo > Please install GDB and run 'crashinfo' again. > The easiest way to install GDB is: pkg install gdb > Unable to find matching kernel for /var/crash/vmcore.1 > > https://reviews.freebsd.org/D10429 > > This should be good enough to keep the user from looking for a new OS. > It also gets a much better version of GDB onto the box, which will make > the user happier than giving them an ancient one and letting them flail > around with it for a while before learning that they should install a > newer one. Actually this is exactly what I would expect from Linux! Why do we need to pull the trigger on GDB other than to pull the trigger to say we are GPL free, if that is the reason then this is the wrong way to go about it. As I said, pull the trigger when you have a new tool in base to replace what I have expected to be in base, have been using in base for 2.5 decades, and not a day before. Your fixing a single point issue, crashinfo, where is my debugger, and why cant it do the crashinfo stuff??? -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Wed Apr 19 22:20:42 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E887FD46EF6; Wed, 19 Apr 2017 22:20:42 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BAE7D100; Wed, 19 Apr 2017 22:20:42 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3JMKfr1032780; Wed, 19 Apr 2017 22:20:41 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3JMKftj032754; Wed, 19 Apr 2017 22:20:41 GMT (envelope-from np@FreeBSD.org) Message-Id: <201704192220.v3JMKftj032754@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Wed, 19 Apr 2017 22:20:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317170 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 19 Apr 2017 22:20:43 -0000 Author: np Date: Wed Apr 19 22:20:41 2017 New Revision: 317170 URL: https://svnweb.freebsd.org/changeset/base/317170 Log: Remove redundant assignment. Modified: head/sys/netinet/tcp_lro.c Modified: head/sys/netinet/tcp_lro.c ============================================================================== --- head/sys/netinet/tcp_lro.c Wed Apr 19 21:18:06 2017 (r317169) +++ head/sys/netinet/tcp_lro.c Wed Apr 19 22:20:41 2017 (r317170) @@ -115,7 +115,6 @@ tcp_lro_init_args(struct lro_ctrl *lc, s lc->lro_bad_csum = 0; lc->lro_queued = 0; lc->lro_flushed = 0; - lc->lro_cnt = 0; lc->lro_mbuf_count = 0; lc->lro_mbuf_max = lro_mbufs; lc->lro_cnt = lro_entries; From owner-svn-src-head@freebsd.org Wed Apr 19 22:21:16 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DD454D46F62; Wed, 19 Apr 2017 22:21:16 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8F5845E7; Wed, 19 Apr 2017 22:21:16 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3JMLF69032867; Wed, 19 Apr 2017 22:21:15 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3JMLFPs032866; Wed, 19 Apr 2017 22:21:15 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201704192221.v3JMLFPs032866@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Wed, 19 Apr 2017 22:21:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317171 - head/sys/dev/vt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 19 Apr 2017 22:21:17 -0000 Author: jkim Date: Wed Apr 19 22:21:15 2017 New Revision: 317171 URL: https://svnweb.freebsd.org/changeset/base/317171 Log: Micro-optimize vt_set_border(). Modified: head/sys/dev/vt/vt_core.c Modified: head/sys/dev/vt/vt_core.c ============================================================================== --- head/sys/dev/vt/vt_core.c Wed Apr 19 22:20:41 2017 (r317170) +++ head/sys/dev/vt/vt_core.c Wed Apr 19 22:21:15 2017 (r317171) @@ -1528,43 +1528,32 @@ vtterm_opened(struct terminal *tm, int o VT_UNLOCK(vd); } -static int +static void vt_set_border(struct vt_window *vw, term_color_t c) { struct vt_device *vd = vw->vw_device; - - if (vd->vd_driver->vd_drawrect == NULL) - return (ENOTSUP); + term_rect_t *vda = &vw->vw_draw_area; + int x, y; /* Top bar. */ - if (vw->vw_draw_area.tr_begin.tp_row > 0) - vd->vd_driver->vd_drawrect(vd, - 0, 0, - vd->vd_width - 1, vw->vw_draw_area.tr_begin.tp_row - 1, - 1, c); - - /* Left bar. */ - if (vw->vw_draw_area.tr_begin.tp_col > 0) - vd->vd_driver->vd_drawrect(vd, - 0, 0, - vw->vw_draw_area.tr_begin.tp_col - 1, vd->vd_height - 1, - 1, c); - - /* Right bar. */ - if (vw->vw_draw_area.tr_end.tp_col < vd->vd_width) - vd->vd_driver->vd_drawrect(vd, - vw->vw_draw_area.tr_end.tp_col - 1, 0, - vd->vd_width - 1, vd->vd_height - 1, - 1, c); + for (y = 0; y < vda->tr_begin.tp_row; y++) + for (x = 0; x < vd->vd_width; x++) + vd->vd_driver->vd_setpixel(vd, x, y, c); + + for (y = vda->tr_begin.tp_row; y <= vda->tr_end.tp_row; y++) { + /* Left bar. */ + for (x = 0; x < vda->tr_begin.tp_col; x++) + vd->vd_driver->vd_setpixel(vd, x, y, c); + + /* Right bar. */ + for (x = vda->tr_end.tp_col + 1; x < vd->vd_width; x++) + vd->vd_driver->vd_setpixel(vd, x, y, c); + } /* Bottom bar. */ - if (vw->vw_draw_area.tr_end.tp_row < vd->vd_height) - vd->vd_driver->vd_drawrect(vd, - 0, vw->vw_draw_area.tr_end.tp_row - 1, - vd->vd_width - 1, vd->vd_height - 1, - 1, c); - - return (0); + for (y = vda->tr_end.tp_row + 1; y < vd->vd_height; y++) + for (x = 0; x < vd->vd_width; x++) + vd->vd_driver->vd_setpixel(vd, x, y, c); } static int From owner-svn-src-head@freebsd.org Wed Apr 19 22:22:42 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 38C9DD460DB for ; Wed, 19 Apr 2017 22:22:42 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x22c.google.com (mail-io0-x22c.google.com [IPv6:2607:f8b0:4001:c06::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F11348DF for ; Wed, 19 Apr 2017 22:22:41 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x22c.google.com with SMTP id r16so39350378ioi.2 for ; Wed, 19 Apr 2017 15:22:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=GAiPBWudWD8ejv3f3l3MWsNlaP9NSMIc83VMFWqtgPY=; b=vl8zuEmoegwYQdnImrU71wrnfkr6mxCbBgbuFG8+87i/55iYSAKUY7pWjgCfu+9d+v X5UDwYIKVCwTlCQSKSrhkltHlyoxD8b5+FsnIdG2ikTJAv5SiUHryZHXkJxR4EQmJODa xKfC26vSwPgiIlTgaEKNKgVUAUTKtEEFXO3X/zj7ei1wLLV+V+NERh1IxjoiVi5DQd4J /sQVOamSQXtagPAncIDVXqpoKr94sqO3sxliziXg+LqO2nWCq6ymivAi9ztYtooGTOLl CpD46+f3v9YU0P9RLWDZ9BU9fTCPGwwmkv0ylXq0g7lfGbBFAplj2XoziEmyzEpzzZxp +3dQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=GAiPBWudWD8ejv3f3l3MWsNlaP9NSMIc83VMFWqtgPY=; b=txIRS2q6d469EWUZItUhQSkGzQ6zt/eplPqnM0tunhDyzB6yBxxzNMVzoXeGXSYToR /w2yyQB1AJrU4xasQcvVKc7NJ/nuA0UI+4NOG0eXHxMo18Dn2bmNyIW+ZTlJyeXkDZWU JOW2SDbI5EjH6rwBA2ycT86xcX54VSS+0gdSKYsALn2y8NBi6v7IroRBoxC+iv236TB9 ImnqrL/ivJP72hg3Rj/DGe2txLM6Hr43JI1Gnr25A7pdRVq/aDu6sOWrxA+ayM8CQ9iK QUBv089D7Kgt7JCTRxMxH4Zcs6iQY/nkVonNfZ58+Bkn4tWKq7fQsz7Qw36NHDzgH5QN GTAg== X-Gm-Message-State: AN3rC/4hAw2tdlArLQgI0482nIJdnkgnK0iJlo7/yi5ZBUKkEhmt0Kfl zKlE54B80GWq6h6hOGdkBfQ7eVz0Sg== X-Received: by 10.36.31.200 with SMTP id d191mr327671itd.85.1492640559669; Wed, 19 Apr 2017 15:22:39 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.146.69 with HTTP; Wed, 19 Apr 2017 15:22:39 -0700 (PDT) X-Originating-IP: [2607:fb10:7021:1::68] In-Reply-To: <201704192218.v3JMIYtS032774@pdx.rh.CN85.dnsmgr.net> References: <201704192218.v3JMIYtS032774@pdx.rh.CN85.dnsmgr.net> From: Warner Losh Date: Wed, 19 Apr 2017 16:22:39 -0600 X-Google-Sender-Auth: 8L6LxEvN6Hsm9SEcRgmLHKp_wTo Message-ID: Subject: Re: svn commit: r317094 - head/share/mk To: rgrimes@freebsd.org Cc: Eric van Gyzen , John Baldwin , Slawa Olhovchenkov , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , src-committers Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 19 Apr 2017 22:22:42 -0000 On Wed, Apr 19, 2017 at 4:18 PM, Rodney W. Grimes wrote: > [ Charset windows-1252 unsupported, converting... ] >> >>>>> Generating core.txt now complety broken? >> >>>> >> >>>> No. crashinfo has supported gdb from ports for quite a while now. >> >>>> If you 'pkg install gdb' crashinfo defaults to using the ports gdb over >> >>>> the base one already. >> >>> >> >>> I am about clean install, w/o ports. >> >> >> >> Until we get some sort of klldb support that will not work. However, >> >> we already have platforms now where /usr/bin/gdb doesn't work for that. >> >> riscv and aarch64 aren't supported in ancient gdb, and the MIPS >> >> /usr/bin/gdb didn't really work for me in my testing. >> > >> > So we break what worked on a Tier1 Platform? With my "user" hat on >> > these are the exact kind of breakages that send me looking for another >> > platform to run on. We far to often just go oh you can do X y and Z >> > to get around what we broke forgetting that the user 6 months from now >> > when this hits a release isnt gona come ask, he may just go down the >> > road to something else. >> > >> > Remove gdb WHEN klldb can replace it, not a day before. Using "oh its >> > broken on aarch64 and mips" is not a reason to break things on i386/amd64. >> > >> > Yes, I know we want to get gnu stuff out of the tree, but that needs >> > to come AFTER a proper replacement is avaliable. >> > >> >> >> >>> Also, how to generate core.txt after crash, reboot and install gdb >> >>> from ports? (port instaled after crash) >> >> >> >> You can always run crashinfo by hand. >> > >> > /me starts to look for a new OS, this one is not very good at user support. >> >> # crashinfo >> Please install GDB and run 'crashinfo' again. >> The easiest way to install GDB is: pkg install gdb >> Unable to find matching kernel for /var/crash/vmcore.1 >> >> https://reviews.freebsd.org/D10429 >> >> This should be good enough to keep the user from looking for a new OS. >> It also gets a much better version of GDB onto the box, which will make >> the user happier than giving them an ancient one and letting them flail >> around with it for a while before learning that they should install a >> newer one. > > Actually this is exactly what I would expect from Linux! > > Why do we need to pull the trigger on GDB other than to pull the trigger > to say we are GPL free, if that is the reason then this is the wrong > way to go about it. I think "gdb in base is horribly broken" is the real reason. You need the port to do anything non-trivial these days. Plus core set this as a goal for the project after it was clear that was a consensus desire several years ago. Can't fault someone for working towards that goal. > As I said, pull the trigger when you have a new tool in base to replace > what I have expected to be in base, have been using in base for 2.5 > decades, and not a day before. > > Your fixing a single point issue, crashinfo, where is my debugger, and > why cant it do the crashinfo stuff??? Things break with progress. That's always been true. We lost functionality when we kicked perl and TCL out of the tree. We lost functionality when we kicked sysinstall to the curb, etc. However, we've also gained functionality as well with things like clang. It's always balancing act. I think we've bent over too far backwards with gdb, and it's time to kick it to the curb entirely. Warner From owner-svn-src-head@freebsd.org Wed Apr 19 22:27:28 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0DC54D461EF; Wed, 19 Apr 2017 22:27:28 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D41F8B76; Wed, 19 Apr 2017 22:27:27 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3JMRR0b036044; Wed, 19 Apr 2017 22:27:27 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3JMRRxS036043; Wed, 19 Apr 2017 22:27:27 GMT (envelope-from np@FreeBSD.org) Message-Id: <201704192227.v3JMRRxS036043@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Wed, 19 Apr 2017 22:27:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317172 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 19 Apr 2017 22:27:28 -0000 Author: np Date: Wed Apr 19 22:27:26 2017 New Revision: 317172 URL: https://svnweb.freebsd.org/changeset/base/317172 Log: Do not leak lro_hash on failure to allocate lro_mbuf_data. MFC after: 1 week Modified: head/sys/netinet/tcp_lro.c Modified: head/sys/netinet/tcp_lro.c ============================================================================== --- head/sys/netinet/tcp_lro.c Wed Apr 19 22:21:15 2017 (r317171) +++ head/sys/netinet/tcp_lro.c Wed Apr 19 22:27:26 2017 (r317172) @@ -144,6 +144,7 @@ tcp_lro_init_args(struct lro_ctrl *lc, s /* check for out of memory */ if (lc->lro_mbuf_data == NULL) { + free(lc->lro_hash, M_LRO); memset(lc, 0, sizeof(*lc)); return (ENOMEM); } From owner-svn-src-head@freebsd.org Wed Apr 19 22:31:46 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5C1CED46321; Wed, 19 Apr 2017 22:31:46 +0000 (UTC) (envelope-from linimon@lonesome.com) Received: from mail.soaustin.net (mail.soaustin.net [192.108.105.60]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.soaustin.net", Issuer "StartCom Class 2 IV Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 40B23FC7; Wed, 19 Apr 2017 22:31:45 +0000 (UTC) (envelope-from linimon@lonesome.com) Received: from lonesome.com (bones.soaustin.net [192.108.105.22]) by mail.soaustin.net (Postfix) with ESMTPSA id 17EDD5FE; Wed, 19 Apr 2017 17:31:39 -0500 (CDT) Date: Wed, 19 Apr 2017 17:31:38 -0500 From: Mark Linimon To: Warner Losh Cc: rgrimes@freebsd.org, src-committers , John Baldwin , "svn-src-all@freebsd.org" , Eric van Gyzen , Slawa Olhovchenkov , "svn-src-head@freebsd.org" Subject: Re: svn commit: r317094 - head/share/mk Message-ID: <20170419223137.GA29669@lonesome.com> References: <201704192218.v3JMIYtS032774@pdx.rh.CN85.dnsmgr.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 19 Apr 2017 22:31:46 -0000 At this point is there anything that the gdb port does not do, that the base version does? I know a lot of work has gone into making it a strict superset. mcl From owner-svn-src-head@freebsd.org Wed Apr 19 22:41:25 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AEC08D4667C; Wed, 19 Apr 2017 22:41:25 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6D2401393; Wed, 19 Apr 2017 22:41:25 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3JMfOs3040944; Wed, 19 Apr 2017 22:41:24 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3JMfOCo040943; Wed, 19 Apr 2017 22:41:24 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201704192241.v3JMfOCo040943@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Wed, 19 Apr 2017 22:41:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317173 - head/sys/dev/vt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 19 Apr 2017 22:41:25 -0000 Author: jkim Date: Wed Apr 19 22:41:24 2017 New Revision: 317173 URL: https://svnweb.freebsd.org/changeset/base/317173 Log: Always clear borders when the terminal is flushed. PR: 202288 Modified: head/sys/dev/vt/vt_core.c Modified: head/sys/dev/vt/vt_core.c ============================================================================== --- head/sys/dev/vt/vt_core.c Wed Apr 19 22:27:26 2017 (r317172) +++ head/sys/dev/vt/vt_core.c Wed Apr 19 22:41:24 2017 (r317173) @@ -1149,6 +1149,34 @@ vt_mark_mouse_position_as_dirty(struct v } #endif +static void +vt_set_border(struct vt_window *vw, term_color_t c) +{ + struct vt_device *vd = vw->vw_device; + term_rect_t *vda = &vw->vw_draw_area; + int x, y; + + /* Top bar. */ + for (y = 0; y < vda->tr_begin.tp_row; y++) + for (x = 0; x < vd->vd_width; x++) + vd->vd_driver->vd_setpixel(vd, x, y, c); + + for (y = vda->tr_begin.tp_row; y <= vda->tr_end.tp_row; y++) { + /* Left bar. */ + for (x = 0; x < vda->tr_begin.tp_col; x++) + vd->vd_driver->vd_setpixel(vd, x, y, c); + + /* Right bar. */ + for (x = vda->tr_end.tp_col + 1; x < vd->vd_width; x++) + vd->vd_driver->vd_setpixel(vd, x, y, c); + } + + /* Bottom bar. */ + for (y = vda->tr_end.tp_row + 1; y < vd->vd_height; y++) + for (x = 0; x < vd->vd_width; x++) + vd->vd_driver->vd_setpixel(vd, x, y, c); +} + static int vt_flush(struct vt_device *vd) { @@ -1214,6 +1242,7 @@ vt_flush(struct vt_device *vd) if (vd->vd_flags & VDF_INVALID) { vd->vd_flags &= ~VDF_INVALID; + vt_set_border(vw, TC_BLACK); vt_termrect(vd, vf, &tarea); if (vt_draw_logo_cpus) vtterm_draw_cpu_logos(vd); @@ -1528,34 +1557,6 @@ vtterm_opened(struct terminal *tm, int o VT_UNLOCK(vd); } -static void -vt_set_border(struct vt_window *vw, term_color_t c) -{ - struct vt_device *vd = vw->vw_device; - term_rect_t *vda = &vw->vw_draw_area; - int x, y; - - /* Top bar. */ - for (y = 0; y < vda->tr_begin.tp_row; y++) - for (x = 0; x < vd->vd_width; x++) - vd->vd_driver->vd_setpixel(vd, x, y, c); - - for (y = vda->tr_begin.tp_row; y <= vda->tr_end.tp_row; y++) { - /* Left bar. */ - for (x = 0; x < vda->tr_begin.tp_col; x++) - vd->vd_driver->vd_setpixel(vd, x, y, c); - - /* Right bar. */ - for (x = vda->tr_end.tp_col + 1; x < vd->vd_width; x++) - vd->vd_driver->vd_setpixel(vd, x, y, c); - } - - /* Bottom bar. */ - for (y = vda->tr_end.tp_row + 1; y < vd->vd_height; y++) - for (x = 0; x < vd->vd_width; x++) - vd->vd_driver->vd_setpixel(vd, x, y, c); -} - static int vt_change_font(struct vt_window *vw, struct vt_font *vf) { @@ -1621,7 +1622,6 @@ vt_change_font(struct vt_window *vw, str /* Force a full redraw the next timer tick. */ if (vd->vd_curwindow == vw) { - vt_set_border(vw, TC_BLACK); vd->vd_flags |= VDF_INVALID; vt_resume_flush_timer(vw->vw_device, 0); } From owner-svn-src-head@freebsd.org Wed Apr 19 22:43:12 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ED28AD4671C; Wed, 19 Apr 2017 22:43:12 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BEFF11777; Wed, 19 Apr 2017 22:43:12 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3JMhBuP044116; Wed, 19 Apr 2017 22:43:11 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3JMhB7a044115; Wed, 19 Apr 2017 22:43:11 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201704192243.v3JMhB7a044115@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Wed, 19 Apr 2017 22:43:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317174 - head/sys/dev/vt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 19 Apr 2017 22:43:13 -0000 Author: jkim Date: Wed Apr 19 22:43:11 2017 New Revision: 317174 URL: https://svnweb.freebsd.org/changeset/base/317174 Log: Revert r316796. It is not necessary since r317173. Modified: head/sys/dev/vt/vt_cpulogos.c Modified: head/sys/dev/vt/vt_cpulogos.c ============================================================================== --- head/sys/dev/vt/vt_cpulogos.c Wed Apr 19 22:41:24 2017 (r317173) +++ head/sys/dev/vt/vt_cpulogos.c Wed Apr 19 22:43:11 2017 (r317174) @@ -153,7 +153,6 @@ vt_fini_logos(void *dummy __unused) struct winsize wsz; term_pos_t size; unsigned int i; - int row; if (!vt_draw_logo_cpus) return; @@ -171,7 +170,7 @@ vt_fini_logos(void *dummy __unused) vt_draw_logo_cpus = 0; VT_UNLOCK(vd); - for (i = row = 0; i < VT_MAXWINDOWS; i++) { + for (i = 0; i < VT_MAXWINDOWS; i++) { vw = vd->vd_windows[i]; if (vw == NULL) continue; @@ -194,16 +193,11 @@ vt_fini_logos(void *dummy __unused) vt_compute_drawable_area(vw); if (vd->vd_curwindow == vw) { - row = vw->vw_draw_area.tr_begin.tp_row; vd->vd_flags |= VDF_INVALID; vt_resume_flush_timer(vd, 0); } VT_UNLOCK(vd); } - - if (row > 0 && vd->vd_driver->vd_drawrect != NULL) - vd->vd_driver->vd_drawrect(vd, 0, 0, vd->vd_width, row - 1, - 1, TC_BLACK); } static void From owner-svn-src-head@freebsd.org Wed Apr 19 22:44:26 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EAB64D46794; Wed, 19 Apr 2017 22:44:26 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-io0-x242.google.com (mail-io0-x242.google.com [IPv6:2607:f8b0:4001:c06::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B233118ED; Wed, 19 Apr 2017 22:44:26 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-io0-x242.google.com with SMTP id d203so8414455iof.2; Wed, 19 Apr 2017 15:44:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=A0MSAUH/AFMZ+H8x9Mxq17PBZhlkwUGN9e2Ix9Yl5rY=; b=MgPeJQvtPp/uh7uTEZBPm5zrujTc5GuJ03Nr7hneVqfjegQKEJ1d9yuh931KpJMGXE 72EoxLVPSTJ1CP4Hbd5UR/atdPeYtXXuK0KgapeAoTOa8v5BmbIlL67ecaAoEB7ujJA9 D9jFrX9EAh9otBRj7kLAKRRt2Ud8tbg4RUVzz0xbtqXTdS7i1ql2Ktlcey1wWP0Kv1ll +SJeyWZrFh0tH65qJeg73fO483kTnrwBaZ2NhvpdkpUeVANd/FtCS9dPivfefGCFkYO7 SLjL09vtzO4ArNIlG0+eOEx84xI/SZBtV8dSPELfPZlr3XaiNJVvevPgq5aaOq1CM2gL zF8w== 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=A0MSAUH/AFMZ+H8x9Mxq17PBZhlkwUGN9e2Ix9Yl5rY=; b=tF6my7OiII9CgUGZOz3837Webn5haz1TPOLtaIW3JRaJHC3QlXDm5WIw4Fu3MuMeEz M3qyM07yHaoQZKO9DqNjTRRWfi6Hbdzoks6jyBjgKA010/g3Ge9qLh7piyZ3KbANE1H9 iDI4VKUEEpfGcv7+lMWs0Px2C6GrEJl40OhFdUHC08QCsqvSk/TF4EOq66+RIp4CNrXR 32OxsXNR1FFJ/a0xbC9B4IOf2gRgUIXXueIz7mvzr2jB+oKugmVr5QbzSeRZMVg2mPPW nHWg0xYFeFcPPy6yvJVQ/qKmLZagJGkTxB6frC73u6qtLmUTo7PifeqzWczcP7q9Am75 8ELQ== X-Gm-Message-State: AN3rC/4MMhDaeEe8SzTwarnw5xhQ/rk8FNwQqpXcyniZFMCAvGWjS9sg suNoWnsmZ3oXwgNNU+D9ug== X-Received: by 10.99.169.10 with SMTP id u10mr5172913pge.26.1492641865878; Wed, 19 Apr 2017 15:44:25 -0700 (PDT) Received: from ?IPv6:2607:fb90:836c:99e9:f192:37b0:a12c:66b2? ([2607:fb90:836c:99e9:f192:37b0:a12c:66b2]) by smtp.gmail.com with ESMTPSA id o7sm6379350pga.36.2017.04.19.15.44.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 19 Apr 2017 15:44:25 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r317168 - in head: share/mk tools/build/options usr.sbin/rpcbind From: Ngie Cooper X-Mailer: iPhone Mail (14E304) In-Reply-To: <201704192045.v3JKjkgh095435@repo.freebsd.org> Date: Wed, 19 Apr 2017 15:44:24 -0700 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <19BDE8D1-FD09-4105-ADFE-BF3ED18352F0@gmail.com> References: <201704192045.v3JKjkgh095435@repo.freebsd.org> To: Ngie Cooper X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 19 Apr 2017 22:44:27 -0000 > On Apr 19, 2017, at 13:45, Ngie Cooper wrote: >=20 > Author: ngie > Date: Wed Apr 19 20:45:46 2017 > New Revision: 317168 > URL: https://svnweb.freebsd.org/changeset/base/317168 >=20 > Log: > Add a knob, WITH*_RPCBIND_WARMSTART_SUPPORT, to allow the end-user to bui= ld > rpcbind(8) with/without warmstart support. >=20 > The knob defaults to off to preserve POLA for the feature. >=20 > See rpcbind(8) for more details about the warmstart feature. I haven't regenerated src.conf(5) yet due to other items I noticed were m= issing when running makeman. I'll regenerate it sometime today. Thanks, -Ngie= From owner-svn-src-head@freebsd.org Wed Apr 19 22:48:28 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E7EF3D46865; Wed, 19 Apr 2017 22:48:28 +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 mx1.freebsd.org (Postfix) with ESMTPS id B9ECE1AF4; Wed, 19 Apr 2017 22:48:28 +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 v3JMmR3D044383; Wed, 19 Apr 2017 22:48:27 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3JMmRo1044382; Wed, 19 Apr 2017 22:48:27 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201704192248.v3JMmRo1044382@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Wed, 19 Apr 2017 22:48:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317175 - head/sys/dev/syscons X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 19 Apr 2017 22:48:29 -0000 Author: glebius Date: Wed Apr 19 22:48:27 2017 New Revision: 317175 URL: https://svnweb.freebsd.org/changeset/base/317175 Log: Fix build without SC_PIXEL_MODE defined. Modified: head/sys/dev/syscons/scvgarndr.c Modified: head/sys/dev/syscons/scvgarndr.c ============================================================================== --- head/sys/dev/syscons/scvgarndr.c Wed Apr 19 22:43:11 2017 (r317174) +++ head/sys/dev/syscons/scvgarndr.c Wed Apr 19 22:48:27 2017 (r317175) @@ -173,7 +173,8 @@ static const struct mousedata mouse9x13 0x0c00, 0x0c00, 0x0600, 0x0600, 0x0000, 0x0000, 0x0000, 0x0000, }, 9, 13, }; - +#endif +#if defined(SC_PIXEL_MODE) static const struct mousedata mouse10x16 = { { 0xc000, 0xa000, 0x9000, 0x8800, 0x8400, 0x8200, 0x8100, 0x8080, 0x8040, 0x83c0, 0x9200, 0xa900, 0xc900, 0x0480, 0x0480, 0x0300, }, { From owner-svn-src-head@freebsd.org Wed Apr 19 22:50:21 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3324DD468F9; Wed, 19 Apr 2017 22:50:21 +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 mx1.freebsd.org (Postfix) with ESMTPS id 0514A1C84; Wed, 19 Apr 2017 22:50:20 +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 v3JMoKqS044520; Wed, 19 Apr 2017 22:50:20 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3JMoKWE044519; Wed, 19 Apr 2017 22:50:20 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201704192250.v3JMoKWE044519@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Wed, 19 Apr 2017 22:50:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317176 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 19 Apr 2017 22:50:21 -0000 Author: glebius Date: Wed Apr 19 22:50:19 2017 New Revision: 317176 URL: https://svnweb.freebsd.org/changeset/base/317176 Log: Bump __FreeBSD_version due to r317061, struct vmmeter changes. Modified: head/sys/sys/param.h Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Wed Apr 19 22:48:27 2017 (r317175) +++ head/sys/sys/param.h Wed Apr 19 22:50:19 2017 (r317176) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1200028 /* Master, propagated to newvers */ +#define __FreeBSD_version 1200029 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-head@freebsd.org Wed Apr 19 22:51:27 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2FBCAD46A81; Wed, 19 Apr 2017 22:51:27 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-io0-x242.google.com (mail-io0-x242.google.com [IPv6:2607:f8b0:4001:c06::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E84AD1F84; Wed, 19 Apr 2017 22:51:26 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-io0-x242.google.com with SMTP id d203so8481441iof.2; Wed, 19 Apr 2017 15:51:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=tDud5Le/8pS25DunzwTjUZkg4KvMPFbY7OlFsyUBVPQ=; b=eDztotlCgyyLCpvwzVzug+DMdEX9L+08haMSogqxMntxIER2oXBqGZDK0V1WyunSi1 QinM4E7ONJVshtJv6WouJYLVunBrF8aLjlI4ZwtObGGaL5z6EgstYtqPLpmTkLjJ/kCI Ymfg0x9GcPVfyNX7zqT6/IIs9JkfL2zQysCSVWElSfghTpAyK34G907VPmk2vFkyotNk 9RRFYjegWk3EGWMCRFAmOhLwSf0g0Ddf37RtdAVbqayNASC9qRZomXdb5dJJcGhRGaLd Lzj+dwN5XivwFeqJ6weYhQhwkN/hTJt8ZjMCkEiWi52sDnqboQFkwA3d9dHwYb+6mDlC 4FIA== 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=tDud5Le/8pS25DunzwTjUZkg4KvMPFbY7OlFsyUBVPQ=; b=pOzKgIfkvzmPd0WjoK3TVfsdM4RzIbaYwdigbbV1CHxUhNlQUecNL0VavnuRCa+f6R jOOQuvbgM973jEuDCbtSyv/7lOH4QQVPW5+sOt2VhtTrqFzbyKeHKRkVGg2eNv3MXizi iWVDwBzCOn4EX037V4E59+tyGH0VkUpwt37bf609Wlbcmn5w3haI171pUipJTrPDQGq1 JYAQZzOM3ALF6HpwqwDE0xAIRqlo1QIgMyJyDZz88n2j5nYaAclZ4nPQUakolMn29yo1 y6IMLN2YHOwkMZq2vXqoN2E3BvnEEcS/9xvx5uqVhV3SiVY8ZlxDQYPRJzJdBjDF4BlM S/Cw== X-Gm-Message-State: AN3rC/5rtBsw9KxroccvY5BcMa1TCMlAgKcZ9NQhvtQs4jGKqZI3z8/N 7fWg7I+xVgAcKXEXRPz8Bw== X-Received: by 10.98.160.24 with SMTP id r24mr5232080pfe.16.1492642286117; Wed, 19 Apr 2017 15:51:26 -0700 (PDT) Received: from ?IPv6:2607:fb90:836c:99e9:f192:37b0:a12c:66b2? ([2607:fb90:836c:99e9:f192:37b0:a12c:66b2]) by smtp.gmail.com with ESMTPSA id m194sm6373682pga.62.2017.04.19.15.51.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 19 Apr 2017 15:51:25 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r317094 - head/share/mk From: Ngie Cooper X-Mailer: iPhone Mail (14E304) In-Reply-To: Date: Wed, 19 Apr 2017 15:51:24 -0700 Cc: rgrimes@freebsd.org, Eric van Gyzen , John Baldwin , Slawa Olhovchenkov , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , src-committers Content-Transfer-Encoding: quoted-printable Message-Id: <25F616D2-DE24-485B-9549-E1C4F68B9379@gmail.com> References: <201704192218.v3JMIYtS032774@pdx.rh.CN85.dnsmgr.net> To: Warner Losh X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 19 Apr 2017 22:51:27 -0000 > On Apr 19, 2017, at 15:22, Warner Losh wrote: ... >> Actually this is exactly what I would expect from Linux! >>=20 >> Why do we need to pull the trigger on GDB other than to pull the trigger >> to say we are GPL free, if that is the reason then this is the wrong >> way to go about it. >=20 > I think "gdb in base is horribly broken" is the real reason. You need > the port to do anything non-trivial these days. >=20 > Plus core set this as a goal for the project after it was clear that > was a consensus desire several years ago. Can't fault someone for > working towards that goal. +1 to Warner's sentiments. gdb in base doesn't work well with threads (6.x never did ;/..), and lacks s= upport for other things (like python debugging). Being able to debug threads= reliably is a make or break thing. So while I understand and in general agree with you Rod, I completely disagr= ee on the practical end of things. I'm actually kind of curious as to why th= is isn't being done globally.. but I assume that it was described in one of t= he many threads some time ago about the status quo for debugging with gdb on= tier-two architectures. Thanks, -Ngie= From owner-svn-src-head@freebsd.org Wed Apr 19 23:06:09 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1ACE1D46D88; Wed, 19 Apr 2017 23:06:09 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E11C8884; Wed, 19 Apr 2017 23:06:08 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3JN68WW052326; Wed, 19 Apr 2017 23:06:08 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3JN68Cu052325; Wed, 19 Apr 2017 23:06:08 GMT (envelope-from np@FreeBSD.org) Message-Id: <201704192306.v3JN68Cu052325@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Wed, 19 Apr 2017 23:06:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317177 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 19 Apr 2017 23:06:09 -0000 Author: np Date: Wed Apr 19 23:06:07 2017 New Revision: 317177 URL: https://svnweb.freebsd.org/changeset/base/317177 Log: Free lro_hash unconditionally, just like lro_mbuf_data a few lines later. Fix whitespace nit while here. Modified: head/sys/netinet/tcp_lro.c Modified: head/sys/netinet/tcp_lro.c ============================================================================== --- head/sys/netinet/tcp_lro.c Wed Apr 19 22:50:19 2017 (r317176) +++ head/sys/netinet/tcp_lro.c Wed Apr 19 23:06:07 2017 (r317177) @@ -175,17 +175,15 @@ tcp_lro_free(struct lro_ctrl *lc) } /* free hash table */ - if (lc->lro_hash != NULL) { - free(lc->lro_hash, M_LRO); - lc->lro_hash = NULL; - } + free(lc->lro_hash, M_LRO); + lc->lro_hash = NULL; lc->lro_hashsz = 0; /* free mbuf array, if any */ for (x = 0; x != lc->lro_mbuf_count; x++) m_freem(lc->lro_mbuf_data[x].mb); lc->lro_mbuf_count = 0; - + /* free allocated memory, if any */ free(lc->lro_mbuf_data, M_LRO); lc->lro_mbuf_data = NULL; From owner-svn-src-head@freebsd.org Wed Apr 19 23:10:42 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 89B17D46E76 for ; Wed, 19 Apr 2017 23:10:42 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from nm20-vm3.bullet.mail.ne1.yahoo.com (nm20-vm3.bullet.mail.ne1.yahoo.com [98.138.91.150]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5DD7BA59 for ; Wed, 19 Apr 2017 23:10:42 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1492643043; bh=Ylh2uWd2AlgrVqzIRIdy5qw5FZHRGZnUoxOaZjrbHHs=; h=Subject:To:References:Cc:From:Date:In-Reply-To:From:Subject; b=E+1Sr40bNo+BQnAuW6neBfW0TSrloKCY3vJk+r8uHuKe0yOyjVBJX1/vrtF1eJ2kwyZLiMrgZzE4IOlNykjr9avpDtC0yr9GLBFI1NveqXCIZDd+YlpxLrget4WPqeoSuL6Ocpetxds6gpGkhuw9aGyK8ugTQP9iZRiI25YK1EuPPcClzMW39jaiAr7Yc3m4bC0qkzser2Mrp9sJEzGf3SUCgl7wGq3fFZGVknxewfzQILGRMSpUBgmK6TMZpsv+zDwsui3CIk5Xbxa0TysA7PUy7763opg6wXZAj2YCjb0ojjQg0mO+Vtw/aXe+jiZASdYjF93HO1x/UR2fP80POA== Received: from [98.138.226.179] by nm20.bullet.mail.ne1.yahoo.com with NNFMP; 19 Apr 2017 23:04:03 -0000 Received: from [98.138.84.45] by tm14.bullet.mail.ne1.yahoo.com with NNFMP; 19 Apr 2017 23:04:03 -0000 Received: from [127.0.0.1] by smtp113.mail.ne1.yahoo.com with NNFMP; 19 Apr 2017 23:04:02 -0000 X-Yahoo-Newman-Id: 988610.30654.bm@smtp113.mail.ne1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: Tf1OaFEVM1mI3sr8oeobJPjiCxPbcbAD9RcqWVU3sdIj21d tjmd9ndKf5HKKPig.qnjl66eqgYK3jbUUYplyVhtShbWpmoCPoLB5TgBauVZ u_m3ILzPQE4tQjfDTm0RVEU7hNr.nChLEuZMSRjvcjKBUDrTUIwK.WFv_ylv rr84oPuM3un6.acc.byy4mz0Wj_i0lqzaTpsLLs4vXd200xbQlFe75.NYqf0 .l_xMBQkduipnRB5koSrWPV.5QKNInM_w9KS5fF9IbNGJYTCFFZsyJZuHQFJ K7uX4jhPD70eYasMvYwTrtESbvW1g1Syl8YIrMtbZv3e7CqbWqzG.iWgghR8 axP_8uE1liqbZ8b63Sr5lvNzDIHRkTE6eEZF0ryXIcNT3bZOvmsDID4Pmfvi klId1lDR.rf0Dd158OWZ60xo58Ap04GoHYQX9renx.ZOC_UJrPHPZP4Rj_1I .h76UJQbW7d_GE1FnhjKBn0R0SqHc_p7W3Gpr1jOyl09YNJ4HaOGPPLJ9hDS WvrUz9bWi5MViShCarhEAO7wZv21YSIQXNDjiGpoJ3YTD X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Subject: Re: svn commit: r317094 - head/share/mk To: rgrimes@FreeBSD.org, Eric van Gyzen References: <201704192218.v3JMIYtS032774@pdx.rh.CN85.dnsmgr.net> Cc: John Baldwin , Slawa Olhovchenkov , svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org From: Pedro Giffuni Organization: FreeBSD Project Message-ID: Date: Wed, 19 Apr 2017 18:04:12 -0500 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <201704192218.v3JMIYtS032774@pdx.rh.CN85.dnsmgr.net> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 19 Apr 2017 23:10:42 -0000 On 19/4/2017 17:18, Rodney W. Grimes wrote: > [ Charset windows-1252 unsupported, converting... ] >>>>>>> Generating core.txt now complety broken? >>>>>> No. crashinfo has supported gdb from ports for quite a while now. >>>>>> If you 'pkg install gdb' crashinfo defaults to using the ports gdb over >>>>>> the base one already. >>>>> I am about clean install, w/o ports. >>>> Until we get some sort of klldb support that will not work. However, >>>> we already have platforms now where /usr/bin/gdb doesn't work for that. >>>> riscv and aarch64 aren't supported in ancient gdb, and the MIPS >>>> /usr/bin/gdb didn't really work for me in my testing. >>> So we break what worked on a Tier1 Platform? With my "user" hat on >>> these are the exact kind of breakages that send me looking for another >>> platform to run on. We far to often just go oh you can do X y and Z >>> to get around what we broke forgetting that the user 6 months from now >>> when this hits a release isnt gona come ask, he may just go down the >>> road to something else. >>> >>> Remove gdb WHEN klldb can replace it, not a day before. Using "oh its >>> broken on aarch64 and mips" is not a reason to break things on i386/amd64. >>> >>> Yes, I know we want to get gnu stuff out of the tree, but that needs >>> to come AFTER a proper replacement is avaliable. >>> >>>>> Also, how to generate core.txt after crash, reboot and install gdb >>>>> from ports? (port instaled after crash) >>>> You can always run crashinfo by hand. >>> /me starts to look for a new OS, this one is not very good at user support. >> # crashinfo >> Please install GDB and run 'crashinfo' again. >> The easiest way to install GDB is: pkg install gdb >> Unable to find matching kernel for /var/crash/vmcore.1 >> >> https://reviews.freebsd.org/D10429 >> >> This should be good enough to keep the user from looking for a new OS. >> It also gets a much better version of GDB onto the box, which will make >> the user happier than giving them an ancient one and letting them flail >> around with it for a while before learning that they should install a >> newer one. > Actually this is exactly what I would expect from Linux! Does linux include a kernel debugger now? Last I heard Linus was against debuggers, just as he was once against version control ... and Codes of Conduct. > Why do we need to pull the trigger on GDB other than to pull the trigger > to say we are GPL free, if that is the reason then this is the wrong > way to go about it. Well, one of the reasons may be that we need a debugger that supports newer DWARF. At some time we started hacking our llvm to not use a recent dwarf versions(4?). Pedro. From owner-svn-src-head@freebsd.org Thu Apr 20 02:22:26 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E2795D4734D; Thu, 20 Apr 2017 02:22:26 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-io0-x230.google.com (mail-io0-x230.google.com [IPv6:2607:f8b0:4001:c06::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id ABF801F34; Thu, 20 Apr 2017 02:22:26 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-io0-x230.google.com with SMTP id o22so52227030iod.3; Wed, 19 Apr 2017 19:22:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=h30ho+da/qrTQ11u8AtuUvLY3GRry9ZvdImhGtNxnWg=; b=Y2prvCDlTEmBkwM0FSM4DQUuMFcxlUi8x/7h38suGoi/5ZVqFEoYE1/TP/w6W7MF4+ RsRyhGeXUWJ+b4otLIOgQTvJ0aXWFZHEHJf02ER9RzXs4+q1/fJKedd9M9hBozmN0hM4 WlMiSeXcZeGvXcwr0envB8jf/dDcCtyB1mrPUJbqoDvGGiUzQqe0ybjmp81zmqY5+l/Z 0ToNTTn2OuCziJOE03sZMQYuckW1BXYUf9nqN/KjbFg1eKsQxed2HJO0IFG0Q2Y6NLr7 scqScbIdqcKxd53AXtl/cRThhiHHc/vX/SKRD+j7GWBoaJeq3NFiZBAiG1B/mrh9K6gl 9Czg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=h30ho+da/qrTQ11u8AtuUvLY3GRry9ZvdImhGtNxnWg=; b=q8InGjnR5UB1m9jVfJ4cGX70oLKyJLsRLcI/epLiEq08ncR8r369mAvYL0kJ8YRG0n XG59vFRxvtp+OcnQq0hULDjTFnN2q6srJLYO+3rYdPIXy9fpvTr2uWMO9IUEwTTms4as nPpANtP3ZOU8MGINI1U1fBtnAVzVJZbSYbNe1HW5hU2xmP5QRoBBrpZA5KiBFp0XqGMy jC5o7v26uYab+2u6nImrFsuoAXvKLr6gnt23Ytla3+r9N5Slz6uk/UTIo+Jnwo2QmGSL 8m+eFXXvUm0qOy9NWdjSg06mBmHhUcqMU6zFMym1voagFJWmno2nr8Ev/2C44DrocqKR GHpQ== X-Gm-Message-State: AN3rC/6nOTIWO9HmVDBYjpcY91BZlGIufY+Fnzrrdo6XOA8Ug3wk33XR cj+hG+3FdAndu2SNSYu+NcnuDMHDyOIb X-Received: by 10.107.34.21 with SMTP id i21mr6961892ioi.52.1492654945981; Wed, 19 Apr 2017 19:22:25 -0700 (PDT) MIME-Version: 1.0 Sender: carpeddiem@gmail.com Received: by 10.107.30.136 with HTTP; Wed, 19 Apr 2017 19:22:05 -0700 (PDT) In-Reply-To: <201704192221.v3JMLFPs032866@repo.freebsd.org> References: <201704192221.v3JMLFPs032866@repo.freebsd.org> From: Ed Maste Date: Wed, 19 Apr 2017 22:22:05 -0400 X-Google-Sender-Auth: HzcygzhUpNiRK9NwmlXmJDbtpI8 Message-ID: Subject: Re: svn commit: r317171 - head/sys/dev/vt To: Jung-uk Kim 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.23 Precedence: list List-Id: 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, 20 Apr 2017 02:22:27 -0000 On 19 April 2017 at 18:21, Jung-uk Kim wrote: > Author: jkim > Date: Wed Apr 19 22:21:15 2017 > New Revision: 317171 > URL: https://svnweb.freebsd.org/changeset/base/317171 > > Log: > Micro-optimize vt_set_border(). I expect we'll eventually have vt drivers that have a non-trivial vd_drawrect, making the previous implementation preferable. Can you comment a bit more on this change? From owner-svn-src-head@freebsd.org Thu Apr 20 02:33:22 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A00D3D47B35; Thu, 20 Apr 2017 02:33:22 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "vps1.elischer.org", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 851BDBE4; Thu, 20 Apr 2017 02:33:22 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from Julian-MBP3.local (58-7-91-98.dyn.iinet.net.au [58.7.91.98]) (authenticated bits=0) by vps1.elischer.org (8.15.2/8.15.2) with ESMTPSA id v3K2XCbn007834 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Wed, 19 Apr 2017 19:33:16 -0700 (PDT) (envelope-from julian@freebsd.org) Subject: Re: svn commit: r317094 - head/share/mk To: Justin Hibbits , rgrimes@freebsd.org References: <1709565.BYcnqjiFaR@ralph.baldwin.cx> <201704191633.v3JGXWmu031427@pdx.rh.CN85.dnsmgr.net> Cc: John Baldwin , Slawa Olhovchenkov , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , src-committers From: Julian Elischer Message-ID: Date: Thu, 20 Apr 2017 10:33:07 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 20 Apr 2017 02:33:22 -0000 On 20/4/17 3:13 am, Justin Hibbits wrote: > On Wed, Apr 19, 2017 at 11:33 AM, Rodney W. Grimes > wrote: >>> On Wednesday, April 19, 2017 01:28:37 AM Slawa Olhovchenkov wrote: >>>> On Tue, Apr 18, 2017 at 12:45:25PM -0700, John Baldwin wrote: >>>> >>>>> On Tuesday, April 18, 2017 07:30:13 PM Slawa Olhovchenkov wrote: >>>>>> On Tue, Apr 18, 2017 at 04:27:48PM +0000, John Baldwin wrote: >>>>>> >>>>>>> Author: jhb >>>>>>> Date: Tue Apr 18 16:27:48 2017 >>>>>>> New Revision: 317094 >>>>>>> URL: https://svnweb.freebsd.org/changeset/base/317094 >>>>>>> >>>>>>> Log: >>>>>>> Disable in-tree GDB by default on x86, mips, and powerpc. >>>>>>> >>>>>>> GDB in ports contains all of the functionality as GDB in base >>>>>>> (including kgdb) for these platforms along with additional >>>>>>> functionality. In-tree GDB remains enabled on ARM and sparc64. >>>>>>> GDB in ports does not currently support kernel debugging on arm, >>>>>>> and ports GDB for sparc64 has not been tested (though it does >>>>>>> include sparc64 support). >>>>>>> >>>>>>> Reviewed by: bdrewery, emaste, imp >>>>>>> Relnotes: yes >>>>>>> Sponsored by: DARPA / AFRL >>>>>>> Differential Revision: https://reviews.freebsd.org/D10399 >>>>>> Generating core.txt now complety broken? >>>>> No. crashinfo has supported gdb from ports for quite a while now. >>>>> If you 'pkg install gdb' crashinfo defaults to using the ports gdb over >>>>> the base one already. >>>> I am about clean install, w/o ports. >>> Until we get some sort of klldb support that will not work. However, >>> we already have platforms now where /usr/bin/gdb doesn't work for that. >>> riscv and aarch64 aren't supported in ancient gdb, and the MIPS >>> /usr/bin/gdb didn't really work for me in my testing. >> So we break what worked on a Tier1 Platform? With my "user" hat on >> these are the exact kind of breakages that send me looking for another >> platform to run on. We far to often just go oh you can do X y and Z >> to get around what we broke forgetting that the user 6 months from now >> when this hits a release isnt gona come ask, he may just go down the >> road to something else. >> >> Remove gdb WHEN klldb can replace it, not a day before. Using "oh its >> broken on aarch64 and mips" is not a reason to break things on i386/amd64. >> > It's not removed, it's disabled by default now. As the commit message > states, gdb in ports is much more feature filled than gdb in base yeah but we ship both (on 10.3) because we've had issues where one or the other crashes.. > >> Yes, I know we want to get gnu stuff out of the tree, but that needs >> to come AFTER a proper replacement is avaliable. >> >>>> Also, how to generate core.txt after crash, reboot and install gdb >>>> from ports? (port instaled after crash) >>> You can always run crashinfo by hand. >> /me starts to look for a new OS, this one is not very good at user support. > I'd say this more warrants a set of "blessed" packages to include on > install disks so we get this functionality without the extra step. > > - Justin > >> >> -- >> Rod Grimes rgrimes@freebsd.org >> > From owner-svn-src-head@freebsd.org Thu Apr 20 02:35:21 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B2025D47C5C; Thu, 20 Apr 2017 02:35:21 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "vps1.elischer.org", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 973D3DAB; Thu, 20 Apr 2017 02:35:21 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from Julian-MBP3.local (58-7-91-98.dyn.iinet.net.au [58.7.91.98]) (authenticated bits=0) by vps1.elischer.org (8.15.2/8.15.2) with ESMTPSA id v3K2ZBxo007848 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Wed, 19 Apr 2017 19:35:15 -0700 (PDT) (envelope-from julian@freebsd.org) Subject: Re: svn commit: r317094 - head/share/mk To: Justin Hibbits , rgrimes@freebsd.org References: <1709565.BYcnqjiFaR@ralph.baldwin.cx> <201704191633.v3JGXWmu031427@pdx.rh.CN85.dnsmgr.net> Cc: John Baldwin , Slawa Olhovchenkov , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , src-committers From: Julian Elischer Message-ID: <52e09270-6535-d15e-de9b-c33a4fd62210@freebsd.org> Date: Thu, 20 Apr 2017 10:35:06 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 20 Apr 2017 02:35:21 -0000 On 20/4/17 3:13 am, Justin Hibbits wrote: > On Wed, Apr 19, 2017 at 11:33 AM, Rodney W. Grimes > wrote: >>> On Wednesday, April 19, 2017 01:28:37 AM Slawa Olhovchenkov wrote: >>>> On Tue, Apr 18, 2017 at 12:45:25PM -0700, John Baldwin wrote: >>>> >>>>> On Tuesday, April 18, 2017 07:30:13 PM Slawa Olhovchenkov wrote: >>>>>> On Tue, Apr 18, 2017 at 04:27:48PM +0000, John Baldwin wrote: >>>>>> >>>>>>> Author: jhb >>>>>>> Date: Tue Apr 18 16:27:48 2017 >>>>>>> New Revision: 317094 >>>>>>> URL: https://svnweb.freebsd.org/changeset/base/317094 >>>>>>> >>>>>>> Log: >>>>>>> Disable in-tree GDB by default on x86, mips, and powerpc. >>>>>>> >>>>>>> GDB in ports contains all of the functionality as GDB in base >>>>>>> (including kgdb) for these platforms along with additional >>>>>>> functionality. In-tree GDB remains enabled on ARM and sparc64. >>>>>>> GDB in ports does not currently support kernel debugging on arm, >>>>>>> and ports GDB for sparc64 has not been tested (though it does >>>>>>> include sparc64 support). >>>>>>> >>>>>>> Reviewed by: bdrewery, emaste, imp >>>>>>> Relnotes: yes >>>>>>> Sponsored by: DARPA / AFRL >>>>>>> Differential Revision: https://reviews.freebsd.org/D10399 >>>>>> Generating core.txt now complety broken? >>>>> No. crashinfo has supported gdb from ports for quite a while now. >>>>> If you 'pkg install gdb' crashinfo defaults to using the ports gdb over >>>>> the base one already. >>>> I am about clean install, w/o ports. >>> Until we get some sort of klldb support that will not work. However, >>> we already have platforms now where /usr/bin/gdb doesn't work for that. >>> riscv and aarch64 aren't supported in ancient gdb, and the MIPS >>> /usr/bin/gdb didn't really work for me in my testing. >> So we break what worked on a Tier1 Platform? With my "user" hat on >> these are the exact kind of breakages that send me looking for another >> platform to run on. We far to often just go oh you can do X y and Z >> to get around what we broke forgetting that the user 6 months from now >> when this hits a release isnt gona come ask, he may just go down the >> road to something else. >> >> Remove gdb WHEN klldb can replace it, not a day before. Using "oh its >> broken on aarch64 and mips" is not a reason to break things on i386/amd64. >> > It's not removed, it's disabled by default now. As the commit message > states, gdb in ports is much more feature filled than gdb in base > >> Yes, I know we want to get gnu stuff out of the tree, but that needs >> to come AFTER a proper replacement is avaliable. >> >>>> Also, how to generate core.txt after crash, reboot and install gdb >>>> from ports? (port instaled after crash) >>> You can always run crashinfo by hand. >> /me starts to look for a new OS, this one is not very good at user support. > I'd say this more warrants a set of "blessed" packages to include on > install disks so we get this functionality without the extra step. I've been pushing this idea for years.. The idea of "critical" packages, where failure to build/work is regarded as much as a reason to stop-ship as a failure in the base itself. > - Justin > >> >> -- >> Rod Grimes rgrimes@freebsd.org >> > From owner-svn-src-head@freebsd.org Thu Apr 20 03:32:31 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EE142D47E46; Thu, 20 Apr 2017 03:32:31 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BD92B9CB; Thu, 20 Apr 2017 03:32:31 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3K3WU6t063170; Thu, 20 Apr 2017 03:32:30 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3K3WUlS063169; Thu, 20 Apr 2017 03:32:30 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201704200332.v3K3WUlS063169@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Thu, 20 Apr 2017 03:32:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317178 - head/tools/build/options X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 20 Apr 2017 03:32:32 -0000 Author: ngie Date: Thu Apr 20 03:32:30 2017 New Revision: 317178 URL: https://svnweb.freebsd.org/changeset/base/317178 Log: Add WITH_GROFF to complement WITHOUT_GROFF and placate complaints from makeman MFC after: 7 weeks Sponsored by: Dell EMC Isilon Added: head/tools/build/options/WITH_GROFF - copied, changed from r317167, head/tools/build/options/WITHOUT_GROFF Copied and modified: head/tools/build/options/WITH_GROFF (from r317167, head/tools/build/options/WITHOUT_GROFF) ============================================================================== --- head/tools/build/options/WITHOUT_GROFF Wed Apr 19 20:35:47 2017 (r317167, copy source) +++ head/tools/build/options/WITH_GROFF Thu Apr 20 03:32:30 2017 (r317178) @@ -1,7 +1,5 @@ .\" $FreeBSD$ -Set to not build +Set to build .Xr groff 1 and .Xr vgrind 1 . -You should consider installing the textproc/groff port to not break -.Xr man 1 . From owner-svn-src-head@freebsd.org Thu Apr 20 03:36:11 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6BB4BD47002; Thu, 20 Apr 2017 03:36:11 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 35FE7C28; Thu, 20 Apr 2017 03:36:11 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3K3aAu3063348; Thu, 20 Apr 2017 03:36:10 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3K3aAcB063346; Thu, 20 Apr 2017 03:36:10 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201704200336.v3K3aAcB063346@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Thu, 20 Apr 2017 03:36:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317179 - head/tools/build/options X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 20 Apr 2017 03:36:11 -0000 Author: ngie Date: Thu Apr 20 03:36:09 2017 New Revision: 317179 URL: https://svnweb.freebsd.org/changeset/base/317179 Log: Clean up WITH*_PROFILE - Clarify that profiled libraries are usable with gprof(8). - Add WITH_PROFILE to complement WITHOUT_PROFILE and placate makeman. MFC after: 7 weeks Sponsored by: Dell EMC Isilon Added: head/tools/build/options/WITH_PROFILE - copied, changed from r317167, head/tools/build/options/WITHOUT_PROFILE Modified: head/tools/build/options/WITHOUT_PROFILE Modified: head/tools/build/options/WITHOUT_PROFILE ============================================================================== --- head/tools/build/options/WITHOUT_PROFILE Thu Apr 20 03:32:30 2017 (r317178) +++ head/tools/build/options/WITHOUT_PROFILE Thu Apr 20 03:36:09 2017 (r317179) @@ -1,2 +1,3 @@ .\" $FreeBSD$ -Set to avoid compiling profiled libraries. +Set to not build profiled libraries for use with +.Xr gprof 8 . Copied and modified: head/tools/build/options/WITH_PROFILE (from r317167, head/tools/build/options/WITHOUT_PROFILE) ============================================================================== --- head/tools/build/options/WITHOUT_PROFILE Wed Apr 19 20:35:47 2017 (r317167, copy source) +++ head/tools/build/options/WITH_PROFILE Thu Apr 20 03:36:09 2017 (r317179) @@ -1,2 +1,3 @@ .\" $FreeBSD$ -Set to avoid compiling profiled libraries. +Set to build profiled libraries for use with +.Xr gprof 8 . From owner-svn-src-head@freebsd.org Thu Apr 20 03:41:44 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 620C4D4739B; Thu, 20 Apr 2017 03:41:44 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 245B3120D; Thu, 20 Apr 2017 03:41:44 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3K3fh08066475; Thu, 20 Apr 2017 03:41:43 GMT (envelope-from davidcs@FreeBSD.org) Received: (from davidcs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3K3fgEX066469; Thu, 20 Apr 2017 03:41:42 GMT (envelope-from davidcs@FreeBSD.org) Message-Id: <201704200341.v3K3fgEX066469@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: davidcs set sender to davidcs@FreeBSD.org using -f From: David C Somayajulu Date: Thu, 20 Apr 2017 03:41:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317180 - head/sys/dev/qlxgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 20 Apr 2017 03:41:44 -0000 Author: davidcs Date: Thu Apr 20 03:41:42 2017 New Revision: 317180 URL: https://svnweb.freebsd.org/changeset/base/317180 Log: Cleanup QLA_LOCK/QLA_UNLOCK macros remove unused QLA_TX_LOCK/QLA_TX_UNLOCK macros format qla_error_recovery() MFC after:3 days Modified: head/sys/dev/qlxgbe/ql_hw.c head/sys/dev/qlxgbe/ql_ioctl.c head/sys/dev/qlxgbe/ql_os.c head/sys/dev/qlxgbe/ql_os.h Modified: head/sys/dev/qlxgbe/ql_hw.c ============================================================================== --- head/sys/dev/qlxgbe/ql_hw.c Thu Apr 20 03:36:09 2017 (r317179) +++ head/sys/dev/qlxgbe/ql_hw.c Thu Apr 20 03:41:42 2017 (r317180) @@ -183,9 +183,9 @@ qla_sysctl_stop_pegs(SYSCTL_HANDLER_ARGS if (ret == 1) { ha = (qla_host_t *)arg1; - (void)QLA_LOCK(ha, __func__, 0); + QLA_LOCK(ha); qla_stop_pegs(ha); - QLA_UNLOCK(ha, __func__); + QLA_UNLOCK(ha); } return err; Modified: head/sys/dev/qlxgbe/ql_ioctl.c ============================================================================== --- head/sys/dev/qlxgbe/ql_ioctl.c Thu Apr 20 03:36:09 2017 (r317179) +++ head/sys/dev/qlxgbe/ql_ioctl.c Thu Apr 20 03:41:42 2017 (r317180) @@ -233,10 +233,10 @@ ql_eioctl(struct cdev *dev, u_long cmd, break; } - (void)QLA_LOCK(ha, __func__, 0); + QLA_LOCK(ha); if (!ha->hw.mdump_done) ha->qla_initiate_recovery = 1; - QLA_UNLOCK(ha, __func__); + QLA_UNLOCK(ha); #define QLNX_DUMP_WAIT_SECS 30 @@ -254,9 +254,9 @@ ql_eioctl(struct cdev *dev, u_long cmd, break; } - (void)QLA_LOCK(ha, __func__, 0); + QLA_LOCK(ha); ha->hw.mdump_done = 0; - QLA_UNLOCK(ha, __func__); + QLA_UNLOCK(ha); if ((rval = copyout(ha->hw.mdump_template, fw_dump->minidump, ha->hw.mdump_template_size))) { Modified: head/sys/dev/qlxgbe/ql_os.c ============================================================================== --- head/sys/dev/qlxgbe/ql_os.c Thu Apr 20 03:36:09 2017 (r317179) +++ head/sys/dev/qlxgbe/ql_os.c Thu Apr 20 03:41:42 2017 (r317180) @@ -519,9 +519,9 @@ qla_pci_detach(device_t dev) ifp = ha->ifp; - (void)QLA_LOCK(ha, __func__, 0); + QLA_LOCK(ha); qla_stop(ha); - QLA_UNLOCK(ha, __func__); + QLA_UNLOCK(ha); qla_release(ha); @@ -890,9 +890,9 @@ qla_init(void *arg) QL_DPRINT2(ha, (ha->pci_dev, "%s: enter\n", __func__)); - (void)QLA_LOCK(ha, __func__, 0); + QLA_LOCK(ha); qla_init_locked(ha); - QLA_UNLOCK(ha, __func__); + QLA_UNLOCK(ha); QL_DPRINT2(ha, (ha->pci_dev, "%s: exit\n", __func__)); } @@ -924,13 +924,9 @@ qla_set_multi(qla_host_t *ha, uint32_t a if_maddr_runlock(ifp); - //if (QLA_LOCK(ha, __func__, 1) == 0) { - // ret = ql_hw_set_multi(ha, mta, mcnt, add_multi); - // QLA_UNLOCK(ha, __func__); - //} - QLA_LOCK(ha, __func__, 1); + QLA_LOCK(ha); ret = ql_hw_set_multi(ha, mta, mcnt, add_multi); - QLA_UNLOCK(ha, __func__); + QLA_UNLOCK(ha); return (ret); } @@ -953,9 +949,9 @@ qla_ioctl(struct ifnet *ifp, u_long cmd, if (ifa->ifa_addr->sa_family == AF_INET) { ifp->if_flags |= IFF_UP; if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) { - (void)QLA_LOCK(ha, __func__, 0); + QLA_LOCK(ha); qla_init_locked(ha); - QLA_UNLOCK(ha, __func__); + QLA_UNLOCK(ha); } QL_DPRINT4(ha, (ha->pci_dev, "%s: SIOCSIFADDR (0x%lx) ipv4 [0x%08x]\n", @@ -975,10 +971,12 @@ qla_ioctl(struct ifnet *ifp, u_long cmd, if (ifr->ifr_mtu > QLA_MAX_MTU) { ret = EINVAL; } else { - (void) QLA_LOCK(ha, __func__, 0); + QLA_LOCK(ha); + ifp->if_mtu = ifr->ifr_mtu; ha->max_frame_size = ifp->if_mtu + ETHER_HDR_LEN + ETHER_CRC_LEN; + if ((ifp->if_drv_flags & IFF_DRV_RUNNING)) { ret = ql_set_max_mtu(ha, ha->max_frame_size, ha->hw.rcv_cntxt_id); @@ -990,7 +988,7 @@ qla_ioctl(struct ifnet *ifp, u_long cmd, ha->std_replenish = QL_STD_REPLENISH_THRES; - QLA_UNLOCK(ha, __func__); + QLA_UNLOCK(ha); if (ret) ret = EINVAL; @@ -1002,7 +1000,7 @@ qla_ioctl(struct ifnet *ifp, u_long cmd, QL_DPRINT4(ha, (ha->pci_dev, "%s: SIOCSIFFLAGS (0x%lx)\n", __func__, cmd)); - (void)QLA_LOCK(ha, __func__, 0); + QLA_LOCK(ha); if (ifp->if_flags & IFF_UP) { if ((ifp->if_drv_flags & IFF_DRV_RUNNING)) { @@ -1026,7 +1024,7 @@ qla_ioctl(struct ifnet *ifp, u_long cmd, ha->if_flags = ifp->if_flags; } - QLA_UNLOCK(ha, __func__); + QLA_UNLOCK(ha); break; case SIOCADDMULTI: @@ -1917,7 +1915,7 @@ qla_error_recovery(void *context, int pe struct ifnet *ifp = ha->ifp; int i = 0; - (void)QLA_LOCK(ha, __func__, 0); + QLA_LOCK(ha); if (ha->flags.qla_interface_up) { @@ -1943,7 +1941,7 @@ qla_error_recovery(void *context, int pe } } - QLA_UNLOCK(ha, __func__); + QLA_UNLOCK(ha); if ((ha->pci_func & 0x1) == 0) { @@ -1957,18 +1955,22 @@ qla_error_recovery(void *context, int pe ha->msg_from_peer = 0; - (void)QLA_LOCK(ha, __func__, 0); + QLA_LOCK(ha); + ql_minidump(ha); - QLA_UNLOCK(ha, __func__); + + QLA_UNLOCK(ha); (void) ql_init_hw(ha); - (void)QLA_LOCK(ha, __func__, 0); + QLA_LOCK(ha); + if (ha->flags.qla_interface_up) { - qla_free_xmt_bufs(ha); - qla_free_rcv_bufs(ha); + qla_free_xmt_bufs(ha); + qla_free_rcv_bufs(ha); } - QLA_UNLOCK(ha, __func__); + + QLA_UNLOCK(ha); qla_send_msg_to_peer(ha, QL_PEER_MSG_ACK); @@ -1988,39 +1990,43 @@ qla_error_recovery(void *context, int pe (void) ql_init_hw(ha); - (void)QLA_LOCK(ha, __func__, 0); + QLA_LOCK(ha); + if (ha->flags.qla_interface_up) { - qla_free_xmt_bufs(ha); - qla_free_rcv_bufs(ha); - } - QLA_UNLOCK(ha, __func__); + qla_free_xmt_bufs(ha); + qla_free_rcv_bufs(ha); + } + + QLA_UNLOCK(ha); } - (void)QLA_LOCK(ha, __func__, 0); + QLA_LOCK(ha); if (ha->flags.qla_interface_up) { - if (qla_alloc_xmt_bufs(ha) != 0) { - QLA_UNLOCK(ha, __func__); - return; - } - qla_confirm_9kb_enable(ha); - if (qla_alloc_rcv_bufs(ha) != 0) { - QLA_UNLOCK(ha, __func__); - return; - } + if (qla_alloc_xmt_bufs(ha) != 0) { + QLA_UNLOCK(ha); + return; + } + qla_confirm_9kb_enable(ha); - ha->flags.stop_rcv = 0; - if (ql_init_hw_if(ha) == 0) { - ifp = ha->ifp; - ifp->if_drv_flags |= IFF_DRV_RUNNING; - ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; - ha->flags.qla_watchdog_pause = 0; - } + if (qla_alloc_rcv_bufs(ha) != 0) { + QLA_UNLOCK(ha); + return; + } + + ha->flags.stop_rcv = 0; + + if (ql_init_hw_if(ha) == 0) { + ifp = ha->ifp; + ifp->if_drv_flags |= IFF_DRV_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; + ha->flags.qla_watchdog_pause = 0; + } } else ha->flags.qla_watchdog_pause = 0; - QLA_UNLOCK(ha, __func__); + QLA_UNLOCK(ha); } static void @@ -2028,8 +2034,8 @@ qla_async_event(void *context, int pendi { qla_host_t *ha = context; - (void)QLA_LOCK(ha, __func__, 0); + QLA_LOCK(ha); qla_hw_async_event(ha); - QLA_UNLOCK(ha, __func__); + QLA_UNLOCK(ha); } Modified: head/sys/dev/qlxgbe/ql_os.h ============================================================================== --- head/sys/dev/qlxgbe/ql_os.h Thu Apr 20 03:36:09 2017 (r317179) +++ head/sys/dev/qlxgbe/ql_os.h Thu Apr 20 03:41:42 2017 (r317180) @@ -148,12 +148,9 @@ MALLOC_DECLARE(M_QLA83XXBUF); /* * Locks */ -#define QLA_LOCK(ha, str, no_delay) mtx_lock(&ha->hw_lock) -#define QLA_UNLOCK(ha, str) mtx_unlock(&ha->hw_lock) +#define QLA_LOCK(ha) mtx_lock(&ha->hw_lock) +#define QLA_UNLOCK(ha) mtx_unlock(&ha->hw_lock) -#define QLA_TX_LOCK(ha) mtx_lock(&ha->tx_lock); -#define QLA_TX_UNLOCK(ha) mtx_unlock(&ha->tx_lock); - /* * structure encapsulating a DMA buffer */ From owner-svn-src-head@freebsd.org Thu Apr 20 03:43:38 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AECD2D4749F; Thu, 20 Apr 2017 03:43:38 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 66EDB14D1; Thu, 20 Apr 2017 03:43:38 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3K3hboB067314; Thu, 20 Apr 2017 03:43:37 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3K3hbQ9067313; Thu, 20 Apr 2017 03:43:37 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201704200343.v3K3hbQ9067313@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Thu, 20 Apr 2017 03:43:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317181 - head/share/man/man5 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 20 Apr 2017 03:43:38 -0000 Author: ngie Date: Thu Apr 20 03:43:37 2017 New Revision: 317181 URL: https://svnweb.freebsd.org/changeset/base/317181 Log: Regenerate src.conf(5) after recent additions/clarifications Sponsored by: Dell EMC Isilon Modified: head/share/man/man5/src.conf.5 Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Thu Apr 20 03:41:42 2017 (r317180) +++ head/share/man/man5/src.conf.5 Thu Apr 20 03:43:37 2017 (r317181) @@ -465,6 +465,13 @@ When set, it enforces these options: .It .Va WITHOUT_TESTS_SUPPORT .El +.It Va WITH_CXX +Set to build +.Xr c++ 1 +and related libraries. +.Pp +This is a default setting on +amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe and sparc64/sparc64. .It Va WITHOUT_DEBUG_FILES Set to avoid building or installing standalone debug files for each executable binary and shared library. @@ -740,6 +747,14 @@ You should consider installing the textp .Pp This is a default setting on riscv/riscv64 and riscv/riscv64sf. +.It Va WITH_GROFF +Set to build +.Xr groff 1 +and +.Xr vgrind 1 . +.Pp +This is a default setting on +amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe and sparc64/sparc64. .It Va WITHOUT_GSSAPI Set to not build libgssapi. .It Va WITHOUT_HAST @@ -1222,10 +1237,17 @@ Set to not build .Xr ppp 8 and related programs. .It Va WITHOUT_PROFILE -Set to avoid compiling profiled libraries. +Set to not build profiled libraries for use with +.Xr gprof 8 . .Pp This is a default setting on riscv/riscv64 and riscv/riscv64sf. +.It Va WITH_PROFILE +Set to build profiled libraries for use with +.Xr gprof 8 . +.Pp +This is a default setting on +amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64, powerpc/powerpcspe and sparc64/sparc64. .It Va WITHOUT_QUOTAS Set to not build .Xr quota 1 @@ -1269,6 +1291,10 @@ Set to not build Set to not build .Xr routed 8 utility. +.It Va WITH_RPCBIND_WARMSTART_SUPPORT +Set to build +.Xr rpcbind 8 +with warmstart support. .It Va WITHOUT_SENDMAIL Set to not build .Xr sendmail 8 From owner-svn-src-head@freebsd.org Thu Apr 20 07:31:14 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E812DD471A9; Thu, 20 Apr 2017 07:31:14 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BC79213A9; Thu, 20 Apr 2017 07:31:14 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by mail.baldwin.cx (Postfix) with ESMTPSA id 3B5C610A7B9; Thu, 20 Apr 2017 03:31:13 -0400 (EDT) From: John Baldwin To: Ngie Cooper Cc: Warner Losh , rgrimes@freebsd.org, Eric van Gyzen , Slawa Olhovchenkov , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , src-committers Subject: Re: svn commit: r317094 - head/share/mk Date: Wed, 19 Apr 2017 17:47:57 -0700 Message-ID: <1934449.ZAthNnyNnu@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.0-STABLE; KDE/4.14.10; amd64; ; ) In-Reply-To: <25F616D2-DE24-485B-9549-E1C4F68B9379@gmail.com> References: <25F616D2-DE24-485B-9549-E1C4F68B9379@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Thu, 20 Apr 2017 03:31:13 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 20 Apr 2017 07:31:15 -0000 On Wednesday, April 19, 2017 03:51:24 PM Ngie Cooper wrote: > > > On Apr 19, 2017, at 15:22, Warner Losh wrote: > > ... > > >> Actually this is exactly what I would expect from Linux! > >> > >> Why do we need to pull the trigger on GDB other than to pull the trigger > >> to say we are GPL free, if that is the reason then this is the wrong > >> way to go about it. > > > > I think "gdb in base is horribly broken" is the real reason. You need > > the port to do anything non-trivial these days. > > > > Plus core set this as a goal for the project after it was clear that > > was a consensus desire several years ago. Can't fault someone for > > working towards that goal. > > +1 to Warner's sentiments. > > gdb in base doesn't work well with threads (6.x never did ;/..), and lacks support for other things (like python debugging). Being able to debug threads reliably is a make or break thing. > > So while I understand and in general agree with you Rod, I completely disagree on the practical end of things. I'm actually kind of curious as to why this isn't being done globally.. but I assume that it was described in one of the many threads some time ago about the status quo for debugging with gdb on tier-two architectures. As the commit message stated, gdb in ports doesn't yet include kgdb support for ARM, and no one has tested the sparc64 support for gdb in ports, so those two architectures remain on. For all other platforms, gdb in ports is a strict superset of gdb in base. -- John Baldwin From owner-svn-src-head@freebsd.org Thu Apr 20 07:31:17 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 91CDDD471B9; Thu, 20 Apr 2017 07:31:17 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6D9D013B6; Thu, 20 Apr 2017 07:31:17 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by mail.baldwin.cx (Postfix) with ESMTPSA id 7E6ED10A82D; Thu, 20 Apr 2017 03:31:16 -0400 (EDT) From: John Baldwin To: rgrimes@freebsd.org Cc: Slawa Olhovchenkov , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r317094 - head/share/mk Date: Wed, 19 Apr 2017 12:38:54 -0700 Message-ID: <2211685.c7RPlKUNz2@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.0-STABLE; KDE/4.14.10; amd64; ; ) In-Reply-To: <201704191633.v3JGXWmu031427@pdx.rh.CN85.dnsmgr.net> References: <201704191633.v3JGXWmu031427@pdx.rh.CN85.dnsmgr.net> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Thu, 20 Apr 2017 03:31:16 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 20 Apr 2017 07:31:17 -0000 On Wednesday, April 19, 2017 09:33:32 AM Rodney W. Grimes wrote: > > On Wednesday, April 19, 2017 01:28:37 AM Slawa Olhovchenkov wrote: > > > On Tue, Apr 18, 2017 at 12:45:25PM -0700, John Baldwin wrote: > > > > > > > On Tuesday, April 18, 2017 07:30:13 PM Slawa Olhovchenkov wrote: > > > > > On Tue, Apr 18, 2017 at 04:27:48PM +0000, John Baldwin wrote: > > > > > > > > > > > Author: jhb > > > > > > Date: Tue Apr 18 16:27:48 2017 > > > > > > New Revision: 317094 > > > > > > URL: https://svnweb.freebsd.org/changeset/base/317094 > > > > > > > > > > > > Log: > > > > > > Disable in-tree GDB by default on x86, mips, and powerpc. > > > > > > > > > > > > GDB in ports contains all of the functionality as GDB in base > > > > > > (including kgdb) for these platforms along with additional > > > > > > functionality. In-tree GDB remains enabled on ARM and sparc64. > > > > > > GDB in ports does not currently support kernel debugging on arm, > > > > > > and ports GDB for sparc64 has not been tested (though it does > > > > > > include sparc64 support). > > > > > > > > > > > > Reviewed by: bdrewery, emaste, imp > > > > > > Relnotes: yes > > > > > > Sponsored by: DARPA / AFRL > > > > > > Differential Revision: https://reviews.freebsd.org/D10399 > > > > > > > > > > Generating core.txt now complety broken? > > > > > > > > No. crashinfo has supported gdb from ports for quite a while now. > > > > If you 'pkg install gdb' crashinfo defaults to using the ports gdb over > > > > the base one already. > > > > > > I am about clean install, w/o ports. > > > > Until we get some sort of klldb support that will not work. However, > > we already have platforms now where /usr/bin/gdb doesn't work for that. > > riscv and aarch64 aren't supported in ancient gdb, and the MIPS > > /usr/bin/gdb didn't really work for me in my testing. > > So we break what worked on a Tier1 Platform? With my "user" hat on > these are the exact kind of breakages that send me looking for another > platform to run on. We far to often just go oh you can do X y and Z > to get around what we broke forgetting that the user 6 months from now > when this hits a release isnt gona come ask, he may just go down the > road to something else. > > Remove gdb WHEN klldb can replace it, not a day before. Using "oh its > broken on aarch64 and mips" is not a reason to break things on i386/amd64. /usr/bin/gdb is replaced by gdb from ports. /usr/bin/gdb in base will never get updated and will continue to rot. gdb from ports includes full kgdb support (and crashinfo will use it when available). gdb from ports also includes things like handling inline functions, AVX, fork following, support for threads for compat32 binaries, and cross-debugging of crash dumps (so you can debug a MIPS vmcore on an amd64 host) which /usr/bin/gdb will never be able to do. > Yes, I know we want to get gnu stuff out of the tree, but that needs > to come AFTER a proper replacement is avaliable. In this case the replacement is available as a package. GPLv2 gdb is orphaned and not maintained by anyone. -- John Baldwin From owner-svn-src-head@freebsd.org Thu Apr 20 09:01:32 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 75F8DD46DCE; Thu, 20 Apr 2017 09:01:32 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 47DA6813; Thu, 20 Apr 2017 09:01:32 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3K91VLF094161; Thu, 20 Apr 2017 09:01:31 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3K91VM3094160; Thu, 20 Apr 2017 09:01:31 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201704200901.v3K91VM3094160@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 20 Apr 2017 09:01:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317185 - head/sys/dev/watchdog X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 20 Apr 2017 09:01:32 -0000 Author: mav Date: Thu Apr 20 09:01:31 2017 New Revision: 317185 URL: https://svnweb.freebsd.org/changeset/base/317185 Log: Some cosmetic polishing for pre-timeouts. MFC after: 1 week Modified: head/sys/dev/watchdog/watchdog.c Modified: head/sys/dev/watchdog/watchdog.c ============================================================================== --- head/sys/dev/watchdog/watchdog.c Thu Apr 20 04:36:49 2017 (r317184) +++ head/sys/dev/watchdog/watchdog.c Thu Apr 20 09:01:31 2017 (r317185) @@ -229,13 +229,13 @@ wd_timeout_cb(void *arg) #ifdef DDB if ((wd_pretimeout_act & WD_SOFT_DDB)) { char kdb_why[80]; - snprintf(kdb_why, sizeof(kdb_why), "watchdog %s timeout", type); + snprintf(kdb_why, sizeof(kdb_why), "watchdog %s-timeout", type); kdb_backtrace(); kdb_enter(KDB_WHY_WATCHDOG, kdb_why); } #endif if ((wd_pretimeout_act & WD_SOFT_LOG)) - log(LOG_EMERG, "watchdog %s-timeout, WD_SOFT_LOG", type); + log(LOG_EMERG, "watchdog %s-timeout, WD_SOFT_LOG\n", type); if ((wd_pretimeout_act & WD_SOFT_PRINTF)) printf("watchdog %s-timeout, WD_SOFT_PRINTF\n", type); if ((wd_pretimeout_act & WD_SOFT_PANIC)) @@ -292,8 +292,7 @@ wd_set_pretimeout(int newtimeout, int di /* We determined the value is sane, so reset the callout */ (void) callout_reset(&wd_pretimeo_handle, - timeout_ticks, - wd_timeout_cb, "pre-timeout"); + timeout_ticks, wd_timeout_cb, "pre"); wd_pretimeout = newtimeout; return 0; } From owner-svn-src-head@freebsd.org Thu Apr 20 09:05:54 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9CF0ED47043; Thu, 20 Apr 2017 09:05:54 +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 mx1.freebsd.org (Postfix) with ESMTPS id 535F1B5C; Thu, 20 Apr 2017 09:05:54 +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 v3K95rKP097208; Thu, 20 Apr 2017 09:05:53 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3K95rRT097206; Thu, 20 Apr 2017 09:05:53 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201704200905.v3K95rRT097206@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Thu, 20 Apr 2017 09:05:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317186 - in head/sys: netinet6 netpfil/pf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 20 Apr 2017 09:05:54 -0000 Author: kp Date: Thu Apr 20 09:05:53 2017 New Revision: 317186 URL: https://svnweb.freebsd.org/changeset/base/317186 Log: pf: Fix possible incorrect IPv6 fragmentation When forwarding pf tracks the size of the largest fragment in a fragmented packet, and refragments based on this size. It failed to ensure that this size was a multiple of 8 (as is required for all but the last fragment), so it could end up generating incorrect fragments. For example, if we received an 8 byte and 12 byte fragment pf would emit a first fragment with 12 bytes of payload and the final fragment would claim to be at offset 8 (not 12). We now assert that the fragment size is a multiple of 8 in ip6_fragment(), so other users won't make the same mistake. Reported by: Antonios Atlasis MFC after: 3 days Modified: head/sys/netinet6/ip6_output.c head/sys/netpfil/pf/pf_norm.c Modified: head/sys/netinet6/ip6_output.c ============================================================================== --- head/sys/netinet6/ip6_output.c Thu Apr 20 09:01:31 2017 (r317185) +++ head/sys/netinet6/ip6_output.c Thu Apr 20 09:05:53 2017 (r317186) @@ -226,6 +226,8 @@ ip6_fragment(struct ifnet *ifp, struct m int error; int tlen = m0->m_pkthdr.len; + KASSERT(( mtu % 8 == 0), ("Fragment length must be a multiple of 8")); + m = m0; ip6 = mtod(m, struct ip6_hdr *); mnext = &m->m_nextpkt; Modified: head/sys/netpfil/pf/pf_norm.c ============================================================================== --- head/sys/netpfil/pf/pf_norm.c Thu Apr 20 09:01:31 2017 (r317185) +++ head/sys/netpfil/pf/pf_norm.c Thu Apr 20 09:05:53 2017 (r317186) @@ -762,6 +762,10 @@ pf_refragment6(struct ifnet *ifp, struct hdr->ip6_nxt = IPPROTO_FRAGMENT; } + /* The MTU must be a multiple of 8 bytes, or we risk doing the + * fragmentation wrong. */ + maxlen = maxlen & ~7; + /* * Maxlen may be less than 8 if there was only a single * fragment. As it was fragmented before, add a fragment From owner-svn-src-head@freebsd.org Thu Apr 20 09:35:23 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C7359D47D3D; Thu, 20 Apr 2017 09:35:23 +0000 (UTC) (envelope-from remko@FreeBSD.org) Received: from smtp-out.elvandar.org (gandalf.elvandar.org [149.210.225.204]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8815D6ED; Thu, 20 Apr 2017 09:35:22 +0000 (UTC) (envelope-from remko@FreeBSD.org) Received: from mail1.elvandar.org (mail1.elvandar.org [IPv6:2001:470:d701::3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp-out.elvandar.org (Postfix) with ESMTPS id DE6A04707BC; Thu, 20 Apr 2017 11:35:14 +0200 (CEST) Received: from [10.0.2.17] (f239026.upc-f.chello.nl [80.56.239.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail1.elvandar.org (Postfix) with ESMTPSA id 907B81EF7E; Thu, 20 Apr 2017 11:35:14 +0200 (CEST) From: Remko Lodder Message-Id: <96411818-CC1A-4814-9C01-B10E2A353EBC@FreeBSD.org> Content-Type: multipart/signed; boundary="Apple-Mail=_8789A627-C181-42EA-A6D6-864E4293BB34"; protocol="application/pgp-signature"; micalg=pgp-sha512 Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: svn commit: r317186 - in head/sys: netinet6 netpfil/pf Date: Thu, 20 Apr 2017 11:35:13 +0200 In-Reply-To: <201704200905.v3K95rRT097206@repo.freebsd.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org To: Kristof Provost References: <201704200905.v3K95rRT097206@repo.freebsd.org> X-Mailer: Apple Mail (2.3273) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 20 Apr 2017 09:35:23 -0000 --Apple-Mail=_8789A627-C181-42EA-A6D6-864E4293BB34 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii > On 20 Apr 2017, at 11:05, Kristof Provost wrote: > > Author: kp > Date: Thu Apr 20 09:05:53 2017 > New Revision: 317186 > URL: https://svnweb.freebsd.org/changeset/base/317186 > > Log: > pf: Fix possible incorrect IPv6 fragmentation > > Thank you! --Apple-Mail=_8789A627-C181-42EA-A6D6-864E4293BB34 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- iQIcBAEBCgAGBQJY+IDSAAoJEHE1jtY/d0B5hYMP/RsoRutUCE4KNIKGKLpK1y3z 6O3dZ64T/W3uQNRcm9NcvX4OG/222b7FM555Rjxf2qr6FV395q1ILfK530UZiNeE jrdhoRZky+meCgAwAH0907q5wgcAhCrBhOKjLicAY/nCqLYSvC7Rf35wXu3JwJ9B 3ltEcejSv06fJzKfng1CghaskwMFSM9wiXSsBcR/tcKnl0iBsKN/NhEepJAmedO9 nkx7a3uYLFdv/jKWK8Lce0R8L/WiQcYPUXtnKVI5328IANO9VHJqdvvF+3Ldpd89 02hebWex32Xn4tiNLxNptiu6BCeWm9gY6StUvQSBjzsWfvj+Jy+8UfQkIVW50Qul VEqOrP/XUyd0yfJfs5Xj+8PQx1Q0J7fK0JeSjNLMBYzd81VAtALRUDwxRK8iVwV1 LTTINwuYjUc6waqO2k6IL2v6TXBushp29bvRgKHg9+tsdktSosQoyWCoF8QxavB9 71qNLDOI5wMeTLyerz0pzv5rdifkwkX2HAR7qUw7PclRXf3vOEb4a3YSPz/sOsdj x5ao+OLdgl5VK6ysiocKObhvj9W63RG8H44c7g0n38ljbRu64lUPxsg2BbOzhn/j tog7vB3/afN43IUAbNcly75SGdUqKeA8RG6GtsjI4hz/WvIxmKzCp/ZDxSgqWgA3 1jGM9I6fZ6mDeVwRoWgI =H37S -----END PGP SIGNATURE----- --Apple-Mail=_8789A627-C181-42EA-A6D6-864E4293BB34-- From owner-svn-src-head@freebsd.org Thu Apr 20 11:32:19 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A8ABED471C4; Thu, 20 Apr 2017 11:32:19 +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 mx1.freebsd.org (Postfix) with ESMTPS id 5EE40F78; Thu, 20 Apr 2017 11:32:19 +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 v3KBWINn057597; Thu, 20 Apr 2017 11:32:18 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3KBWInA057594; Thu, 20 Apr 2017 11:32:18 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201704201132.v3KBWInA057594@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Thu, 20 Apr 2017 11:32:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317187 - head/usr.bin/diff/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 20 Apr 2017 11:32:19 -0000 Author: bapt Date: Thu Apr 20 11:32:18 2017 New Revision: 317187 URL: https://svnweb.freebsd.org/changeset/base/317187 Log: Add a regression test for diff -D Added: head/usr.bin/diff/tests/ifdef.out (contents, props changed) Modified: head/usr.bin/diff/tests/Makefile head/usr.bin/diff/tests/diff_test.sh Modified: head/usr.bin/diff/tests/Makefile ============================================================================== --- head/usr.bin/diff/tests/Makefile Thu Apr 20 09:05:53 2017 (r317186) +++ head/usr.bin/diff/tests/Makefile Thu Apr 20 11:32:18 2017 (r317187) @@ -21,7 +21,8 @@ ${PACKAGE}FILES+= \ unified_c9999.out \ unified_9999.out \ header.out \ - header_ns.out + header_ns.out \ + ifdef.out NETBSD_ATF_TESTS_SH+= netbsd_diff_test Modified: head/usr.bin/diff/tests/diff_test.sh ============================================================================== --- head/usr.bin/diff/tests/diff_test.sh Thu Apr 20 09:05:53 2017 (r317186) +++ head/usr.bin/diff/tests/diff_test.sh Thu Apr 20 11:32:18 2017 (r317187) @@ -4,6 +4,7 @@ atf_test_case simple atf_test_case unified atf_test_case header atf_test_case header_ns +atf_test_case ifdef simple_body() { @@ -70,10 +71,18 @@ header_ns_body() diff -u empty hello } +ifdef_body() +{ + atf_check -o file:$(atf_get_srcdir)/ifdef.out -s eq:1 \ + diff -D PLOP "$(atf_get_srcdir)/input_c1.in" \ + "$(atf_get_srcdir)/input_c2.in" +} + atf_init_test_cases() { atf_add_test_case simple atf_add_test_case unified atf_add_test_case header atf_add_test_case header_ns + atf_add_test_case ifdef } Added: head/usr.bin/diff/tests/ifdef.out ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/diff/tests/ifdef.out Thu Apr 20 11:32:18 2017 (r317187) @@ -0,0 +1,26 @@ +/* + * A comment + * +#ifndef PLOP + * And another bla +#else /* PLOP */ + * And another bla +#endif /* PLOP */ + * +#ifndef PLOP + * And yet another +#else /* PLOP */ + * and yet another +#endif /* PLOP */ + */ + +int +main(void) +{ +#ifdef PLOP + +#endif /* PLOP */ + printf("something"); + + return (0); +} From owner-svn-src-head@freebsd.org Thu Apr 20 13:46:56 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C5276D4873D; Thu, 20 Apr 2017 13:46:56 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A22C4A8B; Thu, 20 Apr 2017 13:46:56 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3KDktkD013228; Thu, 20 Apr 2017 13:46:55 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3KDktZ6013225; Thu, 20 Apr 2017 13:46:55 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201704201346.v3KDktZ6013225@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Thu, 20 Apr 2017 13:46:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317190 - in head/sys: dev/fb sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 20 Apr 2017 13:46:56 -0000 Author: bde Date: Thu Apr 20 13:46:55 2017 New Revision: 317190 URL: https://svnweb.freebsd.org/changeset/base/317190 Log: Attempt to determine the modes in which 8-bit wide characters are actually 9 wide. I only need this to improve the mouse cursor, but it has always been needed to select and/or adjust fonts. This is complicated because there are no standard parameter tables giving this bit of information directly, and the device register bit giving the information can't be trusted even if it is read from the hardware. Use a heuristic to guess if the device register can be trusted. (The device register is normally read from the BIOS mode table, but on my system where the device register is wrong, the mode table doesn't match the hardware and is not used; the device registers are used in this case.) Modified: head/sys/dev/fb/vesa.c head/sys/dev/fb/vga.c head/sys/sys/fbio.h Modified: head/sys/dev/fb/vesa.c ============================================================================== --- head/sys/dev/fb/vesa.c Thu Apr 20 12:48:01 2017 (r317189) +++ head/sys/dev/fb/vesa.c Thu Apr 20 13:46:55 2017 (r317190) @@ -1359,6 +1359,7 @@ vesa_set_mode(video_adapter_t *adp, int vesa_adp->va_crtc_addr = (vesa_adp->va_flags & V_ADP_COLOR) ? COLOR_CRTC : MONO_CRTC; + vesa_adp->va_flags &= ~V_ADP_CWIDTH9; vesa_adp->va_line_width = info.vi_buffer_size / info.vi_height; if ((info.vi_flags & V_INFO_GRAPHICS) != 0) vesa_adp->va_line_width /= info.vi_planes; Modified: head/sys/dev/fb/vga.c ============================================================================== --- head/sys/dev/fb/vga.c Thu Apr 20 12:48:01 2017 (r317189) +++ head/sys/dev/fb/vga.c Thu Apr 20 13:46:55 2017 (r317190) @@ -862,6 +862,9 @@ update_adapter_info(video_adapter_t *adp /* XXX */ adp->va_buffer = info->vi_buffer; adp->va_buffer_size = info->vi_buffer_size; + adp->va_flags &= ~V_ADP_CWIDTH9; + if (info->vi_flags & V_INFO_CWIDTH9) + adp->va_flags |= V_ADP_CWIDTH9; if (info->vi_mem_model == V_INFO_MM_VGAX) { adp->va_line_width = info->vi_width/2; } else if (info->vi_flags & V_INFO_GRAPHICS) { @@ -1221,6 +1224,29 @@ probe_adapters(void) } } +#if !defined(VGA_NO_BIOS) && !defined(VGA_NO_MODE_CHANGE) + /* + * Attempt to determine the real character width for each mode. 9 wide + * is supposed to be standard for EGA mono mode and most VGA text modes, + * but some hardware doesn't support it, so dynamic configuration is + * needed. Bit 0 in sequencer register 1 is supposed control the width + * (set = 8), but this is unreliable too. Trust that 0 in the sequencer + * bit means 9 wide after verifying that 9 is consistent with some CRTC + * timing. The ratio (Horizontal Total) / (Horizontal Displayed) is + * about 1.2 in all standard 9-wide modes and should be about 9/8 larger + * again in similar 8-wide modes; in practice it is usually about 1.4 + * times larger. + */ + for (i = 0; i < nitems(bios_vmode); ++i) { + if (bios_vmode[i].vi_mem_model == V_INFO_MM_TEXT && + bios_vmode[i].vi_width != 90) { + mp = get_mode_param(map_mode_num(bios_vmode[i].vi_mode)); + if (mp != NULL && !(mp[5] & 1) && mp[10] <= mp[11] * 125 / 100) + bios_vmode[i].vi_flags |= V_INFO_CWIDTH9; + } + } +#endif + /* buffer address */ vga_get_info(&biosadapter[V_ADP_PRIMARY], biosadapter[V_ADP_PRIMARY].va_initial_mode, &info); Modified: head/sys/sys/fbio.h ============================================================================== --- head/sys/sys/fbio.h Thu Apr 20 12:48:01 2017 (r317189) +++ head/sys/sys/fbio.h Thu Apr 20 13:46:55 2017 (r317190) @@ -338,6 +338,7 @@ struct video_info { #define V_INFO_LINEAR (1 << 2) #define V_INFO_VESA (1 << 3) #define V_INFO_NONVGA (1 << 4) +#define V_INFO_CWIDTH9 (1 << 5) int vi_width; int vi_height; int vi_cwidth; @@ -400,6 +401,7 @@ struct video_adapter { #define V_ADP_REGISTERED (1 << 18) #define V_ADP_ATTACHED (1 << 19) #define V_ADP_DAC8 (1 << 20) +#define V_ADP_CWIDTH9 (1 << 21) vm_offset_t va_io_base; int va_io_size; vm_offset_t va_crtc_addr; From owner-svn-src-head@freebsd.org Thu Apr 20 13:56:08 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2A6A7D489CE; Thu, 20 Apr 2017 13:56:08 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EEE5A68; Thu, 20 Apr 2017 13:56:07 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3KDu7pr017075; Thu, 20 Apr 2017 13:56:07 GMT (envelope-from cognet@FreeBSD.org) Received: (from cognet@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3KDu7VK017074; Thu, 20 Apr 2017 13:56:07 GMT (envelope-from cognet@FreeBSD.org) Message-Id: <201704201356.v3KDu7VK017074@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cognet set sender to cognet@FreeBSD.org using -f From: Olivier Houchard Date: Thu, 20 Apr 2017 13:56:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317191 - head/sys/dev/ofw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 20 Apr 2017 13:56:08 -0000 Author: cognet Date: Thu Apr 20 13:56:06 2017 New Revision: 317191 URL: https://svnweb.freebsd.org/changeset/base/317191 Log: ePAPR states that any non-boot CPU will come in "disabled" state. So we should not consider a "disabled" cpu as a CPU we have to ignore, and we should use them if they provide a "enable-method". While I'm there, support "ok" as well as "okay", while ePAPR only accepts "okay", linux accepts "ok" too so we can expect it to be used. Reviewed by: andrew (partially) Modified: head/sys/dev/ofw/ofw_cpu.c Modified: head/sys/dev/ofw/ofw_cpu.c ============================================================================== --- head/sys/dev/ofw/ofw_cpu.c Thu Apr 20 13:46:55 2017 (r317190) +++ head/sys/dev/ofw/ofw_cpu.c Thu Apr 20 13:56:06 2017 (r317191) @@ -320,8 +320,10 @@ ofw_cpu_early_foreach(ofw_cpu_foreach_cb if (only_runnable) { status[0] = '\0'; OF_getprop(child, "status", status, sizeof(status)); - if (status[0] != '\0' && strcmp(status, "okay") != 0) - continue; + if (status[0] != '\0' && strcmp(status, "okay") != 0 && + strcmp(status, "ok") != 0 && + !OF_hasprop(child, "enable-method")) + continue; } /* From owner-svn-src-head@freebsd.org Thu Apr 20 13:56:32 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 42531D48A3D; Thu, 20 Apr 2017 13:56:32 +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 mx1.freebsd.org (Postfix) with ESMTPS id 0456E1CD; Thu, 20 Apr 2017 13:56:31 +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 v3KDuVfh017135; Thu, 20 Apr 2017 13:56:31 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3KDuU0k017131; Thu, 20 Apr 2017 13:56:30 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201704201356.v3KDuU0k017131@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Thu, 20 Apr 2017 13:56:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317192 - head/sys/arm64/arm64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 20 Apr 2017 13:56:32 -0000 Author: andrew Date: Thu Apr 20 13:56:30 2017 New Revision: 317192 URL: https://svnweb.freebsd.org/changeset/base/317192 Log: Push loading curthread into assembly in the synchronous exception handlers. This will help investigating the performance impact of moving parts of the switch statement in do_el0_sync into assembly. Sponsored by: DARPA, AFRL Modified: head/sys/arm64/arm64/exception.S head/sys/arm64/arm64/genassym.c head/sys/arm64/arm64/trap.c Modified: head/sys/arm64/arm64/exception.S ============================================================================== --- head/sys/arm64/arm64/exception.S Thu Apr 20 13:56:06 2017 (r317191) +++ head/sys/arm64/arm64/exception.S Thu Apr 20 13:56:30 2017 (r317192) @@ -143,7 +143,8 @@ __FBSDID("$FreeBSD$"); ENTRY(handle_el1h_sync) save_registers 1 - mov x0, sp + ldr x0, [x18, #PC_CURTHREAD] + mov x1, sp bl do_el1h_sync restore_registers 1 eret @@ -163,7 +164,9 @@ END(handle_el1h_error) ENTRY(handle_el0_sync) save_registers 0 - mov x0, sp + ldr x0, [x18, #PC_CURTHREAD] + mov x1, sp + str x1, [x0, #TD_FRAME] bl do_el0_sync do_ast restore_registers 0 Modified: head/sys/arm64/arm64/genassym.c ============================================================================== --- head/sys/arm64/arm64/genassym.c Thu Apr 20 13:56:06 2017 (r317191) +++ head/sys/arm64/arm64/genassym.c Thu Apr 20 13:56:30 2017 (r317192) @@ -57,6 +57,7 @@ ASSYM(SF_UC, offsetof(struct sigframe, s ASSYM(TD_PCB, offsetof(struct thread, td_pcb)); ASSYM(TD_FLAGS, offsetof(struct thread, td_flags)); +ASSYM(TD_FRAME, offsetof(struct thread, td_frame)); ASSYM(TD_LOCK, offsetof(struct thread, td_lock)); ASSYM(TF_SIZE, sizeof(struct trapframe)); Modified: head/sys/arm64/arm64/trap.c ============================================================================== --- head/sys/arm64/arm64/trap.c Thu Apr 20 13:56:06 2017 (r317191) +++ head/sys/arm64/arm64/trap.c Thu Apr 20 13:56:30 2017 (r317192) @@ -72,8 +72,8 @@ __FBSDID("$FreeBSD$"); extern register_t fsu_intr_fault; /* Called from exception.S */ -void do_el1h_sync(struct trapframe *); -void do_el0_sync(struct trapframe *); +void do_el1h_sync(struct thread *, struct trapframe *); +void do_el0_sync(struct thread *, struct trapframe *); void do_el0_error(struct trapframe *); static void print_registers(struct trapframe *frame); @@ -130,23 +130,20 @@ cpu_fetch_syscall_args(struct thread *td #include "../../kern/subr_syscall.c" static void -svc_handler(struct trapframe *frame) +svc_handler(struct thread *td, struct trapframe *frame) { struct syscall_args sa; - struct thread *td; int error; - td = curthread; - error = syscallenter(td, &sa); syscallret(td, error, &sa); } static void -data_abort(struct trapframe *frame, uint64_t esr, uint64_t far, int lower) +data_abort(struct thread *td, struct trapframe *frame, uint64_t esr, + uint64_t far, int lower) { struct vm_map *map; - struct thread *td; struct proc *p; struct pcb *pcb; vm_prot_t ftype; @@ -167,7 +164,6 @@ data_abort(struct trapframe *frame, uint } #endif - td = curthread; pcb = td->td_pcb; /* @@ -261,7 +257,7 @@ print_registers(struct trapframe *frame) } void -do_el1h_sync(struct trapframe *frame) +do_el1h_sync(struct thread *td, struct trapframe *frame) { uint32_t exception; uint64_t esr, far; @@ -276,14 +272,14 @@ do_el1h_sync(struct trapframe *frame) #endif CTR4(KTR_TRAP, - "do_el1_sync: curthread: %p, esr %lx, elr: %lx, frame: %p", - curthread, esr, frame->tf_elr, frame); + "do_el1_sync: curthread: %p, esr %lx, elr: %lx, frame: %p", td, + esr, frame->tf_elr, frame); switch(exception) { case EXCP_FP_SIMD: case EXCP_TRAP_FP: #ifdef VFP - if ((curthread->td_pcb->pcb_fpflags & PCB_FP_KERN) != 0) { + if ((td->td_pcb->pcb_fpflags & PCB_FP_KERN) != 0) { vfp_restore_state(); } else #endif @@ -297,7 +293,7 @@ do_el1h_sync(struct trapframe *frame) case EXCP_DATA_ABORT: far = READ_SPECIALREG(far_el1); intr_enable(); - data_abort(frame, esr, far, 0); + data_abort(td, frame, esr, far, 0); break; case EXCP_BRK: #ifdef KDTRACE_HOOKS @@ -338,9 +334,8 @@ el0_excp_unknown(struct trapframe *frame } void -do_el0_sync(struct trapframe *frame) +do_el0_sync(struct thread *td, struct trapframe *frame) { - struct thread *td; uint32_t exception; uint64_t esr, far; @@ -349,9 +344,6 @@ do_el0_sync(struct trapframe *frame) ("Invalid pcpu address from userland: %p (tpidr %lx)", get_pcpu(), READ_SPECIALREG(tpidr_el1))); - td = curthread; - td->td_frame = frame; - esr = frame->tf_esr; exception = ESR_ELx_EXCEPTION(esr); switch (exception) { @@ -364,8 +356,8 @@ do_el0_sync(struct trapframe *frame) intr_enable(); CTR4(KTR_TRAP, - "do_el0_sync: curthread: %p, esr %lx, elr: %lx, frame: %p", - curthread, esr, frame->tf_elr, frame); + "do_el0_sync: curthread: %p, esr %lx, elr: %lx, frame: %p", td, esr, + frame->tf_elr, frame); switch(exception) { case EXCP_FP_SIMD: @@ -377,12 +369,12 @@ do_el0_sync(struct trapframe *frame) #endif break; case EXCP_SVC: - svc_handler(frame); + svc_handler(td, frame); break; case EXCP_INSN_ABORT_L: case EXCP_DATA_ABORT_L: case EXCP_DATA_ABORT: - data_abort(frame, esr, far, 1); + data_abort(td, frame, esr, far, 1); break; case EXCP_UNKNOWN: el0_excp_unknown(frame, far); @@ -418,10 +410,10 @@ do_el0_sync(struct trapframe *frame) break; } - KASSERT((curthread->td_pcb->pcb_fpflags & ~PCB_FP_USERMASK) == 0, + KASSERT((td->td_pcb->pcb_fpflags & ~PCB_FP_USERMASK) == 0, ("Kernel VFP flags set while entering userspace")); KASSERT( - curthread->td_pcb->pcb_fpusaved == &curthread->td_pcb->pcb_fpustate, + td->td_pcb->pcb_fpusaved == &td->td_pcb->pcb_fpustate, ("Kernel VFP state in use when entering userspace")); } From owner-svn-src-head@freebsd.org Thu Apr 20 13:57:55 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3EA77D48B1C; Thu, 20 Apr 2017 13:57:55 +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 mx1.freebsd.org (Postfix) with ESMTPS id 0ED713D8; Thu, 20 Apr 2017 13:57:54 +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 v3KDvsDs017223; Thu, 20 Apr 2017 13:57:54 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3KDvsSu017222; Thu, 20 Apr 2017 13:57:54 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201704201357.v3KDvsSu017222@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 20 Apr 2017 13:57:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317193 - head/contrib/elftoolchain/elfcopy X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 20 Apr 2017 13:57:55 -0000 Author: emaste Date: Thu Apr 20 13:57:53 2017 New Revision: 317193 URL: https://svnweb.freebsd.org/changeset/base/317193 Log: elfcopy: document --strip-symbols=filename in the man page Reported by: bz MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/contrib/elftoolchain/elfcopy/elfcopy.1 Modified: head/contrib/elftoolchain/elfcopy/elfcopy.1 ============================================================================== --- head/contrib/elftoolchain/elfcopy/elfcopy.1 Thu Apr 20 13:56:30 2017 (r317192) +++ head/contrib/elftoolchain/elfcopy/elfcopy.1 Thu Apr 20 13:57:53 2017 (r317193) @@ -23,7 +23,7 @@ .\" .\" $Id: elfcopy.1 3426 2016-03-05 13:32:28Z emaste $ .\" -.Dd March 5, 2016 +.Dd April 20, 2017 .Os .Dt ELFCOPY 1 .Sh NAME @@ -83,6 +83,7 @@ .Op Fl -srec-forceS3 .Op Fl -srec-len Ns = Ns Ar val .Op Fl -strip-dwo +.Op Fl -strip-symbols= Ns Ar filename .Op Fl -strip-unneeded .Ar infile .Op Ar outfile @@ -339,6 +340,10 @@ This option is only meaningful when the .Dq srec . .It Fl -strip-dwo Do not copy .dwo debug sections to the output file. +.It Fl -strip-symbols= Ns Ar filename +Do not copy any of the symbols specified by +.Ar filename +to the output. .It Fl -strip-unneeded Do not copy symbols that are not needed for relocation processing. .El From owner-svn-src-head@freebsd.org Thu Apr 20 14:22:35 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 81EE7D463E2; Thu, 20 Apr 2017 14:22:35 +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 mx1.freebsd.org (Postfix) with ESMTPS id 5CFAB15EB; Thu, 20 Apr 2017 14:22:35 +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 v3KEMYK1029240; Thu, 20 Apr 2017 14:22:34 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3KEMXU2029234; Thu, 20 Apr 2017 14:22:33 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201704201422.v3KEMXU2029234@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Thu, 20 Apr 2017 14:22:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317194 - in head/usr.bin/diff: . tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 20 Apr 2017 14:22:35 -0000 Author: bapt Date: Thu Apr 20 14:22:33 2017 New Revision: 317194 URL: https://svnweb.freebsd.org/changeset/base/317194 Log: Implement a basic --changed-group-format etcupdate(8) requires that option, while GNU diff supports many more variation of that options, their behaviour beside the simple verion implemented here are quite inconsistent as such I do not plan to implement those. The only special keyword supported by this implementation are: %< and %> %= is not implemented as the documentation of GNU diff says: common lines, but it actually when tested print the changes from the first file Added: head/usr.bin/diff/tests/group-format.out (contents, props changed) Modified: head/usr.bin/diff/diff.1 head/usr.bin/diff/diff.c head/usr.bin/diff/diff.h head/usr.bin/diff/diffreg.c head/usr.bin/diff/tests/Makefile head/usr.bin/diff/tests/diff_test.sh Modified: head/usr.bin/diff/diff.1 ============================================================================== --- head/usr.bin/diff/diff.1 Thu Apr 20 13:57:53 2017 (r317193) +++ head/usr.bin/diff/diff.1 Thu Apr 20 14:22:33 2017 (r317194) @@ -30,7 +30,7 @@ .\" @(#)diff.1 8.1 (Berkeley) 6/30/93 .\" $FreeBSD$ .\" -.Dd April 8, 2017 +.Dd April 20, 2017 .Dt DIFF 1 .Os .Sh NAME @@ -44,6 +44,7 @@ .Fl n | q | u .Oc .Op Fl -brief +.Op Fl -changed-group-format Ar GFMT .Op Fl -ed .Op Fl -expand-tabs .Op Fl -forward-ed @@ -70,6 +71,7 @@ .Op Fl I Ar pattern | Fl -ignore-matching-lines Ar pattern .Op Fl L Ar label | Fl -label Ar label .Op Fl -brief +.Op Fl -changed-group-format Ar GFMT .Op Fl -ed .Op Fl -expand-tabs .Op Fl -forward-ed @@ -94,6 +96,7 @@ .Op Fl abdiltw .Op Fl I Ar pattern | Fl -ignore-matching-lines Ar pattern .Op Fl -brief +.Op Fl -changed-group-format Ar GFMT .Op Fl -ed .Op Fl -expand-tabs .Op Fl -forward-ed @@ -119,6 +122,7 @@ .Op Fl I Ar pattern | Fl -ignore-matching-lines Ar pattern .Op Fl L Ar label | Fl -label Ar label .Op Fl -brief +.Op Fl -changed-group-format Ar GFMT .Op Fl -ed .Op Fl -expand-tabs .Op Fl -forward-ed @@ -146,6 +150,7 @@ .Fl n | q | u .Oc .Op Fl -brief +.Op Fl -changed-group-format Ar GFMT .Op Fl -context .Op Fl -ed .Op Fl -expand-tabs @@ -355,6 +360,16 @@ E.g., .Dq if (\ \&a == b \&) will compare equal to .Dq if(a==b) . +.It Fl -changed-group-format Ar GFMT +Format input groups in the provided +.Pp +the format is a string with special keywords: +.Bl -tag -width %< +.It %< +lines from FILE1 +.It %< +lines from FILE2 +.El .El .Pp Directory comparison options: Modified: head/usr.bin/diff/diff.c ============================================================================== --- head/usr.bin/diff/diff.c Thu Apr 20 13:57:53 2017 (r317193) +++ head/usr.bin/diff/diff.c Thu Apr 20 14:22:33 2017 (r317194) @@ -41,6 +41,7 @@ int lflag, Nflag, Pflag, rflag, sflag, int diff_format, diff_context, status, ignore_file_case; int tabsize = 8; char *start, *ifdefname, *diffargs, *label[2], *ignore_pats; +char *group_format = NULL; struct stat stb1, stb2; struct excludes *excludes_list; regex_t ignore_re; @@ -54,6 +55,7 @@ enum { OPT_NORMAL, OPT_HORIZON_LINES, OPT_SPEED_LARGE_FILES, + OPT_CHANGED_GROUP_FORMAT, }; static struct option longopts[] = { @@ -89,6 +91,7 @@ static struct option longopts[] = { { "speed-large-files", no_argument, NULL, OPT_SPEED_LARGE_FILES}, { "strip-trailing-cr", no_argument, NULL, OPT_STRIPCR }, { "tabsize", optional_argument, NULL, OPT_TSIZE }, + { "changed-group-format", required_argument, NULL, OPT_CHANGED_GROUP_FORMAT}, { NULL, 0, 0, '\0'} }; @@ -227,6 +230,10 @@ main(int argc, char **argv) case 'x': push_excludes(optarg); break; + case OPT_CHANGED_GROUP_FORMAT: + diff_format = D_GFORMAT; + group_format = optarg; + break; case OPT_HORIZON_LINES: break; /* XXX TODO for compatibility with GNU diff3 */ case OPT_IGN_FN_CASE: Modified: head/usr.bin/diff/diff.h ============================================================================== --- head/usr.bin/diff/diff.h Thu Apr 20 13:57:53 2017 (r317193) +++ head/usr.bin/diff/diff.h Thu Apr 20 14:22:33 2017 (r317194) @@ -47,6 +47,7 @@ #define D_NREVERSE 5 /* Reverse ed script with numbered lines and no trailing . */ #define D_BRIEF 6 /* Say if the files differ */ +#define D_GFORMAT 7 /* Diff with defined changed group format */ /* * Output flags @@ -87,6 +88,7 @@ extern int lflag, Nflag, Pflag, rflag, s extern int diff_format, diff_context, status, ignore_file_case; extern int tabsize; extern char *start, *ifdefname, *diffargs, *label[2], *ignore_pats; +extern char *group_format; extern struct stat stb1, stb2; extern struct excludes *excludes_list; extern regex_t ignore_re; Modified: head/usr.bin/diff/diffreg.c ============================================================================== --- head/usr.bin/diff/diffreg.c Thu Apr 20 13:57:53 2017 (r317193) +++ head/usr.bin/diff/diffreg.c Thu Apr 20 14:22:33 2017 (r317194) @@ -1008,7 +1008,7 @@ output(char *file1, FILE *f1, char *file } if (m == 0) change(file1, f1, file2, f2, 1, 0, 1, len[1], &flags); - if (diff_format == D_IFDEF) { + if (diff_format == D_IFDEF || diff_format == D_GFORMAT) { for (;;) { #define c i0 if ((c = getc(f1)) == EOF) @@ -1081,10 +1081,13 @@ change(char *file1, FILE *f1, char *file int *pflags) { static size_t max_context = 64; - int i; + long curpos; + int i, nc; + const char *walk; restart: - if (diff_format != D_IFDEF && a > b && c > d) + if ((diff_format != D_IFDEF || diff_format == D_GFORMAT) && + a > b && c > d) return; if (ignore_pats != NULL) { char *line; @@ -1181,12 +1184,38 @@ proceed: } break; } + if (diff_format == D_GFORMAT) { + curpos = ftell(f1); + /* print through if append (a>b), else to (nb: 0 vs 1 orig) */ + nc = ixold[a > b ? b : a - 1] - curpos; + for (i = 0; i < nc; i++) + diff_output("%c", getc(f1)); + for (walk = group_format; *walk != '\0'; walk++) { + if (*walk == '%') { + walk++; + switch (*walk) { + case '<': + fetch(ixold, a, b, f1, '<', 1, *pflags); + break; + case '>': + fetch(ixnew, c, d, f2, '>', 0, *pflags); + break; + default: + diff_output("%%%c", *walk); + break; + } + continue; + } + diff_output("%c", *walk); + } + } if (diff_format == D_NORMAL || diff_format == D_IFDEF) { fetch(ixold, a, b, f1, '<', 1, *pflags); if (a <= b && c <= d && diff_format == D_NORMAL) diff_output("---\n"); } - i = fetch(ixnew, c, d, f2, diff_format == D_NORMAL ? '>' : '\0', 0, *pflags); + if (diff_format != D_GFORMAT) + i = fetch(ixnew, c, d, f2, diff_format == D_NORMAL ? '>' : '\0', 0, *pflags); if (i != 0 && diff_format == D_EDIT) { /* * A non-zero return value for D_EDIT indicates that the @@ -1220,7 +1249,7 @@ fetch(long *f, int a, int b, FILE *lb, i * When doing #ifdef's, copy down to current line * if this is the first file, so that stuff makes it to output. */ - if (diff_format == D_IFDEF && oldfile) { + if ((diff_format == D_IFDEF) && oldfile) { long curpos = ftell(lb); /* print through if append (a>b), else to (nb: 0 vs 1 orig) */ nc = f[a > b ? b : a - 1] - curpos; @@ -1244,7 +1273,8 @@ fetch(long *f, int a, int b, FILE *lb, i for (i = a; i <= b; i++) { fseek(lb, f[i - 1], SEEK_SET); nc = f[i] - f[i - 1]; - if (diff_format != D_IFDEF && ch != '\0') { + if ((diff_format != D_IFDEF && diff_format != D_GFORMAT) && + ch != '\0') { diff_output("%c", ch); if (Tflag && (diff_format == D_NORMAL || diff_format == D_CONTEXT || diff_format == D_UNIFIED)) Modified: head/usr.bin/diff/tests/Makefile ============================================================================== --- head/usr.bin/diff/tests/Makefile Thu Apr 20 13:57:53 2017 (r317193) +++ head/usr.bin/diff/tests/Makefile Thu Apr 20 14:22:33 2017 (r317194) @@ -22,7 +22,8 @@ ${PACKAGE}FILES+= \ unified_9999.out \ header.out \ header_ns.out \ - ifdef.out + ifdef.out \ + group-format.out NETBSD_ATF_TESTS_SH+= netbsd_diff_test Modified: head/usr.bin/diff/tests/diff_test.sh ============================================================================== --- head/usr.bin/diff/tests/diff_test.sh Thu Apr 20 13:57:53 2017 (r317193) +++ head/usr.bin/diff/tests/diff_test.sh Thu Apr 20 14:22:33 2017 (r317194) @@ -5,6 +5,7 @@ atf_test_case unified atf_test_case header atf_test_case header_ns atf_test_case ifdef +atf_test_case group_format simple_body() { @@ -78,6 +79,15 @@ ifdef_body() "$(atf_get_srcdir)/input_c2.in" } +group_format_body() +{ + atf_check -o file:$(atf_get_srcdir)/group-format.out -s eq:1 \ + diff --changed-group-format='<<<<<<< (local) +%<======= +%>>>>>>>> (stock) +' "$(atf_get_srcdir)/input_c1.in" "$(atf_get_srcdir)/input_c2.in" +} + atf_init_test_cases() { atf_add_test_case simple @@ -85,4 +95,5 @@ atf_init_test_cases() atf_add_test_case header atf_add_test_case header_ns atf_add_test_case ifdef + atf_add_test_case group_format } Added: head/usr.bin/diff/tests/group-format.out ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/diff/tests/group-format.out Thu Apr 20 14:22:33 2017 (r317194) @@ -0,0 +1,27 @@ +/* + * A comment + * +<<<<<<< (local) + * And another bla +======= + * And another bla +>>>>>>> (stock) + * +<<<<<<< (local) + * And yet another +======= + * and yet another +>>>>>>> (stock) + */ + +int +main(void) +{ +<<<<<<< (local) +======= + +>>>>>>> (stock) + printf("something"); + + return (0); +} From owner-svn-src-head@freebsd.org Thu Apr 20 15:06:17 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E5EF2D488BB; Thu, 20 Apr 2017 15:06:17 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B21BA1F6F; Thu, 20 Apr 2017 15:06:17 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3KF6Ghf047302; Thu, 20 Apr 2017 15:06:16 GMT (envelope-from cognet@FreeBSD.org) Received: (from cognet@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3KF6G7c047301; Thu, 20 Apr 2017 15:06:16 GMT (envelope-from cognet@FreeBSD.org) Message-Id: <201704201506.v3KF6G7c047301@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cognet set sender to cognet@FreeBSD.org using -f From: Olivier Houchard Date: Thu, 20 Apr 2017 15:06:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317195 - head/sys/dev/ofw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 20 Apr 2017 15:06:18 -0000 Author: cognet Date: Thu Apr 20 15:06:16 2017 New Revision: 317195 URL: https://svnweb.freebsd.org/changeset/base/317195 Log: Update comment ot reflect realilty, we know also take care of CPUs that provide a enable-method. Suggested by: jhibbits Modified: head/sys/dev/ofw/ofw_cpu.c Modified: head/sys/dev/ofw/ofw_cpu.c ============================================================================== --- head/sys/dev/ofw/ofw_cpu.c Thu Apr 20 14:22:33 2017 (r317194) +++ head/sys/dev/ofw/ofw_cpu.c Thu Apr 20 15:06:16 2017 (r317195) @@ -315,7 +315,8 @@ ofw_cpu_early_foreach(ofw_cpu_foreach_cb /* * If we are filtering by runnable then limit to only - * those that have been enabled. + * those that have been enabled, or do provide a method + * to enable them. */ if (only_runnable) { status[0] = '\0'; From owner-svn-src-head@freebsd.org Thu Apr 20 15:18:16 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 83795D48B1E; Thu, 20 Apr 2017 15:18:16 +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 mx1.freebsd.org (Postfix) with ESMTPS id 55C007F1; Thu, 20 Apr 2017 15:18: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 v3KFIFlg051663; Thu, 20 Apr 2017 15:18:15 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3KFIFVk051662; Thu, 20 Apr 2017 15:18:15 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201704201518.v3KFIFVk051662@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 20 Apr 2017 15:18:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317196 - head/sys/dev/fb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 20 Apr 2017 15:18:16 -0000 Author: kib Date: Thu Apr 20 15:18:15 2017 New Revision: 317196 URL: https://svnweb.freebsd.org/changeset/base/317196 Log: Write-combine framebuffer writes through user-space mappings, if possible. Note that KVA mapping of the framebuffer already uses write-combining mode, so the change, besides improving speed of user mode writes, also satisfies requirement of the IA32 architecture of using consistent caching modes for multiple mappings of the same page. Reported and tested by: bde Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/dev/fb/vesa.c Modified: head/sys/dev/fb/vesa.c ============================================================================== --- head/sys/dev/fb/vesa.c Thu Apr 20 15:06:16 2017 (r317195) +++ head/sys/dev/fb/vesa.c Thu Apr 20 15:18:15 2017 (r317196) @@ -1643,6 +1643,9 @@ vesa_mmap(video_adapter_t *adp, vm_ooffs if (offset > adp->va_window_size - PAGE_SIZE) return (-1); *paddr = adp->va_info.vi_buffer + offset; +#ifdef VM_MEMATTR_WRITE_COMBINING + *memattr = VM_MEMATTR_WRITE_COMBINING; +#endif return (0); } return ((*prevvidsw->mmap)(adp, offset, paddr, prot, memattr)); From owner-svn-src-head@freebsd.org Thu Apr 20 15:53:21 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E5D7FD48AA8; Thu, 20 Apr 2017 15:53:21 +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 mx1.freebsd.org (Postfix) with ESMTPS id B79823CE; Thu, 20 Apr 2017 15:53:21 +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 v3KFrKdq068496; Thu, 20 Apr 2017 15:53:20 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3KFrKaZ068495; Thu, 20 Apr 2017 15:53:20 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201704201553.v3KFrKaZ068495@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Thu, 20 Apr 2017 15:53:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317197 - head/sys/arm64/arm64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 20 Apr 2017 15:53:22 -0000 Author: andrew Date: Thu Apr 20 15:53:20 2017 New Revision: 317197 URL: https://svnweb.freebsd.org/changeset/base/317197 Log: Restrict the arm64 supervisor all instructions to only allow a zero immediate value for system calls. We may wish to use other values in the future for other purposes. MFC after: 1 week Sponsored by: DARPA, AFRL Modified: head/sys/arm64/arm64/trap.c Modified: head/sys/arm64/arm64/trap.c ============================================================================== --- head/sys/arm64/arm64/trap.c Thu Apr 20 15:18:15 2017 (r317196) +++ head/sys/arm64/arm64/trap.c Thu Apr 20 15:53:20 2017 (r317197) @@ -135,8 +135,13 @@ svc_handler(struct thread *td, struct tr struct syscall_args sa; int error; - error = syscallenter(td, &sa); - syscallret(td, error, &sa); + if ((frame->tf_esr & ESR_ELx_ISS_MASK) == 0) { + error = syscallenter(td, &sa); + syscallret(td, error, &sa); + } else { + call_trapsignal(td, SIGILL, ILL_ILLOPN, (void *)frame->tf_elr); + userret(td, frame); + } } static void From owner-svn-src-head@freebsd.org Thu Apr 20 16:08:42 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EC1C5D4809B; Thu, 20 Apr 2017 16:08:42 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D24A01142; Thu, 20 Apr 2017 16:08:42 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id v3KG8UZp036366; Thu, 20 Apr 2017 09:08:30 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id v3KG8S7J036363; Thu, 20 Apr 2017 09:08:28 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201704201608.v3KG8S7J036363@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r317094 - head/share/mk In-Reply-To: <1934449.ZAthNnyNnu@ralph.baldwin.cx> To: John Baldwin Date: Thu, 20 Apr 2017 09:08:28 -0700 (PDT) CC: Ngie Cooper , Warner Losh , rgrimes@freebsd.org, Eric van Gyzen , Slawa Olhovchenkov , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , src-committers Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 20 Apr 2017 16:08:43 -0000 > On Wednesday, April 19, 2017 03:51:24 PM Ngie Cooper wrote: > > > > > On Apr 19, 2017, at 15:22, Warner Losh wrote: > > > > ... > > > > >> Actually this is exactly what I would expect from Linux! > > >> > > >> Why do we need to pull the trigger on GDB other than to pull the trigger > > >> to say we are GPL free, if that is the reason then this is the wrong > > >> way to go about it. > > > > > > I think "gdb in base is horribly broken" is the real reason. You need > > > the port to do anything non-trivial these days. Well it seems it can do some rather important trivial things, like post mortem process kernel dumps during savecore processing helping users submit a kernel panic bugzilla with more than just traceback info. Lets see.. we need to ship a full set of kernel symbols with a distribution, but now we are gona rip out the debugger??? > > > Plus core set this as a goal for the project after it was clear that > > > was a consensus desire several years ago. Can't fault someone for > > > working towards that goal. I do not think Core set this as a goal, the developers did it at a summit, and that was really only adding "by 12.0" to a goal that has been with the project since... well.. 1.0! Removing gdb by calling it a port does not achive the desired goal, it simply makes our base system lacking a kernel debugger and oh, you have to go install port foo to get back what we have been shipping for 25 years, but look, we are GPL free!! Bullocks. > > +1 to Warner's sentiments. > > > > gdb in base doesn't work well with threads (6.x never did ;/..), and lacks support for other things (like python debugging). Being able to debug threads reliably is a make or break thing. > > > > So while I understand and in general agree with you Rod, I completely disagree on the practical end of things. I'm actually kind of curious as to why this isn't being done globally.. but I assume that it was described in one of the many threads some time ago about the status quo for debugging with gdb on tier-two architectures. This is not about debugging python or debugging threads, this is about kernel panics and post mortem processing of a crash dump so a user can submit a more detailed crash than just a trace back from the panic. > > As the commit message stated, gdb in ports doesn't yet include kgdb > support for ARM, and no one has tested the sparc64 support for gdb > in ports, so those two architectures remain on. For all other platforms, > gdb in ports is a strict superset of gdb in base. So in effect we are providing gdb in base for kgdb support of ARM and sparc but removing it from i386 and amd64, stopping things that worked in the name of what? This does not make us any closer to gpl free, breaks functional stuff, and makes us more like Linux and less like FreeBSD (no kernel debugger in base system). If this is a GPL free issue we could of done this with all the GPL code 20 years ago... I see no upside to this change, where is the upside? -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Thu Apr 20 16:34:11 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6C0CDD4872A; Thu, 20 Apr 2017 16:34:11 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2CBF41FA7; Thu, 20 Apr 2017 16:34:11 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3KGYAKu085068; Thu, 20 Apr 2017 16:34:10 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3KGYALk085066; Thu, 20 Apr 2017 16:34:10 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201704201634.v3KGYALk085066@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Thu, 20 Apr 2017 16:34:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317198 - head/sys/dev/syscons X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 20 Apr 2017 16:34:11 -0000 Author: bde Date: Thu Apr 20 16:34:09 2017 New Revision: 317198 URL: https://svnweb.freebsd.org/changeset/base/317198 Log: When the character width is 9, remove vertical lines in the mouse cursor corresponding to the gaps between characters. This fixes distortion of the cursor due to expanding it across the gaps. Again for character width 9, when the cursor characters are not in the graphics range (0xb0-0xdf), the gaps were always there (filled in the background color for the previous char). They still look strange, but don't cause distortion. When the cursor characters are in the graphics range, the gaps are filled by repeating the previous line. This gives distortion with cilia. Removing vertical lines reduces the distortion to vertical cilia. Move the default for the cursor characters out of the graphics range. With character width 9, this gives gaps instead of distortion and other problems. With character width 8, it just fixes a smaller set of other problems. Some distortion and other problems can be recovered using vidcontrol -M. Presumably the default was to fill the gaps intentionally, but it is much better to leave gaps. The gaps can even be considered as a feature for text processing -- they give sub-pointers to character boundaries. The other problems are: (1) with character width 9, characters near the cursor are moved into the graphics range and thus distorted if any of their 8th bits is set; (2) conflicts with national characters in the graphics range. The default range for the graphics cursor characters is now 8-11. This doesn't conflict with anything, since the glyphs for the characters in this range are unreachable. Use the 10x16 mouse cursor in text mode too (if the font size is >= 14). When the character width is 9, removal of 1 or 2 vertical lines makes 10x16 cursor no wider than the 9x13 one usually was. We could even handle cursors 1 pixel wider in 2 character cells and gaps without more clipping than given by the gaps (the worst case is 1 pixel in the left cell, 1 removed in the middle gap, 8 in the right cell and 1 removed in the right gap. The pixel in the right gap is removed so it doesn't matter if it is in the font). When the character width is 8, we now clip the 10-wide cursor by 1 pixel in the worst case. This clipping is usually invisible since it is of the border and and the border usually merges with the background so is invisible. There should be an option to use reverse video to highlight the border and its tip instead of the interior (graphics mode can do better using separate colors). This needs the 9x13 cursor again. Ideas from: ache (especially about the bad default character range) Modified: head/sys/dev/syscons/scvgarndr.c head/sys/dev/syscons/syscons.h Modified: head/sys/dev/syscons/scvgarndr.c ============================================================================== --- head/sys/dev/syscons/scvgarndr.c Thu Apr 20 15:53:20 2017 (r317197) +++ head/sys/dev/syscons/scvgarndr.c Thu Apr 20 16:34:09 2017 (r317198) @@ -173,8 +173,7 @@ static const struct mousedata mouse9x13 0x0c00, 0x0c00, 0x0600, 0x0600, 0x0000, 0x0000, 0x0000, 0x0000, }, 9, 13, }; -#endif -#if defined(SC_PIXEL_MODE) + static const struct mousedata mouse10x16 = { { 0xc000, 0xa000, 0x9000, 0x8800, 0x8400, 0x8200, 0x8100, 0x8080, 0x8040, 0x83c0, 0x9200, 0xa900, 0xc900, 0x0480, 0x0480, 0x0300, }, { @@ -412,6 +411,7 @@ draw_txtmouse(scr_stat *scp, int x, int #ifndef SC_ALT_MOUSE_IMAGE if (ISMOUSEAVAIL(scp->sc->adp->va_flags)) { const struct mousedata *mdp; + uint32_t border, interior; u_char font_buf[128]; u_short cursor[32]; u_char c; @@ -420,7 +420,7 @@ draw_txtmouse(scr_stat *scp, int x, int int crtc_addr; int i; - mdp = &mouse9x13; + mdp = (scp->font_size < 14) ? &mouse9x13 : &mouse10x16; /* prepare mousepointer char's bitmaps */ pos = (y/scp->font_size - scp->yoff)*scp->xsize + x/8 - scp->xoff; @@ -443,9 +443,23 @@ draw_txtmouse(scr_stat *scp, int x, int xoffset = x%8; yoffset = y%scp->font_size; for (i = 0; i < 16; ++i) { - cursor[i + yoffset] = - (cursor[i + yoffset] & ~(mdp->md_border[i] >> xoffset)) - | (mdp->md_interior[i] >> xoffset); + border = mdp->md_border[i] << 8; /* avoid right shifting out */ + interior = mdp->md_interior[i] << 8; + border >>= xoffset; /* normalize */ + interior >>= xoffset; + if (scp->sc->adp->va_flags & V_ADP_CWIDTH9) { + /* skip gaps between characters */ + border = (border & 0xff0000) | + (border & 0x007f80) << 1 | + (border & 0x00003f) << 2; + interior = (interior & 0xff0000) | + (interior & 0x007f80) << 1 | + (interior & 0x00003f) << 2; + } + border >>= 8; /* back to normal position */ + interior >>= 8; + cursor[i + yoffset] = (cursor[i + yoffset] & ~border) | + interior; } for (i = 0; i < scp->font_size; ++i) { font_buf[i] = (cursor[i] & 0xff00) >> 8; Modified: head/sys/dev/syscons/syscons.h ============================================================================== --- head/sys/dev/syscons/syscons.h Thu Apr 20 15:53:20 2017 (r317197) +++ head/sys/dev/syscons/syscons.h Thu Apr 20 16:34:09 2017 (r317198) @@ -68,11 +68,11 @@ #endif #ifndef SC_CURSOR_CHAR -#define SC_CURSOR_CHAR (0x07) +#define SC_CURSOR_CHAR 7 #endif #ifndef SC_MOUSE_CHAR -#define SC_MOUSE_CHAR (0xd0) +#define SC_MOUSE_CHAR 8 #endif #if SC_MOUSE_CHAR <= SC_CURSOR_CHAR && SC_CURSOR_CHAR < (SC_MOUSE_CHAR + 4) From owner-svn-src-head@freebsd.org Thu Apr 20 16:58:18 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E78FBD4839B; Thu, 20 Apr 2017 16:58:18 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A6D6218D8; Thu, 20 Apr 2017 16:58:18 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by mail.baldwin.cx (Postfix) with ESMTPSA id 4CE5710A7B9; Thu, 20 Apr 2017 12:58:17 -0400 (EDT) From: John Baldwin To: rgrimes@freebsd.org Cc: Ngie Cooper , Warner Losh , Eric van Gyzen , Slawa Olhovchenkov , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , src-committers Subject: Re: svn commit: r317094 - head/share/mk Date: Thu, 20 Apr 2017 09:58:10 -0700 Message-ID: <15726118.uZgJrz4zO8@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.0-STABLE; KDE/4.14.10; amd64; ; ) In-Reply-To: <201704201608.v3KG8S7J036363@pdx.rh.CN85.dnsmgr.net> References: <201704201608.v3KG8S7J036363@pdx.rh.CN85.dnsmgr.net> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Thu, 20 Apr 2017 12:58:17 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 20 Apr 2017 16:58:19 -0000 On Thursday, April 20, 2017 09:08:28 AM Rodney W. Grimes wrote: > > On Wednesday, April 19, 2017 03:51:24 PM Ngie Cooper wrote: > > > > > > > On Apr 19, 2017, at 15:22, Warner Losh wrote: > > > > > > ... > > > > > > >> Actually this is exactly what I would expect from Linux! > > > >> > > > >> Why do we need to pull the trigger on GDB other than to pull the trigger > > > >> to say we are GPL free, if that is the reason then this is the wrong > > > >> way to go about it. > > > > > > > > I think "gdb in base is horribly broken" is the real reason. You need > > > > the port to do anything non-trivial these days. > > Well it seems it can do some rather important trivial things, like post > mortem process kernel dumps during savecore processing helping users > submit a kernel panic bugzilla with more than just traceback info. Only somewhat. You should actually try to use kgdb and compare it to the kgdb in ports. > Removing gdb by calling it a port does not achive the desired goal, it > simply makes our base system lacking a kernel debugger and oh, you > have to go install port foo to get back what we have been shipping for > 25 years, but look, we are GPL free!! Bullocks. If we could import GPLv3 code into our tree then /usr/bin/gdb would match what is in ports (as I would have imported it by now), but that isn't a viable option due to non-technical issues. > > > +1 to Warner's sentiments. > > > > > > gdb in base doesn't work well with threads (6.x never did ;/..), and lacks support for other things (like python debugging). Being able to debug threads reliably is a make or break thing. > > > > > > So while I understand and in general agree with you Rod, I completely disagree on the practical end of things. I'm actually kind of curious as to why this isn't being done globally.. but I assume that it was described in one of the many threads some time ago about the status quo for debugging with gdb on tier-two architectures. > > This is not about debugging python or debugging threads, this is about > kernel panics and post mortem processing of a crash dump so a user can > submit a more detailed crash than just a trace back from the panic. Again, you should try to use the tools before arguing the theoretical point. Even the stack traces are better with kgdb from ports since it understands inlined function calls and tail calls that gdb 6.x does not. Even code generated by gcc-4.2 (much less modern compilers) is easier to debug with non-ancient gdb. > > As the commit message stated, gdb in ports doesn't yet include kgdb > > support for ARM, and no one has tested the sparc64 support for gdb > > in ports, so those two architectures remain on. For all other platforms, > > gdb in ports is a strict superset of gdb in base. > > So in effect we are providing gdb in base for kgdb support > of ARM and sparc but removing it from i386 and amd64, stopping > things that worked in the name of what? This does not make > us any closer to gpl free, breaks functional stuff, and makes > us more like Linux and less like FreeBSD (no kernel debugger in > base system). We still have DDB in base, so not quite at zero. > If this is a GPL free issue we could of done this with all the GPL code 20 > years ago... > > I see no upside to this change, where is the upside? Because people type in 'gdb' and get an inferior debugging experience relative to other systems. Also, /usr/bin/gdb doesn't support 64-bit ARM or RISCV (and never will). That support will only be in the ports gdb. At some point ARM support for FreeBSD will be upstreamed at which point I will also add kgdb support to gdb in ports for ARM (which will permit cross-debugging, something /usr/bin/gdb doesn't do). For example, if you try to use /usr/bin/gdb on 32-bit MIPS it gets confused thinking it should use 64-bit registers and gives you utter garbage for register values. That makes it 100% useless for kernels, userland, or anything else. For 64-bit mips /usr/bin/gdb frequently crashed when I tried to use it. We can't pull back fixes from the vendor and I for one am not going to fork gplv2 GDB and maintain it. Instead, I've put my time and effort into adding kernel support to modern GDB and upstreaming support for MIPS (and probably other platforms in the future) to modern GDB. Another route for folks who want to spend time contributing to a solution is to contribute to lldb. At the moment it doesn't support floating-point/SSE/AVX on amd64, doesn't have a framework (even on Linux or OS X) for debugging across forks, and doesn't have support for several architectures (i386, mips, riscv, sparc64). It also doesn't support kernel debugging. -- John Baldwin From owner-svn-src-head@freebsd.org Thu Apr 20 17:02:57 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A1B53D48652; Thu, 20 Apr 2017 17:02:57 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5D3771F3E; Thu, 20 Apr 2017 17:02:57 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1d1FTq-0008Uz-3c; Thu, 20 Apr 2017 20:02:54 +0300 Date: Thu, 20 Apr 2017 20:02:54 +0300 From: Slawa Olhovchenkov To: John Baldwin Cc: rgrimes@freebsd.org, Ngie Cooper , Warner Losh , Eric van Gyzen , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , src-committers Subject: Re: svn commit: r317094 - head/share/mk Message-ID: <20170420170253.GR70430@zxy.spb.ru> References: <201704201608.v3KG8S7J036363@pdx.rh.CN85.dnsmgr.net> <15726118.uZgJrz4zO8@ralph.baldwin.cx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <15726118.uZgJrz4zO8@ralph.baldwin.cx> User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 20 Apr 2017 17:02:57 -0000 On Thu, Apr 20, 2017 at 09:58:10AM -0700, John Baldwin wrote: > > Well it seems it can do some rather important trivial things, like post > > mortem process kernel dumps during savecore processing helping users > > submit a kernel panic bugzilla with more than just traceback info. > > Only somewhat. You should actually try to use kgdb and compare it to the > kgdb in ports. I am don't see many difference: both do strange results, both crashed. For kernel and userland too. From owner-svn-src-head@freebsd.org Thu Apr 20 17:22:04 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 82A81D48D6B; Thu, 20 Apr 2017 17:22:04 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 35EDFF3A; Thu, 20 Apr 2017 17:22:04 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3KHM3qa005532; Thu, 20 Apr 2017 17:22:03 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3KHM3CY005531; Thu, 20 Apr 2017 17:22:03 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201704201722.v3KHM3CY005531@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Thu, 20 Apr 2017 17:22:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317199 - head/sys/dev/syscons X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 20 Apr 2017 17:22:04 -0000 Author: bde Date: Thu Apr 20 17:22:03 2017 New Revision: 317199 URL: https://svnweb.freebsd.org/changeset/base/317199 Log: Eliminate the ega renderer switch. It did nothing useful except hold a pointer to the main ega drawing method which is misoptimized be in a different function than the main vga planar mode drawing method. Vga initialization handles everything with no extra code except for selecting the different function. Modified: head/sys/dev/syscons/scvgarndr.c Modified: head/sys/dev/syscons/scvgarndr.c ============================================================================== --- head/sys/dev/syscons/scvgarndr.c Thu Apr 20 16:34:09 2017 (r317198) +++ head/sys/dev/syscons/scvgarndr.c Thu Apr 20 17:22:03 2017 (r317199) @@ -111,19 +111,6 @@ RENDERER(ega, 0, txtrndrsw, vga_set); RENDERER(vga, 0, txtrndrsw, vga_set); #ifdef SC_PIXEL_MODE -static sc_rndr_sw_t egarndrsw = { - (vr_init_t *)vga_nop, - vga_pxlclear_planar, - vga_pxlborder_planar, - vga_egadraw, - vga_pxlcursor_shape, - vga_pxlcursor_planar, - vga_pxlblink_planar, - (vr_set_mouse_t *)vga_nop, - vga_pxlmouse_planar, -}; -RENDERER(ega, PIXEL_MODE, egarndrsw, vga_set); - static sc_rndr_sw_t vgarndrsw = { vga_rndrinit, (vr_clear_t *)vga_nop, @@ -135,6 +122,7 @@ static sc_rndr_sw_t vgarndrsw = { (vr_set_mouse_t *)vga_nop, (vr_draw_mouse_t *)vga_nop, }; +RENDERER(ega, PIXEL_MODE, vgarndrsw, vga_set); RENDERER(vga, PIXEL_MODE, vgarndrsw, vga_set); #endif /* SC_PIXEL_MODE */ @@ -536,7 +524,10 @@ vga_rndrinit(scr_stat *scp) if (scp->sc->adp->va_info.vi_mem_model == V_INFO_MM_PLANAR) { scp->rndr->clear = vga_pxlclear_planar; scp->rndr->draw_border = vga_pxlborder_planar; - scp->rndr->draw = vga_vgadraw_planar; + if (scp->sc->adp->va_type == KD_VGA) + scp->rndr->draw = vga_egadraw; + else + scp->rndr->draw = vga_vgadraw_planar; scp->rndr->draw_cursor = vga_pxlcursor_planar; scp->rndr->blink_cursor = vga_pxlblink_planar; scp->rndr->draw_mouse = vga_pxlmouse_planar; From owner-svn-src-head@freebsd.org Thu Apr 20 17:43:26 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 92F90D485C3; Thu, 20 Apr 2017 17:43:26 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4B08C1F4D; Thu, 20 Apr 2017 17:43:26 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3KHhPxH014444; Thu, 20 Apr 2017 17:43:25 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3KHhPdG014442; Thu, 20 Apr 2017 17:43:25 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201704201743.v3KHhPdG014442@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Thu, 20 Apr 2017 17:43:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317200 - head/lib/libthread_db X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 20 Apr 2017 17:43:26 -0000 Author: pfg Date: Thu Apr 20 17:43:25 2017 New Revision: 317200 URL: https://svnweb.freebsd.org/changeset/base/317200 Log: libthread_db: unsign map_len and use reallocarray(3). Lengths are not negative, so map_len should be unsigned. Unsign the corresponding indexes too and bring a small use of reallocarray(3). Reorder the memset to be consistent with the realloc: it appears we were only clearing half the memory in pt_map_thread(). MFC after: 2 weeks Modified: head/lib/libthread_db/libpthread_db.c head/lib/libthread_db/libpthread_db.h Modified: head/lib/libthread_db/libpthread_db.c ============================================================================== --- head/lib/libthread_db/libpthread_db.c Thu Apr 20 17:22:03 2017 (r317199) +++ head/lib/libthread_db/libpthread_db.c Thu Apr 20 17:43:25 2017 (r317200) @@ -74,7 +74,8 @@ pt_map_thread(const td_thragent_t *const { td_thragent_t *ta = __DECONST(td_thragent_t *, const_ta); struct pt_map *new; - int i, first = -1; + int first = -1; + unsigned int i; /* leave zero out */ for (i = 1; i < ta->map_len; ++i) { @@ -94,12 +95,12 @@ pt_map_thread(const td_thragent_t *const ta->map_len = 20; first = 1; } else { - new = realloc(ta->map, - sizeof(struct pt_map) * ta->map_len * 2); + new = reallocarray(ta->map, ta->map_len, + 2 * sizeof(struct pt_map)); if (new == NULL) return (-1); - memset(new + ta->map_len, '\0', sizeof(struct pt_map) * - ta->map_len); + memset(new + ta->map_len, '\0', ta->map_len * + 2 * sizeof(struct pt_map)); first = ta->map_len; ta->map = new; ta->map_len *= 2; @@ -1047,7 +1048,7 @@ pt_thr_sstep(const td_thrhandle_t *th, i static void pt_unmap_lwp(const td_thragent_t *ta, lwpid_t lwp) { - int i; + unsigned int i; for (i = 0; i < ta->map_len; ++i) { if (ta->map[i].type == PT_LWP && ta->map[i].lwp == lwp) { Modified: head/lib/libthread_db/libpthread_db.h ============================================================================== --- head/lib/libthread_db/libpthread_db.h Thu Apr 20 17:22:03 2017 (r317199) +++ head/lib/libthread_db/libpthread_db.h Thu Apr 20 17:43:25 2017 (r317200) @@ -77,7 +77,7 @@ struct td_thragent { int thread_off_sigmask; int thread_off_sigpend; struct pt_map *map; - int map_len; + unsigned int map_len; }; void pt_md_init(void); From owner-svn-src-head@freebsd.org Thu Apr 20 17:49:38 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F0B35D48859; Thu, 20 Apr 2017 17:49:38 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C0F743E1; Thu, 20 Apr 2017 17:49:38 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3KHnbH7014708; Thu, 20 Apr 2017 17:49:37 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3KHnbJi014707; Thu, 20 Apr 2017 17:49:37 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201704201749.v3KHnbJi014707@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Thu, 20 Apr 2017 17:49:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317201 - head/lib/libthread_db X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 20 Apr 2017 17:49:39 -0000 Author: pfg Date: Thu Apr 20 17:49:37 2017 New Revision: 317201 URL: https://svnweb.freebsd.org/changeset/base/317201 Log: libpthread_db: leave the memset size from unchanged. The size for the memset in pt_map_thread() shouldn't actually match the reallocarray() so undo that part of r317200. X-MFC with: r317200 Modified: head/lib/libthread_db/libpthread_db.c Modified: head/lib/libthread_db/libpthread_db.c ============================================================================== --- head/lib/libthread_db/libpthread_db.c Thu Apr 20 17:43:25 2017 (r317200) +++ head/lib/libthread_db/libpthread_db.c Thu Apr 20 17:49:37 2017 (r317201) @@ -100,7 +100,7 @@ pt_map_thread(const td_thragent_t *const if (new == NULL) return (-1); memset(new + ta->map_len, '\0', ta->map_len * - 2 * sizeof(struct pt_map)); + sizeof(struct pt_map)); first = ta->map_len; ta->map = new; ta->map_len *= 2; From owner-svn-src-head@freebsd.org Thu Apr 20 17:55:00 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 620F3D48AB2; Thu, 20 Apr 2017 17:55:00 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 342F9BD4; Thu, 20 Apr 2017 17:55:00 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3KHsxm1018663; Thu, 20 Apr 2017 17:54:59 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3KHsxBt018662; Thu, 20 Apr 2017 17:54:59 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201704201754.v3KHsxBt018662@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Thu, 20 Apr 2017 17:54:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317202 - head/lib/libthread_db X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 20 Apr 2017 17:55:00 -0000 Author: pfg Date: Thu Apr 20 17:54:59 2017 New Revision: 317202 URL: https://svnweb.freebsd.org/changeset/base/317202 Log: Revert r317201 to fix the log. Modified: head/lib/libthread_db/libpthread_db.c Modified: head/lib/libthread_db/libpthread_db.c ============================================================================== --- head/lib/libthread_db/libpthread_db.c Thu Apr 20 17:49:37 2017 (r317201) +++ head/lib/libthread_db/libpthread_db.c Thu Apr 20 17:54:59 2017 (r317202) @@ -100,7 +100,7 @@ pt_map_thread(const td_thragent_t *const if (new == NULL) return (-1); memset(new + ta->map_len, '\0', ta->map_len * - sizeof(struct pt_map)); + 2 * sizeof(struct pt_map)); first = ta->map_len; ta->map = new; ta->map_len *= 2; From owner-svn-src-head@freebsd.org Thu Apr 20 17:58:28 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 76DE5D48C33; Thu, 20 Apr 2017 17:58:28 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 473A3EA4; Thu, 20 Apr 2017 17:58:28 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3KHwRI1018863; Thu, 20 Apr 2017 17:58:27 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3KHwRiX018862; Thu, 20 Apr 2017 17:58:27 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201704201758.v3KHwRiX018862@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Thu, 20 Apr 2017 17:58:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317203 - head/lib/libthread_db X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 20 Apr 2017 17:58:28 -0000 Author: pfg Date: Thu Apr 20 17:58:27 2017 New Revision: 317203 URL: https://svnweb.freebsd.org/changeset/base/317203 Log: libpthread_db: undo the memset size change. I inadvertedly soubled the size of the memset without noticing the start address had changed. The size for the memset in pt_map_thread() shouldn't actually match the reallocarray() so undo that part of r317200. This is a re-commit of r317201 to clarify the log. X-MFC with: r317200 Modified: head/lib/libthread_db/libpthread_db.c Modified: head/lib/libthread_db/libpthread_db.c ============================================================================== --- head/lib/libthread_db/libpthread_db.c Thu Apr 20 17:54:59 2017 (r317202) +++ head/lib/libthread_db/libpthread_db.c Thu Apr 20 17:58:27 2017 (r317203) @@ -100,7 +100,7 @@ pt_map_thread(const td_thragent_t *const if (new == NULL) return (-1); memset(new + ta->map_len, '\0', ta->map_len * - 2 * sizeof(struct pt_map)); + sizeof(struct pt_map)); first = ta->map_len; ta->map = new; ta->map_len *= 2; From owner-svn-src-head@freebsd.org Thu Apr 20 18:06:11 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 14436D480E9; Thu, 20 Apr 2017 18:06:11 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) by mx1.freebsd.org (Postfix) with ESMTP id 707A21698; Thu, 20 Apr 2017 18:06:10 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Subject: Re: svn commit: r317171 - head/sys/dev/vt To: Ed Maste Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" References: <201704192221.v3JMLFPs032866@repo.freebsd.org> From: Jung-uk Kim Message-ID: Date: Thu, 20 Apr 2017 14:06:05 -0400 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.0.1 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="D0KmnD46FDVDbQwhX8VS1ukwMSaGJh2TI" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 20 Apr 2017 18:06:11 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --D0KmnD46FDVDbQwhX8VS1ukwMSaGJh2TI Content-Type: multipart/mixed; boundary="jf1OklO0u8PlVmebFFV2M1uGAAfLQrsTc"; protected-headers="v1" From: Jung-uk Kim To: Ed Maste Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Message-ID: Subject: Re: svn commit: r317171 - head/sys/dev/vt References: <201704192221.v3JMLFPs032866@repo.freebsd.org> In-Reply-To: --jf1OklO0u8PlVmebFFV2M1uGAAfLQrsTc Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: quoted-printable On 04/19/2017 22:22, Ed Maste wrote: > On 19 April 2017 at 18:21, Jung-uk Kim wrote: >> Author: jkim >> Date: Wed Apr 19 22:21:15 2017 >> New Revision: 317171 >> URL: https://svnweb.freebsd.org/changeset/base/317171 >> >> Log: >> Micro-optimize vt_set_border(). >=20 > I expect we'll eventually have vt drivers that have a non-trivial > vd_drawrect, making the previous implementation preferable. Can you > comment a bit more on this change? Maybe but I haven't seen much improvement in the area for many years. Do you have any reason to believe someone is working on it? Even if we have such backend, I don't expect much difference in drawing small area, i.e., redrawing narrow borders. On top of that, I don't like "if (vd->vd_driver->vd_drawrect =3D=3D NULL) return (ENOTSUP)" stuff= =2E Jung-uk Kim --jf1OklO0u8PlVmebFFV2M1uGAAfLQrsTc-- --D0KmnD46FDVDbQwhX8VS1ukwMSaGJh2TI Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEl1bqgKaRyqfWXu/CfJ+WJvzb8UYFAlj4+JEACgkQfJ+WJvzb 8UZoagf/TKXZZ6KWkbrn10rmyHg8P/F8ZkrKoSf3vG8LqG97VnqzQOrf5hyHvsm8 LjmYLjHAAwpQ85rcxb57YIwPNMMmz4KaP5C5ys8hVtLUq42umeTTwokHlQAQCQMu y7D8V4C8ehZY5pZj5uzowdXWdcPJrs/8V8tSydbBCYTI0YDKFynhHqjcvlhWuh2x 7Ro9z5EO09OjA3JkMGW+SWbshpqBpxO69c9gO7wba5/VkLSsJ1mGgmEGDizbvhxJ Vib67EMw1yMf90AElqIQNDLfyzvNBkk/kiYEFZfT46ULxOsmBV6rNzhM0/o1qOeN H5bj7W6p8tn1DLVkb4V0vemMi8fr5w== =IDVM -----END PGP SIGNATURE----- --D0KmnD46FDVDbQwhX8VS1ukwMSaGJh2TI-- From owner-svn-src-head@freebsd.org Thu Apr 20 18:21:51 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C86B1D48681; Thu, 20 Apr 2017 18:21:51 +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 mx1.freebsd.org (Postfix) with ESMTPS id 74A1511A; Thu, 20 Apr 2017 18:21:51 +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 v3KILovr027734; Thu, 20 Apr 2017 18:21:50 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3KILo9O027729; Thu, 20 Apr 2017 18:21:50 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201704201821.v3KILo9O027729@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Thu, 20 Apr 2017 18:21:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317204 - in head: . etc/mtree share/colldef share/ctypedef share/monetdef share/msgdef share/numericdef tools/build/mk tools/tools/locale tools/tools/locale/etc tools/tools/locale/etc/... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 20 Apr 2017 18:21:51 -0000 Author: bapt Date: Thu Apr 20 18:21:50 2017 New Revision: 317204 URL: https://svnweb.freebsd.org/changeset/base/317204 Log: Readd Big5: some large databases setup are still requiring it. Reported by: "å¼µå›å¤©(Chun-Tien Chang)" Added: head/share/colldef/zh_TW.Big5.src - copied unchanged from r315567, head/share/colldef/zh_TW.Big5.src head/share/ctypedef/zh_TW.Big5.src - copied unchanged from r315567, head/share/ctypedef/zh_TW.Big5.src head/share/monetdef/zh_TW.Big5.src - copied unchanged from r315567, head/share/monetdef/zh_TW.Big5.src head/share/msgdef/zh_TW.Big5.src - copied unchanged from r315567, head/share/msgdef/zh_TW.Big5.src head/share/numericdef/zh_TW.Big5.src - copied unchanged from r315567, head/share/numericdef/zh_TW.Big5.src head/tools/tools/locale/etc/charmaps/Big5.TXT - copied unchanged from r315566, head/tools/tools/locale/etc/charmaps/Big5.TXT head/tools/tools/locale/etc/final-maps/map.Big5 - copied unchanged from r315566, head/tools/tools/locale/etc/final-maps/map.Big5 Modified: head/ObsoleteFiles.inc head/etc/mtree/BSD.usr.dist head/share/colldef/Makefile head/share/ctypedef/Makefile head/share/monetdef/Makefile head/share/msgdef/Makefile head/share/numericdef/Makefile head/tools/build/mk/OptionalObsoleteFiles.inc head/tools/tools/locale/Makefile head/tools/tools/locale/etc/charmaps.xml head/tools/tools/locale/tools/convert_map.pl head/tools/tools/locale/tools/finalize Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Thu Apr 20 17:58:27 2017 (r317203) +++ head/ObsoleteFiles.inc Thu Apr 20 18:21:50 2017 (r317204) @@ -63,14 +63,6 @@ OLD_FILES+=usr/tests/lib/libc/locale/io_ # 20170319: remove nls for non supported Big5* locales OLD_DIRS+=usr/share/nls/zh_HK.Big5HKSCS OLD_DIRS+=usr/share/nls/zh_TW.Big5 -# 20170319: Remove zh_TW.Big5 -OLD_FILES+=usr/share/locale/zh_TW.Big5/LC_COLLATE -OLD_FILES+=usr/share/locale/zh_TW.Big5/LC_CTYPE -OLD_FILES+=usr/share/locale/zh_TW.Big5/LC_MESSAGES -OLD_FILES+=usr/share/locale/zh_TW.Big5/LC_MONETARY -OLD_FILES+=usr/share/locale/zh_TW.Big5/LC_NUMERIC -OLD_FILES+=usr/share/locale/zh_TW.Big5/LC_TIME -OLD_DIRS+=usr/share/locale/zh_TW.Big5 # 20170313: move .../sys/geom/eli/... to .../sys/geom/class/eli/... OLD_FILES+=usr/tests/sys/geom/eli/pbkdf2/pbkdf2 OLD_FILES+=usr/tests/sys/geom/eli/pbkdf2/Kyuafile Modified: head/etc/mtree/BSD.usr.dist ============================================================================== --- head/etc/mtree/BSD.usr.dist Thu Apr 20 17:58:27 2017 (r317203) +++ head/etc/mtree/BSD.usr.dist Thu Apr 20 18:21:50 2017 (r317204) @@ -897,6 +897,8 @@ .. zh_HK.UTF-8 .. + zh_TW.Big5 + .. zh_TW.UTF-8 .. .. Modified: head/share/colldef/Makefile ============================================================================== --- head/share/colldef/Makefile Thu Apr 20 17:58:27 2017 (r317203) +++ head/share/colldef/Makefile Thu Apr 20 18:21:50 2017 (r317204) @@ -5,7 +5,7 @@ LOCALEDIR= ${SHAREDIR}/locale FILESNAME= LC_COLLATE .SUFFIXES: .src .LC_COLLATE -MAPLOC= ${.CURDIR}/../../tools/tools/locale/etc/final-maps +MAPLOC= ${SRCTOP}/tools/tools/locale/etc/final-maps .src.LC_COLLATE: localedef -D -U -i ${.IMPSRC} \ @@ -158,6 +158,7 @@ LOCALES+= sr_RS.ISO8859-2 LOCALES+= sr_RS.ISO8859-5 LOCALES+= zh_CN.GB2312 LOCALES+= zh_CN.eucCN +LOCALES+= zh_TW.Big5 LOCALES+= zh_CN.GB18030 LOCALES+= zh_CN.GBK LOCALES+= ja_JP.eucJP Copied: head/share/colldef/zh_TW.Big5.src (from r315567, head/share/colldef/zh_TW.Big5.src) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/colldef/zh_TW.Big5.src Thu Apr 20 18:21:50 2017 (r317204, copy of r315567, head/share/colldef/zh_TW.Big5.src) @@ -0,0 +1,16033 @@ +# Warning: Do not edit. This is automatically extracted +# from CLDR project data, obtained from http://cldr.unicode.org/ +# ----------------------------------------------------------------------------- +comment_char * +escape_char / +LC_COLLATE +************* + + + +* Define collation weights as symbols + +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Thu Apr 20 19:05:44 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BB765D48621; Thu, 20 Apr 2017 19:05:44 +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 mx1.freebsd.org (Postfix) with ESMTPS id 7AD07353; Thu, 20 Apr 2017 19:05:44 +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 v3KJ5hM9047784; Thu, 20 Apr 2017 19:05:43 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3KJ5h7k047783; Thu, 20 Apr 2017 19:05:43 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201704201905.v3KJ5h7k047783@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Thu, 20 Apr 2017 19:05:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317205 - head/usr.bin/diff X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 20 Apr 2017 19:05:44 -0000 Author: bapt Date: Thu Apr 20 19:05:43 2017 New Revision: 317205 URL: https://svnweb.freebsd.org/changeset/base/317205 Log: Document all long options Modified: head/usr.bin/diff/diff.1 Modified: head/usr.bin/diff/diff.1 ============================================================================== --- head/usr.bin/diff/diff.1 Thu Apr 20 18:21:50 2017 (r317204) +++ head/usr.bin/diff/diff.1 Thu Apr 20 19:05:43 2017 (r317205) @@ -195,7 +195,7 @@ No output is produced if the files are i .Pp Output options (mutually exclusive): .Bl -tag -width Ds -.It Fl C Ar number +.It Fl C Ar number Fl -context Ar number Like .Fl c but produces a diff with @@ -223,7 +223,7 @@ both files with .Sq !\ \& . Changes which lie within 3 lines of each other are grouped together on output. -.It Fl D Ar string +.It Fl D Ar string Fl -ifdef Ar string Creates a merged version of .Ar file1 and @@ -237,7 +237,7 @@ while defining .Ar string will yield .Ar file2 . -.It Fl e +.It Fl e -ed Produces output in a form suitable as input for the editor utility, .Xr ed 1 , which can then be used to convert file1 into file2. @@ -251,7 +251,7 @@ from their state in .Ar dir1 to their state in .Ar dir2 . -.It Fl f +.It Fl f -forward-ed Identical output to that of the .Fl e flag, but in reverse order. @@ -264,10 +264,10 @@ but in the opposite order and with a cou insert or delete command. This is the form used by .Xr rcsdiff 1 . -.It Fl q +.It Fl q -brief Just print a line when the files differ. Does not output a list of changes. -.It Fl U Ar number +.It Fl U Ar number Fl -unified Ar number Like .Fl u but produces a diff with @@ -288,7 +288,7 @@ a single section. .Pp Comparison options: .Bl -tag -width Ds -.It Fl a +.It Fl a -text Treat all files as .Tn ASCII text. @@ -303,11 +303,11 @@ to produce a diff. .It Fl b Causes trailing blanks (spaces and tabs) to be ignored, and other strings of blanks to compare equal. -.It Fl d +.It Fl d -minimal Try very hard to produce a diff as small as possible. This may consume a lot of processing power and memory when processing large files with many changes. -.It Fl I Ar pattern +.It Fl I Ar pattern Fl -ignore-matching-lines Ar pattern Ignores changes, insertions, and deletions whose lines match the extended regular expression .Ar pattern . @@ -319,32 +319,32 @@ ignored. See .Xr re_format 7 for more information on regular expression patterns. -.It Fl i +.It Fl i -ignore-case Ignores the case of letters. E.g., .Dq A will compare equal to .Dq a . -.It Fl l +.It Fl l -paginate Pass the output through .Xr pr 1 to paginate it. -.It Fl L Ar label +.It Fl L Ar label Fl -label Ar label Print .Ar label instead of the first (and second, if this option is specified twice) file name and time in the context or unified diff header. -.It Fl p +.It Fl p -show-c-function With unified and context diffs, show with each change the first 40 characters of the last line before the context beginning with a letter, an underscore or a dollar sign. For C source code following standard layout conventions, this will show the prototype of the function the change applies to. -.It Fl T +.It Fl T -initial-tab Print a tab rather than a space before the rest of the line for the normal, context or unified output formats. This makes the alignment of tabs in the line consistent. -.It Fl t +.It Fl t -expand-tabs Will expand tabs in output lines. Normal or .Fl c @@ -352,9 +352,9 @@ output adds character(s) to the front of the indentation of the original source lines and make the output listing difficult to interpret. This option will preserve the original source's indentation. -.It Fl w +.It Fl w -ignore-all-blanks Is similar to -.Fl b +.Fl b -ignore-space-change but causes whitespace (blanks and tabs) to be totally ignored. E.g., .Dq if (\ \&a == b \&) @@ -370,40 +370,52 @@ lines from FILE1 .It %< lines from FILE2 .El +.It Fl -ignore-file-name-case +ignore case when comparing file names +.It Fl -no-ignore-file-name-case +do not ignore case wen comparing file names (default) +.It Fl -normal +default diff output +.It Fl -speed-large-files +stub option for compatibility with GNU diff +.It Fl -strip-trailing-cr +strip carriage return on input files +.It Fl tabsize Ar number +Number of spaces representing a tab (default 8) .El .Pp Directory comparison options: .Bl -tag -width Ds -.It Fl N +.It Fl N -new-file If a file is found in only one directory, act as if it was found in the other directory too but was of zero size. -.It Fl P +.It Fl P -unidirectional-new-file If a file is found only in .Ar dir2 , act as if it was found in .Ar dir1 too but was of zero size. -.It Fl r +.It Fl r -recursive Causes application of .Nm recursively to common subdirectories encountered. -.It Fl S Ar name +.It Fl S Ar name Fl -starting-file Ar name Re-starts a directory .Nm in the middle, beginning with file .Ar name . -.It Fl s +.It Fl s -report-identical-files Causes .Nm to report files which are the same, which are otherwise not mentioned. -.It Fl X Ar file +.It Fl X Ar file Fl -exclude-from Ar file Exclude files and subdirectories from comparison whose basenames match lines in .Ar file . Multiple .Fl X options may be specified. -.It Fl x Ar pattern +.It Fl x Ar pattern Fl -exclude Ar pattern Exclude files and subdirectories from comparison whose basenames match .Ar pattern . Patterns are matched using shell-style globbing via @@ -451,7 +463,7 @@ The default (without .Fl e , .Fl c , or -.Fl n +.Fl n -rcs .\" -C options) output contains lines of these forms, where From owner-svn-src-head@freebsd.org Thu Apr 20 19:07:53 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6AEA7D4877C; Thu, 20 Apr 2017 19:07:53 +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 mx1.freebsd.org (Postfix) with ESMTPS id 37C597D6; Thu, 20 Apr 2017 19:07:53 +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 v3KJ7q5n047902; Thu, 20 Apr 2017 19:07:52 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3KJ7qO9047901; Thu, 20 Apr 2017 19:07:52 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201704201907.v3KJ7qO9047901@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Thu, 20 Apr 2017 19:07:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317206 - head/usr.bin/diff X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 20 Apr 2017 19:07:53 -0000 Author: bapt Date: Thu Apr 20 19:07:52 2017 New Revision: 317206 URL: https://svnweb.freebsd.org/changeset/base/317206 Log: Update the TODO list to reflect what has been changed Modified: head/usr.bin/diff/TODO Modified: head/usr.bin/diff/TODO ============================================================================== --- head/usr.bin/diff/TODO Thu Apr 20 19:05:43 2017 (r317205) +++ head/usr.bin/diff/TODO Thu Apr 20 19:07:52 2017 (r317206) @@ -5,14 +5,14 @@ * make a libsdiff and use that directly to avoid duplicating the code to be implemented: ---suppress-common-lines: depends on -y --ignore-blank-lines --horizon-lines --ignore-tab-expansion --line-format Will probably be not implemented: ---GTYPE-group-format +--GTYPE-group-format (partially implement - minimal) --LTYPE-line-format ---speed-large-file: (Do we need that? only a stub?) --help (We have a manpage already) +--suppress-common-lines: depends on -y (won't be implemented, as it conflicts +the way sdiff expects it and in any case we have sdiff for that feature) From owner-svn-src-head@freebsd.org Thu Apr 20 19:14:54 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 41B6BD48BF2; Thu, 20 Apr 2017 19:14:54 +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 mx1.freebsd.org (Postfix) with ESMTPS id 0E9A6DDF; Thu, 20 Apr 2017 19:14:53 +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 v3KJEr0b052309; Thu, 20 Apr 2017 19:14:53 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3KJEr0g052308; Thu, 20 Apr 2017 19:14:53 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201704201914.v3KJEr0g052308@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Thu, 20 Apr 2017 19:14:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317207 - head/usr.bin/diff X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 20 Apr 2017 19:14:54 -0000 Author: bapt Date: Thu Apr 20 19:14:52 2017 New Revision: 317207 URL: https://svnweb.freebsd.org/changeset/base/317207 Log: Cross reference pr(1) which diff might call with -l option Modified: head/usr.bin/diff/diff.1 Modified: head/usr.bin/diff/diff.1 ============================================================================== --- head/usr.bin/diff/diff.1 Thu Apr 20 19:07:52 2017 (r317206) +++ head/usr.bin/diff/diff.1 Thu Apr 20 19:14:52 2017 (r317207) @@ -583,6 +583,7 @@ An error occurred. .Xr diff3 1 , .Xr ed 1 , .Xr patch 1 , +.Xr pr 1 , .Xr sdiff 1 .Rs .%A James W. Hunt From owner-svn-src-head@freebsd.org Thu Apr 20 19:19:35 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 44F89D48DC8; Thu, 20 Apr 2017 19:19:35 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 221E8C5; Thu, 20 Apr 2017 19:19:35 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3KJJYi1052653; Thu, 20 Apr 2017 19:19:34 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3KJJYko052651; Thu, 20 Apr 2017 19:19:34 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201704201919.v3KJJYko052651@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 20 Apr 2017 19:19:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317208 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 20 Apr 2017 19:19:35 -0000 Author: tuexen Date: Thu Apr 20 19:19:33 2017 New Revision: 317208 URL: https://svnweb.freebsd.org/changeset/base/317208 Log: Syncoockies can be used in combination with the syncache. If the cache overflows, syncookies are used. This patch restricts the usage of syncookies in this case: accept syncookies only if there was an overflow of the syncache recently. This mitigates a problem reported in PR217637, where is syncookie was accepted without any recent drops. Thanks to glebius@ for suggesting an improvement. PR: 217637 Reviewed by: gnn, glebius MFC after: 1 week Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D10272 Modified: head/sys/netinet/tcp_syncache.c head/sys/netinet/tcp_syncache.h Modified: head/sys/netinet/tcp_syncache.c ============================================================================== --- head/sys/netinet/tcp_syncache.c Thu Apr 20 19:14:52 2017 (r317207) +++ head/sys/netinet/tcp_syncache.c Thu Apr 20 19:19:33 2017 (r317208) @@ -260,6 +260,7 @@ syncache_init(void) &V_tcp_syncache.hashbase[i].sch_mtx, 0); V_tcp_syncache.hashbase[i].sch_length = 0; V_tcp_syncache.hashbase[i].sch_sc = &V_tcp_syncache; + V_tcp_syncache.hashbase[i].sch_last_overflow = INT64_MIN; } /* Create the syncache entry zone. */ @@ -335,6 +336,7 @@ syncache_insert(struct syncache *sc, str KASSERT(!TAILQ_EMPTY(&sch->sch_bucket), ("sch->sch_length incorrect")); sc2 = TAILQ_LAST(&sch->sch_bucket, sch_head); + sch->sch_last_overflow = time_uptime; syncache_drop(sc2, sch); TCPSTAT_INC(tcps_sc_bucketoverflow); } @@ -974,10 +976,13 @@ syncache_expand(struct in_conninfo *inc, /* * There is no syncache entry, so see if this ACK is * a returning syncookie. To do this, first: - * A. See if this socket has had a syncache entry dropped in - * the past. We don't want to accept a bogus syncookie - * if we've never received a SYN. - * B. check that the syncookie is valid. If it is, then + * A. Check if syncookies are used in case of syncache + * overflows + * B. See if this socket has had a syncache entry dropped in + * the recent past. We don't want to accept a bogus + * syncookie if we've never received a SYN or accept it + * twice. + * C. check that the syncookie is valid. If it is, then * cobble up a fake syncache entry, and return. */ if (!V_tcp_syncookies) { @@ -988,6 +993,15 @@ syncache_expand(struct in_conninfo *inc, s, __func__); goto failed; } + if (!V_tcp_syncookiesonly && + sch->sch_last_overflow < time_uptime - SYNCOOKIE_LIFETIME) { + SCH_UNLOCK(sch); + if ((s = tcp_log_addrs(inc, th, NULL, NULL))) + log(LOG_DEBUG, "%s; %s: Spurious ACK, " + "segment rejected (no syncache entry)\n", + s, __func__); + goto failed; + } bzero(&scs, sizeof(scs)); sc = syncookie_lookup(inc, sch, &scs, th, to, *lsop); SCH_UNLOCK(sch); @@ -1411,8 +1425,10 @@ syncache_add(struct in_conninfo *inc, st * entry and insert the new one. */ TCPSTAT_INC(tcps_sc_zonefail); - if ((sc = TAILQ_LAST(&sch->sch_bucket, sch_head)) != NULL) + if ((sc = TAILQ_LAST(&sch->sch_bucket, sch_head)) != NULL) { + sch->sch_last_overflow = time_uptime; syncache_drop(sc, sch); + } sc = uma_zalloc(V_tcp_syncache.zone, M_NOWAIT | M_ZERO); if (sc == NULL) { if (V_tcp_syncookies) { Modified: head/sys/netinet/tcp_syncache.h ============================================================================== --- head/sys/netinet/tcp_syncache.h Thu Apr 20 19:14:52 2017 (r317207) +++ head/sys/netinet/tcp_syncache.h Thu Apr 20 19:19:33 2017 (r317208) @@ -99,6 +99,7 @@ struct syncache_head { int sch_nextc; u_int sch_length; struct tcp_syncache *sch_sc; + time_t sch_last_overflow; }; #define SYNCOOKIE_SECRET_SIZE 16 From owner-svn-src-head@freebsd.org Thu Apr 20 19:24:53 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 57C70D484A6; Thu, 20 Apr 2017 19:24:53 +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 mx1.freebsd.org (Postfix) with ESMTPS id 1B15991D; Thu, 20 Apr 2017 19:24:53 +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 v3KJOqYa056435; Thu, 20 Apr 2017 19:24:52 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3KJOpxR056429; Thu, 20 Apr 2017 19:24:51 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201704201924.v3KJOpxR056429@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Thu, 20 Apr 2017 19:24:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317209 - in head: . gnu/usr.bin gnu/usr.bin/diff usr.bin X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 20 Apr 2017 19:24:53 -0000 Author: bapt Date: Thu Apr 20 19:24:51 2017 New Revision: 317209 URL: https://svnweb.freebsd.org/changeset/base/317209 Log: Replace again GNU diff with BSD diff After a firts failed attempt, BSD diff is now good enough to replace GNU diff. Relnotes: yes Deleted: head/gnu/usr.bin/diff/ Modified: head/Makefile.inc1 head/ObsoleteFiles.inc head/UPDATING head/gnu/usr.bin/Makefile head/usr.bin/Makefile Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Thu Apr 20 19:19:33 2017 (r317208) +++ head/Makefile.inc1 Thu Apr 20 19:24:51 2017 (r317209) @@ -1972,7 +1972,7 @@ native-xtools: .PHONY ${_clang} \ sbin/md5 \ sbin/sysctl \ - gnu/usr.bin/diff \ + usr.bin/diff \ usr.bin/awk \ usr.bin/basename \ usr.bin/bmake \ Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Thu Apr 20 19:19:33 2017 (r317208) +++ head/ObsoleteFiles.inc Thu Apr 20 19:24:51 2017 (r317209) @@ -38,6 +38,8 @@ # xargs -n1 | sort | uniq -d; # done +# 20170420: remove GNU diff +OLD_FILES+=usr/share/man/man7/diff.7.gz # 20170322: rename to _test to match the FreeBSD test suite name scheme OLD_FILES+=usr/tests/usr.bin/col/col OLD_FILES+=usr/tests/usr.bin/diff/diff Modified: head/UPDATING ============================================================================== --- head/UPDATING Thu Apr 20 19:19:33 2017 (r317208) +++ head/UPDATING Thu Apr 20 19:24:51 2017 (r317209) @@ -51,6 +51,11 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12 ****************************** SPECIAL WARNING: ****************************** +20170420: + GNU diff has been replaced by a BSD licensed diff. Some features of GNU + diff has not been implemented, if those are needed a newer version of + GNU diff is available via the diffutils package under the gdiff name. + 20170413: As of r316810 for ipfilter, keep frags is no longer assumed when keep state is specified in a rule. r316810 aligns ipfilter with Modified: head/gnu/usr.bin/Makefile ============================================================================== --- head/gnu/usr.bin/Makefile Thu Apr 20 19:19:33 2017 (r317208) +++ head/gnu/usr.bin/Makefile Thu Apr 20 19:24:51 2017 (r317209) @@ -17,7 +17,7 @@ SUBDIR_DEPEND_gdb= binutils .endif SUBDIR.${MK_GCC}+= cc -SUBDIR.${MK_GNU_DIFF}+= diff diff3 +SUBDIR.${MK_GNU_DIFF}+= diff3 SUBDIR.${MK_GNU_GREP}+= grep SUBDIR.${MK_GPL_DTC}+= dtc SUBDIR.${MK_TESTS}+= tests Modified: head/usr.bin/Makefile ============================================================================== --- head/usr.bin/Makefile Thu Apr 20 19:19:33 2017 (r317208) +++ head/usr.bin/Makefile Thu Apr 20 19:24:51 2017 (r317209) @@ -34,6 +34,7 @@ SUBDIR= alias \ csplit \ ctlstat \ cut \ + diff \ dirname \ du \ elf2aout \ From owner-svn-src-head@freebsd.org Thu Apr 20 19:29:37 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 20F3BD48816; Thu, 20 Apr 2017 19:29:37 +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 mx1.freebsd.org (Postfix) with ESMTPS id E72BEBB0; Thu, 20 Apr 2017 19:29:36 +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 v3KJTaXm056652; Thu, 20 Apr 2017 19:29:36 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3KJTawx056651; Thu, 20 Apr 2017 19:29:36 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201704201929.v3KJTawx056651@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Thu, 20 Apr 2017 19:29:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317210 - head/gnu/lib X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 20 Apr 2017 19:29:37 -0000 Author: bapt Date: Thu Apr 20 19:29:35 2017 New Revision: 317210 URL: https://svnweb.freebsd.org/changeset/base/317210 Log: Only build libreadline for gdb, binutils actually does not need it Modified: head/gnu/lib/Makefile Modified: head/gnu/lib/Makefile ============================================================================== --- head/gnu/lib/Makefile Thu Apr 20 19:24:51 2017 (r317209) +++ head/gnu/lib/Makefile Thu Apr 20 19:29:35 2017 (r317210) @@ -7,10 +7,7 @@ SUBDIR.${MK_DIALOG}+= libdialog SUBDIR.${MK_GCC}+= libgcov libgomp SUBDIR.${MK_SSP}+= libssp SUBDIR.${MK_TESTS}+= tests - -.if ${MK_BINUTILS} != "no" && ${MK_GDB} != "no" -SUBDIR+= libreadline -.endif +SUBDIR.${MK_GDB}+= libreadline .if ${MK_GNU_DIFF} != "no" || ${MK_GNU_GREP} != "no" || \ ${MK_GNU_GREP_COMPAT} != "no" || ${MK_GDB} != "no" From owner-svn-src-head@freebsd.org Thu Apr 20 19:33:01 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D1236D489BE; Thu, 20 Apr 2017 19:33:01 +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 mx1.freebsd.org (Postfix) with ESMTPS id 9D917FE5; Thu, 20 Apr 2017 19:33:01 +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 v3KJX0O0060330; Thu, 20 Apr 2017 19:33:00 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3KJX09g060329; Thu, 20 Apr 2017 19:33:00 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201704201933.v3KJX09g060329@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Thu, 20 Apr 2017 19:33:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317211 - head/gnu/lib X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 20 Apr 2017 19:33:01 -0000 Author: bapt Date: Thu Apr 20 19:33:00 2017 New Revision: 317211 URL: https://svnweb.freebsd.org/changeset/base/317211 Log: GNU diff is done and GNU diff3 is not using libgnuregex, so no need to condition the build of libgnuregex anymore on WITHOUT_GNU_DIFF Modified: head/gnu/lib/Makefile Modified: head/gnu/lib/Makefile ============================================================================== --- head/gnu/lib/Makefile Thu Apr 20 19:29:35 2017 (r317210) +++ head/gnu/lib/Makefile Thu Apr 20 19:33:00 2017 (r317211) @@ -9,8 +9,8 @@ SUBDIR.${MK_SSP}+= libssp SUBDIR.${MK_TESTS}+= tests SUBDIR.${MK_GDB}+= libreadline -.if ${MK_GNU_DIFF} != "no" || ${MK_GNU_GREP} != "no" || \ - ${MK_GNU_GREP_COMPAT} != "no" || ${MK_GDB} != "no" +.if ${MK_GNU_GREP} != "no" || ${MK_GNU_GREP_COMPAT} != "no" || \ + ${MK_GDB} != "no" SUBDIR+= libregex .endif From owner-svn-src-head@freebsd.org Thu Apr 20 20:02:19 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 766C7D479C1; Thu, 20 Apr 2017 20:02:19 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: from mail-wm0-x244.google.com (mail-wm0-x244.google.com [IPv6:2a00:1450:400c:c09::244]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 08E0F973; Thu, 20 Apr 2017 20:02:19 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: by mail-wm0-x244.google.com with SMTP id z129so543345wmb.1; Thu, 20 Apr 2017 13:02:18 -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:mail-followup-to :references:mime-version:content-disposition:in-reply-to:user-agent; bh=4eTa0i9wy9FugigJHQYpPD2vnLHnInaRAs8ERdk9Kq8=; b=E0DF+PoRuaHufzrxPkN/SnsDq73az+I3glqAo57Cn1fMqiTn08RpyvOHQiOHi6x45w 0tRsEeWC2Yk/Tbw9x4lY85ybR6KcjGtRbikWQvGwMB19KUJtfLWsljE14p97S/JIRcKL KzcDjdEcXBI1SCmJbhRPkGt4YzTHowJiaqClKl0TK1skYKK+ilv6elknsZRsrUTeTt3+ jB6HipcJsMhvhp3zosjbdLA/+Ju879vREFEbsZIP25kPj5yxIusQXePdHLrfMYbO8NzL s8rDNYrknQgxnp9Dj/MMByZut3HKrxTIoxiz7by9phEeLLDIV10tnOboga4wHz8d3zmf 9yCQ== 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 :mail-followup-to:references:mime-version:content-disposition :in-reply-to:user-agent; bh=4eTa0i9wy9FugigJHQYpPD2vnLHnInaRAs8ERdk9Kq8=; b=Ljdc8f0Yc5iD0Q9s4uAImeiHoyhtWsbb0r4WTZQ0cYTpTxKe3RTKdouGecRK5B751k Saj+1NT6nkhDXsto/OMsYLYbIzVaS5T7WQHol7TsPO5KJfgHtBgsqnK+/qQrKvOv1/wv +c0LOb9Q3sQ41Jf432Q3SWkzs85YWv+pX5hMkUN4TWstQ0AydTfG7G6LsHjx4WxOHClE HsK2MR7jmJoPTdaPweqFCpxCWBfPH7PTw9NaVhQPegMML7lOr78MHzfmnYp16cIEyuVS 0Ynk4fQmQTWdsMseY8MdnULIkYmnByh+CtfbF73l6vpeLSXu3L6IBtigDoaQdqIP2BAa K/iQ== X-Gm-Message-State: AN3rC/6mBc5UP1+l6Z0aGsxrORSElzKjzU1w91tTY7k5ZEhyzHLI4Nit msIRwMwnJQrggA== X-Received: by 10.28.143.71 with SMTP id r68mr5053851wmd.61.1492718537079; Thu, 20 Apr 2017 13:02:17 -0700 (PDT) Received: from brick (cpc92310-cmbg19-2-0-cust934.5-4.cable.virginm.net. [82.9.227.167]) by smtp.gmail.com with ESMTPSA id k4sm222918wmf.12.2017.04.20.13.02.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 20 Apr 2017 13:02:16 -0700 (PDT) Sender: =?UTF-8?Q?Edward_Tomasz_Napiera=C5=82a?= Date: Thu, 20 Apr 2017 21:02:14 +0100 From: Edward Tomasz Napierala To: Bruce Evans Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r316941 - head/sys/kern Message-ID: <20170420200214.GA1717@brick> Mail-Followup-To: Bruce Evans , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201704142015.v3EKFYWA017623@repo.freebsd.org> <20170415064658.L4428@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170415064658.L4428@besplex.bde.org> User-Agent: Mutt/1.8.0 (2017-02-23) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 20 Apr 2017 20:02:19 -0000 On 0415T0736, Bruce Evans wrote: > On Fri, 14 Apr 2017, Edward Tomasz Napierala wrote: > > > Log: > > Don't try to write out bufs that have already failed with ENXIO. > > This fixes some panics after disconnecting mounted disks. > > > > Submitted by: imp (slightly different version, which I've then lost) > > Reviewed by: kib, imp, mckusick > > MFC after: 2 weeks > > Differential Revision: https://reviews.freebsd.org/D9674 > > > > Modified: > > head/sys/kern/vfs_bio.c > > > > Modified: head/sys/kern/vfs_bio.c > > ============================================================================== > > --- head/sys/kern/vfs_bio.c Fri Apr 14 20:15:17 2017 (r316940) > > +++ head/sys/kern/vfs_bio.c Fri Apr 14 20:15:34 2017 (r316941) > > @@ -2290,18 +2290,28 @@ brelse(struct buf *bp) > > bdirty(bp); > > } > > if (bp->b_iocmd == BIO_WRITE && (bp->b_ioflags & BIO_ERROR) && > > + (bp->b_error != ENXIO || !LIST_EMPTY(&bp->b_dep)) && > > !(bp->b_flags & B_INVAL)) { > > /* > > - * Failed write, redirty. Must clear BIO_ERROR to prevent > > - * pages from being scrapped. > > + * Failed write, redirty. All errors except ENXIO (which > > + * means the device is gone) are expected to be potentially > > + * transient - underlying media might work if tried again > > + * after EIO, and memory might be available after an ENOMEM. > > + * > > + * Do this also for buffers that failed with ENXIO, but have > > + * non-empty dependencies - the soft updates code might need > > + * to access the buffer to untangle them. > > + * > > + * Must clear BIO_ERROR to prevent pages from being scrapped. > > */ > > This is hard to fix, but I have used a version that only retries after > EIO for 15-20 years. I didn't think of ENOMEM. > > The media is unlikely to come back after EIO too. For removable media, > you might be able to get the write done to new media, but a panic reading > from the new media is just as likely. Geom "tasting" might prevent the > new media being used. I think media that actually disappeared will eventually result in ENXIO. That's what GEOMs return when they "wither". > ENXIO is actually the one error that can often be recovered from. I > wrote a form of "tasting" in a toy OS 30-35 years ago. It handled > removal of "mounted" disks with pending writes too well, in a way that > made recovery from non-transient I/O errors almost impossible without > turning off the system. ENXIO was treated as a transient I/O error. > It was recovered from perfectly if the user could find the original > media and unremove it. The "tasting" usually worked to detect different > media and disallow writing cached data to a different disk. Media > errors were common, and when one occurred for writing the method of > replacing the disk by a garbage one did't work since it was a different > disk. The most common one was writing to a write protected disk, and > that was recoverable by removing the write protection. But often you > really didn't want to write to that disk, but wanted to write somewhere. > The only way to continue was to reboot to discard the write. Hah. I actually wrote something similar for FreeBSD: gmountver(8). It's a GEOM class that simply passes BIOs to the lower layer, except when it returns EIO or ENXIO - when that happens it queues the BIO in its queue, closes the provider, and then when it comes back it reattaches and resubmits the BIOs. It might actually be useful again due to not always reliable SD cards one might use for rootfs on Raspberry Pi, for example. From owner-svn-src-head@freebsd.org Thu Apr 20 20:06:52 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7F221D47A5E; Thu, 20 Apr 2017 20:06:52 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 456FEB57; Thu, 20 Apr 2017 20:06:52 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3KK6pwq072794; Thu, 20 Apr 2017 20:06:51 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3KK6p8D072793; Thu, 20 Apr 2017 20:06:51 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201704202006.v3KK6p8D072793@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Thu, 20 Apr 2017 20:06:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317212 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 20 Apr 2017 20:06:52 -0000 Author: trasz Date: Thu Apr 20 20:06:51 2017 New Revision: 317212 URL: https://svnweb.freebsd.org/changeset/base/317212 Log: Mention GEOM_MOUNTVER. MFC after: 2 weeks Modified: head/share/man/man4/geom.4 Modified: head/share/man/man4/geom.4 ============================================================================== --- head/share/man/man4/geom.4 Thu Apr 20 19:33:00 2017 (r317211) +++ head/share/man/man4/geom.4 Thu Apr 20 20:06:51 2017 (r317212) @@ -34,7 +34,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 8, 2015 +.Dd April 20, 2017 .Dt GEOM 4 .Os .Sh NAME @@ -55,6 +55,7 @@ .Cd options GEOM_MAP .Cd options GEOM_MBR .Cd options GEOM_MIRROR +.Cd options GEOM_MOUNTVER .Cd options GEOM_MULTIPATH .Cd options GEOM_NOP .Cd options GEOM_PART_APM From owner-svn-src-head@freebsd.org Thu Apr 20 20:46:35 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CCB1ED48933; Thu, 20 Apr 2017 20:46:35 +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 mx1.freebsd.org (Postfix) with ESMTPS id 939681222; Thu, 20 Apr 2017 20:46:35 +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 v3KKkYRH088968; Thu, 20 Apr 2017 20:46:34 GMT (envelope-from scottl@FreeBSD.org) Received: (from scottl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3KKkYlK088967; Thu, 20 Apr 2017 20:46:34 GMT (envelope-from scottl@FreeBSD.org) Message-Id: <201704202046.v3KKkYlK088967@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: scottl set sender to scottl@FreeBSD.org using -f From: Scott Long Date: Thu, 20 Apr 2017 20:46:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317213 - head/sys/cam/scsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 20 Apr 2017 20:46:35 -0000 Author: scottl Date: Thu Apr 20 20:46:34 2017 New Revision: 317213 URL: https://svnweb.freebsd.org/changeset/base/317213 Log: Reorder the minimum_cmd_size code to make it a little smaller and easier to read. Modified: head/sys/cam/scsi/scsi_da.c Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Thu Apr 20 20:06:51 2017 (r317212) +++ head/sys/cam/scsi/scsi_da.c Thu Apr 20 20:46:34 2017 (r317213) @@ -2500,17 +2500,15 @@ daregister(struct cam_periph *periph, vo /* * 6, 10, 12 and 16 are the currently permissible values. */ - if (softc->minimum_cmd_size < 6) - softc->minimum_cmd_size = 6; - else if ((softc->minimum_cmd_size > 6) - && (softc->minimum_cmd_size <= 10)) - softc->minimum_cmd_size = 10; - else if ((softc->minimum_cmd_size > 10) - && (softc->minimum_cmd_size <= 12)) - softc->minimum_cmd_size = 12; - else if (softc->minimum_cmd_size > 12) + if (softc->minimum_cmd_size > 12) softc->minimum_cmd_size = 16; - + else if (softc->minimum_cmd_size > 10) + softc->minimum_cmd_size = 12; + else if (softc->minimum_cmd_size > 6) + softc->minimum_cmd_size = 10; + else + softc->minimum_cmd_size = 6; + /* Predict whether device may support READ CAPACITY(16). */ if (SID_ANSI_REV(&cgd->inq_data) >= SCSI_REV_SPC3 && (softc->quirks & DA_Q_NO_RC16) == 0) { From owner-svn-src-head@freebsd.org Thu Apr 20 21:00:05 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6586DD48D21; Thu, 20 Apr 2017 21:00:05 +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 mx1.freebsd.org (Postfix) with ESMTPS id 37742194C; Thu, 20 Apr 2017 21:00:05 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3KL04lI093296; Thu, 20 Apr 2017 21:00:04 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3KL04wq093295; Thu, 20 Apr 2017 21:00:04 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201704202100.v3KL04wq093295@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 20 Apr 2017 21:00:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317214 - head/lib/clang/include/llvm/Config X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 20 Apr 2017 21:00:05 -0000 Author: dim Date: Thu Apr 20 21:00:04 2017 New Revision: 317214 URL: https://svnweb.freebsd.org/changeset/base/317214 Log: Turn off llvm/clang's ENABLE_BACKTRACES setting, since it never worked properly anyway. (Upstream has reorganized this somewhat in the mean time, but for proper backtraces we would need llvm-symbolizer in base.) MFC after: 3 days Modified: head/lib/clang/include/llvm/Config/config.h Modified: head/lib/clang/include/llvm/Config/config.h ============================================================================== --- head/lib/clang/include/llvm/Config/config.h Thu Apr 20 20:46:34 2017 (r317213) +++ head/lib/clang/include/llvm/Config/config.h Thu Apr 20 21:00:04 2017 (r317214) @@ -12,7 +12,7 @@ #define BUG_REPORT_URL "https://bugs.freebsd.org/submit/" /* Define to 1 to enable backtraces, and to 0 otherwise. */ -#define ENABLE_BACKTRACES 1 +#define ENABLE_BACKTRACES 0 /* Define to 1 to enable crash overrides, and to 0 otherwise. */ #define ENABLE_CRASH_OVERRIDES 1 From owner-svn-src-head@freebsd.org Thu Apr 20 21:00:11 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 05E7DD48D41; Thu, 20 Apr 2017 21:00:11 +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 mx1.freebsd.org (Postfix) with ESMTPS id CC7C1196E; Thu, 20 Apr 2017 21:00:10 +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 v3KL09ej093346; Thu, 20 Apr 2017 21:00:09 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3KL0938093345; Thu, 20 Apr 2017 21:00:09 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201704202100.v3KL0938093345@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 20 Apr 2017 21:00:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317215 - head/lib/clang X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 20 Apr 2017 21:00:11 -0000 Author: dim Date: Thu Apr 20 21:00:09 2017 New Revision: 317215 URL: https://svnweb.freebsd.org/changeset/base/317215 Log: Add function and data sections when building llvm, clang, lld and lldb, and allow the linker to garbage collect them. This shaves off up to a few MB from the final executables. MFC after: 3 days Modified: head/lib/clang/llvm.build.mk Modified: head/lib/clang/llvm.build.mk ============================================================================== --- head/lib/clang/llvm.build.mk Thu Apr 20 21:00:04 2017 (r317214) +++ head/lib/clang/llvm.build.mk Thu Apr 20 21:00:09 2017 (r317215) @@ -40,6 +40,10 @@ CFLAGS+= -DLLVM_DEFAULT_TARGET_TRIPLE=\" CFLAGS+= -DLLVM_HOST_TRIPLE=\"${BUILD_TRIPLE}\" CFLAGS+= -DDEFAULT_SYSROOT=\"${TOOLS_PREFIX}\" +CFLAGS+= -ffunction-sections +CFLAGS+= -fdata-sections +LDFLAGS+= -Wl,--gc-sections + CXXFLAGS+= -std=c++11 CXXFLAGS+= -fno-exceptions CXXFLAGS+= -fno-rtti From owner-svn-src-head@freebsd.org Thu Apr 20 21:02:01 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 29392D48E2D; Thu, 20 Apr 2017 21:02:01 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EF9661E84; Thu, 20 Apr 2017 21:02:00 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3KL20tK097355; Thu, 20 Apr 2017 21:02:00 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3KL20O2097354; Thu, 20 Apr 2017 21:02:00 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201704202102.v3KL20O2097354@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Thu, 20 Apr 2017 21:02:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317216 - head/lib/libthread_db X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 20 Apr 2017 21:02:01 -0000 Author: pfg Date: Thu Apr 20 21:01:59 2017 New Revision: 317216 URL: https://svnweb.freebsd.org/changeset/base/317216 Log: libthread_db: unbreak build due to sign/unsigned comparison. Reported by: lwshu Modified: head/lib/libthread_db/libpthread_db.c Modified: head/lib/libthread_db/libpthread_db.c ============================================================================== --- head/lib/libthread_db/libpthread_db.c Thu Apr 20 21:00:09 2017 (r317215) +++ head/lib/libthread_db/libpthread_db.c Thu Apr 20 21:01:59 2017 (r317216) @@ -227,7 +227,7 @@ pt_ta_map_id2thr(const td_thragent_t *ta TDBG_FUNC(); - if (id < 0 || id >= ta->map_len || ta->map[id].type == PT_NONE) + if (id < 0 || id >= (long)ta->map_len || ta->map[id].type == PT_NONE) return (TD_NOTHR); ret = thr_pread_ptr(ta, ta->thread_list_addr, &pt); @@ -1062,7 +1062,7 @@ static int pt_validate(const td_thrhandle_t *th) { - if (th->th_tid < 0 || th->th_tid >= th->th_ta->map_len || + if (th->th_tid < 0 || th->th_tid >= (long)th->th_ta->map_len || th->th_ta->map[th->th_tid].type == PT_NONE) return (TD_NOTHR); return (TD_OK); From owner-svn-src-head@freebsd.org Thu Apr 20 21:05:27 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 852BDD4801B; Thu, 20 Apr 2017 21:05:27 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [IPv6:2a01:4f8:c17:6c4b::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 515EE262; Thu, 20 Apr 2017 21:05:27 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [62.141.129.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 7DE801FE022; Thu, 20 Apr 2017 23:05:24 +0200 (CEST) Subject: Re: svn commit: r317215 - head/lib/clang To: Dimitry Andric , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201704202100.v3KL0938093345@repo.freebsd.org> From: Hans Petter Selasky Message-ID: <21e86609-e5f6-48ae-b391-38e5e14fc29b@selasky.org> Date: Thu, 20 Apr 2017 23:03:34 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.7.1 MIME-Version: 1.0 In-Reply-To: <201704202100.v3KL0938093345@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 20 Apr 2017 21:05:27 -0000 On 04/20/17 23:00, Dimitry Andric wrote: > Author: dim > Date: Thu Apr 20 21:00:09 2017 > New Revision: 317215 > URL: https://svnweb.freebsd.org/changeset/base/317215 > > Log: > Add function and data sections when building llvm, clang, lld and lldb, > and allow the linker to garbage collect them. This shaves off up to a > few MB from the final executables. > > MFC after: 3 days > Hi, Just curious. Does the i386 and amd64 built "ld" utility support garbage collection, or is this feature only intended for arm and friends? --HPS From owner-svn-src-head@freebsd.org Thu Apr 20 21:29:18 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 260FAD48DF6; Thu, 20 Apr 2017 21:29:18 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [87.251.56.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "tensor.andric.com", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DFAEA39C; Thu, 20 Apr 2017 21:29:17 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from [IPv6:2001:470:7a58::4c69:647b:8bdc:dcb] (unknown [IPv6:2001:470:7a58:0:4c69:647b:8bdc:dcb]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id B9711876F; Thu, 20 Apr 2017 23:29:08 +0200 (CEST) From: Dimitry Andric Message-Id: <0E80DA66-5D0B-4DC2-8AF9-F2136C1D627E@FreeBSD.org> Content-Type: multipart/signed; boundary="Apple-Mail=_737E4804-0F46-41B5-908C-ABDF0C75DFCE"; protocol="application/pgp-signature"; micalg=pgp-sha1 Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: svn commit: r317215 - head/lib/clang Date: Thu, 20 Apr 2017 23:28:58 +0200 In-Reply-To: <21e86609-e5f6-48ae-b391-38e5e14fc29b@selasky.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org To: Hans Petter Selasky References: <201704202100.v3KL0938093345@repo.freebsd.org> <21e86609-e5f6-48ae-b391-38e5e14fc29b@selasky.org> X-Mailer: Apple Mail (2.3273) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 20 Apr 2017 21:29:18 -0000 --Apple-Mail=_737E4804-0F46-41B5-908C-ABDF0C75DFCE Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On 20 Apr 2017, at 23:03, Hans Petter Selasky wrote: >=20 > On 04/20/17 23:00, Dimitry Andric wrote: >> Author: dim >> Date: Thu Apr 20 21:00:09 2017 >> New Revision: 317215 >> URL: https://svnweb.freebsd.org/changeset/base/317215 >>=20 >> Log: >> Add function and data sections when building llvm, clang, lld and = lldb, >> and allow the linker to garbage collect them. This shaves off up to = a >> few MB from the final executables. >>=20 >> MFC after: 3 days >>=20 >=20 > Hi, >=20 > Just curious. Does the i386 and amd64 built "ld" utility support = garbage collection, or is this feature only intended for arm and = friends? As far as I know, GNU ld (ours is from ~2007) has supported GC'ing sections since a very long time. OTOH, if you meant LLVM's lld, then yes, that also supports --gc-sections. -Dimitry --Apple-Mail=_737E4804-0F46-41B5-908C-ABDF0C75DFCE Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.30 iEYEARECAAYFAlj5KCQACgkQsF6jCi4glqOTqwCfQyA9PAYf0I48KRt6tCq+8TbH VvIAn376GFS6OekSQ/374cwu4yZ2SR3S =9aIm -----END PGP SIGNATURE----- --Apple-Mail=_737E4804-0F46-41B5-908C-ABDF0C75DFCE-- From owner-svn-src-head@freebsd.org Thu Apr 20 22:30:40 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9E04BD484D8; Thu, 20 Apr 2017 22:30:40 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5FA26D76; Thu, 20 Apr 2017 22:30:40 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3KMUds4030763; Thu, 20 Apr 2017 22:30:39 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3KMUdAm030762; Thu, 20 Apr 2017 22:30:39 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201704202230.v3KMUdAm030762@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Thu, 20 Apr 2017 22:30:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317231 - head/usr.bin/systat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 20 Apr 2017 22:30:40 -0000 Author: jkim Date: Thu Apr 20 22:30:39 2017 New Revision: 317231 URL: https://svnweb.freebsd.org/changeset/base/317231 Log: Fix systat(1) regression. It was broken by r317061. Modified: head/usr.bin/systat/vmstat.c Modified: head/usr.bin/systat/vmstat.c ============================================================================== --- head/usr.bin/systat/vmstat.c Thu Apr 20 21:48:54 2017 (r317230) +++ head/usr.bin/systat/vmstat.c Thu Apr 20 22:30:39 2017 (r317231) @@ -70,35 +70,35 @@ static const char sccsid[] = "@(#)vmstat static struct Info { long time[CPUSTATES]; - u_int v_swtch; /* context switches */ - u_int v_trap; /* calls to trap */ - u_int v_syscall; /* calls to syscall() */ - u_int v_intr; /* device interrupts */ - u_int v_soft; /* software interrupts */ + uint64_t v_swtch; /* context switches */ + uint64_t v_trap; /* calls to trap */ + uint64_t v_syscall; /* calls to syscall() */ + uint64_t v_intr; /* device interrupts */ + uint64_t v_soft; /* software interrupts */ /* * Virtual memory activity. */ - u_int v_vm_faults; /* number of address memory faults */ - u_int v_io_faults; /* page faults requiring I/O */ - u_int v_cow_faults; /* number of copy-on-writes */ - u_int v_zfod; /* pages zero filled on demand */ - u_int v_ozfod; /* optimized zero fill pages */ - u_int v_swapin; /* swap pager pageins */ - u_int v_swapout; /* swap pager pageouts */ - u_int v_swappgsin; /* swap pager pages paged in */ - u_int v_swappgsout; /* swap pager pages paged out */ - u_int v_vnodein; /* vnode pager pageins */ - u_int v_vnodeout; /* vnode pager pageouts */ - u_int v_vnodepgsin; /* vnode_pager pages paged in */ - u_int v_vnodepgsout; /* vnode pager pages paged out */ - u_int v_intrans; /* intransit blocking page faults */ - u_int v_reactivated; /* number of pages reactivated by pagedaemon */ - u_int v_pdwakeups; /* number of times daemon has awaken from sleep */ - u_int v_pdpages; /* number of pages analyzed by daemon */ - - u_int v_dfree; /* pages freed by daemon */ - u_int v_pfree; /* pages freed by exiting processes */ - u_int v_tfree; /* total pages freed */ + uint64_t v_vm_faults; /* number of address memory faults */ + uint64_t v_io_faults; /* page faults requiring I/O */ + uint64_t v_cow_faults; /* number of copy-on-writes */ + uint64_t v_zfod; /* pages zero filled on demand */ + uint64_t v_ozfod; /* optimized zero fill pages */ + uint64_t v_swapin; /* swap pager pageins */ + uint64_t v_swapout; /* swap pager pageouts */ + uint64_t v_swappgsin; /* swap pager pages paged in */ + uint64_t v_swappgsout; /* swap pager pages paged out */ + uint64_t v_vnodein; /* vnode pager pageins */ + uint64_t v_vnodeout; /* vnode pager pageouts */ + uint64_t v_vnodepgsin; /* vnode_pager pages paged in */ + uint64_t v_vnodepgsout; /* vnode pager pages paged out */ + uint64_t v_intrans; /* intransit blocking page faults */ + uint64_t v_reactivated; /* number of pages reactivated by pagedaemon */ + uint64_t v_pdwakeups; /* number of times daemon has awaken from sleep */ + uint64_t v_pdpages; /* number of pages analyzed by daemon */ + + uint64_t v_dfree; /* pages freed by daemon */ + uint64_t v_pfree; /* pages freed by exiting processes */ + uint64_t v_tfree; /* total pages freed */ /* * Distribution of page usages. */ From owner-svn-src-head@freebsd.org Thu Apr 20 22:36:34 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 48027D487A4; Thu, 20 Apr 2017 22:36:34 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (glebi.us [96.95.210.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 352DF1E2; Thu, 20 Apr 2017 22:36:33 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id v3KMaQIW007371 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 20 Apr 2017 15:36:26 -0700 (PDT) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id v3KMaQ8Z007370; Thu, 20 Apr 2017 15:36:26 -0700 (PDT) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Thu, 20 Apr 2017 15:36:26 -0700 From: Gleb Smirnoff To: Jung-uk Kim Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r317231 - head/usr.bin/systat Message-ID: <20170420223626.GX1033@FreeBSD.org> References: <201704202230.v3KMUdAm030762@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201704202230.v3KMUdAm030762@repo.freebsd.org> User-Agent: Mutt/1.8.0 (2017-02-23) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 20 Apr 2017 22:36:34 -0000 Thanks, Jung-uk! On Thu, Apr 20, 2017 at 10:30:39PM +0000, Jung-uk Kim wrote: J> Author: jkim J> Date: Thu Apr 20 22:30:39 2017 J> New Revision: 317231 J> URL: https://svnweb.freebsd.org/changeset/base/317231 J> J> Log: J> Fix systat(1) regression. It was broken by r317061. J> J> Modified: J> head/usr.bin/systat/vmstat.c J> J> Modified: head/usr.bin/systat/vmstat.c J> ============================================================================== J> --- head/usr.bin/systat/vmstat.c Thu Apr 20 21:48:54 2017 (r317230) J> +++ head/usr.bin/systat/vmstat.c Thu Apr 20 22:30:39 2017 (r317231) J> @@ -70,35 +70,35 @@ static const char sccsid[] = "@(#)vmstat J> J> static struct Info { J> long time[CPUSTATES]; J> - u_int v_swtch; /* context switches */ J> - u_int v_trap; /* calls to trap */ J> - u_int v_syscall; /* calls to syscall() */ J> - u_int v_intr; /* device interrupts */ J> - u_int v_soft; /* software interrupts */ J> + uint64_t v_swtch; /* context switches */ J> + uint64_t v_trap; /* calls to trap */ J> + uint64_t v_syscall; /* calls to syscall() */ J> + uint64_t v_intr; /* device interrupts */ J> + uint64_t v_soft; /* software interrupts */ J> /* J> * Virtual memory activity. J> */ J> - u_int v_vm_faults; /* number of address memory faults */ J> - u_int v_io_faults; /* page faults requiring I/O */ J> - u_int v_cow_faults; /* number of copy-on-writes */ J> - u_int v_zfod; /* pages zero filled on demand */ J> - u_int v_ozfod; /* optimized zero fill pages */ J> - u_int v_swapin; /* swap pager pageins */ J> - u_int v_swapout; /* swap pager pageouts */ J> - u_int v_swappgsin; /* swap pager pages paged in */ J> - u_int v_swappgsout; /* swap pager pages paged out */ J> - u_int v_vnodein; /* vnode pager pageins */ J> - u_int v_vnodeout; /* vnode pager pageouts */ J> - u_int v_vnodepgsin; /* vnode_pager pages paged in */ J> - u_int v_vnodepgsout; /* vnode pager pages paged out */ J> - u_int v_intrans; /* intransit blocking page faults */ J> - u_int v_reactivated; /* number of pages reactivated by pagedaemon */ J> - u_int v_pdwakeups; /* number of times daemon has awaken from sleep */ J> - u_int v_pdpages; /* number of pages analyzed by daemon */ J> - J> - u_int v_dfree; /* pages freed by daemon */ J> - u_int v_pfree; /* pages freed by exiting processes */ J> - u_int v_tfree; /* total pages freed */ J> + uint64_t v_vm_faults; /* number of address memory faults */ J> + uint64_t v_io_faults; /* page faults requiring I/O */ J> + uint64_t v_cow_faults; /* number of copy-on-writes */ J> + uint64_t v_zfod; /* pages zero filled on demand */ J> + uint64_t v_ozfod; /* optimized zero fill pages */ J> + uint64_t v_swapin; /* swap pager pageins */ J> + uint64_t v_swapout; /* swap pager pageouts */ J> + uint64_t v_swappgsin; /* swap pager pages paged in */ J> + uint64_t v_swappgsout; /* swap pager pages paged out */ J> + uint64_t v_vnodein; /* vnode pager pageins */ J> + uint64_t v_vnodeout; /* vnode pager pageouts */ J> + uint64_t v_vnodepgsin; /* vnode_pager pages paged in */ J> + uint64_t v_vnodepgsout; /* vnode pager pages paged out */ J> + uint64_t v_intrans; /* intransit blocking page faults */ J> + uint64_t v_reactivated; /* number of pages reactivated by pagedaemon */ J> + uint64_t v_pdwakeups; /* number of times daemon has awaken from sleep */ J> + uint64_t v_pdpages; /* number of pages analyzed by daemon */ J> + J> + uint64_t v_dfree; /* pages freed by daemon */ J> + uint64_t v_pfree; /* pages freed by exiting processes */ J> + uint64_t v_tfree; /* total pages freed */ J> /* J> * Distribution of page usages. J> */ J> _______________________________________________ J> svn-src-all@freebsd.org mailing list J> https://lists.freebsd.org/mailman/listinfo/svn-src-all J> To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" -- Totus tuus, Glebius. From owner-svn-src-head@freebsd.org Fri Apr 21 00:00:24 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 480FAD45028; Fri, 21 Apr 2017 00:00:24 +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 mx1.freebsd.org (Postfix) with ESMTPS id 2292DAF1; Fri, 21 Apr 2017 00:00:24 +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 v3L00N3I070008; Fri, 21 Apr 2017 00:00:23 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3L00NrH070007; Fri, 21 Apr 2017 00:00:23 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201704210000.v3L00NrH070007@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Fri, 21 Apr 2017 00:00:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317234 - head/usr.bin/vmstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 21 Apr 2017 00:00:24 -0000 Author: glebius Date: Fri Apr 21 00:00:23 2017 New Revision: 317234 URL: https://svnweb.freebsd.org/changeset/base/317234 Log: - When reading VM stats, provide proper size argument to sysctl. - While here, remove unused arguments from mysysctl(). Modified: head/usr.bin/vmstat/vmstat.c Modified: head/usr.bin/vmstat/vmstat.c ============================================================================== --- head/usr.bin/vmstat/vmstat.c Thu Apr 20 23:12:50 2017 (r317233) +++ head/usr.bin/vmstat/vmstat.c Fri Apr 21 00:00:23 2017 (r317234) @@ -413,12 +413,11 @@ retry_nlist: } static int -mysysctl(const char *name, void *oldp, size_t *oldlenp, - void *newp, size_t newlen) +mysysctl(const char *name, void *oldp, size_t *oldlenp) { int error; - error = sysctlbyname(name, oldp, oldlenp, newp, newlen); + error = sysctlbyname(name, oldp, oldlenp, NULL, 0); if (error != 0 && errno != ENOMEM) xo_err(1, "sysctl(%s)", name); return (error); @@ -541,10 +540,12 @@ fill_vmmeter(struct __vmmeter *vmmp) GET_COUNTER(v_kthreadpages); #undef GET_COUNTER } else { - size_t size = sizeof(uint64_t); + size_t size; -#define GET_VM_STATS(cat, name) \ - mysysctl("vm.stats." #cat "." #name, &vmmp->name, &size, NULL, 0) +#define GET_VM_STATS(cat, name) do { \ + size = sizeof(vmmp->name); \ + mysysctl("vm.stats." #cat "." #name, &vmmp->name, &size); \ +} while (0) /* sys */ GET_VM_STATS(sys, v_swtch); GET_VM_STATS(sys, v_trap); @@ -609,7 +610,7 @@ fill_vmtotal(struct vmtotal *vmtp) xo_errx(1, "not implemented"); } else { size_t size = sizeof(*vmtp); - mysysctl("vm.vmtotal", vmtp, &size, NULL, 0); + mysysctl("vm.vmtotal", vmtp, &size); if (size != sizeof(*vmtp)) xo_errx(1, "vm.total size mismatch"); } @@ -633,14 +634,14 @@ getcpuinfo(u_long *maskp, int *maxidp) mask = 0; ncpus = 0; size = sizeof(maxcpu); - mysysctl("kern.smp.maxcpus", &maxcpu, &size, NULL, 0); + mysysctl("kern.smp.maxcpus", &maxcpu, &size); if (size != sizeof(maxcpu)) xo_errx(1, "sysctl kern.smp.maxcpus"); size = sizeof(long) * maxcpu * CPUSTATES; times = malloc(size); if (times == NULL) xo_err(1, "malloc %zd bytes", size); - mysysctl("kern.cp_times", times, &size, NULL, 0); + mysysctl("kern.cp_times", times, &size); maxid = (size / CPUSTATES / sizeof(long)) - 1; for (i = 0; i <= maxid; i++) { empty = 1; @@ -731,7 +732,7 @@ dovmstat(unsigned int interval, int reps struct clockinfo clockrate; size = sizeof(clockrate); - mysysctl("kern.clockrate", &clockrate, &size, NULL, 0); + mysysctl("kern.clockrate", &clockrate, &size); if (size != sizeof(clockrate)) xo_errx(1, "clockrate size mismatch"); hz = clockrate.hz; @@ -751,13 +752,13 @@ dovmstat(unsigned int interval, int reps xo_errx(1, "kvm_getcptime: %s", kvm_geterr(kd)); } else { size = sizeof(cur.cp_time); - mysysctl("kern.cp_time", &cur.cp_time, &size, NULL, 0); + mysysctl("kern.cp_time", &cur.cp_time, &size); if (size != sizeof(cur.cp_time)) xo_errx(1, "cp_time size mismatch"); } if (Pflag) { size = size_cp_times; - mysysctl("kern.cp_times", cur_cp_times, &size, NULL, 0); + mysysctl("kern.cp_times", cur_cp_times, &size); if (size != size_cp_times) xo_errx(1, "cp_times mismatch"); } @@ -1110,7 +1111,7 @@ dosum(void) kread(X_NCHSTATS, &lnchstats, sizeof(lnchstats)); } else { size_t size = sizeof(lnchstats); - mysysctl("vfs.cache.nchstats", &lnchstats, &size, NULL, 0); + mysysctl("vfs.cache.nchstats", &lnchstats, &size); if (size != sizeof(lnchstats)) xo_errx(1, "vfs.cache.nchstats size mismatch"); } @@ -1300,8 +1301,7 @@ read_intrcnts(unsigned long **intrcnts) *intrcnts = reallocf(*intrcnts, intrcntlen); if (*intrcnts == NULL) err(1, "reallocf()"); - if (mysysctl("hw.intrcnt", - *intrcnts, &intrcntlen, NULL, 0) == 0) + if (mysysctl("hw.intrcnt", *intrcnts, &intrcntlen) == 0) break; } } @@ -1369,8 +1369,7 @@ dointr(unsigned int interval, int reps) for (intrnames = NULL, inamlen = 1024; ; inamlen *= 2) { if ((intrnames = reallocf(intrnames, inamlen)) == NULL) xo_err(1, "reallocf()"); - if (mysysctl("hw.intrnames", - intrnames, &inamlen, NULL, 0) == 0) + if (mysysctl("hw.intrnames", intrnames, &inamlen) == 0) break; } } From owner-svn-src-head@freebsd.org Fri Apr 21 00:12:48 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B9055D45432; Fri, 21 Apr 2017 00:12:48 +0000 (UTC) (envelope-from jpaetzel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7B7B81298; Fri, 21 Apr 2017 00:12:48 +0000 (UTC) (envelope-from jpaetzel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3L0Clnw077480; Fri, 21 Apr 2017 00:12:47 GMT (envelope-from jpaetzel@FreeBSD.org) Received: (from jpaetzel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3L0ClUK077476; Fri, 21 Apr 2017 00:12:47 GMT (envelope-from jpaetzel@FreeBSD.org) Message-Id: <201704210012.v3L0ClUK077476@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jpaetzel set sender to jpaetzel@FreeBSD.org using -f From: Josh Paetzel Date: Fri, 21 Apr 2017 00:12:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317235 - in head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 21 Apr 2017 00:12:48 -0000 Author: jpaetzel Date: Fri Apr 21 00:12:47 2017 New Revision: 317235 URL: https://svnweb.freebsd.org/changeset/base/317235 Log: MFV 316868 7430 Backfill metadnode more intelligently illumos/illumos-gate@af346df58864e8fe897b1ff1a3a4c12f9294391b https://github.com/illumos/illumos-gate/commit/af346df58864e8fe897b1ff1a3a4c12f9294391b https://www.illumos.org/issues/7430 Description and patch from brought over from the following ZoL commit: https:// github.com/zfsonlinux/zfs/commit/68cbd56e182ab949f58d004778d463aeb3f595c6 Only attempt to backfill lower metadnode object numbers if at least 4096 objects have been freed since the last rescan, and at most once per transaction group. This avoids a pathology in dmu_object_alloc() that caused O(N^2) behavior for create-heavy workloads and substantially improves object creation rates. As summarized by @mahrens in #4636: "Normally, the object allocator simply checks to see if the next object is available. The slow calls happened when dmu_object_alloc() checks to see if it can backfill lower object numbers. This happens every time we move on to a new L1 indirect block (i.e. every 32 * 128 = 4096 objects). When re-checking lower object numbers, we use the on-disk fill count (blkptr_t:blk_fill) to quickly skip over indirect blocks that don?t have enough free dnodes (defined as an L2 with at least 393,216 of 524,288 dnodes free). Therefore, we may find that a block of dnodes has a low (or zero) fill count, and yet we can?t allocate any of its dnodes, because they've been allocated in memory but not yet written to disk. In this case we have to hold each of the dnodes and then notice that it has been allocated in memory. The end result is that allocating N objects in the same TXG can require CPU usage proportional to N^2." Add a tunable dmu_rescan_dnode_threshold to define the number of objects that must be freed before a rescan is performed. Don't bother to export this as a module option because testing doesn't show a compelling reason to change it. The vast majority of the performance gain comes from limit the rescan to at most once per TXG. Reviewed by: Alek Pinchuk Reviewed by: Brian Behlendorf Reviewed by: Matthew Ahrens Approved by: Gordon Ross Author: Ned Bass Obtained from: Illumos Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_object.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode_sync.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_objset.h Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_object.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_object.c Fri Apr 21 00:00:23 2017 (r317234) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_object.c Fri Apr 21 00:12:47 2017 (r317235) @@ -36,20 +36,22 @@ dmu_object_alloc(objset_t *os, dmu_objec dmu_object_type_t bonustype, int bonuslen, dmu_tx_t *tx) { uint64_t object; - uint64_t L2_dnode_count = DNODES_PER_BLOCK << + uint64_t L1_dnode_count = DNODES_PER_BLOCK << (DMU_META_DNODE(os)->dn_indblkshift - SPA_BLKPTRSHIFT); dnode_t *dn = NULL; - int restarted = B_FALSE; mutex_enter(&os->os_obj_lock); for (;;) { object = os->os_obj_next; /* - * Each time we polish off an L2 bp worth of dnodes - * (2^13 objects), move to another L2 bp that's still - * reasonably sparse (at most 1/4 full). Look from the - * beginning once, but after that keep looking from here. - * If we can't find one, just keep going from here. + * Each time we polish off a L1 bp worth of dnodes (2^12 + * objects), move to another L1 bp that's still reasonably + * sparse (at most 1/4 full). Look from the beginning at most + * once per txg, but after that keep looking from here. + * os_scan_dnodes is set during txg sync if enough objects + * have been freed since the previous rescan to justify + * backfilling again. If we can't find a suitable block, just + * keep going from here. * * Note that dmu_traverse depends on the behavior that we use * multiple blocks of the dnode object before going back to @@ -57,12 +59,19 @@ dmu_object_alloc(objset_t *os, dmu_objec * that property or find another solution to the issues * described in traverse_visitbp. */ - if (P2PHASE(object, L2_dnode_count) == 0) { - uint64_t offset = restarted ? object << DNODE_SHIFT : 0; - int error = dnode_next_offset(DMU_META_DNODE(os), + + if (P2PHASE(object, L1_dnode_count) == 0) { + uint64_t offset; + int error; + if (os->os_rescan_dnodes) { + offset = 0; + os->os_rescan_dnodes = B_FALSE; + } else { + offset = object << DNODE_SHIFT; + } + error = dnode_next_offset(DMU_META_DNODE(os), DNODE_FIND_HOLE, &offset, 2, DNODES_PER_BLOCK >> 2, 0); - restarted = B_TRUE; if (error == 0) object = offset >> DNODE_SHIFT; } Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c Fri Apr 21 00:00:23 2017 (r317234) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c Fri Apr 21 00:12:47 2017 (r317235) @@ -67,6 +67,13 @@ krwlock_t os_lock; */ int dmu_find_threads = 0; +/* + * Backfill lower metadnode objects after this many have been freed. + * Backfilling negatively impacts object creation rates, so only do it + * if there are enough holes to fill. + */ +int dmu_rescan_dnode_threshold = 131072; + static void dmu_objset_find_dp_cb(void *arg); void @@ -1176,6 +1183,13 @@ dmu_objset_sync(objset_t *os, zio_t *pio if (dr->dr_zio) zio_nowait(dr->dr_zio); } + + /* Enable dnode backfill if enough objects have been freed. */ + if (os->os_freed_dnodes >= dmu_rescan_dnode_threshold) { + os->os_rescan_dnodes = B_TRUE; + os->os_freed_dnodes = 0; + } + /* * Free intent log blocks up to this tx. */ Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode_sync.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode_sync.c Fri Apr 21 00:00:23 2017 (r317234) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode_sync.c Fri Apr 21 00:12:47 2017 (r317235) @@ -672,6 +672,7 @@ dnode_sync(dnode_t *dn, dmu_tx_t *tx) } if (freeing_dnode) { + dn->dn_objset->os_freed_dnodes++; dnode_sync_free(dn, tx); return; } Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_objset.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_objset.h Fri Apr 21 00:00:23 2017 (r317234) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_objset.h Fri Apr 21 00:12:47 2017 (r317235) @@ -112,6 +112,8 @@ struct objset { zil_header_t os_zil_header; list_t os_synced_dnodes; uint64_t os_flags; + uint64_t os_freed_dnodes; + boolean_t os_rescan_dnodes; /* Protected by os_obj_lock */ kmutex_t os_obj_lock; From owner-svn-src-head@freebsd.org Fri Apr 21 00:17:48 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 80B0BD45541; Fri, 21 Apr 2017 00:17:48 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 52756149D; Fri, 21 Apr 2017 00:17:48 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3L0Hlbw077713; Fri, 21 Apr 2017 00:17:47 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3L0Hlvi077712; Fri, 21 Apr 2017 00:17:47 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201704210017.v3L0Hlvi077712@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Fri, 21 Apr 2017 00:17:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317236 - head/sys/fs/nfsserver X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 21 Apr 2017 00:17:48 -0000 Author: rmacklem Date: Fri Apr 21 00:17:47 2017 New Revision: 317236 URL: https://svnweb.freebsd.org/changeset/base/317236 Log: Fix the setting of atime for Linux client NFSv4 mounts. The FreeBSD NFSv4 server did not set the attribute bit for TimeAccess in the reply to an Open with exclusive_create, as required by the RFCs. (This is required since the FreeBSD NFS server stores the create_verifier in the va_atime attribute.) As such, the Linux NFSv4 client did not set the TimeAccess (atime) in the Setattr done in an RPC after the one with the Open/exclusive_create. This patch fixes the server to set the TimeAccess bit in the reply. I believe that storing the create_verifier in an extended attribute for file systems that support extended attributes might be a good idea, but I will wait for a discussion of this on the freebsd-fs@ email list before considering committing a patch to do this. Reported by: jim@ks.uiuc.edu Suggested by: dfr MFC after: 2 weeks Modified: head/sys/fs/nfsserver/nfs_nfsdport.c Modified: head/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdport.c Fri Apr 21 00:12:47 2017 (r317235) +++ head/sys/fs/nfsserver/nfs_nfsdport.c Fri Apr 21 00:17:47 2017 (r317236) @@ -1436,7 +1436,9 @@ nfsvno_open(struct nfsrv_descript *nd, s vput(ndp->ni_vp); ndp->ni_vp = NULL; nd->nd_repstat = NFSERR_NOTSUPP; - } + } else + NFSSETBIT_ATTRBIT(attrbitp, + NFSATTRBIT_TIMEACCESS); } else { nfsrv_fixattr(nd, ndp->ni_vp, nvap, aclp, p, attrbitp, exp); From owner-svn-src-head@freebsd.org Fri Apr 21 00:17:55 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E1DA3D4556D; Fri, 21 Apr 2017 00:17:55 +0000 (UTC) (envelope-from jpaetzel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A3E8114F2; Fri, 21 Apr 2017 00:17:55 +0000 (UTC) (envelope-from jpaetzel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3L0HsF0077762; Fri, 21 Apr 2017 00:17:54 GMT (envelope-from jpaetzel@FreeBSD.org) Received: (from jpaetzel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3L0HsdH077760; Fri, 21 Apr 2017 00:17:54 GMT (envelope-from jpaetzel@FreeBSD.org) Message-Id: <201704210017.v3L0HsdH077760@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jpaetzel set sender to jpaetzel@FreeBSD.org using -f From: Josh Paetzel Date: Fri, 21 Apr 2017 00:17:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317237 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 21 Apr 2017 00:17:56 -0000 Author: jpaetzel Date: Fri Apr 21 00:17:54 2017 New Revision: 317237 URL: https://svnweb.freebsd.org/changeset/base/317237 Log: MFV 316870 7448 ZFS doesn't notice when disk vdevs have no write cache illumos/illumos-gate@295438ba3230419314faaa889a2616f561658bd5 https://github.com/illumos/illumos-gate/commit/295438ba3230419314faaa889a2616f561658bd5 https://www.illumos.org/issues/7448 I built a SmartOS image with all the NVMe commits including 7372 (support NVMe volatile write cache) and repeated my dd testing: > #!/bin/bash > for i in `seq 1 1000`; do > dd if=/dev/zero of=file00 bs=1M count=102400 oflag=sync & > dd if=/dev/zero of=file01 bs=1M count=102400 oflag=sync & > wait > rm file00 file01 > done > Previously each dd command took ~145 seconds to finish, now it takes ~400 seconds. Eventually I figured out it is 7372 that causes unnecessary nvme_bd_sync() executions which wasted CPU cycles. If a NVMe device doesn't support a write cache, the nvme_bd_sync function will return ENOTSUP to indicate this to upper layers. It seems this returned value is ignored by ZFS, and as such this bug is not really specific to NVMe. In vdev_disk_io_start() ZFS sends the flush to the disk driver (blkdev) with a callback to vdev_disk_ioctl_done(). As nvme filled in the bd_sync_cache function pointer, blkdev will not return ENOTSUP, as the nvme driver in general does support cache flush. Instead it will issue an asynchronous flush to nvme and immediately return 0, and hence ZFS will not set vdev_nowritecache here. The nvme driver will at some point process the cache flush command, and if there is no write cache on the device it will return ENOTSUP, which will be delivered to the vdev_disk_ioctl_done() callback. This function will not check the error code and not set nowritecache. The right place to check the error code from the cache flush is in zio_vdev_io_assess(). This would catch both cases, synchronous and asynchronous cache flushes. This would also be independent of the implementation detail that some drivers can return ENOTSUP immediately. Reviewed by: Dan Fields Reviewed by: Alek Pinchuk Reviewed by: George Wilson Approved by: Dan McDonald Author: Hans Rosenfeld Obtained from: Illumos Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_disk.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_disk.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_disk.c Fri Apr 21 00:17:47 2017 (r317236) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_disk.c Fri Apr 21 00:17:54 2017 (r317237) @@ -21,7 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2012, 2015 by Delphix. All rights reserved. - * Copyright 2013 Nexenta Systems, Inc. All rights reserved. + * Copyright 2016 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2013 Joyent, Inc. All rights reserved. */ @@ -743,16 +743,6 @@ vdev_disk_io_start(zio_t *zio) return; } - if (error == ENOTSUP || error == ENOTTY) { - /* - * If we get ENOTSUP or ENOTTY, we know that - * no future attempts will ever succeed. - * In this case we set a persistent bit so - * that we don't bother with the ioctl in the - * future. - */ - vd->vdev_nowritecache = B_TRUE; - } zio->io_error = error; break; Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Fri Apr 21 00:17:47 2017 (r317236) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Fri Apr 21 00:17:54 2017 (r317237) @@ -3302,6 +3302,16 @@ zio_vdev_io_assess(zio_t *zio) vd->vdev_cant_write = B_TRUE; } + /* + * If a cache flush returns ENOTSUP or ENOTTY, we know that no future + * attempts will ever succeed. In this case we set a persistent bit so + * that we don't bother with it in the future. + */ + if ((zio->io_error == ENOTSUP || zio->io_error == ENOTTY) && + zio->io_type == ZIO_TYPE_IOCTL && + zio->io_cmd == DKIOCFLUSHWRITECACHE && vd != NULL) + vd->vdev_nowritecache = B_TRUE; + if (zio->io_error) zio->io_pipeline = ZIO_INTERLOCK_PIPELINE; From owner-svn-src-head@freebsd.org Fri Apr 21 00:25:00 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 95775D457E7; Fri, 21 Apr 2017 00:25:00 +0000 (UTC) (envelope-from jpaetzel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 409261AD4; Fri, 21 Apr 2017 00:25:00 +0000 (UTC) (envelope-from jpaetzel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3L0OxRW081861; Fri, 21 Apr 2017 00:24:59 GMT (envelope-from jpaetzel@FreeBSD.org) Received: (from jpaetzel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3L0OxAI081860; Fri, 21 Apr 2017 00:24:59 GMT (envelope-from jpaetzel@FreeBSD.org) Message-Id: <201704210024.v3L0OxAI081860@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jpaetzel set sender to jpaetzel@FreeBSD.org using -f From: Josh Paetzel Date: Fri, 21 Apr 2017 00:24:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317238 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 21 Apr 2017 00:25:00 -0000 Author: jpaetzel Date: Fri Apr 21 00:24:59 2017 New Revision: 317238 URL: https://svnweb.freebsd.org/changeset/base/317238 Log: MFV 316871 7490 real checksum errors are silenced when zinject is on illumos/illumos-gate@6cedfc397d92d64e442f0aae4445ac507beaf58f https://github.com/illumos/illumos-gate/commit/6cedfc397d92d64e442f0aae4445ac507beaf58f https://www.illumos.org/issues/7490 When zinject is on, error codes from zfs_checksum_error() can be overwritten due to an incorrect and overly-complex if condition. Reviewed by: George Wilson Reviewed by: Paul Dagnelie Reviewed by: Dan Kimmel Reviewed by: Matthew Ahrens Approved by: Robert Mustacchi Author: Pavel Zakharov Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_checksum.c Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_checksum.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_checksum.c Fri Apr 21 00:17:54 2017 (r317237) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_checksum.c Fri Apr 21 00:24:59 2017 (r317238) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2013, 2015 by Delphix. All rights reserved. + * Copyright (c) 2013, 2016 by Delphix. All rights reserved. * Copyright (c) 2013, Joyent, Inc. All rights reserved. * Copyright 2013 Saso Kiselkov. All rights reserved. */ @@ -392,12 +392,13 @@ zio_checksum_error(zio_t *zio, zio_bad_c error = zio_checksum_error_impl(spa, bp, checksum, data, size, offset, info); - if (error != 0 && zio_injection_enabled && !zio->io_error && - (error = zio_handle_fault_injection(zio, ECKSUM)) != 0) { - info->zbc_injected = 1; - return (error); + if (zio_injection_enabled && error == 0 && zio->io_error == 0) { + error = zio_handle_fault_injection(zio, ECKSUM); + if (error != 0) + info->zbc_injected = 1; } + return (error); } From owner-svn-src-head@freebsd.org Fri Apr 21 00:45:47 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 20BB3D46126; Fri, 21 Apr 2017 00:45:47 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B7C797D9; Fri, 21 Apr 2017 00:45:46 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3L0jkdp089900; Fri, 21 Apr 2017 00:45:46 GMT (envelope-from sjg@FreeBSD.org) Received: (from sjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3L0jiQk089883; Fri, 21 Apr 2017 00:45:44 GMT (envelope-from sjg@FreeBSD.org) Message-Id: <201704210045.v3L0jiQk089883@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sjg set sender to sjg@FreeBSD.org using -f From: "Simon J. Gerraty" Date: Fri, 21 Apr 2017 00:45:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317239 - in head: contrib/bmake contrib/bmake/mk usr.bin/bmake X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 21 Apr 2017 00:45:47 -0000 Author: sjg Date: Fri Apr 21 00:45:44 2017 New Revision: 317239 URL: https://svnweb.freebsd.org/changeset/base/317239 Log: Merge bmake-20170420 Modified: head/contrib/bmake/ChangeLog head/contrib/bmake/Makefile head/contrib/bmake/arch.c head/contrib/bmake/cond.c head/contrib/bmake/dir.c head/contrib/bmake/for.c head/contrib/bmake/job.c head/contrib/bmake/main.c head/contrib/bmake/make_malloc.c head/contrib/bmake/mk/ChangeLog head/contrib/bmake/mk/auto.obj.mk head/contrib/bmake/mk/install-mk head/contrib/bmake/parse.c head/contrib/bmake/suff.c head/contrib/bmake/targ.c head/contrib/bmake/var.c head/usr.bin/bmake/Makefile Directory Properties: head/contrib/bmake/ (props changed) Modified: head/contrib/bmake/ChangeLog ============================================================================== --- head/contrib/bmake/ChangeLog Fri Apr 21 00:24:59 2017 (r317238) +++ head/contrib/bmake/ChangeLog Fri Apr 21 00:45:44 2017 (r317239) @@ -1,3 +1,29 @@ +2017-04-20 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20170420 + Merge with NetBSD make, pick up + o main.c: only use -C arg "as is" if it contains no + relative component. + +2017-04-18 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20170418 + Merge with NetBSD make, pick up + o main.c: fix Main_SetObjdir() for relative paths (eg obj). + +2017-04-17 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20170417 + Merge with NetBSD make, pick up + o fixes a number of coverity complaints + - check return value of fseek, fcntl + - plug memory leak in Dir_FindFile, Var_LoopExpand, + JobPrintCommand, ParseTraditionalInclude + - use bmake_malloc() where NULL is not tollerated + - use MAKE_ATTR_UNUSED rather that kludges like + return(unused ? 0 : 0) + - use purge_cached_realpaths() rather than abuse cached_realpath() + 2017-04-13 Simon J. Gerraty * Makefile (_MAKE_VERSION): 20170413 Modified: head/contrib/bmake/Makefile ============================================================================== --- head/contrib/bmake/Makefile Fri Apr 21 00:24:59 2017 (r317238) +++ head/contrib/bmake/Makefile Fri Apr 21 00:45:44 2017 (r317239) @@ -1,7 +1,7 @@ -# $Id: Makefile,v 1.85 2017/04/13 16:29:40 sjg Exp $ +# $Id: Makefile,v 1.88 2017/04/20 14:51:14 sjg Exp $ # Base version on src date -_MAKE_VERSION= 20170413 +_MAKE_VERSION= 20170420 PROG= bmake Modified: head/contrib/bmake/arch.c ============================================================================== --- head/contrib/bmake/arch.c Fri Apr 21 00:24:59 2017 (r317238) +++ head/contrib/bmake/arch.c Fri Apr 21 00:45:44 2017 (r317239) @@ -1,4 +1,4 @@ -/* $NetBSD: arch.c,v 1.69 2016/04/06 09:57:00 gson Exp $ */ +/* $NetBSD: arch.c,v 1.70 2017/04/16 20:49:09 riastradh Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -69,14 +69,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: arch.c,v 1.69 2016/04/06 09:57:00 gson Exp $"; +static char rcsid[] = "$NetBSD: arch.c,v 1.70 2017/04/16 20:49:09 riastradh Exp $"; #else #include #ifndef lint #if 0 static char sccsid[] = "@(#)arch.c 8.2 (Berkeley) 1/2/94"; #else -__RCSID("$NetBSD: arch.c,v 1.69 2016/04/06 09:57:00 gson Exp $"); +__RCSID("$NetBSD: arch.c,v 1.70 2017/04/16 20:49:09 riastradh Exp $"); #endif #endif /* not lint */ #endif @@ -726,7 +726,8 @@ ArchStatMember(char *archive, char *memb if (fread(memName, elen, 1, arch) != 1) goto badarch; memName[elen] = '\0'; - fseek(arch, -elen, SEEK_CUR); + if (fseek(arch, -elen, SEEK_CUR) != 0) + goto badarch; if (DEBUG(ARCH) || DEBUG(MAKE)) { fprintf(debug_file, "ArchStat: Extended format entry for %s\n", memName); } @@ -737,7 +738,8 @@ ArchStatMember(char *archive, char *memb Hash_SetValue(he, bmake_malloc(sizeof(struct ar_hdr))); memcpy(Hash_GetValue(he), &arh, sizeof(struct ar_hdr)); } - fseek(arch, (size + 1) & ~1, SEEK_CUR); + if (fseek(arch, (size + 1) & ~1, SEEK_CUR) != 0) + goto badarch; } fclose(arch); @@ -956,7 +958,10 @@ ArchFindMember(char *archive, char *memb * the file at the actual member, rather than its header, but * not here... */ - fseek(arch, -sizeof(struct ar_hdr), SEEK_CUR); + if (fseek(arch, -sizeof(struct ar_hdr), SEEK_CUR) != 0) { + fclose(arch); + return NULL; + } return (arch); } } else @@ -986,10 +991,17 @@ ArchFindMember(char *archive, char *memb } if (strncmp(ename, member, len) == 0) { /* Found as extended name */ - fseek(arch, -sizeof(struct ar_hdr) - elen, SEEK_CUR); + if (fseek(arch, -sizeof(struct ar_hdr) - elen, + SEEK_CUR) != 0) { + fclose(arch); + return NULL; + } return (arch); } - fseek(arch, -elen, SEEK_CUR); + if (fseek(arch, -elen, SEEK_CUR) != 0) { + fclose(arch); + return NULL; + } goto skip; } else #endif @@ -1002,9 +1014,12 @@ skip: * extract the size of the file from the 'size' field of the * header and round it up during the seek. */ - arhPtr->ar_size[sizeof(arhPtr->AR_SIZE)-1] = '\0'; + arhPtr->AR_SIZE[sizeof(arhPtr->AR_SIZE)-1] = '\0'; size = (int)strtol(arhPtr->AR_SIZE, NULL, 10); - fseek(arch, (size + 1) & ~1, SEEK_CUR); + if (fseek(arch, (size + 1) & ~1, SEEK_CUR) != 0) { + fclose(arch); + return NULL; + } } } Modified: head/contrib/bmake/cond.c ============================================================================== --- head/contrib/bmake/cond.c Fri Apr 21 00:24:59 2017 (r317238) +++ head/contrib/bmake/cond.c Fri Apr 21 00:45:44 2017 (r317239) @@ -1,4 +1,4 @@ -/* $NetBSD: cond.c,v 1.74 2016/02/18 18:29:14 christos Exp $ */ +/* $NetBSD: cond.c,v 1.75 2017/04/16 20:59:04 riastradh Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -70,14 +70,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: cond.c,v 1.74 2016/02/18 18:29:14 christos Exp $"; +static char rcsid[] = "$NetBSD: cond.c,v 1.75 2017/04/16 20:59:04 riastradh Exp $"; #else #include #ifndef lint #if 0 static char sccsid[] = "@(#)cond.c 8.2 (Berkeley) 1/2/94"; #else -__RCSID("$NetBSD: cond.c,v 1.74 2016/02/18 18:29:14 christos Exp $"); +__RCSID("$NetBSD: cond.c,v 1.75 2017/04/16 20:59:04 riastradh Exp $"); #endif #endif /* not lint */ #endif @@ -91,6 +91,7 @@ __RCSID("$NetBSD: cond.c,v 1.74 2016/02/ * */ +#include #include #include /* For strtoul() error checking */ @@ -1174,8 +1175,9 @@ Cond_EvalExpression(const struct If *inf break; dflt_info = info; } + assert(info != NULL); - if_info = info != NULL ? info : ifs + 4; + if_info = info; condExpr = line; condPushBack = TOK_NONE; Modified: head/contrib/bmake/dir.c ============================================================================== --- head/contrib/bmake/dir.c Fri Apr 21 00:24:59 2017 (r317238) +++ head/contrib/bmake/dir.c Fri Apr 21 00:45:44 2017 (r317239) @@ -1,4 +1,4 @@ -/* $NetBSD: dir.c,v 1.69 2017/01/31 06:54:23 sjg Exp $ */ +/* $NetBSD: dir.c,v 1.71 2017/04/16 21:14:47 riastradh Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -70,14 +70,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: dir.c,v 1.69 2017/01/31 06:54:23 sjg Exp $"; +static char rcsid[] = "$NetBSD: dir.c,v 1.71 2017/04/16 21:14:47 riastradh Exp $"; #else #include #ifndef lint #if 0 static char sccsid[] = "@(#)dir.c 8.2 (Berkeley) 1/2/94"; #else -__RCSID("$NetBSD: dir.c,v 1.69 2017/01/31 06:54:23 sjg Exp $"); +__RCSID("$NetBSD: dir.c,v 1.71 2017/04/16 21:14:47 riastradh Exp $"); #endif #endif /* not lint */ #endif @@ -803,11 +803,11 @@ DirExpandInt(const char *word, Lst path, *----------------------------------------------------------------------- */ static int -DirPrintWord(void *word, void *dummy) +DirPrintWord(void *word, void *dummy MAKE_ATTR_UNUSED) { fprintf(debug_file, "%s ", (char *)word); - return(dummy ? 0 : 0); + return 0; } /*- @@ -1315,8 +1315,14 @@ Dir_FindFile(const char *name, Lst path) fprintf(debug_file, " Trying exact path matches...\n"); } - if (!hasLastDot && cur && (file = DirLookupAbs(cur, name, cp)) != NULL) - return *file?file:NULL; + if (!hasLastDot && cur && ((file = DirLookupAbs(cur, name, cp)) + != NULL)) { + if (file[0] == '\0') { + free(file); + return NULL; + } + return file; + } (void)Lst_Open(path); while ((ln = Lst_Next(path)) != NULL) { @@ -1325,13 +1331,23 @@ Dir_FindFile(const char *name, Lst path) continue; if ((file = DirLookupAbs(p, name, cp)) != NULL) { Lst_Close(path); - return *file?file:NULL; + if (file[0] == '\0') { + free(file); + return NULL; + } + return file; } } Lst_Close(path); - if (hasLastDot && cur && (file = DirLookupAbs(cur, name, cp)) != NULL) - return *file?file:NULL; + if (hasLastDot && cur && ((file = DirLookupAbs(cur, name, cp)) + != NULL)) { + if (file[0] == '\0') { + free(file); + return NULL; + } + return file; + } } /* @@ -1851,10 +1867,10 @@ Dir_PrintDirectories(void) } static int -DirPrintDir(void *p, void *dummy) +DirPrintDir(void *p, void *dummy MAKE_ATTR_UNUSED) { fprintf(debug_file, "%s ", ((Path *)p)->name); - return (dummy ? 0 : 0); + return 0; } void Modified: head/contrib/bmake/for.c ============================================================================== --- head/contrib/bmake/for.c Fri Apr 21 00:24:59 2017 (r317238) +++ head/contrib/bmake/for.c Fri Apr 21 00:45:44 2017 (r317239) @@ -1,4 +1,4 @@ -/* $NetBSD: for.c,v 1.52 2016/02/18 18:29:14 christos Exp $ */ +/* $NetBSD: for.c,v 1.53 2017/04/16 21:04:44 riastradh Exp $ */ /* * Copyright (c) 1992, The Regents of the University of California. @@ -30,14 +30,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: for.c,v 1.52 2016/02/18 18:29:14 christos Exp $"; +static char rcsid[] = "$NetBSD: for.c,v 1.53 2017/04/16 21:04:44 riastradh Exp $"; #else #include #ifndef lint #if 0 static char sccsid[] = "@(#)for.c 8.1 (Berkeley) 6/6/93"; #else -__RCSID("$NetBSD: for.c,v 1.52 2016/02/18 18:29:14 christos Exp $"); +__RCSID("$NetBSD: for.c,v 1.53 2017/04/16 21:04:44 riastradh Exp $"); #endif #endif /* not lint */ #endif @@ -427,7 +427,7 @@ For_Iterate(void *v_arg, size_t *ret_len for (cp = cmd_cp; (cp = strchr(cp, '$')) != NULL;) { char ech; ch = *++cp; - if ((ch == '(' && (ech = ')')) || (ch == '{' && (ech = '}'))) { + if ((ch == '(' && (ech = ')', 1)) || (ch == '{' && (ech = '}', 1))) { cp++; /* Check variable name against the .for loop variables */ STRLIST_FOREACH(var, &arg->vars, i) { Modified: head/contrib/bmake/job.c ============================================================================== --- head/contrib/bmake/job.c Fri Apr 21 00:24:59 2017 (r317238) +++ head/contrib/bmake/job.c Fri Apr 21 00:45:44 2017 (r317239) @@ -1,4 +1,4 @@ -/* $NetBSD: job.c,v 1.188 2016/08/26 23:28:39 dholland Exp $ */ +/* $NetBSD: job.c,v 1.190 2017/04/16 21:23:43 riastradh Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -70,14 +70,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: job.c,v 1.188 2016/08/26 23:28:39 dholland Exp $"; +static char rcsid[] = "$NetBSD: job.c,v 1.190 2017/04/16 21:23:43 riastradh Exp $"; #else #include #ifndef lint #if 0 static char sccsid[] = "@(#)job.c 8.2 (Berkeley) 3/19/94"; #else -__RCSID("$NetBSD: job.c,v 1.188 2016/08/26 23:28:39 dholland Exp $"); +__RCSID("$NetBSD: job.c,v 1.190 2017/04/16 21:23:43 riastradh Exp $"); #endif #endif /* not lint */ #endif @@ -443,7 +443,7 @@ static void JobSigUnlock(sigset_t *omask static void JobCreatePipe(Job *job, int minfd) { - int i, fd; + int i, fd, flags; if (pipe(job->jobPipe) == -1) Punt("Cannot create pipe: %s", strerror(errno)); @@ -458,8 +458,10 @@ JobCreatePipe(Job *job, int minfd) } /* Set close-on-exec flag for both */ - (void)fcntl(job->jobPipe[0], F_SETFD, FD_CLOEXEC); - (void)fcntl(job->jobPipe[1], F_SETFD, FD_CLOEXEC); + if (fcntl(job->jobPipe[0], F_SETFD, FD_CLOEXEC) == -1) + Punt("Cannot set close-on-exec: %s", strerror(errno)); + if (fcntl(job->jobPipe[1], F_SETFD, FD_CLOEXEC) == -1) + Punt("Cannot set close-on-exec: %s", strerror(errno)); /* * We mark the input side of the pipe non-blocking; we poll(2) the @@ -467,8 +469,12 @@ JobCreatePipe(Job *job, int minfd) * race for the token when a new one becomes available, so the read * from the pipe should not block. */ - fcntl(job->jobPipe[0], F_SETFL, - fcntl(job->jobPipe[0], F_GETFL, 0) | O_NONBLOCK); + flags = fcntl(job->jobPipe[0], F_GETFL, 0); + if (flags == -1) + Punt("Cannot get flags: %s", strerror(errno)); + flags |= O_NONBLOCK; + if (fcntl(job->jobPipe[0], F_SETFL, flags) == -1) + Punt("Cannot set flags: %s", strerror(errno)); } /*- @@ -770,6 +776,7 @@ JobPrintCommand(void *cmdp, void *jobp) * but this one needs to be - use compat mode just for it. */ CompatRunCommand(cmdp, job->node); + free(cmdStart); return 0; } break; @@ -1398,16 +1405,28 @@ JobExec(Job *job, char **argv) execError("dup2", "job->cmdFILE"); _exit(1); } - (void)fcntl(0, F_SETFD, 0); - (void)lseek(0, (off_t)0, SEEK_SET); + if (fcntl(0, F_SETFD, 0) == -1) { + execError("fcntl clear close-on-exec", "stdin"); + _exit(1); + } + if (lseek(0, (off_t)0, SEEK_SET) == -1) { + execError("lseek to 0", "stdin"); + _exit(1); + } if (Always_pass_job_queue || (job->node->type & (OP_MAKE | OP_SUBMAKE))) { /* * Pass job token pipe to submakes. */ - fcntl(tokenWaitJob.inPipe, F_SETFD, 0); - fcntl(tokenWaitJob.outPipe, F_SETFD, 0); + if (fcntl(tokenWaitJob.inPipe, F_SETFD, 0) == -1) { + execError("clear close-on-exec", "tokenWaitJob.inPipe"); + _exit(1); + } + if (fcntl(tokenWaitJob.outPipe, F_SETFD, 0) == -1) { + execError("clear close-on-exec", "tokenWaitJob.outPipe"); + _exit(1); + } } /* @@ -1424,7 +1443,10 @@ JobExec(Job *job, char **argv) * it before routing the shell's error output to the same place as * its standard output. */ - (void)fcntl(1, F_SETFD, 0); + if (fcntl(1, F_SETFD, 0) == -1) { + execError("clear close-on-exec", "stdout"); + _exit(1); + } if (dup2(1, 2) == -1) { execError("dup2", "1, 2"); _exit(1); Modified: head/contrib/bmake/main.c ============================================================================== --- head/contrib/bmake/main.c Fri Apr 21 00:24:59 2017 (r317238) +++ head/contrib/bmake/main.c Fri Apr 21 00:45:44 2017 (r317239) @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.260 2017/04/13 13:55:23 christos Exp $ */ +/* $NetBSD: main.c,v 1.264 2017/04/20 03:57:27 sjg Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -69,7 +69,7 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: main.c,v 1.260 2017/04/13 13:55:23 christos Exp $"; +static char rcsid[] = "$NetBSD: main.c,v 1.264 2017/04/20 03:57:27 sjg Exp $"; #else #include #ifndef lint @@ -81,7 +81,7 @@ __COPYRIGHT("@(#) Copyright (c) 1988, 19 #if 0 static char sccsid[] = "@(#)main.c 8.3 (Berkeley) 3/19/94"; #else -__RCSID("$NetBSD: main.c,v 1.260 2017/04/13 13:55:23 christos Exp $"); +__RCSID("$NetBSD: main.c,v 1.264 2017/04/20 03:57:27 sjg Exp $"); #endif #endif /* not lint */ #endif @@ -187,6 +187,7 @@ static const char * tracefile; static void MainParseArgs(int, char **); static int ReadMakefile(const void *, const void *); static void usage(void) MAKE_ATTR_DEAD; +static void purge_cached_realpaths(void); static Boolean ignorePWD; /* if we use -C, PWD is meaningless */ static char objdir[MAXPATHLEN + 1]; /* where we chdir'ed to */ @@ -336,7 +337,7 @@ parse_debug_options(const char *argvalue goto debug_setbuf; } len = strlen(modules); - fname = malloc(len + 20); + fname = bmake_malloc(len + 20); memcpy(fname, modules, len + 1); /* Let the filename be modified by the pid */ if (strcmp(fname + len - 3, ".%d") == 0) @@ -367,6 +368,32 @@ debug_setbuf: } } +/* + * does path contain any relative components + */ +static int +is_relpath(const char *path) +{ + const char *cp; + + if (path[0] != '/') + return TRUE; + cp = path; + do { + cp = strstr(cp, "/."); + if (!cp) + break; + cp += 2; + if (cp[0] == '/' || cp[0] == '\0') + return TRUE; + else if (cp[0] == '.') { + if (cp[1] == '/' || cp[1] == '\0') + return TRUE; + } + } while (cp); + return FALSE; +} + /*- * MainParseArgs -- * Parse a given argument vector. Called from main() and from @@ -458,7 +485,7 @@ rearg: (void)fprintf(stderr, "%s: %s.\n", progname, strerror(errno)); exit(2); } - if (argvalue[0] == '/' && + if (!is_relpath(argvalue) && stat(argvalue, &sa) != -1 && stat(curdir, &sb) != -1 && sa.st_ino == sb.st_ino && @@ -732,8 +759,10 @@ Main_SetObjdir(const char *fmt, ...) va_end(ap); if (path[0] != '/') { - snprintf(buf, MAXPATHLEN, "%s/%s", curdir, path); - path = buf; + char buf2[MAXPATHLEN + 1]; + + snprintf(buf2, MAXPATHLEN, "%s/%s", curdir, path); + path = buf2; } /* look for the directory and try to chdir there */ @@ -746,7 +775,7 @@ Main_SetObjdir(const char *fmt, ...) Var_Set(".OBJDIR", objdir, VAR_GLOBAL, 0); setenv("PWD", objdir, 1); Dir_InitDot(); - cached_realpath(".OBJDIR", NULL); /* purge */ + purge_cached_realpaths(); rc = TRUE; if (enterFlag && strcmp(objdir, curdir) != 0) enterFlagObj = TRUE; @@ -1907,42 +1936,56 @@ usage(void) exit(2); } - /* * realpath(3) can get expensive, cache results... */ +static GNode *cached_realpaths = NULL; + +static GNode * +get_cached_realpaths(void) +{ + + if (!cached_realpaths) { + cached_realpaths = Targ_NewGN("Realpath"); +#ifndef DEBUG_REALPATH_CACHE + cached_realpaths->flags = INTERNAL; +#endif + } + + return cached_realpaths; +} + +/* purge any relative paths */ +static void +purge_cached_realpaths(void) +{ + GNode *cache = get_cached_realpaths(); + Hash_Entry *he, *nhe; + Hash_Search hs; + + he = Hash_EnumFirst(&cache->context, &hs); + while (he) { + nhe = Hash_EnumNext(&hs); + if (he->name[0] != '/') { + if (DEBUG(DIR)) + fprintf(stderr, "cached_realpath: purging %s\n", he->name); + Hash_DeleteEntry(&cache->context, he); + } + he = nhe; + } +} + char * cached_realpath(const char *pathname, char *resolved) { - static GNode *cache; + GNode *cache; char *rp, *cp; if (!pathname || !pathname[0]) return NULL; - if (!cache) { - cache = Targ_NewGN("Realpath"); -#ifndef DEBUG_REALPATH_CACHE - cache->flags = INTERNAL; -#endif - } - if (resolved == NULL && strcmp(pathname, ".OBJDIR") == 0) { - /* purge any relative paths */ - Hash_Entry *he, *nhe; - Hash_Search hs; - - he = Hash_EnumFirst(&cache->context, &hs); - while (he) { - nhe = Hash_EnumNext(&hs); - if (he->name[0] != '/') { - if (DEBUG(DIR)) - fprintf(stderr, "cached_realpath: purging %s\n", he->name); - Hash_DeleteEntry(&cache->context, he); - } - he = nhe; - } - return NULL; - } + cache = get_cached_realpaths(); + if ((rp = Var_Value(pathname, cache, &cp)) != NULL) { /* a hit */ strlcpy(resolved, rp, MAXPATHLEN); Modified: head/contrib/bmake/make_malloc.c ============================================================================== --- head/contrib/bmake/make_malloc.c Fri Apr 21 00:24:59 2017 (r317238) +++ head/contrib/bmake/make_malloc.c Fri Apr 21 00:45:44 2017 (r317239) @@ -1,4 +1,4 @@ -/* $NetBSD: make_malloc.c,v 1.10 2012/06/20 17:46:28 sjg Exp $ */ +/* $NetBSD: make_malloc.c,v 1.11 2017/04/16 20:20:24 dholland Exp $ */ /*- * Copyright (c) 2009 The NetBSD Foundation, Inc. @@ -28,7 +28,7 @@ #ifdef MAKE_NATIVE #include -__RCSID("$NetBSD: make_malloc.c,v 1.10 2012/06/20 17:46:28 sjg Exp $"); +__RCSID("$NetBSD: make_malloc.c,v 1.11 2017/04/16 20:20:24 dholland Exp $"); #endif #include @@ -39,13 +39,13 @@ __RCSID("$NetBSD: make_malloc.c,v 1.10 2 #include "make.h" #ifndef USE_EMALLOC -static void enomem(void) MAKE_ATTR_DEAD; +static MAKE_ATTR_DEAD void enomem(void); /* * enomem -- * die when out of memory. */ -static void +static MAKE_ATTR_DEAD void enomem(void) { (void)fprintf(stderr, "%s: %s.\n", progname, strerror(ENOMEM)); Modified: head/contrib/bmake/mk/ChangeLog ============================================================================== --- head/contrib/bmake/mk/ChangeLog Fri Apr 21 00:24:59 2017 (r317238) +++ head/contrib/bmake/mk/ChangeLog Fri Apr 21 00:45:44 2017 (r317239) @@ -1,3 +1,10 @@ +2017-04-18 Simon J. Gerraty + + * install-mk (MK_VERSION): 20170418 + + * auto.obj.mk: if using MAKEOBJDIRPREFIX check if it is a + prefix match for .CURDIR - in which case .CURDIR *is* __objdir. + 2017-04-01 Simon J. Gerraty * install-mk (MK_VERSION): 20170401 Modified: head/contrib/bmake/mk/auto.obj.mk ============================================================================== --- head/contrib/bmake/mk/auto.obj.mk Fri Apr 21 00:24:59 2017 (r317238) +++ head/contrib/bmake/mk/auto.obj.mk Fri Apr 21 00:45:44 2017 (r317239) @@ -1,4 +1,4 @@ -# $Id: auto.obj.mk,v 1.13 2017/03/24 20:53:22 sjg Exp $ +# $Id: auto.obj.mk,v 1.14 2017/04/18 23:53:18 sjg Exp $ # # @(#) Copyright (c) 2004, Simon J. Gerraty # @@ -41,6 +41,10 @@ MKOBJDIRS= auto # Use __objdir here so it is easier to tweak without impacting # the logic. .if !empty(MAKEOBJDIRPREFIX) +.if ${.CURDIR:M${MAKEOBJDIRPREFIX}/*} != "" +# we are already in obj tree! +__objdir?= ${.CURDIR} +.endif __objdir?= ${MAKEOBJDIRPREFIX}${.CURDIR} .endif __objdir?= ${MAKEOBJDIR:Uobj} Modified: head/contrib/bmake/mk/install-mk ============================================================================== --- head/contrib/bmake/mk/install-mk Fri Apr 21 00:24:59 2017 (r317238) +++ head/contrib/bmake/mk/install-mk Fri Apr 21 00:45:44 2017 (r317239) @@ -55,7 +55,7 @@ # Simon J. Gerraty # RCSid: -# $Id: install-mk,v 1.140 2017/04/03 21:04:09 sjg Exp $ +# $Id: install-mk,v 1.141 2017/04/18 23:53:18 sjg Exp $ # # @(#) Copyright (c) 1994 Simon J. Gerraty # @@ -70,7 +70,7 @@ # sjg@crufty.net # -MK_VERSION=20170401 +MK_VERSION=20170418 OWNER= GROUP= MODE=444 Modified: head/contrib/bmake/parse.c ============================================================================== --- head/contrib/bmake/parse.c Fri Apr 21 00:24:59 2017 (r317238) +++ head/contrib/bmake/parse.c Fri Apr 21 00:45:44 2017 (r317239) @@ -1,4 +1,4 @@ -/* $NetBSD: parse.c,v 1.218 2017/03/01 16:39:49 sjg Exp $ */ +/* $NetBSD: parse.c,v 1.225 2017/04/17 13:29:07 maya Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -69,14 +69,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: parse.c,v 1.218 2017/03/01 16:39:49 sjg Exp $"; +static char rcsid[] = "$NetBSD: parse.c,v 1.225 2017/04/17 13:29:07 maya Exp $"; #else #include #ifndef lint #if 0 static char sccsid[] = "@(#)parse.c 8.3 (Berkeley) 3/19/94"; #else -__RCSID("$NetBSD: parse.c,v 1.218 2017/03/01 16:39:49 sjg Exp $"); +__RCSID("$NetBSD: parse.c,v 1.225 2017/04/17 13:29:07 maya Exp $"); #endif #endif /* not lint */ #endif @@ -130,6 +130,7 @@ __RCSID("$NetBSD: parse.c,v 1.218 2017/0 #include #include #include +#include #include "make.h" #include "hash.h" @@ -539,7 +540,7 @@ loadfile(const char *path, int fd) if (lf->buf != MAP_FAILED) { /* succeeded */ if (lf->len == lf->maplen && lf->buf[lf->len - 1] != '\n') { - char *b = malloc(lf->len + 1); + char *b = bmake_malloc(lf->len + 1); b[lf->len] = '\n'; memcpy(b, lf->buf, lf->len++); munmap(lf->buf, lf->maplen); @@ -560,9 +561,15 @@ loadfile(const char *path, int fd) while (1) { assert(bufpos <= lf->len); if (bufpos == lf->len) { + if (lf->len > SIZE_MAX/2) { + errno = EFBIG; + Error("%s: file too large", path); + exit(1); + } lf->len *= 2; lf->buf = bmake_realloc(lf->buf, lf->len); } + assert(bufpos < lf->len); result = read(fd, lf->buf + bufpos, lf->len - bufpos); if (result < 0) { Error("%s: read error: %s", path, strerror(errno)); @@ -1099,15 +1106,15 @@ ParseDoSrc(int tOp, const char *src) *----------------------------------------------------------------------- */ static int -ParseFindMain(void *gnp, void *dummy) +ParseFindMain(void *gnp, void *dummy MAKE_ATTR_UNUSED) { GNode *gn = (GNode *)gnp; if ((gn->type & OP_NOTARGET) == 0) { mainNode = gn; Targ_SetMain(gn); - return (dummy ? 1 : 1); + return 1; } else { - return (dummy ? 0 : 0); + return 0; } } @@ -1145,10 +1152,10 @@ ParseAddDir(void *path, void *name) *----------------------------------------------------------------------- */ static int -ParseClearPath(void *path, void *dummy) +ParseClearPath(void *path, void *dummy MAKE_ATTR_UNUSED) { Dir_ClearPath((Lst) path); - return(dummy ? 0 : 0); + return 0; } /*- @@ -1685,10 +1692,12 @@ ParseDoDependency(char *line) } if (paths) { Lst_Destroy(paths, NULL); + paths = NULL; } if (specType == ExPath) Dir_SetPATH(); } else { + assert(paths == NULL); while (*line) { /* * The targets take real sources, so we must beware of archive @@ -1747,6 +1756,7 @@ ParseDoDependency(char *line) } out: + assert(paths == NULL); if (curTargs) Lst_Destroy(curTargs, NULL); } @@ -2550,7 +2560,7 @@ ParseTraditionalInclude(char *line) if (*file == '\0') { Parse_Error(PARSE_FATAL, "Filename missing from \"include\""); - return; + goto out; } for (file = all_files; !done; file = cp + 1) { @@ -2565,6 +2575,7 @@ ParseTraditionalInclude(char *line) Parse_include_file(file, FALSE, FALSE, silent); } +out: free(all_files); } #endif @@ -2615,6 +2626,7 @@ ParseGmakeExport(char *line) */ value = Var_Subst(NULL, value, VAR_CMD, VARF_WANTRES); setenv(variable, value, 1); + free(value); } #endif Modified: head/contrib/bmake/suff.c ============================================================================== --- head/contrib/bmake/suff.c Fri Apr 21 00:24:59 2017 (r317238) +++ head/contrib/bmake/suff.c Fri Apr 21 00:45:44 2017 (r317239) @@ -1,4 +1,4 @@ -/* $NetBSD: suff.c,v 1.84 2016/06/30 05:34:04 dholland Exp $ */ +/* $NetBSD: suff.c,v 1.86 2017/04/16 20:38:18 riastradh Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -69,14 +69,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: suff.c,v 1.84 2016/06/30 05:34:04 dholland Exp $"; +static char rcsid[] = "$NetBSD: suff.c,v 1.86 2017/04/16 20:38:18 riastradh Exp $"; #else #include #ifndef lint #if 0 static char sccsid[] = "@(#)suff.c 8.4 (Berkeley) 3/21/94"; #else -__RCSID("$NetBSD: suff.c,v 1.84 2016/06/30 05:34:04 dholland Exp $"); +__RCSID("$NetBSD: suff.c,v 1.86 2017/04/16 20:38:18 riastradh Exp $"); #endif #endif /* not lint */ #endif @@ -135,6 +135,7 @@ __RCSID("$NetBSD: suff.c,v 1.84 2016/06/ * order to find the node. */ +#include #include #include "make.h" #include "hash.h" @@ -762,12 +763,10 @@ Suff_AddTransform(char *line) *----------------------------------------------------------------------- */ int -Suff_EndTransform(void *gnp, void *dummy) +Suff_EndTransform(void *gnp, void *dummy MAKE_ATTR_UNUSED) { GNode *gn = (GNode *)gnp; - (void)dummy; - if ((gn->type & OP_DOUBLEDEP) && !Lst_IsEmpty (gn->cohorts)) gn = (GNode *)Lst_Datum(Lst_Last(gn->cohorts)); if ((gn->type & OP_TRANSFORM) && Lst_IsEmpty(gn->commands) && @@ -1908,6 +1907,13 @@ SuffFindArchiveDeps(GNode *gn, Lst slst) eoarch = strchr(gn->name, '('); eoname = strchr(eoarch, ')'); + /* + * Caller guarantees the format `libname(member)', via + * Arch_ParseArchive. + */ + assert(eoarch != NULL); + assert(eoname != NULL); + *eoname = '\0'; /* Nuke parentheses during suffix search */ *eoarch = '\0'; /* So a suffix can be found */ @@ -2597,23 +2603,20 @@ Suff_End(void) /********************* DEBUGGING FUNCTIONS **********************/ -static int SuffPrintName(void *s, void *dummy) +static int SuffPrintName(void *s, void *dummy MAKE_ATTR_UNUSED) { - (void)dummy; fprintf(debug_file, "%s ", ((Suff *)s)->name); return 0; } static int -SuffPrintSuff(void *sp, void *dummy) +SuffPrintSuff(void *sp, void *dummy MAKE_ATTR_UNUSED) { Suff *s = (Suff *)sp; int flags; int flag; - (void)dummy; - fprintf(debug_file, "# `%s' [%d] ", s->name, s->refCount); flags = s->flags; @@ -2650,12 +2653,10 @@ SuffPrintSuff(void *sp, void *dummy) } static int -SuffPrintTrans(void *tp, void *dummy) +SuffPrintTrans(void *tp, void *dummy MAKE_ATTR_UNUSED) { GNode *t = (GNode *)tp; - (void)dummy; - fprintf(debug_file, "%-16s: ", t->name); Targ_PrintType(t->type); fputc('\n', debug_file); Modified: head/contrib/bmake/targ.c ============================================================================== --- head/contrib/bmake/targ.c Fri Apr 21 00:24:59 2017 (r317238) +++ head/contrib/bmake/targ.c Fri Apr 21 00:45:44 2017 (r317239) @@ -1,4 +1,4 @@ -/* $NetBSD: targ.c,v 1.61 2016/01/17 17:45:21 christos Exp $ */ +/* $NetBSD: targ.c,v 1.62 2017/04/16 19:53:58 riastradh Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -69,14 +69,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: targ.c,v 1.61 2016/01/17 17:45:21 christos Exp $"; +static char rcsid[] = "$NetBSD: targ.c,v 1.62 2017/04/16 19:53:58 riastradh Exp $"; #else #include #ifndef lint #if 0 static char sccsid[] = "@(#)targ.c 8.2 (Berkeley) 3/19/94"; #else -__RCSID("$NetBSD: targ.c,v 1.61 2016/01/17 17:45:21 christos Exp $"); +__RCSID("$NetBSD: targ.c,v 1.62 2017/04/16 19:53:58 riastradh Exp $"); #endif #endif /* not lint */ #endif @@ -521,10 +521,10 @@ TargPrintName(void *gnp, void *pflags MA int -Targ_PrintCmd(void *cmd, void *dummy) +Targ_PrintCmd(void *cmd, void *dummy MAKE_ATTR_UNUSED) { fprintf(debug_file, "\t%s\n", (char *)cmd); - return (dummy ? 0 : 0); + return 0; } /*- Modified: head/contrib/bmake/var.c ============================================================================== --- head/contrib/bmake/var.c Fri Apr 21 00:24:59 2017 (r317238) +++ head/contrib/bmake/var.c Fri Apr 21 00:45:44 2017 (r317239) @@ -1,4 +1,4 @@ -/* $NetBSD: var.c,v 1.213 2017/02/01 18:39:27 sjg Exp $ */ +/* $NetBSD: var.c,v 1.215 2017/04/16 21:39:49 riastradh Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -69,14 +69,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: var.c,v 1.213 2017/02/01 18:39:27 sjg Exp $"; +static char rcsid[] = "$NetBSD: var.c,v 1.215 2017/04/16 21:39:49 riastradh Exp $"; #else #include #ifndef lint #if 0 static char sccsid[] = "@(#)var.c 8.3 (Berkeley) 3/19/94"; #else -__RCSID("$NetBSD: var.c,v 1.213 2017/02/01 18:39:27 sjg Exp $"); +__RCSID("$NetBSD: var.c,v 1.215 2017/04/16 21:39:49 riastradh Exp $"); #endif #endif /* not lint */ #endif @@ -1181,7 +1181,7 @@ Var_Value(const char *name, GNode *ctxt, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Fri Apr 21 01:43:21 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B15F9D47375; Fri, 21 Apr 2017 01:43:21 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 5EF692E2; Fri, 21 Apr 2017 01:43:20 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from spqr.komquats.com ([96.50.22.10]) by shaw.ca with SMTP id 1NbLdilfVBVcj1NbMd7G4g; Thu, 20 Apr 2017 19:43:13 -0600 X-Authority-Analysis: v=2.2 cv=RoC1FGuK c=1 sm=1 tr=0 a=jvE2nwUzI0ECrNeyr98KWA==:117 a=jvE2nwUzI0ECrNeyr98KWA==:17 a=kj9zAlcOel0A:10 a=AzvcPWV-tVgA:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=itYTvNewW3kXQSC1HmMA:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id C3ECE1081; Thu, 20 Apr 2017 18:43:10 -0700 (PDT) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id v3L1h99s037727; Thu, 20 Apr 2017 18:43:09 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201704210143.v3L1h99s037727@slippy.cwsent.com> X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.6 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Michael Tuexen cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r317208 - head/sys/netinet In-Reply-To: Message from Michael Tuexen of "Thu, 20 Apr 2017 19:19:34 -0000." <201704201919.v3KJJYko052651@repo.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 20 Apr 2017 18:43:09 -0700 X-CMAE-Envelope: MS4wfK0SGfBkCSKZwTbNI4oj8uL6BQ78Ywaae7YMY168DrJjRyQpEUUItuiIofQRbySS24qPtLFoAbUD9XoNUO1xbU/0h3vvC0sMtQronvHzLrTthaYrjZ5w FVByustbOPxvpDkauYAonL5lRnRA4QBGw5oU/1mkT8XHckE6GDbta9TP41LtlLZSAh+dtWrd7AXIstCHZQTsWnAJ+YWGII6qA9qsmgsbwjR8/TY6OcWLL/sZ 4698hCxj1w0jyxuKV9sak20DAS3BqG0clavr1RpKDADFAjeWRUBVns5IzchxbhzE X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 21 Apr 2017 01:43:21 -0000 In message <201704201919.v3KJJYko052651@repo.freebsd.org>, Michael Tuexen write s: > Author: tuexen > Date: Thu Apr 20 19:19:33 2017 > New Revision: 317208 > URL: https://svnweb.freebsd.org/changeset/base/317208 > > Log: > Syncoockies can be used in combination with the syncache. If the cache > overflows, syncookies are used. > This patch restricts the usage of syncookies in this case: accept > syncookies only if there was an overflow of the syncache recently. > This mitigates a problem reported in PR217637, where is syncookie was > accepted without any recent drops. > Thanks to glebius@ for suggesting an improvement. > > PR: 217637 > Reviewed by: gnn, glebius > MFC after: 1 week > Sponsored by: Netflix, Inc. > Differential Revision: https://reviews.freebsd.org/D10272 > > Modified: > head/sys/netinet/tcp_syncache.c > head/sys/netinet/tcp_syncache.h > > Modified: head/sys/netinet/tcp_syncache.c > ============================================================================= > = > --- head/sys/netinet/tcp_syncache.c Thu Apr 20 19:14:52 2017 (r31720 > 7) > +++ head/sys/netinet/tcp_syncache.c Thu Apr 20 19:19:33 2017 (r31720 > 8) > @@ -260,6 +260,7 @@ syncache_init(void) > &V_tcp_syncache.hashbase[i].sch_mtx, 0); > V_tcp_syncache.hashbase[i].sch_length = 0; > V_tcp_syncache.hashbase[i].sch_sc = &V_tcp_syncache; > + V_tcp_syncache.hashbase[i].sch_last_overflow = INT64_MIN; Hi Michael, This line produced the following on i386: /opt/src/svn-current/sys/netinet/tcp_syncache.c:263:50: error: implicit conversion from 'long long' to 'time_t' (aka 'int') changes value from -9223372036854775808 to 0 [-Werror,-Wconstant-conversion] V_tcp_syncache.hashbase[i].sch_last_overflow = INT64_MIN; ~ ^~~~~~~~~ ./x86/_stdint.h:91:41: note: expanded from macro 'INT64_MIN' #define INT64_MIN (-0x7fffffffffffffffLL-1) ~~~~~~~~~~~~~~~~~~~~~^~ Looks like it needs a time_t cast. > [...] -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-head@freebsd.org Fri Apr 21 01:50:43 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 07FEAD474E1; Fri, 21 Apr 2017 01:50:43 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C368D75F; Fri, 21 Apr 2017 01:50:42 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3L1ofV4014510; Fri, 21 Apr 2017 01:50:41 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3L1ofgl014509; Fri, 21 Apr 2017 01:50:41 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201704210150.v3L1ofgl014509@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Fri, 21 Apr 2017 01:50:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317240 - head/sys/fs/nfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 21 Apr 2017 01:50:43 -0000 Author: rmacklem Date: Fri Apr 21 01:50:41 2017 New Revision: 317240 URL: https://svnweb.freebsd.org/changeset/base/317240 Log: Set default uid/gid to nobody/nogroup for NFSv4 mapping. The default uid/gid for NFSv4 are set by the nfsuserd(8) daemon. However, they were 0 until the nfsuserd(8) was run. Since it is possible to use NFSv4 without running the nfsuserd(8) daemon, set them to nobody/nogroup initially. Without this patch, the values would be set by the nfsuserd(8) daemon and left changed even if the nfsuserd(8) daemon was killed. Also, the default values of 0 meant that setting a group to "wheel" would fail even when done by root and this patch fixes this issue. MFC after: 2 weeks Modified: head/sys/fs/nfs/nfs_commonsubs.c Modified: head/sys/fs/nfs/nfs_commonsubs.c ============================================================================== --- head/sys/fs/nfs/nfs_commonsubs.c Fri Apr 21 00:45:44 2017 (r317239) +++ head/sys/fs/nfs/nfs_commonsubs.c Fri Apr 21 01:50:41 2017 (r317240) @@ -63,8 +63,8 @@ int nfsrv_useacl = 1; struct nfssockreq nfsrv_nfsuserdsock; int nfsrv_nfsuserd = 0; struct nfsreqhead nfsd_reqq; -uid_t nfsrv_defaultuid; -gid_t nfsrv_defaultgid; +uid_t nfsrv_defaultuid = 65534; +gid_t nfsrv_defaultgid = 65533; int nfsrv_lease = NFSRV_LEASE; int ncl_mbuf_mlen = MLEN; int nfsd_enable_stringtouid = 0; From owner-svn-src-head@freebsd.org Fri Apr 21 03:12:41 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A8329D4901F; Fri, 21 Apr 2017 03:12:41 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 5D0E21D16; Fri, 21 Apr 2017 03:12:41 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from spqr.komquats.com ([96.50.22.10]) by shaw.ca with SMTP id 1Ozndde7lol5Z1OzodEyxq; Thu, 20 Apr 2017 21:12:33 -0600 X-Authority-Analysis: v=2.2 cv=B8rJ6KlM c=1 sm=1 tr=0 a=jvE2nwUzI0ECrNeyr98KWA==:117 a=jvE2nwUzI0ECrNeyr98KWA==:17 a=kj9zAlcOel0A:10 a=AzvcPWV-tVgA:10 a=VxmjJ2MpAAAA:8 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=v2JZ80VQ7frUTbXu9uYA:9 a=CjuIK1q_8ugA:10 a=7gXAzLPJhVmCkEl4_tsf:22 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id 949061131; Thu, 20 Apr 2017 20:12:31 -0700 (PDT) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id v3L3CTKK086513; Thu, 20 Apr 2017 20:12:29 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201704210312.v3L3CTKK086513@slippy.cwsent.com> X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.6 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Cy Schubert cc: Michael Tuexen , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r317208 - head/sys/netinet In-Reply-To: Message from Cy Schubert of "Thu, 20 Apr 2017 18:43:09 -0700." <201704210143.v3L1h99s037727@slippy.cwsent.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 20 Apr 2017 20:12:29 -0700 X-CMAE-Envelope: MS4wfIWaH47o5IWxTyDRD3uChj6EeFi9h0QcO6dEKep/zzytTdexXqldNN1td3J7r/RBpeZgjGMUL/1RrWy9l+xYxlZYrAFkFvNhTH06F4WH1PCoAR85TSlR 48sg4708RbZhW4jPh+mFdbNaR4igm97MMD0l1JN54FiGQPdQSeAEiMwpNYIrxsrKoFB7WeJWaYnc15LgWdKkEuHkwkv82NS0I2PT+Gg2GiUI9nVr1lbHW+R9 Swmwl9A3UUR9oKmYSPb8wHUwu9t1H3C1SvJDxElkwt1Fxk0nNKCFsPtruxJq/6nE X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 21 Apr 2017 03:12:41 -0000 In message <201704210143.v3L1h99s037727@slippy.cwsent.com>, Cy Schubert writes: > In message <201704201919.v3KJJYko052651@repo.freebsd.org>, Michael Tuexen > write > s: > > Author: tuexen > > Date: Thu Apr 20 19:19:33 2017 > > New Revision: 317208 > > URL: https://svnweb.freebsd.org/changeset/base/317208 > > > > Log: > > Syncoockies can be used in combination with the syncache. If the cache > > overflows, syncookies are used. > > This patch restricts the usage of syncookies in this case: accept > > syncookies only if there was an overflow of the syncache recently. > > This mitigates a problem reported in PR217637, where is syncookie was > > accepted without any recent drops. > > Thanks to glebius@ for suggesting an improvement. > > > > PR: 217637 > > Reviewed by: gnn, glebius > > MFC after: 1 week > > Sponsored by: Netflix, Inc. > > Differential Revision: https://reviews.freebsd.org/D10272 > > > > Modified: > > head/sys/netinet/tcp_syncache.c > > head/sys/netinet/tcp_syncache.h > > > > Modified: head/sys/netinet/tcp_syncache.c > > =========================================================================== > == > > = > > --- head/sys/netinet/tcp_syncache.c Thu Apr 20 19:14:52 2017 (r31720 > > 7) > > +++ head/sys/netinet/tcp_syncache.c Thu Apr 20 19:19:33 2017 (r31720 > > 8) > > @@ -260,6 +260,7 @@ syncache_init(void) > > &V_tcp_syncache.hashbase[i].sch_mtx, 0); > > V_tcp_syncache.hashbase[i].sch_length = 0; > > V_tcp_syncache.hashbase[i].sch_sc = &V_tcp_syncache; > > + V_tcp_syncache.hashbase[i].sch_last_overflow = INT64_MIN; > > > Hi Michael, > > This line produced the following on i386: > > /opt/src/svn-current/sys/netinet/tcp_syncache.c:263:50: error: implicit > conversion from 'long long' to 'time_t' (aka 'int') changes value from > -9223372036854775808 to 0 [-Werror,-Wconstant-conversion] > V_tcp_syncache.hashbase[i].sch_last_overflow = INT64_MIN; > ~ ^~~~~~~~~ > ./x86/_stdint.h:91:41: note: expanded from macro 'INT64_MIN' > #define INT64_MIN (-0x7fffffffffffffffLL-1) > ~~~~~~~~~~~~~~~~~~~~~^~ > > Looks like it needs a time_t cast. Playing with it for a short while, a cast doesn't produce the desired results. My solution is ugly so far. -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-head@freebsd.org Fri Apr 21 03:16:50 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 04ABED490B2; Fri, 21 Apr 2017 03:16:50 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail108.syd.optusnet.com.au (mail108.syd.optusnet.com.au [211.29.132.59]) by mx1.freebsd.org (Postfix) with ESMTP id C21241E97; Fri, 21 Apr 2017 03:16:49 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from besplex.bde.org (c122-106-153-191.carlnfd1.nsw.optusnet.com.au [122.106.153.191]) by mail108.syd.optusnet.com.au (Postfix) with ESMTPS id 783D11A38A1; Fri, 21 Apr 2017 13:16:40 +1000 (AEST) Date: Fri, 21 Apr 2017 13:16:44 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Cy Schubert cc: Michael Tuexen , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r317208 - head/sys/netinet In-Reply-To: <201704210143.v3L1h99s037727@slippy.cwsent.com> Message-ID: <20170421131041.G966@besplex.bde.org> References: <201704210143.v3L1h99s037727@slippy.cwsent.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=VbSHBBh9 c=1 sm=1 tr=0 a=Tj3pCpwHnMupdyZSltBt7Q==:117 a=Tj3pCpwHnMupdyZSltBt7Q==:17 a=kj9zAlcOel0A:10 a=6I5d2MoRAAAA:8 a=JOBH9iDo1MMysTRtogwA:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 21 Apr 2017 03:16:50 -0000 On Thu, 20 Apr 2017, Cy Schubert wrote: Please trim quotes. > In message <201704201919.v3KJJYko052651@repo.freebsd.org>, Michael Tuexen > write > s: [>> ... 5 lines trimmed] >> Log: >> Syncoockies can be used in combination with the syncache. If the cache >> overflows, syncookies are used. [>> ... 16 lines trimmed] >> Modified: head/sys/netinet/tcp_syncache.c >> ============================================================================= >> = >> --- head/sys/netinet/tcp_syncache.c Thu Apr 20 19:14:52 2017 (r31720 >> 7) >> +++ head/sys/netinet/tcp_syncache.c Thu Apr 20 19:19:33 2017 (r31720 >> 8) >> @@ -260,6 +260,7 @@ syncache_init(void) >> &V_tcp_syncache.hashbase[i].sch_mtx, 0); >> V_tcp_syncache.hashbase[i].sch_length = 0; >> V_tcp_syncache.hashbase[i].sch_sc = &V_tcp_syncache; >> + V_tcp_syncache.hashbase[i].sch_last_overflow = INT64_MIN; > ... > This line produced the following on i386: > > /opt/src/svn-current/sys/netinet/tcp_syncache.c:263:50: error: implicit > conversion from 'long long' to 'time_t' (aka 'int') changes value from > -9223372036854775808 to 0 [-Werror,-Wconstant-conversion] > V_tcp_syncache.hashbase[i].sch_last_overflow = INT64_MIN; > ~ ^~~~~~~~~ > ./x86/_stdint.h:91:41: note: expanded from macro 'INT64_MIN' > #define INT64_MIN (-0x7fffffffffffffffLL-1) > ~~~~~~~~~~~~~~~~~~~~~^~ > > Looks like it needs a time_t cast. A cast would just break the warning. INT64_MIN has nothing to do with time_t. The expression (time_t)INT64_MIN would be more obviously garbage since in the above it is not clear that sch_last_overflow has a type unrelated to the constant. INT64_MIN is also broken if time_t is 64 bits but unsigned. Then it is converted to half of plus infinity instead of the intended minus infinity. Bruce From owner-svn-src-head@freebsd.org Fri Apr 21 04:15:30 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EE207D49C53; Fri, 21 Apr 2017 04:15:30 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail105.syd.optusnet.com.au (mail105.syd.optusnet.com.au [211.29.132.249]) by mx1.freebsd.org (Postfix) with ESMTP id 791D316C1; Fri, 21 Apr 2017 04:15:30 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from besplex.bde.org (c122-106-153-191.carlnfd1.nsw.optusnet.com.au [122.106.153.191]) by mail105.syd.optusnet.com.au (Postfix) with ESMTPS id 3D60C104F969; Fri, 21 Apr 2017 14:15:22 +1000 (AEST) Date: Fri, 21 Apr 2017 14:15:19 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Jung-uk Kim cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r317231 - head/usr.bin/systat In-Reply-To: <201704202230.v3KMUdAm030762@repo.freebsd.org> Message-ID: <20170421131652.P966@besplex.bde.org> References: <201704202230.v3KMUdAm030762@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=KeqiiUQD c=1 sm=1 tr=0 a=Tj3pCpwHnMupdyZSltBt7Q==:117 a=Tj3pCpwHnMupdyZSltBt7Q==:17 a=kj9zAlcOel0A:10 a=Fda5ZpxS8tIVVS_qyfgA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 21 Apr 2017 04:15:31 -0000 On Thu, 20 Apr 2017, Jung-uk Kim wrote: > Log: > Fix systat(1) regression. It was broken by r317061. It is more broken than before. Now it fails when the kernel is older than the utility instead of vice versa. When it fails, the failures are more serious than before. systat -v actually does complete checking for errors (some are only errors in itself), but mishandles them. It reports the errors on the status line and continues. The error message overwrites the previous one. Continuing is more broken than before: Previously, reading 64-bit values into 32-bit variables truncated them, just like a correct fix would do except for the error messages. Large values often never occur, and used to be truncated in the kernel, so noting would be lost by truncating. The support for 64-bit types would just remain intentionally unfinished instead of wrong. systat has a lot of modes and fields in which it only reports delta values. Then truncation doesn't matter unless it occurs more often than the refresh interval. Now, reading 32-bit values into 64-bit variabeles leaves garbage in the top bits. I think the garbage is initially 0 and remains 0, since the variables are statically initializated and short reads by sysctl() don't change the top bits. But delta-values are broken if values that need 64-bit types actually occur. E.g., after increasing a 32-bit value of 0xffffffff with overflow to 1, 32-bit subtraction gave the correct delta of 2, but 64-bit subtraction gives 1 - (2**32 - 1) = 2 - 2**32 = 0xffffffff00000002. > Modified: head/usr.bin/systat/vmstat.c > ============================================================================== > --- head/usr.bin/systat/vmstat.c Thu Apr 20 21:48:54 2017 (r317230) > +++ head/usr.bin/systat/vmstat.c Thu Apr 20 22:30:39 2017 (r317231) > @@ -70,35 +70,35 @@ static const char sccsid[] = "@(#)vmstat > > static struct Info { > long time[CPUSTATES]; > - u_int v_swtch; /* context switches */ > - u_int v_trap; /* calls to trap */ > - u_int v_syscall; /* calls to syscall() */ > - u_int v_intr; /* device interrupts */ > - u_int v_soft; /* software interrupts */ > + uint64_t v_swtch; /* context switches */ > + uint64_t v_trap; /* calls to trap */ > + uint64_t v_syscall; /* calls to syscall() */ > + uint64_t v_intr; /* device interrupts */ > + uint64_t v_soft; /* software interrupts */ systat -v may also have problems printing large values. It mostly uses PUTRATE(), and I think that handles 64-bit types not very badly, though compilers tend to have bugs converting uint64_t to floating point and systat -v uses float since it doesn't need much precision. PUTRATE() on a uint64_t calculates the delta in that type and then scales in double precision and then prints in single precision. The overflowed value 0xffffffff00000002 gives a huge rate, say only 1e17 = 100P (P = peta) after scaling down the value from 1.8e19 = 18E (E = exa). putfloat() only supports up to small numbers of mega and prints larger values as '*'s. systat -v thus doesn't actually support 64-bit values. 32-bit values only go up to 4G or 4294M. With no scaling, 4294M stays large, but some fields are wide enough to print it so it is not printed as '*'s. 64-bit values go up to 18E. PUTRATE() already had to be careful with types to get suitable overflow when calculating the deltas. It is careful enough. It assigns to unsigned integer fields. This gives modular arithmetic. Expressions like (new.fld - old.fld) / (float)rate would give sign extension/overflow bugs depending on the type of fld in a MD way. Bruce From owner-svn-src-head@freebsd.org Fri Apr 21 05:19:47 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BE1CAD48A33; Fri, 21 Apr 2017 05:19:47 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail104.syd.optusnet.com.au (mail104.syd.optusnet.com.au [211.29.132.246]) by mx1.freebsd.org (Postfix) with ESMTP id 66B271299; Fri, 21 Apr 2017 05:19:47 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from besplex.bde.org (c122-106-153-191.carlnfd1.nsw.optusnet.com.au [122.106.153.191]) by mail104.syd.optusnet.com.au (Postfix) with ESMTPS id F34C4424158; Fri, 21 Apr 2017 15:19:26 +1000 (AEST) Date: Fri, 21 Apr 2017 15:19:25 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Rick Macklem cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r317240 - head/sys/fs/nfs In-Reply-To: <201704210150.v3L1ofgl014509@repo.freebsd.org> Message-ID: <20170421141623.A1141@besplex.bde.org> References: <201704210150.v3L1ofgl014509@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=AYLBJzfG c=1 sm=1 tr=0 a=Tj3pCpwHnMupdyZSltBt7Q==:117 a=Tj3pCpwHnMupdyZSltBt7Q==:17 a=kj9zAlcOel0A:10 a=t3nMVfT35bfJNYdJFxsA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 21 Apr 2017 05:19:47 -0000 On Fri, 21 Apr 2017, Rick Macklem wrote: > Log: > Set default uid/gid to nobody/nogroup for NFSv4 mapping. > > The default uid/gid for NFSv4 are set by the nfsuserd(8) daemon. > However, they were 0 until the nfsuserd(8) was run. Since it is > possible to use NFSv4 without running the nfsuserd(8) daemon, set them > to nobody/nogroup initially. > Without this patch, the values would be set by the nfsuserd(8) daemon > and left changed even if the nfsuserd(8) daemon was killed. Also, the default > values of 0 meant that setting a group to "wheel" would fail even when > done by root and this patch fixes this issue. Hard-coding these values is wrong, and the actual values seem wronger. The values in nfsuserd(8) are clearly wrong. It hard-codes 32767 (with bogus casts) for both the default uid and the default gid. These values are in the user namespace have nothing to do with nobody/nogroup. > and left changed even if the nfsuserd(8) daemon was killed. Also, the default > ... > Modified: head/sys/fs/nfs/nfs_commonsubs.c > ============================================================================== > --- head/sys/fs/nfs/nfs_commonsubs.c Fri Apr 21 00:45:44 2017 (r317239) > +++ head/sys/fs/nfs/nfs_commonsubs.c Fri Apr 21 01:50:41 2017 (r317240) > @@ -63,8 +63,8 @@ int nfsrv_useacl = 1; > struct nfssockreq nfsrv_nfsuserdsock; > int nfsrv_nfsuserd = 0; > struct nfsreqhead nfsd_reqq; > -uid_t nfsrv_defaultuid; > -gid_t nfsrv_defaultgid; > +uid_t nfsrv_defaultuid = 65534; > +gid_t nfsrv_defaultgid = 65533; > int nfsrv_lease = NFSRV_LEASE; > int ncl_mbuf_mlen = MLEN; > int nfsd_enable_stringtouid = 0; These are the traditional values in /etc/group. It is bogus but traditional to have a uid in /etc/group. nobody doesn't actually have group nogroup. nobody is also in the correct place (/etc/passwd) provided the sysadmin didn't meddle with this, but it has group 65534 there. Group 65533 is traditionally for kmem and tty in /etc/passwd. mountd uses the less bogus values with more bogus casts (uid_t)-2 and (gid_t)-2. These are obfuscated spellings of 0xfffffffe. You don't really want these values to depend on the types because then the values break when the types are expanded, like they already did for the expansion to 32 bits. These values should be reserved in /etc/passwd and /etc/group, but they still aren't, 20-25 years after the expansion. You don't want to spell these values in decimal because decimal values much larger than 65534 are too hard to convert back to hex to see what they mean. The bogus casts are to break warnings about converting the easy-to-remember (but wrong becaus they are negative) values of -2 to unsigned. The magic values are still incompletely documented in exports(8) as pure -2:-2. It doesn't mention nobody or any other magic numbers or any bugs in defaulting or specifying the numbers. Last time I looked, most utilities and even basic library functions had the usual errors for parsing large and negative values by misusing atoi() or strtol(). Many can't parse 0xfffffffe or even this value in decimal, so the value has to be spelled -2 so that undocumented overflow bugs can convert it to the correct value of 0xffffffffe. On 64-bit systems, it might be first converted to 0xffffffffffffffffe so another layer of overflow bugs is needed to get back to 0xfffffffe. Since library functions are buggy, it is at best unportable to put any of -2, 0xfffffffe or this value in hex in /etc/passwd or /etc/group. 65534 always worked there since it is much smaller than 32-bit LONG_MAX and the library was probably never bad enough to use atoi() and 16-bit ints. IIRC, -2 doesn't wrok in /etc/passwd, but is the only spelling that works near mountd. Checking now shows mountd using many different misparsing methods: - it uses only atoi() in parescred(). This can read -2 in /etc/exports, but misparses the correct value of 0xfffffffe to 0 and the correct value of this in decimal to 0x7fffffffl; it silently ignores errors in both cases; it blindly assigns to uid_t/gid_t, so -2 becomes the correct value - it uses strtol() with mostly missing and half wrong error checking for masklen - it uses strtoul() with mostly wrong but not so much missing error checking for -p. First it truncates the value to break its subsequent range checks... - its use of atoi() implicitly forces base 10. This is forced explicitly for the strtol() and strtoul(). This makes sure that hex never works. Hex is always misparsed as 0, and the resulting garbage after the 0 is only checked for after the strtoul() call. Kernel code shouldn't hard-code any user ids, starting with 0 for root (this is worse than 65534 for nobody since 0 is so special), but for devices I hard-coded many ids in . This works well enough and is better than implicit 0 for root provided everything uses the #defined values. It is better than scattered values of 32767, 65534, 65533 and 0xfffffffe and -2. Bruce From owner-svn-src-head@freebsd.org Fri Apr 21 06:05:35 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A8760D46D39; Fri, 21 Apr 2017 06:05:35 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6B19AA8E; Fri, 21 Apr 2017 06:05:35 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3L65Ya5020750; Fri, 21 Apr 2017 06:05:34 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3L65Yx1020749; Fri, 21 Apr 2017 06:05:34 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201704210605.v3L65Yx1020749@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Fri, 21 Apr 2017 06:05:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317244 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 21 Apr 2017 06:05:35 -0000 Author: tuexen Date: Fri Apr 21 06:05:34 2017 New Revision: 317244 URL: https://svnweb.freebsd.org/changeset/base/317244 Log: Represent "a syncache overflow hasn't happend yet" by using -(SYNCOOKIE_LIFETIME + 1) instead of INT64_MIN, since it is good enough and works when time_t is int32 or int64. This fixes the issue reported by cy@ on i386. Reported by: cy MFC after: 1 week Sponsored by: Netflix, Inc. Modified: head/sys/netinet/tcp_syncache.c Modified: head/sys/netinet/tcp_syncache.c ============================================================================== --- head/sys/netinet/tcp_syncache.c Fri Apr 21 02:11:44 2017 (r317243) +++ head/sys/netinet/tcp_syncache.c Fri Apr 21 06:05:34 2017 (r317244) @@ -260,7 +260,8 @@ syncache_init(void) &V_tcp_syncache.hashbase[i].sch_mtx, 0); V_tcp_syncache.hashbase[i].sch_length = 0; V_tcp_syncache.hashbase[i].sch_sc = &V_tcp_syncache; - V_tcp_syncache.hashbase[i].sch_last_overflow = INT64_MIN; + V_tcp_syncache.hashbase[i].sch_last_overflow = + -(SYNCOOKIE_LIFETIME + 1); } /* Create the syncache entry zone. */ From owner-svn-src-head@freebsd.org Fri Apr 21 06:09:11 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2498ED46DF1; Fri, 21 Apr 2017 06:09:11 +0000 (UTC) (envelope-from tuexen@freebsd.org) Received: from drew.franken.de (drew.ipv6.franken.de [IPv6:2001:638:a02:a001:20e:cff:fe4a:feaa]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.franken.de", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DF4A0C21; Fri, 21 Apr 2017 06:09:10 +0000 (UTC) (envelope-from tuexen@freebsd.org) Received: from [IPv6:2003:cd:6bd7:7400:8f3:efd8:6932:24f0] (p200300CD6BD7740008F3EFD8693224F0.dip0.t-ipconnect.de [IPv6:2003:cd:6bd7:7400:8f3:efd8:6932:24f0]) (Authenticated sender: macmic) by mail-n.franken.de (Postfix) with ESMTPSA id EC63B721E281E; Fri, 21 Apr 2017 08:09:03 +0200 (CEST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: svn commit: r317208 - head/sys/netinet From: Michael Tuexen In-Reply-To: <201704210143.v3L1h99s037727@slippy.cwsent.com> Date: Fri, 21 Apr 2017 08:09:02 +0200 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: 7bit Message-Id: <5381DC80-1E0A-416C-BD05-99B01F0A066F@freebsd.org> References: <201704210143.v3L1h99s037727@slippy.cwsent.com> To: Cy Schubert X-Mailer: Apple Mail (2.3273) X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=disabled version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on mail-n.franken.de X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 21 Apr 2017 06:09:11 -0000 > On 21. Apr 2017, at 03:43, Cy Schubert wrote: > > In message <201704201919.v3KJJYko052651@repo.freebsd.org>, Michael Tuexen > writes: > [...] > Hi Michael, > > This line produced the following on i386: > > /opt/src/svn-current/sys/netinet/tcp_syncache.c:263:50: error: implicit > conversion from 'long long' to 'time_t' (aka 'int') changes value from > -9223372036854775808 to 0 [-Werror,-Wconstant-conversion] > V_tcp_syncache.hashbase[i].sch_last_overflow = INT64_MIN; > ~ ^~~~~~~~~ > ./x86/_stdint.h:91:41: note: expanded from macro 'INT64_MIN' > #define INT64_MIN (-0x7fffffffffffffffLL-1) > ~~~~~~~~~~~~~~~~~~~~~^~ > > Looks like it needs a time_t cast. Fixed in https://svnweb.freebsd.org/changeset/base/317244. Thanks for reporting and sorry for the breakage. Best regards Michael > >> [...] > > > -- > Cheers, > Cy Schubert > FreeBSD UNIX: Web: http://www.FreeBSD.org > > The need of the many outweighs the greed of the few. > > > From owner-svn-src-head@freebsd.org Fri Apr 21 06:10:34 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 28C3BD46ED4; Fri, 21 Apr 2017 06:10:34 +0000 (UTC) (envelope-from tuexen@freebsd.org) Received: from drew.franken.de (drew.ipv6.franken.de [IPv6:2001:638:a02:a001:20e:cff:fe4a:feaa]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.franken.de", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E25F3DAD; Fri, 21 Apr 2017 06:10:33 +0000 (UTC) (envelope-from tuexen@freebsd.org) Received: from [IPv6:2003:cd:6bd7:7400:8f3:efd8:6932:24f0] (p200300CD6BD7740008F3EFD8693224F0.dip0.t-ipconnect.de [IPv6:2003:cd:6bd7:7400:8f3:efd8:6932:24f0]) (Authenticated sender: macmic) by mail-n.franken.de (Postfix) with ESMTPSA id 3E3AD721E280D; Fri, 21 Apr 2017 08:10:31 +0200 (CEST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: svn commit: r317208 - head/sys/netinet From: Michael Tuexen In-Reply-To: <20170421131041.G966@besplex.bde.org> Date: Fri, 21 Apr 2017 08:10:30 +0200 Cc: Cy Schubert , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <8BBC38A0-DDBA-4C04-9654-98755B3E4E13@freebsd.org> References: <201704210143.v3L1h99s037727@slippy.cwsent.com> <20170421131041.G966@besplex.bde.org> To: Bruce Evans X-Mailer: Apple Mail (2.3273) X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=disabled version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on mail-n.franken.de X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 21 Apr 2017 06:10:34 -0000 > On 21. Apr 2017, at 05:16, Bruce Evans wrote: >=20 > On Thu, 20 Apr 2017, Cy Schubert wrote: >=20 > Please trim quotes. >=20 >> In message <201704201919.v3KJJYko052651@repo.freebsd.org>, Michael = Tuexen >> write >> s: >=20 > [>> ... 5 lines trimmed] >=20 >>> Log: >>> Syncoockies can be used in combination with the syncache. If the = cache >>> overflows, syncookies are used. >=20 > [>> ... 16 lines trimmed] >=20 >>> Modified: head/sys/netinet/tcp_syncache.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/netinet/tcp_syncache.c Thu Apr 20 19:14:52 2017 = (r31720 >>> 7) >>> +++ head/sys/netinet/tcp_syncache.c Thu Apr 20 19:19:33 2017 = (r31720 >>> 8) >>> @@ -260,6 +260,7 @@ syncache_init(void) >>> &V_tcp_syncache.hashbase[i].sch_mtx, 0); >>> V_tcp_syncache.hashbase[i].sch_length =3D 0; >>> V_tcp_syncache.hashbase[i].sch_sc =3D &V_tcp_syncache; >>> + V_tcp_syncache.hashbase[i].sch_last_overflow =3D = INT64_MIN; >> ... >> This line produced the following on i386: >>=20 >> /opt/src/svn-current/sys/netinet/tcp_syncache.c:263:50: error: = implicit >> conversion from 'long long' to 'time_t' (aka 'int') changes value = from >> -9223372036854775808 to 0 [-Werror,-Wconstant-conversion] >> V_tcp_syncache.hashbase[i].sch_last_overflow =3D = INT64_MIN; >> ~ = ^~~~~~~~~ >> ./x86/_stdint.h:91:41: note: expanded from macro 'INT64_MIN' >> #define INT64_MIN (-0x7fffffffffffffffLL-1) >> ~~~~~~~~~~~~~~~~~~~~~^~ >>=20 >> Looks like it needs a time_t cast. >=20 > A cast would just break the warning. INT64_MIN has nothing to do with > time_t. The expression (time_t)INT64_MIN would be more obviously = garbage > since in the above it is not clear that sch_last_overflow has a type > unrelated to the constant. Fixed in https://svnweb.freebsd.org/changeset/base/317244 >=20 > INT64_MIN is also broken if time_t is 64 bits but unsigned. Then it = is > converted to half of plus infinity instead of the intended minus = infinity. The patch assumes that time_t is signed, which is true for FreeBSD on = all platforms. Or am I missing a platform? Best regards Michael >=20 > Bruce From owner-svn-src-head@freebsd.org Fri Apr 21 06:55:18 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 78A4AD48B7A; Fri, 21 Apr 2017 06:55:18 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3F56D90C; Fri, 21 Apr 2017 06:55:18 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3L6tHi0041618; Fri, 21 Apr 2017 06:55:17 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3L6tHFF041617; Fri, 21 Apr 2017 06:55:17 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201704210655.v3L6tHFF041617@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Fri, 21 Apr 2017 06:55:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317245 - head/sys/dev/syscons X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 21 Apr 2017 06:55:18 -0000 Author: bde Date: Fri Apr 21 06:55:17 2017 New Revision: 317245 URL: https://svnweb.freebsd.org/changeset/base/317245 Log: Oops, the previous commit swapped the main ega method with the main vga planar method (for testing that was supposed to be local that the former still works). The ega method works on vga but is about twice as slow. The vga method doesn't work on ega. Optimize the main vga planar method a little. For changing the background color (which was otherwise optimized better than most things), don't switch the write mode from 3 to 0 just to select the pixel mask of 0xff obscurely by writing 0. Just write 0xff directly. Modified: head/sys/dev/syscons/scvgarndr.c Modified: head/sys/dev/syscons/scvgarndr.c ============================================================================== --- head/sys/dev/syscons/scvgarndr.c Fri Apr 21 06:05:34 2017 (r317244) +++ head/sys/dev/syscons/scvgarndr.c Fri Apr 21 06:55:17 2017 (r317245) @@ -525,9 +525,9 @@ vga_rndrinit(scr_stat *scp) scp->rndr->clear = vga_pxlclear_planar; scp->rndr->draw_border = vga_pxlborder_planar; if (scp->sc->adp->va_type == KD_VGA) - scp->rndr->draw = vga_egadraw; - else scp->rndr->draw = vga_vgadraw_planar; + else + scp->rndr->draw = vga_egadraw; scp->rndr->draw_cursor = vga_pxlcursor_planar; scp->rndr->blink_cursor = vga_pxlblink_planar; scp->rndr->draw_mouse = vga_pxlmouse_planar; @@ -828,11 +828,9 @@ vga_vgadraw_planar(scr_stat *scp, int fr /* set background color in EGA/VGA latch */ if (bg != col2) { bg = col2; - outw(GDCIDX, 0x0005); /* read mode 0, write mode 0 */ outw(GDCIDX, bg | 0x00); /* set/reset */ - writeb(d, 0); + writeb(d, 0xff); c = readb(d); /* set bg color in the latch */ - outw(GDCIDX, 0x0305); /* read mode 0, write mode 3 */ } /* foreground color */ outw(GDCIDX, col1 | 0x00); /* set/reset */ From owner-svn-src-head@freebsd.org Fri Apr 21 07:16:09 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 27098D49030; Fri, 21 Apr 2017 07:16:09 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C76FE10D4; Fri, 21 Apr 2017 07:16:08 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3L7G7wM049705; Fri, 21 Apr 2017 07:16:07 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3L7G7Aa049703; Fri, 21 Apr 2017 07:16:07 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201704210716.v3L7G7Aa049703@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 21 Apr 2017 07:16:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317246 - in head: sbin/geom/class/eli sys/geom/eli X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 21 Apr 2017 07:16:09 -0000 Author: mav Date: Fri Apr 21 07:16:07 2017 New Revision: 317246 URL: https://svnweb.freebsd.org/changeset/base/317246 Log: Always allow setting number of iterations for the first time. Before this change it was impossible to set number of PKCS#5v2 iterations, required to set passphrase, if it has two keys and never had any passphrase. Due to present metadata format limitations there are still cases when number of iterations can not be changed, but now it works in cases when it can. PR: 218512 MFC after: 2 weeks Sponsored by: iXsystems, Inc. Differential Revision: https://reviews.freebsd.org/D10338 Modified: head/sbin/geom/class/eli/geom_eli.c head/sys/geom/eli/g_eli_ctl.c Modified: head/sbin/geom/class/eli/geom_eli.c ============================================================================== --- head/sbin/geom/class/eli/geom_eli.c Fri Apr 21 06:55:17 2017 (r317245) +++ head/sbin/geom/class/eli/geom_eli.c Fri Apr 21 07:16:07 2017 (r317246) @@ -1118,7 +1118,9 @@ eli_setkey_detached(struct gctl_req *req val = gctl_get_intmax(req, "iterations"); /* Check if iterations number should and can be changed. */ - if (val != -1) { + if (val != -1 && md->md_iterations == -1) { + md->md_iterations = val; + } else if (val != -1 && val != md->md_iterations) { if (bitcount32(md->md_keys) != 1) { gctl_error(req, "To be able to use '-i' option, only " "one key can be defined."); Modified: head/sys/geom/eli/g_eli_ctl.c ============================================================================== --- head/sys/geom/eli/g_eli_ctl.c Fri Apr 21 06:55:17 2017 (r317245) +++ head/sys/geom/eli/g_eli_ctl.c Fri Apr 21 07:16:07 2017 (r317246) @@ -618,7 +618,9 @@ g_eli_ctl_setkey(struct gctl_req *req, s return; } /* Check if iterations number should and can be changed. */ - if (*valp != -1) { + if (*valp != -1 && md.md_iterations == -1) { + md.md_iterations = *valp; + } else if (*valp != -1 && *valp != md.md_iterations) { if (bitcount32(md.md_keys) != 1) { gctl_error(req, "To be able to use '-i' option, only " "one key can be defined."); From owner-svn-src-head@freebsd.org Fri Apr 21 07:43:45 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5AA01D49A0E; Fri, 21 Apr 2017 07:43:45 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 29F41BC1; Fri, 21 Apr 2017 07:43:45 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3L7hiZS063228; Fri, 21 Apr 2017 07:43:44 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3L7hiBP063227; Fri, 21 Apr 2017 07:43:44 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201704210743.v3L7hiBP063227@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 21 Apr 2017 07:43:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317247 - head/sys/geom/eli X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 21 Apr 2017 07:43:45 -0000 Author: mav Date: Fri Apr 21 07:43:44 2017 New Revision: 317247 URL: https://svnweb.freebsd.org/changeset/base/317247 Log: Dump md_iterations as signed, which it really is. PR: 208305 PR: 196834 MFC after: 2 weeks Modified: head/sys/geom/eli/g_eli.h Modified: head/sys/geom/eli/g_eli.h ============================================================================== --- head/sys/geom/eli/g_eli.h Fri Apr 21 07:16:07 2017 (r317246) +++ head/sys/geom/eli/g_eli.h Fri Apr 21 07:43:44 2017 (r317247) @@ -510,7 +510,7 @@ eli_metadata_dump(const struct g_eli_met printf(" provsize: %ju\n", (uintmax_t)md->md_provsize); printf("sectorsize: %u\n", (u_int)md->md_sectorsize); printf(" keys: 0x%02x\n", (u_int)md->md_keys); - printf("iterations: %u\n", (u_int)md->md_iterations); + printf("iterations: %d\n", (int)md->md_iterations); bzero(str, sizeof(str)); for (i = 0; i < sizeof(md->md_salt); i++) { str[i * 2] = hex[md->md_salt[i] >> 4]; From owner-svn-src-head@freebsd.org Fri Apr 21 08:10:25 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CA8EFD494E1; Fri, 21 Apr 2017 08:10:25 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail106.syd.optusnet.com.au (mail106.syd.optusnet.com.au [211.29.132.42]) by mx1.freebsd.org (Postfix) with ESMTP id 628DB1C49; Fri, 21 Apr 2017 08:10:25 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from besplex.bde.org (c122-106-153-191.carlnfd1.nsw.optusnet.com.au [122.106.153.191]) by mail106.syd.optusnet.com.au (Postfix) with ESMTPS id D7DEC3C6324; Fri, 21 Apr 2017 18:10:15 +1000 (AEST) Date: Fri, 21 Apr 2017 18:10:08 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Michael Tuexen cc: Bruce Evans , Cy Schubert , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r317208 - head/sys/netinet In-Reply-To: <8BBC38A0-DDBA-4C04-9654-98755B3E4E13@freebsd.org> Message-ID: <20170421173453.J1735@besplex.bde.org> References: <201704210143.v3L1h99s037727@slippy.cwsent.com> <20170421131041.G966@besplex.bde.org> <8BBC38A0-DDBA-4C04-9654-98755B3E4E13@freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=VbSHBBh9 c=1 sm=1 tr=0 a=Tj3pCpwHnMupdyZSltBt7Q==:117 a=Tj3pCpwHnMupdyZSltBt7Q==:17 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=6I5d2MoRAAAA:8 a=Mk1zjkTLLVCeTCkj1yEA:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 21 Apr 2017 08:10:25 -0000 On Fri, 21 Apr 2017, Michael Tuexen wrote: >> On 21. Apr 2017, at 05:16, Bruce Evans wrote: >> >> On Thu, 20 Apr 2017, Cy Schubert wrote: >> >> Please trim quotes. >> >>> In message <201704201919.v3KJJYko052651@repo.freebsd.org>, Michael Tuexen >>> write >>> s: >> >> [>> ... 5 lines trimmed] >> >>>> Log: >>>> Syncoockies can be used in combination with the syncache. If the cache >>>> overflows, syncookies are used. >> >> [>> ... 16 lines trimmed] >> >>>> Modified: head/sys/netinet/tcp_syncache.c >>>> ============================================================================= >>>> = >>>> --- head/sys/netinet/tcp_syncache.c Thu Apr 20 19:14:52 2017 (r31720 >>>> 7) >>>> +++ head/sys/netinet/tcp_syncache.c Thu Apr 20 19:19:33 2017 (r31720 >>>> 8) >>>> @@ -260,6 +260,7 @@ syncache_init(void) >>>> &V_tcp_syncache.hashbase[i].sch_mtx, 0); >>>> V_tcp_syncache.hashbase[i].sch_length = 0; >>>> V_tcp_syncache.hashbase[i].sch_sc = &V_tcp_syncache; >>>> + V_tcp_syncache.hashbase[i].sch_last_overflow = INT64_MIN; >>> ... >>> This line produced the following on i386: >>> >>> /opt/src/svn-current/sys/netinet/tcp_syncache.c:263:50: error: implicit >>> conversion from 'long long' to 'time_t' (aka 'int') changes value from >>> -9223372036854775808 to 0 [-Werror,-Wconstant-conversion] >>> V_tcp_syncache.hashbase[i].sch_last_overflow = INT64_MIN; >>> ~ ^~~~~~~~~ >>> ./x86/_stdint.h:91:41: note: expanded from macro 'INT64_MIN' >>> #define INT64_MIN (-0x7fffffffffffffffLL-1) >>> ~~~~~~~~~~~~~~~~~~~~~^~ >>> >>> Looks like it needs a time_t cast. >> >> A cast would just break the warning. INT64_MIN has nothing to do with >> time_t. The expression (time_t)INT64_MIN would be more obviously garbage >> since in the above it is not clear that sch_last_overflow has a type >> unrelated to the constant. > Fixed in https://svnweb.freebsd.org/changeset/base/317244 >> >> INT64_MIN is also broken if time_t is 64 bits but unsigned. Then it is >> converted to half of plus infinity instead of the intended minus infinity. > The patch assumes that time_t is signed, which is true for FreeBSD on all > platforms. Or am I missing a platform? Only future platforms. i386 should use time_t = uint32_t to fully support years 2038-2106 instead of time_t = int32_t to partially support years 1902-1970 (even time 0 (the Epoch) and other early hours in 1970 are not fully supported now and would be broken by unsigned time_t, since subtraction of the timezone offset from 0 gives negative values with signed time_t and overflowing values with unsigned time_t). (time_t)-1 is special, so the time 1 second before the Epoch cannot work with signed time_t. This value works better with unsigned time_t because it is not in the middle of the range, but times before the Epoch are just unrepresentable with unsigned time_t. Changing the signedness of time_t would break the ABI less than changing its size, but it still causes problems with buggy software which assumes that time_t is signed or encodes special values in it. Negative times are at best unspecified by POSIX. They give a large range of magic out of band values below 0, provided nothing assumes that the system is better designed than POSIX so supports times before the Epoch. Even the Standard C library is not that bad, except POSIX forces a bad design for time_t so mktime() and friends are restricted to times. If time_t is unsigned, then no times before the Epoch can work, and if it is signed then times before the Epoch are unportable. netinet could use non-negative times far in the past as out-of-band values if there are any. But it mostly uses monotonic times. The Epoch for monotonic times starts at boot time (modulo other bugs), so there are not enough times far enough in the past shortly after booting. If time_t is unsigned, there just aren't enough, and if it is signed there are only enough by using unportable negative times. Bruce From owner-svn-src-head@freebsd.org Fri Apr 21 09:26:54 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D386DD47044; Fri, 21 Apr 2017 09:26:54 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [IPv6:2a01:4f8:c17:6c4b::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7FC82FAC; Fri, 21 Apr 2017 09:26:54 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [62.141.129.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 7ABBF1FE022; Fri, 21 Apr 2017 11:26:52 +0200 (CEST) Subject: Re: svn commit: r317208 - head/sys/netinet To: Bruce Evans , Michael Tuexen References: <201704210143.v3L1h99s037727@slippy.cwsent.com> <20170421131041.G966@besplex.bde.org> <8BBC38A0-DDBA-4C04-9654-98755B3E4E13@freebsd.org> <20170421173453.J1735@besplex.bde.org> Cc: Cy Schubert , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Hans Petter Selasky Message-ID: <1920616c-1993-07d5-4855-73264dce0980@selasky.org> Date: Fri, 21 Apr 2017 11:25:02 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.7.1 MIME-Version: 1.0 In-Reply-To: <20170421173453.J1735@besplex.bde.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 21 Apr 2017 09:26:54 -0000 On 04/21/17 10:10, Bruce Evans wrote: > On Fri, 21 Apr 2017, Michael Tuexen wrote: > >>> On 21. Apr 2017, at 05:16, Bruce Evans wrote: >>> >>> On Thu, 20 Apr 2017, Cy Schubert wrote: >>> >>> Please trim quotes. >>> >>>> In message <201704201919.v3KJJYko052651@repo.freebsd.org>, Michael >>>> Tuexen >>>> write >>>> s: >>> >>> [>> ... 5 lines trimmed] >>> >>>>> Log: >>>>> Syncoockies can be used in combination with the syncache. If the >>>>> cache >>>>> overflows, syncookies are used. >>> >>> [>> ... 16 lines trimmed] >>> >>>>> Modified: head/sys/netinet/tcp_syncache.c >>>>> ============================================================================= >>>>> >>>>> = >>>>> --- head/sys/netinet/tcp_syncache.c Thu Apr 20 19:14:52 2017 >>>>> (r31720 >>>>> 7) >>>>> +++ head/sys/netinet/tcp_syncache.c Thu Apr 20 19:19:33 2017 >>>>> (r31720 >>>>> 8) >>>>> @@ -260,6 +260,7 @@ syncache_init(void) >>>>> &V_tcp_syncache.hashbase[i].sch_mtx, 0); >>>>> V_tcp_syncache.hashbase[i].sch_length = 0; >>>>> V_tcp_syncache.hashbase[i].sch_sc = &V_tcp_syncache; >>>>> + V_tcp_syncache.hashbase[i].sch_last_overflow = INT64_MIN; >>>> ... >>>> This line produced the following on i386: >>>> >>>> /opt/src/svn-current/sys/netinet/tcp_syncache.c:263:50: error: implicit >>>> conversion from 'long long' to 'time_t' (aka 'int') changes value from >>>> -9223372036854775808 to 0 [-Werror,-Wconstant-conversion] >>>> V_tcp_syncache.hashbase[i].sch_last_overflow = INT64_MIN; >>>> ~ ^~~~~~~~~ >>>> ./x86/_stdint.h:91:41: note: expanded from macro 'INT64_MIN' >>>> #define INT64_MIN (-0x7fffffffffffffffLL-1) >>>> ~~~~~~~~~~~~~~~~~~~~~^~ >>>> >>>> Looks like it needs a time_t cast. >>> >>> A cast would just break the warning. INT64_MIN has nothing to do with >>> time_t. The expression (time_t)INT64_MIN would be more obviously >>> garbage >>> since in the above it is not clear that sch_last_overflow has a type >>> unrelated to the constant. >> Fixed in https://svnweb.freebsd.org/changeset/base/317244 >>> >>> INT64_MIN is also broken if time_t is 64 bits but unsigned. Then it is >>> converted to half of plus infinity instead of the intended minus >>> infinity. >> The patch assumes that time_t is signed, which is true for FreeBSD on all >> platforms. Or am I missing a platform? > > Only future platforms. > > i386 should use time_t = uint32_t to fully support years 2038-2106 instead > of time_t = int32_t to partially support years 1902-1970 > (even time 0 (the Epoch) and other early hours in 1970 are not fully > supported now and would be broken by unsigned time_t, since subtraction > of the timezone offset from 0 gives negative values with signed time_t > and overflowing values with unsigned time_t). (time_t)-1 is special, > so the time 1 second before the Epoch cannot work with signed time_t. > This value works better with unsigned time_t because it is not in the > middle of the range, but times before the Epoch are just unrepresentable > with unsigned time_t. > > Changing the signedness of time_t would break the ABI less than changing > its size, but it still causes problems with buggy software which assumes > that time_t is signed or encodes special values in it. Negative times > are at best unspecified by POSIX. They give a large range of magic out > of band values below 0, provided nothing assumes that the system is better > designed than POSIX so supports times before the Epoch. Even the Standard > C library is not that bad, except POSIX forces a bad design for time_t so > mktime() and friends are restricted to times. If time_t is unsigned, > then no times before the Epoch can work, and if it is signed then times > before > the Epoch are unportable. > > netinet could use non-negative times far in the past as out-of-band > values if there are any. But it mostly uses monotonic times. The > Epoch for monotonic times starts at boot time (modulo other bugs), so > there are not enough times far enough in the past shortly after booting. > If time_t is unsigned, there just aren't enough, and if it is signed > there are only enough by using unportable negative times. Hi, Your proposal to change time_t to unsigned type is potentially dangerous in combination with NTP, where negative time deltas may occur. Consider existing code like this, both in three and outside the tree. static time_t last; time_t now = time(); time_t delta delta = now - last; if (delta > 0) { /* do something */ } else { /* ignore */ } If time_t is now unsigned, then the check above becomes true for alomost all values of time_t, except zero, which is wrong! Can C-compilers assert signedness of a variable? I propose, utime_t -> unsigned time and stime_t -> signed time. --HPS From owner-svn-src-head@freebsd.org Fri Apr 21 11:41:44 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8FB26D49BC7; Fri, 21 Apr 2017 11:41:44 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from CAN01-TO1-obe.outbound.protection.outlook.com (mail-eopbgr670061.outbound.protection.outlook.com [40.107.67.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "Microsoft IT SSL SHA2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 42F67ACF; Fri, 21 Apr 2017 11:41:43 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from YTXPR01MB0189.CANPRD01.PROD.OUTLOOK.COM (10.165.218.133) by YTXPR01MB0190.CANPRD01.PROD.OUTLOOK.COM (10.165.218.134) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1034.10; Fri, 21 Apr 2017 11:41:41 +0000 Received: from YTXPR01MB0189.CANPRD01.PROD.OUTLOOK.COM ([10.165.218.133]) by YTXPR01MB0189.CANPRD01.PROD.OUTLOOK.COM ([10.165.218.133]) with mapi id 15.01.1034.015; Fri, 21 Apr 2017 11:41:40 +0000 From: Rick Macklem To: Bruce Evans , Rick Macklem CC: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r317240 - head/sys/fs/nfs Thread-Topic: svn commit: r317240 - head/sys/fs/nfs Thread-Index: AQHSukG4mqORxxi2eUqFpYoQywI2x6HPSSuAgABqG6Y= Date: Fri, 21 Apr 2017 11:41:40 +0000 Message-ID: References: <201704210150.v3L1ofgl014509@repo.freebsd.org>, <20170421141623.A1141@besplex.bde.org> In-Reply-To: <20170421141623.A1141@besplex.bde.org> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: optusnet.com.au; dkim=none (message not signed) header.d=none;optusnet.com.au; dmarc=none action=none header.from=uoguelph.ca; x-microsoft-exchange-diagnostics: 1; YTXPR01MB0190; 7:zM5sS+ykvx9HtncusFOFSZXaNOiL2tfeg/20EtWWz4x58RNN0Q4CtvFc+7USUq4drIQRi08blGrb5ovYLCKMaHS0x+O74DvoOqKcBycWy4A1DFeTvC49WaB/rlCNr8s4oKt1Wm3/XwjrZ5Mjg0om/Hum2+F1CSkCpB5D3Bk779Uq3ENec82HyLNXQNsH0aZqNvRQxkz14AWzFnklRERijptbs7HWNrbovrMsiEph8qMPGurGAxDCKpWW3XWU+MImquHkXIFLMHlRLNiuVSlHZyVNtSsT1PEPxeIACYmhB5v4UwA7M6S+l+OvkvC1Jm3C1HPlqHv3y/VZGInnxPemRw== x-ms-office365-filtering-correlation-id: caedf6bf-5f62-4fde-ca9a-08d488ab60bb x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254075)(201703131423075)(201703031133081); SRVR:YTXPR01MB0190; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(46150409022019)(96448707832919); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040450)(2401047)(5005006)(8121501046)(10201501046)(3002001)(93006095)(93001095)(6041248)(20161123560025)(201703131423075)(201702281529075)(201702281528075)(201703061421075)(20161123555025)(20161123564025)(20161123562025)(6072148); SRVR:YTXPR01MB0190; BCL:0; PCL:0; RULEID:; SRVR:YTXPR01MB0190; x-forefront-prvs: 02843AA9E0 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(6009001)(39400400002)(39840400002)(39450400003)(39850400002)(39410400002)(24454002)(377454003)(6246003)(305945005)(5660300001)(229853002)(8676002)(122556002)(74316002)(77096006)(54356999)(53546009)(9686003)(2900100001)(4326008)(102836003)(6506006)(76176999)(38730400002)(25786009)(551544002)(3280700002)(3660700001)(6436002)(7696004)(189998001)(50986999)(2906002)(54906002)(86362001)(55016002)(33656002)(74482002)(2950100002)(8936002)(53936002)(81166006); DIR:OUT; SFP:1101; SCL:1; SRVR:YTXPR01MB0190; H:YTXPR01MB0189.CANPRD01.PROD.OUTLOOK.COM; FPR:; SPF:None; MLV:sfv; LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: uoguelph.ca X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Apr 2017 11:41:40.8926 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: be62a12b-2cad-49a1-a5fa-85f4f3156a7d X-MS-Exchange-Transport-CrossTenantHeadersStamped: YTXPR01MB0190 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 21 Apr 2017 11:41:44 -0000 Yes, I agree that hardcoded values are bad. Thanks for pointing out the constants in sys/conf.h, I can use those instea= d. sys/conf.h does not have an entry for "nogroup", which is what has been use= d by nfsuserd since it was written. Is adding an entry to sys/conf.h for GID_NOGROUP ok to do? rick ps: I hope you don't mind the top post... ________________________________________ From: Bruce Evans Sent: Friday, April 21, 2017 1:19:25 AM To: Rick Macklem Cc: src-committers@freebsd.org; svn-src-all@freebsd.org; svn-src-head@freeb= sd.org Subject: Re: svn commit: r317240 - head/sys/fs/nfs On Fri, 21 Apr 2017, Rick Macklem wrote: > Log: > Set default uid/gid to nobody/nogroup for NFSv4 mapping. > > The default uid/gid for NFSv4 are set by the nfsuserd(8) daemon. > However, they were 0 until the nfsuserd(8) was run. Since it is > possible to use NFSv4 without running the nfsuserd(8) daemon, set them > to nobody/nogroup initially. > Without this patch, the values would be set by the nfsuserd(8) daemon > and left changed even if the nfsuserd(8) daemon was killed. Also, the de= fault > values of 0 meant that setting a group to "wheel" would fail even when > done by root and this patch fixes this issue. Hard-coding these values is wrong, and the actual values seem wronger. The values in nfsuserd(8) are clearly wrong. It hard-codes 32767 (with bogus casts) for both the default uid and the default gid. These values are in the user namespace have nothing to do with nobody/nogroup. > and left changed even if the nfsuserd(8) daemon was killed. Also, the de= fault > ... > Modified: head/sys/fs/nfs/nfs_commonsubs.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/fs/nfs/nfs_commonsubs.c Fri Apr 21 00:45:44 2017 (r3= 17239) > +++ head/sys/fs/nfs/nfs_commonsubs.c Fri Apr 21 01:50:41 2017 (r3= 17240) > @@ -63,8 +63,8 @@ int nfsrv_useacl =3D 1; > struct nfssockreq nfsrv_nfsuserdsock; > int nfsrv_nfsuserd =3D 0; > struct nfsreqhead nfsd_reqq; > -uid_t nfsrv_defaultuid; > -gid_t nfsrv_defaultgid; > +uid_t nfsrv_defaultuid =3D 65534; > +gid_t nfsrv_defaultgid =3D 65533; > int nfsrv_lease =3D NFSRV_LEASE; > int ncl_mbuf_mlen =3D MLEN; > int nfsd_enable_stringtouid =3D 0; These are the traditional values in /etc/group. It is bogus but traditiona= l to have a uid in /etc/group. nobody doesn't actually have group nogroup. nobody is also in the correct place (/etc/passwd) provided the sysadmin didn't meddle with this, but it has group 65534 there. Group 65533 is traditionally for kmem and tty in /etc/passwd. mountd uses the less bogus values with more bogus casts (uid_t)-2 and (gid_t)-2. These are obfuscated spellings of 0xfffffffe. You don't really want these values to depend on the types because then the values break when the types are expanded, like they already did for the expansion to 32 bits. These values should be reserved in /etc/passwd and /etc/group, but they still aren't, 20-25 years after the expansion. You don't want to spell these values in decimal because decimal values much larger than 65534 are too hard to convert back to hex to see what they mean. The bogus casts are to break warnings about converting the easy-to-remember (but wrong becaus they are negative) values of -2 to unsigned. The magic values are still incompletely documented in exports(8) as pure -2:-2. It doesn't mention nobody or any other magic numbers or any bugs in defaulting or specifying the numbers. Last time I looked, most utilities and even basic library functions had the usual errors for parsing large and negative values by misusing atoi() or strtol(). Many can't parse 0xfffffffe or even this value in decimal, so the value has to be spelled -2 so that undocumented overflow bugs can convert it to the correct value of 0xffffffffe. On 64-bit systems, it might be first converted to 0xffffffffffffffffe so another layer of overflow bugs is needed to get back to 0xfffffffe. Since library functions are buggy, it is at best unportable to put any of -2, 0xfffffffe or this value in hex in /etc/passwd or /etc/group. 65534 always worked there since it is much smaller than 32-bit LONG_MAX and the library was probably never bad enough to use atoi() and 16-bit ints. IIRC, -2 doesn't wrok in /etc/passwd, but is the only spelling that works near mountd. Checking now shows mountd using many different misparsing methods: - it uses only atoi() in parescred(). This can read -2 in /etc/exports, but misparses the correct value of 0xfffffffe to 0 and the correct value of this in decimal to 0x7fffffffl; it silently ignores errors in both cases; it blindly assigns to uid_t/gid_t, so -2 becomes the correct value - it uses strtol() with mostly missing and half wrong error checking for masklen - it uses strtoul() with mostly wrong but not so much missing error checking for -p. First it truncates the value to break its subsequent range checks... - its use of atoi() implicitly forces base 10. This is forced explicitly for the strtol() and strtoul(). This makes sure that hex never works. Hex is always misparsed as 0, and the resulting garbage after the 0 is only checked for after the strtoul() call. Kernel code shouldn't hard-code any user ids, starting with 0 for root (this is worse than 65534 for nobody since 0 is so special), but for devices I hard-coded many ids in . This works well enough and is better than implicit 0 for root provided everything uses the #defined values. It is better than scattered values of 32767, 65534, 65533 and 0xfffffffe and -2. Bruce From owner-svn-src-head@freebsd.org Fri Apr 21 11:48:13 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 61768D49CD4; Fri, 21 Apr 2017 11:48:13 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 31A3FF0F; Fri, 21 Apr 2017 11:48:13 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3LBmCKR064953; Fri, 21 Apr 2017 11:48:12 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3LBmCOX064952; Fri, 21 Apr 2017 11:48:12 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201704211148.v3LBmCOX064952@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Fri, 21 Apr 2017 11:48:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317251 - head/sys/fs/nfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 21 Apr 2017 11:48:13 -0000 Author: rmacklem Date: Fri Apr 21 11:48:12 2017 New Revision: 317251 URL: https://svnweb.freebsd.org/changeset/base/317251 Log: Revert r317240. I didn't realize there were defined constants for uid/gid values in sys/conf.h. I will do another commit using those. Modified: head/sys/fs/nfs/nfs_commonsubs.c Modified: head/sys/fs/nfs/nfs_commonsubs.c ============================================================================== --- head/sys/fs/nfs/nfs_commonsubs.c Fri Apr 21 10:16:34 2017 (r317250) +++ head/sys/fs/nfs/nfs_commonsubs.c Fri Apr 21 11:48:12 2017 (r317251) @@ -63,8 +63,8 @@ int nfsrv_useacl = 1; struct nfssockreq nfsrv_nfsuserdsock; int nfsrv_nfsuserd = 0; struct nfsreqhead nfsd_reqq; -uid_t nfsrv_defaultuid = 65534; -gid_t nfsrv_defaultgid = 65533; +uid_t nfsrv_defaultuid; +gid_t nfsrv_defaultgid; int nfsrv_lease = NFSRV_LEASE; int ncl_mbuf_mlen = MLEN; int nfsd_enable_stringtouid = 0; From owner-svn-src-head@freebsd.org Fri Apr 21 11:53:28 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C33D8D49EF6; Fri, 21 Apr 2017 11:53:28 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail105.syd.optusnet.com.au (mail105.syd.optusnet.com.au [211.29.132.249]) by mx1.freebsd.org (Postfix) with ESMTP id 55FF361F; Fri, 21 Apr 2017 11:53:27 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from besplex.bde.org (c122-106-153-191.carlnfd1.nsw.optusnet.com.au [122.106.153.191]) by mail105.syd.optusnet.com.au (Postfix) with ESMTPS id 08AB91041A66; Fri, 21 Apr 2017 21:53:22 +1000 (AEST) Date: Fri, 21 Apr 2017 21:53:21 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Hans Petter Selasky cc: Bruce Evans , Michael Tuexen , Cy Schubert , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r317208 - head/sys/netinet In-Reply-To: <1920616c-1993-07d5-4855-73264dce0980@selasky.org> Message-ID: <20170421211348.I2311@besplex.bde.org> References: <201704210143.v3L1h99s037727@slippy.cwsent.com> <20170421131041.G966@besplex.bde.org> <8BBC38A0-DDBA-4C04-9654-98755B3E4E13@freebsd.org> <20170421173453.J1735@besplex.bde.org> <1920616c-1993-07d5-4855-73264dce0980@selasky.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=KeqiiUQD c=1 sm=1 tr=0 a=Tj3pCpwHnMupdyZSltBt7Q==:117 a=Tj3pCpwHnMupdyZSltBt7Q==:17 a=kj9zAlcOel0A:10 a=fC9__l7nNtu63dUNZJMA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 21 Apr 2017 11:53:28 -0000 On Fri, 21 Apr 2017, Hans Petter Selasky wrote: > On 04/21/17 10:10, Bruce Evans wrote: >> ... >> i386 should use time_t = uint32_t to fully support years 2038-2106 instead >> of time_t = int32_t to partially support years 1902-1970 >> (even time 0 (the Epoch) and other early hours in 1970 are not fully >> supported now and would be broken by unsigned time_t, since subtraction >> of the timezone offset from 0 gives negative values with signed time_t >> and overflowing values with unsigned time_t). (time_t)-1 is special, >> so the time 1 second before the Epoch cannot work with signed time_t. >> This value works better with unsigned time_t because it is not in the >> middle of the range, but times before the Epoch are just unrepresentable >> with unsigned time_t. >> >> Changing the signedness of time_t would break the ABI less than changing >> its size, but it still causes problems with buggy software which assumes >> that time_t is signed or encodes special values in it. Negative times >> are at best unspecified by POSIX. They give a large range of magic out >> of band values below 0, provided nothing assumes that the system is better >> designed than POSIX so supports times before the Epoch. Even the Standard >> C library is not that bad, except POSIX forces a bad design for time_t so >> mktime() and friends are restricted to times. If time_t is unsigned, >> then no times before the Epoch can work, and if it is signed then times >> before >> the Epoch are unportable. > ... > > Your proposal to change time_t to unsigned type is potentially dangerous in > combination with NTP, where negative time deltas may occur. Consider existing > code like this, both in three and outside the tree. Yes, I already pointed out that there is a lot of buggy software out there. Maybe ntp understansd time_t, but its users might not. > static time_t last; > time_t now = time(); > time_t delta > > delta = now - last; This assumes something like POSIX plus signed time_t. In standard C, time_t can be almost anything so the subtraction is invalid. You have to use difftime(). difftime() was heavyweight when C was young, but now with time_t = double and difftime() inline, it is probably lighter and faster than POSIX timespecs. difftime(x, y) can be just x - y in 64-bit double precision, while timespecs may be bloated to 128 bits and are in a non-binary format that is hard to subtract. Timespecs do have a larger range. The precision of 64-bit double is only enough for microseconds resolution over 272 years. So it can easily replace timevals but not timespecs. In original POSIX, time_t could be any arithmetic type. This allowed it to be double. Good for userland but bad for kernels and sysctls, so few or no POSIX systems made it double. time_t is now integral in POSIX. It could be unsigned the last time I looked. > if (delta > 0) { > /* do something */ > } else { > /* ignore */ > } > > If time_t is now unsigned, then the check above becomes true for alomost all > values of time_t, except zero, which is wrong! Who would write such buggy code? :-) Practical POSIX code near ntp would probably use timespecs or timevals, and they can't be subtracted or compared easily anyway. FreeBSD has macros for this, but they are unportable and not as easy to use as difftime or simple conversion to floating point (except for timespecs, the conversion is not so simple since it may lose resolution). > Can C-compilers assert signedness of a variable? Yes, but they don't since this would find too many errors and non-errors for conversions. > I propose, utime_t -> unsigned time and stime_t -> signed time. That would just increase unportability and not help to avoid changing the size of time_t in standard APIs that require it. With another hat on, I lecture about the error of using unsigned types except in emergency. int32_t time_t rollover in 2038 is getting a bit closer to an emergency. Even for variables and types that were misdesigned to be unsigned, it is easy to forget this and use them in things like delta-calculations which require signed types. Bruce From owner-svn-src-head@freebsd.org Fri Apr 21 11:58:39 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 94A6CD47191; Fri, 21 Apr 2017 11:58:39 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail109.syd.optusnet.com.au (mail109.syd.optusnet.com.au [211.29.132.80]) by mx1.freebsd.org (Postfix) with ESMTP id 5AC0F99C; Fri, 21 Apr 2017 11:58:38 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from besplex.bde.org (c122-106-153-191.carlnfd1.nsw.optusnet.com.au [122.106.153.191]) by mail109.syd.optusnet.com.au (Postfix) with ESMTPS id 45E2ED66337; Fri, 21 Apr 2017 21:58:32 +1000 (AEST) Date: Fri, 21 Apr 2017 21:58:30 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Rick Macklem cc: Bruce Evans , Rick Macklem , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r317240 - head/sys/fs/nfs In-Reply-To: Message-ID: <20170421215452.R2416@besplex.bde.org> References: <201704210150.v3L1ofgl014509@repo.freebsd.org>, <20170421141623.A1141@besplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=AYLBJzfG c=1 sm=1 tr=0 a=Tj3pCpwHnMupdyZSltBt7Q==:117 a=Tj3pCpwHnMupdyZSltBt7Q==:17 a=kj9zAlcOel0A:10 a=p2sOvODb33Ro217gv_8A:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 21 Apr 2017 11:58:39 -0000 On Fri, 21 Apr 2017, Rick Macklem wrote: > Yes, I agree that hardcoded values are bad. > Thanks for pointing out the constants in sys/conf.h, I can use those instead. > sys/conf.h does not have an entry for "nogroup", which is what has been used > by nfsuserd since it was written. > > Is adding an entry to sys/conf.h for GID_NOGROUP ok to do? It is currently mostly for device configuration, but the user/group defines in it are already misplaced (for convenience) so a couple more wouldn't hurt. > rick > ps: I hope you don't mind the top post... I prefer not. Bruce From owner-svn-src-head@freebsd.org Fri Apr 21 13:39:16 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 393B3D4123A; Fri, 21 Apr 2017 13:39:16 +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 mx1.freebsd.org (Postfix) with ESMTPS id 0AE9D1A24; Fri, 21 Apr 2017 13:39:15 +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 v3LDdFHR009447; Fri, 21 Apr 2017 13:39:15 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3LDdFxk009446; Fri, 21 Apr 2017 13:39:15 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201704211339.v3LDdFxk009446@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 21 Apr 2017 13:39:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317252 - head/gnu/usr.bin X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 21 Apr 2017 13:39:16 -0000 Author: emaste Date: Fri Apr 21 13:39:14 2017 New Revision: 317252 URL: https://svnweb.freebsd.org/changeset/base/317252 Log: Simplify gnu/usr.bin Makefile conditions After r307655 MK_GDB is forced to no if MK_BINUTILS is no, and similarly MK_GROFF is forced to no if MK_CXX is no, so we can remove nested conditionals. Reviewed by: bapt, brooks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D8287 Modified: head/gnu/usr.bin/Makefile Modified: head/gnu/usr.bin/Makefile ============================================================================== --- head/gnu/usr.bin/Makefile Fri Apr 21 11:48:12 2017 (r317251) +++ head/gnu/usr.bin/Makefile Fri Apr 21 13:39:14 2017 (r317252) @@ -5,21 +5,17 @@ .if ${MK_CXX} != "no" SUBDIR.${MK_GCC}+= gperf -SUBDIR.${MK_GROFF}+= groff .endif SUBDIR.${MK_BINUTILS}+= binutils SUBDIR.${MK_DIALOG}+= dialog - -.if ${MK_BINUTILS} != "no" -SUBDIR.${MK_GDB}+= gdb -SUBDIR_DEPEND_gdb= binutils -.endif - SUBDIR.${MK_GCC}+= cc SUBDIR.${MK_GNU_DIFF}+= diff3 SUBDIR.${MK_GNU_GREP}+= grep +SUBDIR.${MK_GDB}+= gdb +SUBDIR_DEPEND_gdb= binutils SUBDIR.${MK_GPL_DTC}+= dtc +SUBDIR.${MK_GROFF}+= groff SUBDIR.${MK_TESTS}+= tests SUBDIR_PARALLEL= From owner-svn-src-head@freebsd.org Fri Apr 21 13:45:03 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 308A8D415EC; Fri, 21 Apr 2017 13:45:03 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E6010242; Fri, 21 Apr 2017 13:45:02 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3LDj2xr013801; Fri, 21 Apr 2017 13:45:02 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3LDj2jK013800; Fri, 21 Apr 2017 13:45:02 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201704211345.v3LDj2jK013800@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 21 Apr 2017 13:45:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317253 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 21 Apr 2017 13:45:03 -0000 Author: mav Date: Fri Apr 21 13:45:01 2017 New Revision: 317253 URL: https://svnweb.freebsd.org/changeset/base/317253 Log: Add interface reference counting to if_lagg. Using plain ifunit() looks like request for troubles. MFC after: 2 weeks Modified: head/sys/net/if_lagg.c Modified: head/sys/net/if_lagg.c ============================================================================== --- head/sys/net/if_lagg.c Fri Apr 21 13:39:14 2017 (r317252) +++ head/sys/net/if_lagg.c Fri Apr 21 13:45:01 2017 (r317253) @@ -683,6 +683,7 @@ lagg_port_lladdr(struct lagg_port *lp, u if (llq == NULL) /* XXX what to do */ return; + if_ref(ifp); llq->llq_ifp = ifp; llq->llq_type = llq_type; bcopy(lladdr, llq->llq_lladdr, ETHER_ADDR_LEN); @@ -731,6 +732,7 @@ lagg_port_setlladdr(void *arg, int pendi EVENTHANDLER_INVOKE(iflladdr_event, ifp); CURVNET_RESTORE(); head = SLIST_NEXT(llq, llq_entries); + if_rele(ifp); free(llq, M_DEVBUF); } } @@ -805,6 +807,7 @@ lagg_port_create(struct lagg_softc *sc, lp->lp_output = ifp->if_output; ifp->if_output = lagg_port_output; + if_ref(ifp); lp->lp_ifp = ifp; lp->lp_softc = sc; @@ -958,6 +961,7 @@ lagg_port_destroy(struct lagg_port *lp, if (llq->llq_ifp == ifp) { SLIST_REMOVE(&sc->sc_llq_head, llq, lagg_llq, llq_entries); + if_rele(llq->llq_ifp); free(llq, M_DEVBUF); break; /* Only appears once */ } @@ -967,6 +971,7 @@ lagg_port_destroy(struct lagg_port *lp, if (lp->lp_ifflags) if_printf(ifp, "%s: lp_ifflags unclean\n", __func__); + if_rele(ifp); free(lp, M_DEVBUF); /* Update lagg capabilities */ @@ -1443,7 +1448,7 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd break; case SIOCGLAGGPORT: if (rp->rp_portname[0] == '\0' || - (tpif = ifunit(rp->rp_portname)) == NULL) { + (tpif = ifunit_ref(rp->rp_portname)) == NULL) { error = EINVAL; break; } @@ -1453,18 +1458,20 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd lp->lp_softc != sc) { error = ENOENT; LAGG_RUNLOCK(sc, &tracker); + if_rele(tpif); break; } lagg_port2req(lp, rp); LAGG_RUNLOCK(sc, &tracker); + if_rele(tpif); break; case SIOCSLAGGPORT: error = priv_check(td, PRIV_NET_LAGG); if (error) break; if (rp->rp_portname[0] == '\0' || - (tpif = ifunit(rp->rp_portname)) == NULL) { + (tpif = ifunit_ref(rp->rp_portname)) == NULL) { error = EINVAL; break; } @@ -1491,13 +1498,14 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd LAGG_WLOCK(sc); error = lagg_port_create(sc, tpif); LAGG_WUNLOCK(sc); + if_rele(tpif); break; case SIOCSLAGGDELPORT: error = priv_check(td, PRIV_NET_LAGG); if (error) break; if (rp->rp_portname[0] == '\0' || - (tpif = ifunit(rp->rp_portname)) == NULL) { + (tpif = ifunit_ref(rp->rp_portname)) == NULL) { error = EINVAL; break; } @@ -1507,11 +1515,13 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd lp->lp_softc != sc) { error = ENOENT; LAGG_WUNLOCK(sc); + if_rele(tpif); break; } error = lagg_port_destroy(lp, 1); LAGG_WUNLOCK(sc); + if_rele(tpif); break; case SIOCSIFFLAGS: /* Set flags on ports too */ From owner-svn-src-head@freebsd.org Fri Apr 21 14:22:31 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4EB5DD48724; Fri, 21 Apr 2017 14:22:31 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail110.syd.optusnet.com.au (mail110.syd.optusnet.com.au [211.29.132.97]) by mx1.freebsd.org (Postfix) with ESMTP id CE5488E1; Fri, 21 Apr 2017 14:22:30 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from besplex.bde.org (c122-106-153-191.carlnfd1.nsw.optusnet.com.au [122.106.153.191]) by mail110.syd.optusnet.com.au (Postfix) with ESMTPS id 2004C10C774; Sat, 22 Apr 2017 00:22:28 +1000 (AEST) Date: Sat, 22 Apr 2017 00:22:27 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Bruce Evans cc: Jung-uk Kim , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r317231 - head/usr.bin/systat In-Reply-To: <20170421131652.P966@besplex.bde.org> Message-ID: <20170421232411.H2704@besplex.bde.org> References: <201704202230.v3KMUdAm030762@repo.freebsd.org> <20170421131652.P966@besplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=AYLBJzfG c=1 sm=1 tr=0 a=Tj3pCpwHnMupdyZSltBt7Q==:117 a=Tj3pCpwHnMupdyZSltBt7Q==:17 a=kj9zAlcOel0A:10 a=j1YcvcGwAk2caA5GzGUA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 21 Apr 2017 14:22:31 -0000 On Fri, 21 Apr 2017, Bruce Evans wrote: > On Thu, 20 Apr 2017, Jung-uk Kim wrote: > >> Log: >> Fix systat(1) regression. It was broken by r317061. > > It is more broken than before. Now it fails when the kernel is older > than the utility instead of vice versa. When it fails, the failures > are more serious than before. systat -v actually does complete > checking for errors (some are only errors in itself), but mishandles > them. It reports the errors on the status line and continues. The > error message overwrites the previous one. Continuing is more broken > than before: The follow patch reduces the ABI breakage as much as possible. On a lightly loaded system, the maximum value in any counter used by top, vmstat or systat -v is growing at a rate of 1M per hour, so the 32-bit variables in the application are enough for about 166 days. I only applied the fix to some counter sysctls with broken ABIs, but wrote it for general use. It doesn't handle SYSCTL_IN(), and assumes unsigned counters. X Index: subr_counter.c X =================================================================== X --- subr_counter.c (revision 317243) X +++ subr_counter.c (working copy) X @@ -74,6 +75,95 @@ X uma_zfree(pcpu_zone_64, c); X } X X +/* Output a signed integer with the caller's size as well as possible. */ X +__unused X +static int X +sysctl_out_i(struct sysctl_req *req, intmax_t val) X +{ X + intmax_t valtrunc; X + int64_t val64; X + int32_t val32; X + int16_t val16; X + int8_t val8; X + int error; X + X + switch (req->oldlen) { X + case 1: X + valtrunc = val8 = val; X + error = SYSCTL_OUT(req, &val8, 1); X + break; X + case 2: X + valtrunc = val16 = val; X + error = SYSCTL_OUT(req, &val16, 2); X + break; X + case 4: X + valtrunc = val32 = val; X + error = SYSCTL_OUT(req, &val32, 4); X + break; X + case 8: X + valtrunc = val64 = val; X + error = SYSCTL_OUT(req, &val64, 8); X + break; X + default: X + valtrunc = val; X + error = SYSCTL_OUT(req, &val, sizeof(val)); X + break; X + } X + if (valtrunc != val && error == 0) X + error = EOVERFLOW; X + return (error); X +} X + X +uintmax_t sysoui_max; X + X +/* Output an unsigned integer with the caller's size as well as possible. */ X +static int X +sysctl_out_ui(struct sysctl_req *req, uintmax_t val) X +{ X + uintmax_t valtrunc; X + uint64_t val64; X + uint32_t val32; X + uint16_t val16; X + uint8_t val8; X + int error; X + X + if (sysoui_max < val) { X + sysoui_max = val; X + if ((val & 0xffff) == 0) X + printf("new sysoui_max %#jx\n", val); X + } X + val64 = val32 = val16 = val8 = 0; X + switch (req->oldlen) { X + case 1: X + valtrunc = val8 = val; X + error = SYSCTL_OUT(req, &val8, 1); X + break; X + case 2: X + valtrunc = val16 = val; X + error = SYSCTL_OUT(req, &val16, 2); X + break; X + case 4: X + valtrunc = val32 = val; X + error = SYSCTL_OUT(req, &val32, 4); X + break; X + case 8: X + valtrunc = val64 = val; X + error = SYSCTL_OUT(req, &val64, 8); X + break; X + default: X + valtrunc = val; X + error = SYSCTL_OUT(req, &val, sizeof(val)); X + break; X + } X + if (valtrunc != val && error == 0) { X + printf( X + "val %#jx, valtrunc %#jx, val64 %#jx, val32 %#x, val16 %#x, val8 %#x\n", X + val, valtrunc, val64, val32, val16, val8); X + error = EOVERFLOW; X + } X + return (error); X +} X + X int X sysctl_handle_counter_u64(SYSCTL_HANDLER_ARGS) X { X @@ -82,7 +172,7 @@ X X out = counter_u64_fetch(*(counter_u64_t *)arg1); X X - error = SYSCTL_OUT(req, &out, sizeof(uint64_t)); X + error = sysctl_out_ui(req, out); X X if (error || !req->newptr) X return (error); Bruce From owner-svn-src-head@freebsd.org Fri Apr 21 14:36:11 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B63DFD48A53; Fri, 21 Apr 2017 14:36:11 +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 mx1.freebsd.org (Postfix) with ESMTPS id 79784E0A; Fri, 21 Apr 2017 14:36:11 +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 v3LEaA4B035525; Fri, 21 Apr 2017 14:36:10 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3LEa9Ns035517; Fri, 21 Apr 2017 14:36:09 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201704211436.v3LEa9Ns035517@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 21 Apr 2017 14:36:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317254 - in head: share/man/man5 share/mk tools/build/options usr.bin/grep X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 21 Apr 2017 14:36:11 -0000 Author: emaste Date: Fri Apr 21 14:36:09 2017 New Revision: 317254 URL: https://svnweb.freebsd.org/changeset/base/317254 Log: bsdgrep: add BSD_GREP_FASTMATCH knob for built-in fastmatch Bugs have been found in the fastmatch implementation as used in bsdgrep. Some have been fixed (r316495) while fixes for others are in review (D10098). In comparison with the fastmatch implementation, Kyle Evans found that: - regex(3)'s performance with literal expressions offers a speed improvement over fastmatch - regex(3)'s performance, both with simple BREs and EREs, seems to be comparable The regex implementation was imported in r226035, and the commit message reports: This is a temporary solution until the whole regex library is not replaced so that BSD grep development can continue and the backported code gets some review and testing. This change only improves scalability slightly, there is no big performance boost yet but several minor bugs have been found and fixed. Introduce a WITH_/WITHOUT_BSD_GREP_FASTMATCH knob to support testing of both approaches. PR: 175314, 194823 Submitted by: Kyle Evans Reviewed by: bdrewery (in part) Differential Revision: https://reviews.freebsd.org/D10282 Added: head/tools/build/options/WITHOUT_BSD_GREP_FASTMATCH (contents, props changed) Modified: head/share/man/man5/src.conf.5 head/share/mk/src.opts.mk head/usr.bin/grep/Makefile head/usr.bin/grep/grep.c head/usr.bin/grep/grep.h head/usr.bin/grep/util.c Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Fri Apr 21 13:45:01 2017 (r317253) +++ head/share/man/man5/src.conf.5 Fri Apr 21 14:36:09 2017 (r317254) @@ -1,6 +1,6 @@ .\" DO NOT EDIT-- this file is generated by tools/build/options/makeman. .\" $FreeBSD$ -.Dd April 19, 2017 +.Dd April 21, 2017 .Dt SRC.CONF 5 .Os .Sh NAME @@ -215,6 +215,11 @@ Set to not build the BSD licensed versio .Xr libarchive 3 . .It Va WITH_BSD_GREP Install BSD-licensed grep as '[ef]grep' instead of GNU grep. +.It Va WITHOUT_BSD_GREP_FASTMATCH +Set this option to exclude the fastmatch implementation from +.Xr bsdgrep 1 , +instead using only +.Xr regex 3 . .It Va WITHOUT_BSNMP Set to not build or install .Xr bsnmpd 1 Modified: head/share/mk/src.opts.mk ============================================================================== --- head/share/mk/src.opts.mk Fri Apr 21 13:45:01 2017 (r317253) +++ head/share/mk/src.opts.mk Fri Apr 21 14:36:09 2017 (r317254) @@ -62,6 +62,7 @@ __DEFAULT_YES_OPTIONS = \ BOOTPARAMD \ BOOTPD \ BSD_CPIO \ + BSD_GREP_FASTMATCH \ BSDINSTALL \ BSNMP \ BZIP2 \ Added: head/tools/build/options/WITHOUT_BSD_GREP_FASTMATCH ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITHOUT_BSD_GREP_FASTMATCH Fri Apr 21 14:36:09 2017 (r317254) @@ -0,0 +1,5 @@ +.\" $FreeBSD$ +Set this option to exclude the fastmatch implementation from +.Xr bsdgrep 1 , +instead using only +.Xr regex 3 . Modified: head/usr.bin/grep/Makefile ============================================================================== --- head/usr.bin/grep/Makefile Fri Apr 21 13:45:01 2017 (r317253) +++ head/usr.bin/grep/Makefile Fri Apr 21 14:36:09 2017 (r317254) @@ -15,10 +15,14 @@ bsdgrep.1: grep.1 .endif SRCS= file.c grep.c queue.c util.c -# Extra files ported backported form some regex improvements +.if ${MK_BSD_GREP_FASTMATCH} == "yes" +# Extra files ported backported for some regex improvements .PATH: ${.CURDIR}/regex SRCS+= fastmatch.c hashtable.c tre-compile.c tre-fastmatch.c CFLAGS+=-I${.CURDIR}/regex +.else +CFLAGS+= -DWITHOUT_FASTMATCH +.endif CFLAGS.gcc+= --param max-inline-insns-single=500 Modified: head/usr.bin/grep/grep.c ============================================================================== --- head/usr.bin/grep/grep.c Fri Apr 21 13:45:01 2017 (r317253) +++ head/usr.bin/grep/grep.c Fri Apr 21 14:36:09 2017 (r317254) @@ -49,7 +49,9 @@ __FBSDID("$FreeBSD$"); #include #include +#ifndef WITHOUT_FASTMATCH #include "fastmatch.h" +#endif #include "grep.h" #ifndef WITHOUT_NLS @@ -86,7 +88,9 @@ unsigned int patterns; static unsigned int pattern_sz; struct pat *pattern; regex_t *r_pattern; +#ifndef WITHOUT_FASTMATCH fastmatch_t *fg_pattern; +#endif /* Filename exclusion/inclusion patterns */ unsigned int fpatterns, dpatterns; @@ -715,20 +719,25 @@ main(int argc, char *argv[]) usage(); } +#ifndef WITHOUT_FASTMATCH fg_pattern = grep_calloc(patterns, sizeof(*fg_pattern)); +#endif r_pattern = grep_calloc(patterns, sizeof(*r_pattern)); /* Check if cheating is allowed (always is for fgrep). */ for (i = 0; i < patterns; ++i) { +#ifndef WITHOUT_FASTMATCH + /* Attempt compilation with fastmatch regex and fallback to + regex(3) if it fails. */ if (fastncomp(&fg_pattern[i], pattern[i].pat, - pattern[i].len, cflags) != 0) { - /* Fall back to full regex library */ - c = regcomp(&r_pattern[i], pattern[i].pat, cflags); - if (c != 0) { - regerror(c, &r_pattern[i], re_error, - RE_ERROR_BUF); - errx(2, "%s", re_error); - } + pattern[i].len, cflags) == 0) + continue; +#endif + c = regcomp(&r_pattern[i], pattern[i].pat, cflags); + if (c != 0) { + regerror(c, &r_pattern[i], re_error, + RE_ERROR_BUF); + errx(2, "%s", re_error); } } Modified: head/usr.bin/grep/grep.h ============================================================================== --- head/usr.bin/grep/grep.h Fri Apr 21 13:45:01 2017 (r317253) +++ head/usr.bin/grep/grep.h Fri Apr 21 14:36:09 2017 (r317254) @@ -36,7 +36,9 @@ #include #include +#ifndef WITHOUT_FASTMATCH #include "fastmatch.h" +#endif #ifdef WITHOUT_NLS #define getstr(n) errstr[n] @@ -127,7 +129,9 @@ extern unsigned int dpatterns, fpatterns extern struct pat *pattern; extern struct epat *dpattern, *fpattern; extern regex_t *er_pattern, *r_pattern; +#ifndef WITHOUT_FASTMATCH extern fastmatch_t *fg_pattern; +#endif /* For regex errors */ #define RE_ERROR_BUF 512 Modified: head/usr.bin/grep/util.c ============================================================================== --- head/usr.bin/grep/util.c Fri Apr 21 13:45:01 2017 (r317253) +++ head/usr.bin/grep/util.c Fri Apr 21 14:36:09 2017 (r317254) @@ -49,7 +49,9 @@ __FBSDID("$FreeBSD$"); #include #include +#ifndef WITHOUT_FASTMATCH #include "fastmatch.h" +#endif #include "grep.h" static int linesqueued; @@ -317,10 +319,12 @@ procline(struct str *l, int nottext) for (i = 0; i < patterns; i++) { pmatch.rm_so = st; pmatch.rm_eo = l->len; +#ifndef WITHOUT_FASTMATCH if (fg_pattern[i].pattern) r = fastexec(&fg_pattern[i], l->dat, 1, &pmatch, leflags); else +#endif r = regexec(&r_pattern[i], l->dat, 1, &pmatch, leflags); r = (r == 0) ? 0 : REG_NOMATCH; @@ -332,7 +336,11 @@ procline(struct str *l, int nottext) (size_t)pmatch.rm_eo != l->len) r = REG_NOMATCH; /* Check for whole word match */ +#ifndef WITHOUT_FASTMATCH if (r == 0 && (wflag || fg_pattern[i].word)) { +#else + if (r == 0 && wflag) { +#endif wchar_t wbegin, wend; wbegin = wend = L' '; From owner-svn-src-head@freebsd.org Fri Apr 21 14:39:29 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F1C57D48C3F for ; Fri, 21 Apr 2017 14:39:29 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1a.eu.mailhop.org (outbound1a.eu.mailhop.org [52.58.109.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8CB73108E for ; Fri, 21 Apr 2017 14:39:28 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: 4ed58442-26a0-11e7-b96e-2378c10e3beb X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 73.78.92.27 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [73.78.92.27]) by outbound1.eu.mailhop.org (Halon) with ESMTPSA id 4ed58442-26a0-11e7-b96e-2378c10e3beb; Fri, 21 Apr 2017 14:39:23 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id v3LEdH8P003681; Fri, 21 Apr 2017 08:39:17 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1492785557.56859.9.camel@freebsd.org> Subject: Re: svn commit: r317208 - head/sys/netinet From: Ian Lepore To: Bruce Evans , Hans Petter Selasky Cc: Michael Tuexen , Cy Schubert , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Fri, 21 Apr 2017 08:39:17 -0600 In-Reply-To: <20170421211348.I2311@besplex.bde.org> References: <201704210143.v3L1h99s037727@slippy.cwsent.com> <20170421131041.G966@besplex.bde.org> <8BBC38A0-DDBA-4C04-9654-98755B3E4E13@freebsd.org> <20170421173453.J1735@besplex.bde.org> <1920616c-1993-07d5-4855-73264dce0980@selasky.org> <20170421211348.I2311@besplex.bde.org> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 21 Apr 2017 14:39:30 -0000 On Fri, 2017-04-21 at 21:53 +1000, Bruce Evans wrote: > On Fri, 21 Apr 2017, Hans Petter Selasky wrote: > > > On 04/21/17 10:10, Bruce Evans wrote: > >> ... > >> [...] > > With another hat on, I lecture about the error of using unsigned types > except in emergency.  int32_t time_t rollover in 2038 is getting a bit > closer to an emergency.  Even for variables and types that were > misdesigned to be unsigned, it is easy to forget this and use them in > things like delta-calculations which require signed types. > > Bruce > In freebsd, only i386 and powerpc32 use 32-bit time_t.  So we have 21 years left to wither-away all use of those 32-bit arches. :) With laptops and other portable devices increasingly being built around arm chips, and powerpc32 being relegated mostly to special purpose embedded systems, it may just happen naturally.  (As someone who builds special purpose embedded systems related to timekeeping, it probably won't be as easy or natural for me.) -- Ian From owner-svn-src-head@freebsd.org Fri Apr 21 14:50:30 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A8874D48182; Fri, 21 Apr 2017 14:50:30 +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 mx1.freebsd.org (Postfix) with ESMTPS id 6B74A18D5; Fri, 21 Apr 2017 14:50:30 +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 v3LEoTEK039854; Fri, 21 Apr 2017 14:50:29 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3LEoTIl039851; Fri, 21 Apr 2017 14:50:29 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201704211450.v3LEoTIl039851@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 21 Apr 2017 14:50:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317255 - in head: share/man/man5 share/mk tools/build/options X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 21 Apr 2017 14:50:30 -0000 Author: emaste Date: Fri Apr 21 14:50:29 2017 New Revision: 317255 URL: https://svnweb.freebsd.org/changeset/base/317255 Log: bsdgrep: disable GNU_GREP_COMPAT by default The GNU extension bits in the base system are old, no longer faithful to upstream, and surprising in some regards. Switch to documenting WITH_GNU_GREP_COMPAT and default GNU_GREP_COMPAT to OFF in the name of good behavior. According to http://www.regular-expressions.info, GNU extensions: - Add missing quantifiers to BREs: \?, \+ - Add branching to BREs: \| - Add backreferences (\1 through \9) to EREs - Add \w, \W, \s, and \S corresponding to :alnum:, [^[:alnum:]], :space:, and [^[:space:]] respectively - Add word boundaries and anchors: \b: word boundary \B: not word boundary \<: Strt of word \>: End of word \`: Start of subject string \': End of subject string These extensions are still available in /usr/bin/grep by default today, as it is still GNU grep. As part of the bsdgrep migration plan these extensions may be added to bsdgrep's regex support if necessary. Submitted by: Kyle Evans Reviewed by: cem Differential Revision: https://reviews.freebsd.org/D10114 Added: head/tools/build/options/WITH_GNU_GREP_COMPAT (contents, props changed) Modified: head/share/man/man5/src.conf.5 head/share/mk/src.opts.mk Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Fri Apr 21 14:36:09 2017 (r317254) +++ head/share/man/man5/src.conf.5 Fri Apr 21 14:50:29 2017 (r317255) @@ -732,9 +732,10 @@ and .It Va WITHOUT_GNU_GREP Set to not build GNU .Xr grep 1 . -.It Va WITHOUT_GNU_GREP_COMPAT -Set this option to omit the gnu extensions to grep from being included in -BSD grep. +.It Va WITH_GNU_GREP_COMPAT +Set this option to include GNU extensions in +.Xr bsdgrep 1 +by linking against libgnuregex. .It Va WITHOUT_GPIO Set to not build .Xr gpioctl 8 Modified: head/share/mk/src.opts.mk ============================================================================== --- head/share/mk/src.opts.mk Fri Apr 21 14:36:09 2017 (r317254) +++ head/share/mk/src.opts.mk Fri Apr 21 14:50:29 2017 (r317255) @@ -99,7 +99,6 @@ __DEFAULT_YES_OPTIONS = \ GCOV \ GNU_DIFF \ GNU_GREP \ - GNU_GREP_COMPAT \ GPIO \ GPL_DTC \ GROFF \ @@ -181,6 +180,7 @@ __DEFAULT_NO_OPTIONS = \ BSD_GREP \ CLANG_EXTRAS \ DTRACE_TESTS \ + GNU_GREP_COMPAT \ HESIOD \ LIBSOFT \ NAND \ Added: head/tools/build/options/WITH_GNU_GREP_COMPAT ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITH_GNU_GREP_COMPAT Fri Apr 21 14:50:29 2017 (r317255) @@ -0,0 +1,4 @@ +.\" $FreeBSD$ +Set this option to include GNU extensions in +.Xr bsdgrep 1 +by linking against libgnuregex. From owner-svn-src-head@freebsd.org Fri Apr 21 15:12:44 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E28C0D488EB; Fri, 21 Apr 2017 15:12:44 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9BC68A63; Fri, 21 Apr 2017 15:12:44 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3LFChuv052102; Fri, 21 Apr 2017 15:12:43 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3LFChXG052101; Fri, 21 Apr 2017 15:12:43 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201704211512.v3LFChXG052101@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Fri, 21 Apr 2017 15:12:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317256 - head/sys/dev/syscons X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 21 Apr 2017 15:12:45 -0000 Author: bde Date: Fri Apr 21 15:12:43 2017 New Revision: 317256 URL: https://svnweb.freebsd.org/changeset/base/317256 Log: Merge the main ega drawing method into the main vga planar method and remove the former. All other EGA/VGA methods were already shared, with VGA-only features mostly not used and no decisions in inner loops to optimize fof VGA, but this method was split up because it is the only important one and using VGA methods if possible is about twice as fast. The speed is mostly not from splitting to reduce branches but from doing half as many bus accesses, so make this easier to maintain by not splitting. There is now 1 extra branch in an inner loop where it costs less than 1% of the bus access overhead on Haswell even if the compiler schedules it poorly. Modified: head/sys/dev/syscons/scvgarndr.c Modified: head/sys/dev/syscons/scvgarndr.c ============================================================================== --- head/sys/dev/syscons/scvgarndr.c Fri Apr 21 14:50:29 2017 (r317255) +++ head/sys/dev/syscons/scvgarndr.c Fri Apr 21 15:12:43 2017 (r317256) @@ -71,7 +71,6 @@ static vr_clear_t vga_pxlclear_direct; static vr_clear_t vga_pxlclear_planar; static vr_draw_border_t vga_pxlborder_direct; static vr_draw_border_t vga_pxlborder_planar; -static vr_draw_t vga_egadraw; static vr_draw_t vga_vgadraw_direct; static vr_draw_t vga_vgadraw_planar; static vr_set_cursor_t vga_pxlcursor_shape; @@ -524,10 +523,7 @@ vga_rndrinit(scr_stat *scp) if (scp->sc->adp->va_info.vi_mem_model == V_INFO_MM_PLANAR) { scp->rndr->clear = vga_pxlclear_planar; scp->rndr->draw_border = vga_pxlborder_planar; - if (scp->sc->adp->va_type == KD_VGA) - scp->rndr->draw = vga_vgadraw_planar; - else - scp->rndr->draw = vga_egadraw; + scp->rndr->draw = vga_vgadraw_planar; scp->rndr->draw_cursor = vga_pxlcursor_planar; scp->rndr->blink_cursor = vga_pxlblink_planar; scp->rndr->draw_mouse = vga_pxlmouse_planar; @@ -684,64 +680,6 @@ vga_pxlborder_planar(scr_stat *scp, int outw(GDCIDX, 0x0001); /* set/reset enable */ } -static void -vga_egadraw(scr_stat *scp, int from, int count, int flip) -{ - vm_offset_t d; - vm_offset_t e; - u_char *f; - u_short bg; - u_short col1, col2; - int line_width; - int i, j; - int a; - u_char c; - - line_width = scp->sc->adp->va_line_width; - - d = GET_PIXEL(scp, from, 1, line_width); - - outw(GDCIDX, 0x0005); /* read mode 0, write mode 0 */ - outw(GDCIDX, 0x0003); /* data rotate/function select */ - outw(GDCIDX, 0x0f01); /* set/reset enable */ - bg = -1; - if (from + count > scp->xsize*scp->ysize) - count = scp->xsize*scp->ysize - from; - for (i = from; count-- > 0; ++i) { - a = sc_vtb_geta(&scp->vtb, i); - if (flip) { - col1 = ((a & 0x7000) >> 4) | (a & 0x0800); - col2 = ((a & 0x8000) >> 4) | (a & 0x0700); - } else { - col1 = (a & 0x0f00); - col2 = (a & 0xf000) >> 4; - } - /* set background color in EGA/VGA latch */ - if (bg != col2) { - bg = col2; - outw(GDCIDX, bg | 0x00); /* set/reset */ - outw(GDCIDX, 0xff08); /* bit mask */ - writeb(d, 0); - c = readb(d); /* set bg color in the latch */ - } - /* foreground color */ - outw(GDCIDX, col1 | 0x00); /* set/reset */ - e = d; - f = &(scp->font[sc_vtb_getc(&scp->vtb, i)*scp->font_size]); - for (j = 0; j < scp->font_size; ++j, ++f) { - outw(GDCIDX, (*f << 8) | 0x08); /* bit mask */ - writeb(e, 0); - e += line_width; - } - ++d; - if ((i % scp->xsize) == scp->xsize - 1) - d += scp->font_size * line_width - scp->xsize; - } - outw(GDCIDX, 0x0000); /* set/reset */ - outw(GDCIDX, 0x0001); /* set/reset enable */ - outw(GDCIDX, 0xff08); /* bit mask */ -} - static void vga_vgadraw_direct(scr_stat *scp, int from, int count, int flip) { @@ -809,10 +747,13 @@ vga_vgadraw_planar(scr_stat *scp, int fr d = GET_PIXEL(scp, from, 1, line_width); - outw(GDCIDX, 0x0305); /* read mode 0, write mode 3 */ + if (scp->sc->adp->va_type == KD_VGA) { + outw(GDCIDX, 0x0305); /* read mode 0, write mode 3 */ + outw(GDCIDX, 0xff08); /* bit mask */ + } else + outw(GDCIDX, 0x0005); /* read mode 0, write mode 0 */ outw(GDCIDX, 0x0003); /* data rotate/function select */ outw(GDCIDX, 0x0f01); /* set/reset enable */ - outw(GDCIDX, 0xff08); /* bit mask */ bg = -1; if (from + count > scp->xsize*scp->ysize) count = scp->xsize*scp->ysize - from; @@ -829,6 +770,8 @@ vga_vgadraw_planar(scr_stat *scp, int fr if (bg != col2) { bg = col2; outw(GDCIDX, bg | 0x00); /* set/reset */ + if (scp->sc->adp->va_type != KD_VGA) + outw(GDCIDX, 0xff08); /* bit mask */ writeb(d, 0xff); c = readb(d); /* set bg color in the latch */ } @@ -837,14 +780,22 @@ vga_vgadraw_planar(scr_stat *scp, int fr e = d; f = &(scp->font[sc_vtb_getc(&scp->vtb, i)*scp->font_size]); for (j = 0; j < scp->font_size; ++j, ++f) { - writeb(e, *f); + if (scp->sc->adp->va_type == KD_VGA) + writeb(e, *f); + else { + outw(GDCIDX, (*f << 8) | 0x08); /* bit mask */ + writeb(e, 0); + } e += line_width; } ++d; if ((i % scp->xsize) == scp->xsize - 1) d += scp->font_size * line_width - scp->xsize; } - outw(GDCIDX, 0x0005); /* read mode 0, write mode 0 */ + if (scp->sc->adp->va_type == KD_VGA) + outw(GDCIDX, 0x0005); /* read mode 0, write mode 0 */ + else + outw(GDCIDX, 0xff08); /* bit mask */ outw(GDCIDX, 0x0000); /* set/reset */ outw(GDCIDX, 0x0001); /* set/reset enable */ } From owner-svn-src-head@freebsd.org Fri Apr 21 15:15:34 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 86DA0D4897B; Fri, 21 Apr 2017 15:15:34 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: from mail-qk0-x22c.google.com (mail-qk0-x22c.google.com [IPv6:2607:f8b0:400d:c09::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3E8BAC0B; Fri, 21 Apr 2017 15:15:34 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: by mail-qk0-x22c.google.com with SMTP id y63so44062137qkd.1; Fri, 21 Apr 2017 08:15:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=4VAH0G2/GkNQ9vdkxRJf4mzykPiFaY0li5XbbuVE2E0=; b=IqV04+O7k8mwm9pkD53uz47LQVjrYNl66qojO6Fhdh3LIJxg4T+9ijDGyzeF44/C2K Y4fDx38SNKJZQPCT85ISZG/+aUg7OmUJLVANjpIRwpBLduc/MumYGNVSYkHkOjJda4x6 kU995+h4lOs6s87erhN/r/QfX/XfdLrEYfhJ5wMJqzpTQOunwASUgQ12djZguqcLAYZs zwC8ykdrQRhW2N9ly+7+Z9ZJ2HosXo4pklFjMFdWzPpDte0h17toLNvKU0IXoMUVrni7 YqrQn2GCTWgLLHnIaQ9zuwCBDyaIZXJ4FIw5tkpOgmuXjzuYd55bmL8Pj6gr8fXWiWQj TVKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=4VAH0G2/GkNQ9vdkxRJf4mzykPiFaY0li5XbbuVE2E0=; b=D0bHTNp9sRAmiZ1sa6beoKgCBzAICM3rGoUU0DuNTYo6xL34qvpwwEVtS2r+rSh8HK dhyYBThHDF0ckvLR6AnEAOU+madgANm2Ku98W3yOTnr5qvcCNS6R4ThyDtDoWViq/+v+ K0a65mmYWE8UMrVGkVGaYuto3yunJHqYkpcH0c6EpjZTw8uT9BoWwGlwcgFKL5A5ov/f K/wAJgW3KbXiF+ro+u5+arv9HsGeZd0P8zp1b/oNstN+sDQD0+FohfraOkguv9NjzQPE YlASpCxxPf9nVJvwwFVrnb+78gtVCBn9OU9oLt47uUfOiXl/duPxfOz02OEJF7+H6MnE DKPg== X-Gm-Message-State: AN3rC/5HP66D882XJzoxLdWLjKvwivawqKCQ6f1mqDyj6xOmQFXXaojs jnjFMzarPQQVoO9nlujh7tApmBPgvQ== X-Received: by 10.55.168.9 with SMTP id r9mr14484813qke.239.1492787733345; Fri, 21 Apr 2017 08:15:33 -0700 (PDT) MIME-Version: 1.0 Sender: chmeeedalf@gmail.com Received: by 10.12.178.219 with HTTP; Fri, 21 Apr 2017 08:15:32 -0700 (PDT) In-Reply-To: <1492785557.56859.9.camel@freebsd.org> References: <201704210143.v3L1h99s037727@slippy.cwsent.com> <20170421131041.G966@besplex.bde.org> <8BBC38A0-DDBA-4C04-9654-98755B3E4E13@freebsd.org> <20170421173453.J1735@besplex.bde.org> <1920616c-1993-07d5-4855-73264dce0980@selasky.org> <20170421211348.I2311@besplex.bde.org> <1492785557.56859.9.camel@freebsd.org> From: Justin Hibbits Date: Fri, 21 Apr 2017 10:15:32 -0500 X-Google-Sender-Auth: BnExYivl89LvipkeZqRke8HIYcA Message-ID: Subject: Re: svn commit: r317208 - head/sys/netinet To: Ian Lepore Cc: Bruce Evans , Hans Petter Selasky , Michael Tuexen , Cy Schubert , src-committers , "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.23 Precedence: list List-Id: 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, 21 Apr 2017 15:15:34 -0000 On Fri, Apr 21, 2017 at 9:39 AM, Ian Lepore wrote: > On Fri, 2017-04-21 at 21:53 +1000, Bruce Evans wrote: >> On Fri, 21 Apr 2017, Hans Petter Selasky wrote: >> >> > On 04/21/17 10:10, Bruce Evans wrote: >> >> ... >> >> [...] >> >> With another hat on, I lecture about the error of using unsigned types >> except in emergency. int32_t time_t rollover in 2038 is getting a bit >> closer to an emergency. Even for variables and types that were >> misdesigned to be unsigned, it is easy to forget this and use them in >> things like delta-calculations which require signed types. >> >> Bruce >> > > In freebsd, only i386 and powerpc32 use 32-bit time_t. So we have 21 > years left to wither-away all use of those 32-bit arches. :) > Talking with kib yesterday I intend to move powerpc/powerpc{,spe} to 64-bit time_t for 12, unless there are any objections (will start the bikeshed sometime in the next few months). Since it's Tier-2 I don't have to worry too much about compatibility (but will make some token effort). - Justin From owner-svn-src-head@freebsd.org Fri Apr 21 17:57:25 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4F84FD4997F; Fri, 21 Apr 2017 17:57:25 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1C81A86B; Fri, 21 Apr 2017 17:57:25 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3LHvOiv019418; Fri, 21 Apr 2017 17:57:24 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3LHvOj3019417; Fri, 21 Apr 2017 17:57:24 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201704211757.v3LHvOj3019417@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Fri, 21 Apr 2017 17:57:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317264 - head/sys/dev/syscons X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 21 Apr 2017 17:57:25 -0000 Author: bde Date: Fri Apr 21 17:57:23 2017 New Revision: 317264 URL: https://svnweb.freebsd.org/changeset/base/317264 Log: Optimize setting of the foreground color in the main planar method much like for the background color. This is a about 5% faster for output that actually reaches the screen. Modified: head/sys/dev/syscons/scvgarndr.c Modified: head/sys/dev/syscons/scvgarndr.c ============================================================================== --- head/sys/dev/syscons/scvgarndr.c Fri Apr 21 17:42:48 2017 (r317263) +++ head/sys/dev/syscons/scvgarndr.c Fri Apr 21 17:57:23 2017 (r317264) @@ -736,7 +736,7 @@ vga_vgadraw_planar(scr_stat *scp, int fr vm_offset_t d; vm_offset_t e; u_char *f; - u_short bg; + u_short bg, fg; u_short col1, col2; int line_width; int i, j; @@ -754,7 +754,7 @@ vga_vgadraw_planar(scr_stat *scp, int fr outw(GDCIDX, 0x0005); /* read mode 0, write mode 0 */ outw(GDCIDX, 0x0003); /* data rotate/function select */ outw(GDCIDX, 0x0f01); /* set/reset enable */ - bg = -1; + fg = bg = -1; if (from + count > scp->xsize*scp->ysize) count = scp->xsize*scp->ysize - from; for (i = from; count-- > 0; ++i) { @@ -769,6 +769,7 @@ vga_vgadraw_planar(scr_stat *scp, int fr /* set background color in EGA/VGA latch */ if (bg != col2) { bg = col2; + fg = -1; outw(GDCIDX, bg | 0x00); /* set/reset */ if (scp->sc->adp->va_type != KD_VGA) outw(GDCIDX, 0xff08); /* bit mask */ @@ -776,7 +777,10 @@ vga_vgadraw_planar(scr_stat *scp, int fr c = readb(d); /* set bg color in the latch */ } /* foreground color */ - outw(GDCIDX, col1 | 0x00); /* set/reset */ + if (fg != col1) { + fg = col1; + outw(GDCIDX, col1 | 0x00); /* set/reset */ + } e = d; f = &(scp->font[sc_vtb_getc(&scp->vtb, i)*scp->font_size]); for (j = 0; j < scp->font_size; ++j, ++f) { From owner-svn-src-head@freebsd.org Fri Apr 21 19:27:35 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9957FD498B1; Fri, 21 Apr 2017 19:27:35 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 74A20177; Fri, 21 Apr 2017 19:27:35 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3LJRYOO058187; Fri, 21 Apr 2017 19:27:34 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3LJRYHj058182; Fri, 21 Apr 2017 19:27:34 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201704211927.v3LJRYHj058182@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 21 Apr 2017 19:27:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317265 - in head/lib: libgssapi libiconv_modules/ISO2022 libutil X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 21 Apr 2017 19:27:35 -0000 Author: pfg Date: Fri Apr 21 19:27:33 2017 New Revision: 317265 URL: https://svnweb.freebsd.org/changeset/base/317265 Log: lib: initial use of reallocarray(3). Make some use of reallocarray, attempting to limit it to cases where the parameters are unsigned and there is some theoretical chance of overflow. MFC afer: 2 weeks Differential Revision: https://reviews.freebsd.org/D9980 Modified: head/lib/libgssapi/gss_buffer_set.c head/lib/libiconv_modules/ISO2022/citrus_iso2022.c head/lib/libutil/gr_util.c head/lib/libutil/login_cap.c head/lib/libutil/pw_util.c Modified: head/lib/libgssapi/gss_buffer_set.c ============================================================================== --- head/lib/libgssapi/gss_buffer_set.c Fri Apr 21 17:57:23 2017 (r317264) +++ head/lib/libgssapi/gss_buffer_set.c Fri Apr 21 19:27:33 2017 (r317265) @@ -76,8 +76,8 @@ gss_add_buffer_set_member(OM_uint32 * mi } set = *buffer_set; - set->elements = realloc(set->elements, - (set->count + 1) * sizeof(set->elements[0])); + set->elements = reallocarray(set->elements, set->count + 1, + sizeof(set->elements[0])); if (set->elements == NULL) { *minor_status = ENOMEM; return (GSS_S_FAILURE); Modified: head/lib/libiconv_modules/ISO2022/citrus_iso2022.c ============================================================================== --- head/lib/libiconv_modules/ISO2022/citrus_iso2022.c Fri Apr 21 17:57:23 2017 (r317264) +++ head/lib/libiconv_modules/ISO2022/citrus_iso2022.c Fri Apr 21 19:27:33 2017 (r317265) @@ -259,8 +259,8 @@ get_recommend(_ISO2022EncodingInfo * __r if (!ei->recommend[i]) ei->recommend[i] = malloc(sizeof(_ISO2022Charset)); else { - p = realloc(ei->recommend[i], - sizeof(_ISO2022Charset) * (ei->recommendsize[i] + 1)); + p = reallocarray(ei->recommend[i], ei->recommendsize[i] + 1, + sizeof(_ISO2022Charset)); if (!p) return (_PARSEFAIL); ei->recommend[i] = p; Modified: head/lib/libutil/gr_util.c ============================================================================== --- head/lib/libutil/gr_util.c Fri Apr 21 17:57:23 2017 (r317264) +++ head/lib/libutil/gr_util.c Fri Apr 21 19:27:33 2017 (r317265) @@ -205,7 +205,7 @@ gr_copy(int ffd, int tfd, const struct g if (eof) break; while ((size_t)(q - p) >= size) { - if ((tmp = realloc(buf, size * 2)) == NULL) { + if ((tmp = reallocarray(buf, 2, size)) == NULL) { warnx("group line too long"); goto err; } Modified: head/lib/libutil/login_cap.c ============================================================================== --- head/lib/libutil/login_cap.c Fri Apr 21 17:57:23 2017 (r317264) +++ head/lib/libutil/login_cap.c Fri Apr 21 19:27:33 2017 (r317265) @@ -86,7 +86,7 @@ allocarray(size_t sz) if (sz <= internal_arraysz) p = internal_array; - else if ((p = realloc(internal_array, sz * sizeof(char*))) != NULL) { + else if ((p = reallocarray(internal_array, sz, sizeof(char*))) != NULL) { internal_arraysz = sz; internal_array = p; } Modified: head/lib/libutil/pw_util.c ============================================================================== --- head/lib/libutil/pw_util.c Fri Apr 21 17:57:23 2017 (r317264) +++ head/lib/libutil/pw_util.c Fri Apr 21 19:27:33 2017 (r317265) @@ -468,7 +468,7 @@ pw_copy(int ffd, int tfd, const struct p if (eof) break; while ((size_t)(q - p) >= size) { - if ((tmp = realloc(buf, size * 2)) == NULL) { + if ((tmp = reallocarray(buf, 2, size)) == NULL) { warnx("passwd line too long"); goto err; } From owner-svn-src-head@freebsd.org Fri Apr 21 19:53:54 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8871FD49258; Fri, 21 Apr 2017 19:53:54 +0000 (UTC) (envelope-from jpaetzel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5227FC25; Fri, 21 Apr 2017 19:53:54 +0000 (UTC) (envelope-from jpaetzel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3LJrrif070840; Fri, 21 Apr 2017 19:53:53 GMT (envelope-from jpaetzel@FreeBSD.org) Received: (from jpaetzel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3LJrqRH070833; Fri, 21 Apr 2017 19:53:52 GMT (envelope-from jpaetzel@FreeBSD.org) Message-Id: <201704211953.v3LJrqRH070833@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jpaetzel set sender to jpaetzel@FreeBSD.org using -f From: Josh Paetzel Date: Fri, 21 Apr 2017 19:53:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317267 - in head: cddl/contrib/opensolaris/cmd/zfs cddl/contrib/opensolaris/lib/libzfs/common sys/cddl/contrib/opensolaris/common/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 21 Apr 2017 19:53:54 -0000 Author: jpaetzel Date: Fri Apr 21 19:53:52 2017 New Revision: 317267 URL: https://svnweb.freebsd.org/changeset/base/317267 Log: MFV 316891 7386 zfs get does not work properly with bookmarks illumos/illumos-gate@edb901aab9c738b5eb15aa55933e82b0f2f9d9a2 https://github.com/illumos/illumos-gate/commit/edb901aab9c738b5eb15aa55933e82b0f2f9d9a2 https://www.illumos.org/issues/7386 The zfs get command does not work with the bookmark parameter while it works properly with both filesystem and snapshot: # zfs get -t all -r creation rpool/test NAME PROPERTY VALUE SOURCE rpool/test creation Fri Sep 16 15:00 2016 - rpool/test@snap creation Fri Sep 16 15:00 2016 - rpool/test#bkmark creation Fri Sep 16 15:00 2016 - # zfs get -t all -r creation rpool/test@snap NAME PROPERTY VALUE SOURCE rpool/test@snap creation Fri Sep 16 15:00 2016 - # zfs get -t all -r creation rpool/test#bkmark cannot open 'rpool/test#bkmark': invalid dataset name # The zfs get command should be modified to work properly with bookmarks too. Reviewed by: Simon Klinkert Reviewed by: Paul Dagnelie Approved by: Matthew Ahrens Author: Marcel Telka Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_util.c head/sys/cddl/contrib/opensolaris/common/zfs/zfs_namecheck.c head/sys/cddl/contrib/opensolaris/common/zfs/zfs_namecheck.h Directory Properties: head/cddl/contrib/opensolaris/ (props changed) head/cddl/contrib/opensolaris/cmd/zfs/ (props changed) head/cddl/contrib/opensolaris/lib/libzfs/ (props changed) head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Fri Apr 21 19:41:33 2017 (r317266) +++ head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Fri Apr 21 19:53:52 2017 (r317267) @@ -25,13 +25,13 @@ .\" Copyright (c) 2013 by Saso Kiselkov. All rights reserved. .\" Copyright (c) 2014, Joyent, Inc. All rights reserved. .\" Copyright (c) 2013, Steven Hartland -.\" Copyright (c) 2014 Nexenta Systems, Inc. All Rights Reserved. +.\" Copyright (c) 2016 Nexenta Systems, Inc. All Rights Reserved. .\" Copyright (c) 2014, Xin LI .\" Copyright (c) 2014-2015, The FreeBSD Foundation, All Rights Reserved. .\" .\" $FreeBSD$ .\" -.Dd May 31, 2016 +.Dd September 16, 2016 .Dt ZFS 8 .Os .Sh NAME @@ -114,7 +114,7 @@ .Op Fl t Ar type Ns Oo , Ns type Ns Oc Ns ... .Oo Fl s Ar property Oc Ns ... .Oo Fl S Ar property Oc Ns ... -.Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot +.Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot | Ns Ar bookmark Ns ... .Nm .Cm set .Ar property Ns = Ns Ar value Oo Ar property Ns = Ns Ar value Oc Ns ... @@ -2156,7 +2156,7 @@ section. .Op Fl t Ar type Ns Oo , Ns Ar type Oc Ns ... .Op Fl s Ar source Ns Oo , Ns Ar source Oc Ns ... .Ar all | property Ns Oo , Ns Ar property Oc Ns ... -.Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot Ns ... +.Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot Ns | Ns Ar bookmark Ns ... .Xc .Pp Displays properties for the given datasets. If no datasets are specified, then Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Fri Apr 21 19:41:33 2017 (r317266) +++ head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Fri Apr 21 19:53:52 2017 (r317267) @@ -243,7 +243,7 @@ get_usage(zfs_help_t idx) "[-o \"all\" | field[,...]]\n" "\t [-t type[,...]] [-s source[,...]]\n" "\t <\"all\" | property[,...]> " - "[filesystem|volume|snapshot] ...\n")); + "[filesystem|volume|snapshot|bookmark] ...\n")); case HELP_INHERIT: return (gettext("\tinherit [-rS] " " ...\n")); @@ -1622,7 +1622,7 @@ zfs_do_get(int argc, char **argv) { zprop_get_cbdata_t cb = { 0 }; int i, c, flags = ZFS_ITER_ARGS_CAN_BE_PATHS; - int types = ZFS_TYPE_DATASET; + int types = ZFS_TYPE_DATASET | ZFS_TYPE_BOOKMARK; char *value, *fields; int ret = 0; int limit = 0; Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Fri Apr 21 19:41:33 2017 (r317266) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Fri Apr 21 19:53:52 2017 (r317267) @@ -103,7 +103,7 @@ zfs_validate_name(libzfs_handle_t *hdl, char what; (void) zfs_prop_get_table(); - if (dataset_namecheck(path, &why, &what) != 0) { + if (entity_namecheck(path, &why, &what) != 0) { if (hdl != NULL) { switch (why) { case NAME_ERR_TOOLONG: @@ -132,9 +132,10 @@ zfs_validate_name(libzfs_handle_t *hdl, "'%c' in name"), what); break; - case NAME_ERR_MULTIPLE_AT: + case NAME_ERR_MULTIPLE_DELIMITERS: zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, - "multiple '@' delimiters in name")); + "multiple '@' and/or '#' delimiters in " + "name")); break; case NAME_ERR_NOLETTER: @@ -165,7 +166,7 @@ zfs_validate_name(libzfs_handle_t *hdl, if (!(type & ZFS_TYPE_SNAPSHOT) && strchr(path, '@') != NULL) { if (hdl != NULL) zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, - "snapshot delimiter '@' in filesystem name")); + "snapshot delimiter '@' is not expected here")); return (0); } @@ -176,6 +177,20 @@ zfs_validate_name(libzfs_handle_t *hdl, return (0); } + if (!(type & ZFS_TYPE_BOOKMARK) && strchr(path, '#') != NULL) { + if (hdl != NULL) + zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, + "bookmark delimiter '#' is not expected here")); + return (0); + } + + if (type == ZFS_TYPE_BOOKMARK && strchr(path, '#') == NULL) { + if (hdl != NULL) + zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, + "missing '#' delimiter in bookmark name")); + return (0); + } + if (modifying && strchr(path, '%') != NULL) { if (hdl != NULL) zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, @@ -613,8 +628,36 @@ make_bookmark_handle(zfs_handle_t *paren return (zhp); } +struct zfs_open_bookmarks_cb_data { + const char *path; + zfs_handle_t *zhp; +}; + +static int +zfs_open_bookmarks_cb(zfs_handle_t *zhp, void *data) +{ + struct zfs_open_bookmarks_cb_data *dp = data; + + /* + * Is it the one we are looking for? + */ + if (strcmp(dp->path, zfs_get_name(zhp)) == 0) { + /* + * We found it. Save it and let the caller know we are done. + */ + dp->zhp = zhp; + return (EEXIST); + } + + /* + * Not found. Close the handle and ask for another one. + */ + zfs_close(zhp); + return (0); +} + /* - * Opens the given snapshot, filesystem, or volume. The 'types' + * Opens the given snapshot, bookmark, filesystem, or volume. The 'types' * argument is a mask of acceptable types. The function will print an * appropriate error message and return NULL if it can't be opened. */ @@ -623,6 +666,7 @@ zfs_open(libzfs_handle_t *hdl, const cha { zfs_handle_t *zhp; char errbuf[1024]; + char *bookp; (void) snprintf(errbuf, sizeof (errbuf), dgettext(TEXT_DOMAIN, "cannot open '%s'"), path); @@ -630,20 +674,68 @@ zfs_open(libzfs_handle_t *hdl, const cha /* * Validate the name before we even try to open it. */ - if (!zfs_validate_name(hdl, path, ZFS_TYPE_DATASET, B_FALSE)) { - zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, - "invalid dataset name")); + if (!zfs_validate_name(hdl, path, types, B_FALSE)) { (void) zfs_error(hdl, EZFS_INVALIDNAME, errbuf); return (NULL); } /* - * Try to get stats for the dataset, which will tell us if it exists. + * Bookmarks needs to be handled separately. */ - errno = 0; - if ((zhp = make_dataset_handle(hdl, path)) == NULL) { - (void) zfs_standard_error(hdl, errno, errbuf); - return (NULL); + bookp = strchr(path, '#'); + if (bookp == NULL) { + /* + * Try to get stats for the dataset, which will tell us if it + * exists. + */ + errno = 0; + if ((zhp = make_dataset_handle(hdl, path)) == NULL) { + (void) zfs_standard_error(hdl, errno, errbuf); + return (NULL); + } + } else { + char dsname[ZFS_MAX_DATASET_NAME_LEN]; + zfs_handle_t *pzhp; + struct zfs_open_bookmarks_cb_data cb_data = {path, NULL}; + + /* + * We need to cut out '#' and everything after '#' + * to get the parent dataset name only. + */ + assert(bookp - path < sizeof (dsname)); + (void) strncpy(dsname, path, bookp - path); + dsname[bookp - path] = '\0'; + + /* + * Create handle for the parent dataset. + */ + errno = 0; + if ((pzhp = make_dataset_handle(hdl, dsname)) == NULL) { + (void) zfs_standard_error(hdl, errno, errbuf); + return (NULL); + } + + /* + * Iterate bookmarks to find the right one. + */ + errno = 0; + if ((zfs_iter_bookmarks(pzhp, zfs_open_bookmarks_cb, + &cb_data) == 0) && (cb_data.zhp == NULL)) { + (void) zfs_error(hdl, EZFS_NOENT, errbuf); + zfs_close(pzhp); + return (NULL); + } + if (cb_data.zhp == NULL) { + (void) zfs_standard_error(hdl, errno, errbuf); + zfs_close(pzhp); + return (NULL); + } + zhp = cb_data.zhp; + + /* + * Cleanup. + */ + zfs_close(pzhp); } if (zhp == NULL) { Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Fri Apr 21 19:41:33 2017 (r317266) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Fri Apr 21 19:53:52 2017 (r317267) @@ -947,9 +947,10 @@ zpool_name_valid(libzfs_handle_t *hdl, b "trailing slash in name")); break; - case NAME_ERR_MULTIPLE_AT: + case NAME_ERR_MULTIPLE_DELIMITERS: zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, - "multiple '@' delimiters in name")); + "multiple '@' and/or '#' delimiters in " + "name")); break; default: Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_util.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_util.c Fri Apr 21 19:41:33 2017 (r317266) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_util.c Fri Apr 21 19:53:52 2017 (r317267) @@ -718,7 +718,7 @@ zfs_get_pool_handle(const zfs_handle_t * * Given a name, determine whether or not it's a valid path * (starts with '/' or "./"). If so, walk the mnttab trying * to match the device number. If not, treat the path as an - * fs/vol/snap name. + * fs/vol/snap/bkmark name. */ zfs_handle_t * zfs_path_to_zhandle(libzfs_handle_t *hdl, char *path, zfs_type_t argtype) Modified: head/sys/cddl/contrib/opensolaris/common/zfs/zfs_namecheck.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/common/zfs/zfs_namecheck.c Fri Apr 21 19:41:33 2017 (r317266) +++ head/sys/cddl/contrib/opensolaris/common/zfs/zfs_namecheck.c Fri Apr 21 19:53:52 2017 (r317267) @@ -120,9 +120,9 @@ permset_namecheck(const char *path, name } /* - * Dataset names must be of the following form: + * Entity names must be of the following form: * - * [component][/]*[component][@component] + * [component/]*[component][(@|#)component]? * * Where each component is made up of alphanumeric characters plus the following * characters: @@ -133,10 +133,10 @@ permset_namecheck(const char *path, name * names for temporary clones (for online recv). */ int -dataset_namecheck(const char *path, namecheck_err_t *why, char *what) +entity_namecheck(const char *path, namecheck_err_t *why, char *what) { - const char *loc, *end; - int found_snapshot; + const char *start, *end; + int found_delim; /* * Make sure the name is not too long. @@ -161,12 +161,13 @@ dataset_namecheck(const char *path, name return (-1); } - loc = path; - found_snapshot = 0; + start = path; + found_delim = 0; for (;;) { /* Find the end of this component */ - end = loc; - while (*end != '/' && *end != '@' && *end != '\0') + end = start; + while (*end != '/' && *end != '@' && *end != '#' && + *end != '\0') end++; if (*end == '\0' && end[-1] == '/') { @@ -176,25 +177,8 @@ dataset_namecheck(const char *path, name return (-1); } - /* Zero-length components are not allowed */ - if (loc == end) { - if (why) { - /* - * Make sure this is really a zero-length - * component and not a '@@'. - */ - if (*end == '@' && found_snapshot) { - *why = NAME_ERR_MULTIPLE_AT; - } else { - *why = NAME_ERR_EMPTY_COMPONENT; - } - } - - return (-1); - } - /* Validate the contents of this component */ - while (loc != end) { + for (const char *loc = start; loc != end; loc++) { if (!valid_char(*loc) && *loc != '%') { if (why) { *why = NAME_ERR_INVALCHAR; @@ -202,43 +186,64 @@ dataset_namecheck(const char *path, name } return (-1); } - loc++; } - /* If we've reached the end of the string, we're OK */ - if (*end == '\0') - return (0); - - if (*end == '@') { - /* - * If we've found an @ symbol, indicate that we're in - * the snapshot component, and report a second '@' - * character as an error. - */ - if (found_snapshot) { + /* Snapshot or bookmark delimiter found */ + if (*end == '@' || *end == '#') { + /* Multiple delimiters are not allowed */ + if (found_delim != 0) { if (why) - *why = NAME_ERR_MULTIPLE_AT; + *why = NAME_ERR_MULTIPLE_DELIMITERS; return (-1); } - found_snapshot = 1; + found_delim = 1; + } + + /* Zero-length components are not allowed */ + if (start == end) { + if (why) + *why = NAME_ERR_EMPTY_COMPONENT; + return (-1); } + /* If we've reached the end of the string, we're OK */ + if (*end == '\0') + return (0); + /* - * If there is a '/' in a snapshot name + * If there is a '/' in a snapshot or bookmark name * then report an error */ - if (*end == '/' && found_snapshot) { + if (*end == '/' && found_delim != 0) { if (why) *why = NAME_ERR_TRAILING_SLASH; return (-1); } /* Update to the next component */ - loc = end + 1; + start = end + 1; } } +/* + * Dataset is any entity, except bookmark + */ +int +dataset_namecheck(const char *path, namecheck_err_t *why, char *what) +{ + int ret = entity_namecheck(path, why, what); + + if (ret == 0 && strchr(path, '#') != NULL) { + if (why != NULL) { + *why = NAME_ERR_INVALCHAR; + *what = '#'; + } + return (-1); + } + + return (ret); +} /* * mountpoint names must be of the following form: Modified: head/sys/cddl/contrib/opensolaris/common/zfs/zfs_namecheck.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/common/zfs/zfs_namecheck.h Fri Apr 21 19:41:33 2017 (r317266) +++ head/sys/cddl/contrib/opensolaris/common/zfs/zfs_namecheck.h Fri Apr 21 19:53:52 2017 (r317267) @@ -38,7 +38,7 @@ typedef enum { NAME_ERR_EMPTY_COMPONENT, /* name contains an empty component */ NAME_ERR_TRAILING_SLASH, /* name ends with a slash */ NAME_ERR_INVALCHAR, /* invalid character found */ - NAME_ERR_MULTIPLE_AT, /* multiple '@' characters found */ + NAME_ERR_MULTIPLE_DELIMITERS, /* multiple '@'/'#' delimiters found */ NAME_ERR_NOLETTER, /* pool doesn't begin with a letter */ NAME_ERR_RESERVED, /* entire name is reserved */ NAME_ERR_DISKLIKE, /* reserved disk name (c[0-9].*) */ @@ -49,6 +49,7 @@ typedef enum { #define ZFS_PERMSET_MAXLEN 64 int pool_namecheck(const char *, namecheck_err_t *, char *); +int entity_namecheck(const char *, namecheck_err_t *, char *); int dataset_namecheck(const char *, namecheck_err_t *, char *); int mountpoint_namecheck(const char *, namecheck_err_t *); int zfs_component_namecheck(const char *, namecheck_err_t *, char *); From owner-svn-src-head@freebsd.org Fri Apr 21 20:08:11 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 91D73D496B6; Fri, 21 Apr 2017 20:08:11 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4B3EA67D; Fri, 21 Apr 2017 20:08:11 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3LK8ATl075170; Fri, 21 Apr 2017 20:08:10 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3LK8AVg075168; Fri, 21 Apr 2017 20:08:10 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201704212008.v3LK8AVg075168@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Fri, 21 Apr 2017 20:08:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317269 - in head/sys: fs/nfs sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 21 Apr 2017 20:08:11 -0000 Author: rmacklem Date: Fri Apr 21 20:08:10 2017 New Revision: 317269 URL: https://svnweb.freebsd.org/changeset/base/317269 Log: Set default uid/gid to nobody/nogroup for NFSv4 mapping. The default uid/gid for NFSv4 are set by the nfsuserd(8) daemon. However, they were 0 until the nfsuserd(8) was run. Since it is possible to use NFSv4 without running the nfsuserd(8) daemon, set them to nobody/nogroup initially. Without this patch, the values would be set by the nfsuserd(8) daemon and left changed even if the nfsuserd(8) daemon was killed. The default values of 0 meant that setting a group to "wheel" would fail even when done by root. It also adds a definition of GID_NOGROUP to sys/conf.h. Discussed on: freebsd-current@ MFC after: 2 weeks Modified: head/sys/fs/nfs/nfs_commonsubs.c head/sys/sys/conf.h Modified: head/sys/fs/nfs/nfs_commonsubs.c ============================================================================== --- head/sys/fs/nfs/nfs_commonsubs.c Fri Apr 21 20:03:08 2017 (r317268) +++ head/sys/fs/nfs/nfs_commonsubs.c Fri Apr 21 20:08:10 2017 (r317269) @@ -63,8 +63,8 @@ int nfsrv_useacl = 1; struct nfssockreq nfsrv_nfsuserdsock; int nfsrv_nfsuserd = 0; struct nfsreqhead nfsd_reqq; -uid_t nfsrv_defaultuid; -gid_t nfsrv_defaultgid; +uid_t nfsrv_defaultuid = UID_NOBODY; +gid_t nfsrv_defaultgid = GID_NOGROUP; int nfsrv_lease = NFSRV_LEASE; int ncl_mbuf_mlen = MLEN; int nfsd_enable_stringtouid = 0; Modified: head/sys/sys/conf.h ============================================================================== --- head/sys/sys/conf.h Fri Apr 21 20:03:08 2017 (r317268) +++ head/sys/sys/conf.h Fri Apr 21 20:08:10 2017 (r317269) @@ -315,6 +315,7 @@ void devfs_free_cdp_inode(ino_t ino); #define GID_GAMES 13 #define GID_VIDEO 44 #define GID_DIALER 68 +#define GID_NOGROUP 65533 #define GID_NOBODY 65534 typedef void (*dev_clone_fn)(void *arg, struct ucred *cred, char *name, From owner-svn-src-head@freebsd.org Fri Apr 21 20:53:53 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3752CD497B8; Fri, 21 Apr 2017 20:53:53 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 092AB5DF; Fri, 21 Apr 2017 20:53:52 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3LKrqAS096260; Fri, 21 Apr 2017 20:53:52 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3LKrqVd096259; Fri, 21 Apr 2017 20:53:52 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201704212053.v3LKrqVd096259@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Fri, 21 Apr 2017 20:53:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317270 - head/usr.sbin/nfsuserd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 21 Apr 2017 20:53:53 -0000 Author: rmacklem Date: Fri Apr 21 20:53:51 2017 New Revision: 317270 URL: https://svnweb.freebsd.org/changeset/base/317270 Log: Get rid of bogus statement in the nfsuserd.8 man page. The nfsuserd.8 man page stated that a usertimeout of 0 would disable the cache timeout. This was simply not true, so this patch deletes the sentence. This is a content change. PR: 217406 MFC after: 2 weeks Modified: head/usr.sbin/nfsuserd/nfsuserd.8 Modified: head/usr.sbin/nfsuserd/nfsuserd.8 ============================================================================== --- head/usr.sbin/nfsuserd/nfsuserd.8 Fri Apr 21 20:08:10 2017 (r317269) +++ head/usr.sbin/nfsuserd/nfsuserd.8 Fri Apr 21 20:53:51 2017 (r317270) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 1, 2015 +.Dd April 21, 2017 .Dt NFSUSERD 8 .Os .Sh NAME @@ -64,8 +64,8 @@ if that name is not a fully qualified ho reported by .Xr getaddrinfo 3 . .It Fl usertimeout Ar minutes -Overrides the default timeout for cache entries, in minutes. If the -timeout is specified as 0, cache entries never time out. The longer the +Overrides the default timeout for cache entries, in minutes. +The longer the time out, the better the performance, but the longer it takes for replaced entries to be seen. If your user/group database management system almost never re-uses the same names or id numbers, a large timeout is recommended. From owner-svn-src-head@freebsd.org Fri Apr 21 21:43:02 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1E63CD4964A; Fri, 21 Apr 2017 21:43:02 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E176CF06; Fri, 21 Apr 2017 21:43:01 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3LLh1PA016664; Fri, 21 Apr 2017 21:43:01 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3LLh1bd016663; Fri, 21 Apr 2017 21:43:01 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201704212143.v3LLh1bd016663@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Fri, 21 Apr 2017 21:43:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317272 - head/sys/fs/nfsclient X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 21 Apr 2017 21:43:02 -0000 Author: rmacklem Date: Fri Apr 21 21:43:00 2017 New Revision: 317272 URL: https://svnweb.freebsd.org/changeset/base/317272 Log: Add checks for failed operations to the NFSv4 client function nfscl_mtofh(). The nfscl_mtofh() function didn't check for failed operations and, as such, would have returned EBADRPC for these cases, due to parsing failure. This patch adds checks, so that it returns with ND_NOMOREDATA set. This is needed for future use in the pNFS server and acts as a safety belt in the meantime. MFC after: 2 weeks Modified: head/sys/fs/nfsclient/nfs_clcomsubs.c Modified: head/sys/fs/nfsclient/nfs_clcomsubs.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clcomsubs.c Fri Apr 21 21:06:11 2017 (r317271) +++ head/sys/fs/nfsclient/nfs_clcomsubs.c Fri Apr 21 21:43:00 2017 (r317272) @@ -471,6 +471,11 @@ nfscl_mtofh(struct nfsrv_descript *nd, s flag = fxdr_unsigned(int, *tl); } else if (nd->nd_flag & ND_NFSV4) { NFSM_DISSECT(tl, u_int32_t *, 2 * NFSX_UNSIGNED); + /* If the GetFH failed, clear flag. */ + if (*++tl != 0) { + nd->nd_flag |= ND_NOMOREDATA; + flag = 0; + } } if (flag) { error = nfsm_getfh(nd, nfhpp); @@ -481,8 +486,12 @@ nfscl_mtofh(struct nfsrv_descript *nd, s /* * Now, get the attributes. */ - if (nd->nd_flag & ND_NFSV4) { + if (flag != 0 && (nd->nd_flag & ND_NFSV4) != 0) { NFSM_DISSECT(tl, u_int32_t *, 2 * NFSX_UNSIGNED); + if (*++tl != 0) { + nd->nd_flag |= ND_NOMOREDATA; + flag = 0; + } } else if (nd->nd_flag & ND_NFSV3) { NFSM_DISSECT(tl, u_int32_t *, NFSX_UNSIGNED); if (flag) { From owner-svn-src-head@freebsd.org Fri Apr 21 22:00:23 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B44C1D49908; Fri, 21 Apr 2017 22:00:23 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 865EB15BC; Fri, 21 Apr 2017 22:00:23 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3LM0MuO021011; Fri, 21 Apr 2017 22:00:22 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3LM0M88021010; Fri, 21 Apr 2017 22:00:22 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201704212200.v3LM0M88021010@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Fri, 21 Apr 2017 22:00:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317273 - head/sys/fs/fuse X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 21 Apr 2017 22:00:23 -0000 Author: cem Date: Fri Apr 21 22:00:22 2017 New Revision: 317273 URL: https://svnweb.freebsd.org/changeset/base/317273 Log: fuse: Implement FOPEN_KEEP_CACHE flag Implement FUSE open flag FOPEN_KEEP_CACHE. Without this flag, cached file contents should be invalidated on open. Apparently, fusefs-encfs relies upon this behavior. PR: 218636 Submitted by: Ben RUBSON Modified: head/sys/fs/fuse/fuse_node.c Modified: head/sys/fs/fuse/fuse_node.c ============================================================================== --- head/sys/fs/fuse/fuse_node.c Fri Apr 21 21:43:00 2017 (r317272) +++ head/sys/fs/fuse/fuse_node.c Fri Apr 21 22:00:22 2017 (r317273) @@ -272,8 +272,6 @@ fuse_vnode_open(struct vnode *vp, int32_ /* * Funcation is called for every vnode open. * Merge fuse_open_flags it may be 0 - * - * XXXIP: Handle FOPEN_KEEP_CACHE */ /* * Ideally speaking, direct io should be enabled on @@ -293,6 +291,8 @@ fuse_vnode_open(struct vnode *vp, int32_ VTOFUD(vp)->flag |= FN_DIRECTIO; fuse_io_invalbuf(vp, td); } else { + if ((fuse_open_flags & FOPEN_KEEP_CACHE) == 0) + fuse_io_invalbuf(vp, td); VTOFUD(vp)->flag &= ~FN_DIRECTIO; } From owner-svn-src-head@freebsd.org Fri Apr 21 22:19:15 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8304ED49CEF; Fri, 21 Apr 2017 22:19:15 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 39EA51F02; Fri, 21 Apr 2017 22:19:15 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3LMJEg9029096; Fri, 21 Apr 2017 22:19:14 GMT (envelope-from sjg@FreeBSD.org) Received: (from sjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3LMJEYt029093; Fri, 21 Apr 2017 22:19:14 GMT (envelope-from sjg@FreeBSD.org) Message-Id: <201704212219.v3LMJEYt029093@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sjg set sender to sjg@FreeBSD.org using -f From: "Simon J. Gerraty" Date: Fri, 21 Apr 2017 22:19:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317274 - in head/contrib/bmake: . unit-tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 21 Apr 2017 22:19:15 -0000 Author: sjg Date: Fri Apr 21 22:19:13 2017 New Revision: 317274 URL: https://svnweb.freebsd.org/changeset/base/317274 Log: Str_Match: fix closure tests for [^] and add unit-test. Modified: head/contrib/bmake/str.c head/contrib/bmake/unit-tests/modmatch.exp head/contrib/bmake/unit-tests/modmatch.mk Modified: head/contrib/bmake/str.c ============================================================================== --- head/contrib/bmake/str.c Fri Apr 21 22:00:22 2017 (r317273) +++ head/contrib/bmake/str.c Fri Apr 21 22:19:13 2017 (r317274) @@ -382,8 +382,11 @@ Str_Match(const char *string, const char } else nomatch = 0; for (;;) { - if ((*pattern == ']') || (*pattern == 0)) - return(nomatch); + if ((*pattern == ']') || (*pattern == 0)) { + if (nomatch) + break; + return(0); + } if (*pattern == *string) break; if (pattern[1] == '-') { @@ -400,7 +403,7 @@ Str_Match(const char *string, const char } ++pattern; } - if (nomatch) + if (nomatch && (*pattern != ']') && (*pattern != 0)) return 0; while ((*pattern != ']') && (*pattern != 0)) ++pattern; Modified: head/contrib/bmake/unit-tests/modmatch.exp ============================================================================== --- head/contrib/bmake/unit-tests/modmatch.exp Fri Apr 21 22:00:22 2017 (r317273) +++ head/contrib/bmake/unit-tests/modmatch.exp Fri Apr 21 22:19:13 2017 (r317274) @@ -16,4 +16,5 @@ LIB=e X_LIBS:M*/lib${LIB}.a:tu is "/TMP/ Mscanner=OK Upper=One Two Three Four Lower=five six seven +nose=One Three five exit status 0 Modified: head/contrib/bmake/unit-tests/modmatch.mk ============================================================================== --- head/contrib/bmake/unit-tests/modmatch.mk Fri Apr 21 22:00:22 2017 (r317273) +++ head/contrib/bmake/unit-tests/modmatch.mk Fri Apr 21 22:19:13 2017 (r317274) @@ -31,3 +31,4 @@ LIST= One Two Three Four five six seven check-cclass: @echo Upper=${LIST:M[A-Z]*} @echo Lower=${LIST:M[^A-Z]*} + @echo nose=${LIST:M[^s]*[ex]} From owner-svn-src-head@freebsd.org Fri Apr 21 22:29:50 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0E147D49FEC; Fri, 21 Apr 2017 22:29:50 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C0B3B754; Fri, 21 Apr 2017 22:29:49 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1d1h3d-000454-4R; Sat, 22 Apr 2017 01:29:41 +0300 Date: Sat, 22 Apr 2017 01:29:41 +0300 From: Slawa Olhovchenkov To: Rick Macklem Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r317269 - in head/sys: fs/nfs sys Message-ID: <20170421222941.GE83631@zxy.spb.ru> References: <201704212008.v3LK8AVg075168@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201704212008.v3LK8AVg075168@repo.freebsd.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 21 Apr 2017 22:29:50 -0000 On Fri, Apr 21, 2017 at 08:08:10PM +0000, Rick Macklem wrote: > Author: rmacklem > Date: Fri Apr 21 20:08:10 2017 > New Revision: 317269 > URL: https://svnweb.freebsd.org/changeset/base/317269 > > Log: > Set default uid/gid to nobody/nogroup for NFSv4 mapping. > > The default uid/gid for NFSv4 are set by the nfsuserd(8) daemon. > However, they were 0 until the nfsuserd(8) was run. Since it is > possible to use NFSv4 without running the nfsuserd(8) daemon, set them > to nobody/nogroup initially. > Without this patch, the values would be set by the nfsuserd(8) daemon > and left changed even if the nfsuserd(8) daemon was killed. The default > values of 0 meant that setting a group to "wheel" would fail even when > done by root. > It also adds a definition of GID_NOGROUP to sys/conf.h. > > Discussed on: freebsd-current@ > MFC after: 2 weeks Can you also look to this problem https://lists.freebsd.org/pipermail/freebsd-stable/2012-March/066868.html ? From owner-svn-src-head@freebsd.org Fri Apr 21 22:38:27 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 97FB9D492F9; Fri, 21 Apr 2017 22:38:27 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 616F4C80; Fri, 21 Apr 2017 22:38:27 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3LMcQJG037121; Fri, 21 Apr 2017 22:38:26 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3LMcQrj037120; Fri, 21 Apr 2017 22:38:26 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201704212238.v3LMcQrj037120@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Fri, 21 Apr 2017 22:38:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317275 - head/sys/fs/nfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 21 Apr 2017 22:38:27 -0000 Author: rmacklem Date: Fri Apr 21 22:38:26 2017 New Revision: 317275 URL: https://svnweb.freebsd.org/changeset/base/317275 Log: Don't create a backchannel for a DS connection. An NFSv4.1 client connection to a Data Server (DS) should not have a backchannel. This patch fixes the NFSv4.1/pNFS client to not do a backchannel for this case. Found during recent testing with the pNFS server under development. MFC after: 2 weeks Modified: head/sys/fs/nfs/nfs_commonkrpc.c Modified: head/sys/fs/nfs/nfs_commonkrpc.c ============================================================================== --- head/sys/fs/nfs/nfs_commonkrpc.c Fri Apr 21 22:19:13 2017 (r317274) +++ head/sys/fs/nfs/nfs_commonkrpc.c Fri Apr 21 22:38:26 2017 (r317275) @@ -280,7 +280,8 @@ newnfs_connect(struct nfsmount *nmp, str retries = nmp->nm_retry; } else retries = INT_MAX; - if (NFSHASNFSV4N(nmp)) { + /* cred == NULL for DS connects. */ + if (NFSHASNFSV4N(nmp) && cred != NULL) { /* * Make sure the nfscbd_pool doesn't get destroyed * while doing this. From owner-svn-src-head@freebsd.org Fri Apr 21 23:01:33 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7B963D49959; Fri, 21 Apr 2017 23:01:33 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4DA2C93C; Fri, 21 Apr 2017 23:01:33 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3LN1WgQ045378; Fri, 21 Apr 2017 23:01:32 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3LN1Wl9045377; Fri, 21 Apr 2017 23:01:32 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201704212301.v3LN1Wl9045377@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Fri, 21 Apr 2017 23:01:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317276 - head/sys/fs/nfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 21 Apr 2017 23:01:33 -0000 Author: rmacklem Date: Fri Apr 21 23:01:32 2017 New Revision: 317276 URL: https://svnweb.freebsd.org/changeset/base/317276 Log: Don't set ND_NOMOREDATA for a failed Setattr operation (NFSv4). The NFSv4 Setattr operation always has reply data even when it fails, so don't set the ND_NOMOREDATA for it. This would only affect unusual cases where Setattr fails and the RPC code wants to parse the rest of the compound. Detected during recent development related to the pNFS server. MFC after: 2 weeks Modified: head/sys/fs/nfs/nfs_commonkrpc.c Modified: head/sys/fs/nfs/nfs_commonkrpc.c ============================================================================== --- head/sys/fs/nfs/nfs_commonkrpc.c Fri Apr 21 22:38:26 2017 (r317275) +++ head/sys/fs/nfs/nfs_commonkrpc.c Fri Apr 21 23:01:32 2017 (r317276) @@ -1043,8 +1043,10 @@ tryagain: /* * If this op's status is non-zero, mark * that there is no more data to process. + * The exception is Setattr, which always has xdr + * when it has failed. */ - if (j) + if (j != 0 && i != NFSV4OP_SETATTR) nd->nd_flag |= ND_NOMOREDATA; /* From owner-svn-src-head@freebsd.org Sat Apr 22 01:06:24 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E58E2D40601; Sat, 22 Apr 2017 01:06:24 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B4F3CDC7; Sat, 22 Apr 2017 01:06:24 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3M16N16097823; Sat, 22 Apr 2017 01:06:23 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3M16NLH097822; Sat, 22 Apr 2017 01:06:23 GMT (envelope-from des@FreeBSD.org) Message-Id: <201704220106.v3M16NLH097822@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: des set sender to des@FreeBSD.org using -f From: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= Date: Sat, 22 Apr 2017 01:06:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317277 - head/sys/crypto/chacha20 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 22 Apr 2017 01:06:25 -0000 Author: des Date: Sat Apr 22 01:06:23 2017 New Revision: 317277 URL: https://svnweb.freebsd.org/changeset/base/317277 Log: Fix counter increment in Salsa and ChaCha. In my eagerness to eliminate a branch which is taken once per 2^38 bytes of keystream, I forgot that the state words are in host order. Thus, the counter increment code worked fine on little-endian machines, but not on big-endian ones. Switch to a simpler (branchful) solution. Modified: head/sys/crypto/chacha20/chacha20.c Modified: head/sys/crypto/chacha20/chacha20.c ============================================================================== --- head/sys/crypto/chacha20/chacha20.c Fri Apr 21 23:01:32 2017 (r317276) +++ head/sys/crypto/chacha20/chacha20.c Sat Apr 22 01:06:23 2017 (r317277) @@ -130,7 +130,6 @@ size_t chacha20_encrypt(chacha20_ctx *ctx, const void *vpt, uint8_t *ct, size_t len) { const uint8_t *pt = vpt; - uint64_t ctr; uint32_t mix[16]; uint8_t ks[64]; unsigned int b, i; @@ -157,8 +156,8 @@ chacha20_encrypt(chacha20_ctx *ctx, cons for (i = 0; i < 64 && i < len; ++i) *ct++ = *pt++ ^ ks[i]; } - ctr = le64dec(ctx->state + 12); - le64enc(ctx->state + 12, ++ctr); + if (++ctx->state[12] == 0) + ++ctx->state[13]; } return (len); } From owner-svn-src-head@freebsd.org Sat Apr 22 02:12:09 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6E4E4D4913A; Sat, 22 Apr 2017 02:12:09 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 27DEAAAE; Sat, 22 Apr 2017 02:12:09 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3M2C8XT023608; Sat, 22 Apr 2017 02:12:08 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3M2C8I4023606; Sat, 22 Apr 2017 02:12:08 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201704220212.v3M2C8I4023606@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sat, 22 Apr 2017 02:12:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317278 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 22 Apr 2017 02:12:09 -0000 Author: adrian Date: Sat Apr 22 02:12:07 2017 New Revision: 317278 URL: https://svnweb.freebsd.org/changeset/base/317278 Log: [net80211] add methods to fetch the global and per-VAP WME parameters. For now there isn't any per-VAP WME state. The eventual aim is to migrate the driver direct use of WME parameters over to use these methods as appropriate (global for most devices, per-VAP for firmware NICs that support it) in preparation for actual per-VAP WME (and other thing) state change support. Modified: head/sys/net80211/ieee80211_proto.c head/sys/net80211/ieee80211_proto.h Modified: head/sys/net80211/ieee80211_proto.c ============================================================================== --- head/sys/net80211/ieee80211_proto.c Sat Apr 22 01:06:23 2017 (r317277) +++ head/sys/net80211/ieee80211_proto.c Sat Apr 22 02:12:07 2017 (r317278) @@ -1306,6 +1306,20 @@ ieee80211_wme_updateparams(struct ieee80 } } +void +ieee80211_wme_vap_getparams(struct ieee80211vap *vap, struct chanAccParams *wp) +{ + + memcpy(wp, &vap->iv_ic->ic_wme.wme_chanParams, sizeof(*wp)); +} + +void +ieee80211_wme_ic_getparams(struct ieee80211com *ic, struct chanAccParams *wp) +{ + + memcpy(wp, &ic->ic_wme.wme_chanParams, sizeof(*wp)); +} + static void parent_updown(void *arg, int npending) { Modified: head/sys/net80211/ieee80211_proto.h ============================================================================== --- head/sys/net80211/ieee80211_proto.h Sat Apr 22 01:06:23 2017 (r317277) +++ head/sys/net80211/ieee80211_proto.h Sat Apr 22 02:12:07 2017 (r317278) @@ -292,6 +292,10 @@ struct ieee80211_wme_state { void ieee80211_wme_initparams(struct ieee80211vap *); void ieee80211_wme_updateparams(struct ieee80211vap *); void ieee80211_wme_updateparams_locked(struct ieee80211vap *); +void ieee80211_wme_vap_getparams(struct ieee80211vap *vap, + struct chanAccParams *); +void ieee80211_wme_ic_getparams(struct ieee80211com *ic, + struct chanAccParams *); /* * Return the WME TID from a QoS frame. If no TID From owner-svn-src-head@freebsd.org Sat Apr 22 02:34:03 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E831ED49CF1; Sat, 22 Apr 2017 02:34:03 +0000 (UTC) (envelope-from rpaulo@me.com) Received: from st13p97im-ztdg18291001.me.com (st13p97im-ztdg18291001.me.com [17.41.193.146]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BDE428B6; Sat, 22 Apr 2017 02:34:03 +0000 (UTC) (envelope-from rpaulo@me.com) Received: from process-dkim-sign-daemon.st13p97im-ztdg18291001.me.com by st13p97im-ztdg18291001.me.com (Oracle Communications Messaging Server 7.0.5.38.0 64bit (built Feb 26 2016)) id <0OOS00L00HSA6P00@st13p97im-ztdg18291001.me.com>; Sat, 22 Apr 2017 02:33:57 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=me.com; s=4d515a; t=1492828437; bh=ma39r/1DDrkFNp97kb3uiwHoMS3Q8ly41myM2FeGoBQ=; h=Date:From:Subject:To:Message-id:MIME-version:Content-type; b=pw87NrXvmhOIGK4l+zOcwuC9ePAdqKCe9Br00Qol4ltcBK3VWKS1efdlz08Mfzk9C 1aP4Z5Ay+oiwUG27Z3m8vg9ir8wF+RcdgFBb1fDh8Twp80bRMG6hABvjKKcKTgaetD 19t2QkegYxmv0zfRPS2jpOI1kugJnC8fR+2ptKxPdkAh4vjRNN390ZxJPGwCRjeErq 9mOg5UBvrFizMksrdFpllT0hbO+DhXVuDUR8O6qblG6jedEUbTUgamOKZzz3sLfmbJ hG28QVUeKlb33BVNYsIxSjPsB39iZNLyah5LgdUORnNc1mT0Y2xQGyE2rV4zL/CdQE b4QkR2eJfQf9w== Received: from icloud.com ([127.0.0.1]) by st13p97im-ztdg18291001.me.com (Oracle Communications Messaging Server 7.0.5.38.0 64bit (built Feb 26 2016)) id <0OOS00L00HSK9I00@st13p97im-ztdg18291001.me.com>; Sat, 22 Apr 2017 02:33:56 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-04-21_20:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 clxscore=1034 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1701120000 definitions=main-1704220034 Received: from icloud.com ([127.0.0.1]) by st13p97im-ztdg18291001.me.com (Oracle Communications Messaging Server 7.0.5.38.0 64bit (built Feb 26 2016)) with ESMTPSA id <0OOS00HC7HS2HI20@st13p97im-ztdg18291001.me.com>; Sat, 22 Apr 2017 02:33:56 +0000 (GMT) Date: Fri, 21 Apr 2017 19:33:38 -0700 From: Rui Paulo Subject: Re: svn commit: r317277 - head/sys/crypto/chacha20 In-reply-to: <201704220106.v3M16NLH097822@repo.freebsd.org> To: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-id: MIME-version: 1.0 (Mac OS X Mail 10.3 \(3273\)) X-Mailer: Apple Mail (2.3273) Content-type: text/plain; charset=utf-8 Content-transfer-encoding: quoted-printable References: <201704220106.v3M16NLH097822@repo.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 22 Apr 2017 02:34:04 -0000 On Apr 21, 2017, at 18:06, Dag-Erling Sm=C3=B8rgrav = wrote: >=20 > Author: des > Date: Sat Apr 22 01:06:23 2017 > New Revision: 317277 > URL: https://svnweb.freebsd.org/changeset/base/317277 >=20 > Log: > Fix counter increment in Salsa and ChaCha. >=20 > In my eagerness to eliminate a branch which is taken once per 2^38 > bytes of keystream, I forgot that the state words are in host order. > Thus, the counter increment code worked fine on little-endian > machines, but not on big-endian ones. Switch to a simpler = (branchful) > solution. I=E2=80=99m surprised there=E2=80=99s no mention of who reviewed your = change, especially when you=E2=80=99re changing crypto code.= From owner-svn-src-head@freebsd.org Sat Apr 22 02:42:07 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 66A14D49209 for ; Sat, 22 Apr 2017 02:42:07 +0000 (UTC) (envelope-from 0100015b9386dee4-dad811f0-0615-4160-85d2-b9b7709a15a0-000000@amazonses.com) Received: from a8-56.smtp-out.amazonses.com (a8-56.smtp-out.amazonses.com [54.240.8.56]) (using TLSv1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 29A09E8E for ; Sat, 22 Apr 2017 02:42:06 +0000 (UTC) (envelope-from 0100015b9386dee4-dad811f0-0615-4160-85d2-b9b7709a15a0-000000@amazonses.com) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=ae7m2yrxjw65l2cqdpjxuucyrvy564tn; d=tarsnap.com; t=1492828741; h=Subject:To:References:Cc:From:Message-ID:Date:MIME-Version:In-Reply-To:Content-Type:Content-Transfer-Encoding; bh=Nh3gLOq5f2id/40/aafYhVBtMU/HVgkhDyhDNaQs1yo=; b=oFmVLuaZH1K42Vq84r7tub2Aga5YnK2ZH9/WUMr8MqYAOdSQClIyGKYEcrUA1cSE 95IzJakyvw+7vuOQAVE5Jd36jzKB7eFlad/2k2JzH4BUp/U+wPNmH+/epZCVdK6X4XM HoyfVkB2IovhAaJB9xxl/S864OB83rL3a5U0QBVE= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=224i4yxa5dv7c2xz3womw6peuasteono; d=amazonses.com; t=1492828741; h=Subject:To:References:Cc:From:Message-ID:Date:MIME-Version:In-Reply-To:Content-Type:Content-Transfer-Encoding:Feedback-ID; bh=Nh3gLOq5f2id/40/aafYhVBtMU/HVgkhDyhDNaQs1yo=; b=Mjou+S4hgweTHS9H1xfE/OLYQNqQpOM/RTzJCv75OEzlTDXi2uCg0Q53vrW6F/yV t7o8XeMGRhNji/ZvZTyF6HPHua62LY6VGiYr+L8eYhDI/dfujmUDVoGKsJaaNpcQopw XLJI8VPQTUIFNHKWz4VnvA1gpziyZzL2V81NGz2A= Subject: Re: svn commit: r317277 - head/sys/crypto/chacha20 To: Rui Paulo , =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= References: <201704220106.v3M16NLH097822@repo.freebsd.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Colin Percival Message-ID: <0100015b9386dee4-dad811f0-0615-4160-85d2-b9b7709a15a0-000000@email.amazonses.com> Date: Sat, 22 Apr 2017 02:39:01 +0000 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-SES-Outgoing: 2017.04.22-54.240.8.56 Feedback-ID: 1.us-east-1.Lv9FVjaNvvR5llaqfLoOVbo2VxOELl7cjN0AOyXnPlk=:AmazonSES X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 22 Apr 2017 02:42:07 -0000 On 04/21/17 19:33, Rui Paulo wrote: > On Apr 21, 2017, at 18:06, Dag-Erling Smørgrav wrote: >> Author: des >> Date: Sat Apr 22 01:06:23 2017 >> New Revision: 317277 >> URL: https://svnweb.freebsd.org/changeset/base/317277 >> >> Log: >> Fix counter increment in Salsa and ChaCha. >> >> In my eagerness to eliminate a branch which is taken once per 2^38 >> bytes of keystream, I forgot that the state words are in host order. >> Thus, the counter increment code worked fine on little-endian >> machines, but not on big-endian ones. Switch to a simpler (branchful) >> solution. > > I’m surprised there’s no mention of who reviewed your change, especially when you’re changing crypto code. Reviewed by: cperciva -- Colin Percival Security Officer Emeritus, FreeBSD | The power to serve Founder, Tarsnap | www.tarsnap.com | Online backups for the truly paranoid From owner-svn-src-head@freebsd.org Sat Apr 22 08:38:51 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1A110D49C34; Sat, 22 Apr 2017 08:38:51 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DB699FD3; Sat, 22 Apr 2017 08:38:50 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3M8cnHj080326; Sat, 22 Apr 2017 08:38:49 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3M8cnh2080325; Sat, 22 Apr 2017 08:38:49 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201704220838.v3M8cnh2080325@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 22 Apr 2017 08:38:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317279 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 22 Apr 2017 08:38:51 -0000 Author: mav Date: Sat Apr 22 08:38:49 2017 New Revision: 317279 URL: https://svnweb.freebsd.org/changeset/base/317279 Log: Remove unneeded conditions. MFC after: 2 weeks Modified: head/sys/net/if_lagg.c Modified: head/sys/net/if_lagg.c ============================================================================== --- head/sys/net/if_lagg.c Sat Apr 22 02:12:07 2017 (r317278) +++ head/sys/net/if_lagg.c Sat Apr 22 08:38:49 2017 (r317279) @@ -439,10 +439,8 @@ lagg_register_vlan(void *arg, struct ifn return; LAGG_RLOCK(sc, &tracker); - if (!SLIST_EMPTY(&sc->sc_ports)) { - SLIST_FOREACH(lp, &sc->sc_ports, lp_entries) - EVENTHANDLER_INVOKE(vlan_config, lp->lp_ifp, vtag); - } + SLIST_FOREACH(lp, &sc->sc_ports, lp_entries) + EVENTHANDLER_INVOKE(vlan_config, lp->lp_ifp, vtag); LAGG_RUNLOCK(sc, &tracker); } @@ -461,10 +459,8 @@ lagg_unregister_vlan(void *arg, struct i return; LAGG_RLOCK(sc, &tracker); - if (!SLIST_EMPTY(&sc->sc_ports)) { - SLIST_FOREACH(lp, &sc->sc_ports, lp_entries) - EVENTHANDLER_INVOKE(vlan_unconfig, lp->lp_ifp, vtag); - } + SLIST_FOREACH(lp, &sc->sc_ports, lp_entries) + EVENTHANDLER_INVOKE(vlan_unconfig, lp->lp_ifp, vtag); LAGG_RUNLOCK(sc, &tracker); } From owner-svn-src-head@freebsd.org Sat Apr 22 09:38:44 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DAF4BD47AAA; Sat, 22 Apr 2017 09:38:44 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AA5EA7C4; Sat, 22 Apr 2017 09:38:44 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3M9chHm005077; Sat, 22 Apr 2017 09:38:43 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3M9cheI005076; Sat, 22 Apr 2017 09:38:43 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201704220938.v3M9cheI005076@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sat, 22 Apr 2017 09:38:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317280 - head/usr.bin/tip/tip X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 22 Apr 2017 09:38:45 -0000 Author: trasz Date: Sat Apr 22 09:38:43 2017 New Revision: 317280 URL: https://svnweb.freebsd.org/changeset/base/317280 Log: Add basic example to the cu(1) man page. Srsly, folks, you don't need to install minicom for this... MFC after: 2 weeks Modified: head/usr.bin/tip/tip/cu.1 Modified: head/usr.bin/tip/tip/cu.1 ============================================================================== --- head/usr.bin/tip/tip/cu.1 Sat Apr 22 08:38:49 2017 (r317279) +++ head/usr.bin/tip/tip/cu.1 Sat Apr 22 09:38:43 2017 (r317280) @@ -30,7 +30,7 @@ .\" @(#)tip.1 8.4 (Berkeley) 4/18/94 .\" $FreeBSD$ .\" -.Dd September 1, 2006 +.Dd April 22, 2017 .Dt CU 1 .Os .Sh NAME @@ -494,6 +494,11 @@ line access log lock file to avoid conflicts with .Xr uucp 1 Pq Pa ports/net/freebsd-uucp .El +.Sh EXAMPLES +Connect to the first USB serial port at the speed of 115200 baud: +.Bd -literal -offset indent +cu -s 115200 -l /dev/cuaU0 +.Ed .Sh SEE ALSO .Xr tip 1 .Sh HISTORY From owner-svn-src-head@freebsd.org Sat Apr 22 13:04:37 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AC5D8D49FD3; Sat, 22 Apr 2017 13:04:37 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 56E42BBA; Sat, 22 Apr 2017 13:04:37 +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 v3MD4a23092578; Sat, 22 Apr 2017 13:04:36 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3MD4ahb092577; Sat, 22 Apr 2017 13:04:36 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201704221304.v3MD4ahb092577@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Sat, 22 Apr 2017 13:04:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317282 - head/sys/netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 22 Apr 2017 13:04:37 -0000 Author: kp Date: Sat Apr 22 13:04:36 2017 New Revision: 317282 URL: https://svnweb.freebsd.org/changeset/base/317282 Log: Rename variable for clarity Rename the mtu variable in ip6_fragment(), because mtu is misleading. The variable actually holds the fragment length. No functional change. Suggested by: ae Modified: head/sys/netinet6/ip6_output.c Modified: head/sys/netinet6/ip6_output.c ============================================================================== --- head/sys/netinet6/ip6_output.c Sat Apr 22 11:30:07 2017 (r317281) +++ head/sys/netinet6/ip6_output.c Sat Apr 22 13:04:36 2017 (r317282) @@ -217,7 +217,7 @@ in6_delayed_cksum(struct mbuf *m, uint32 int ip6_fragment(struct ifnet *ifp, struct mbuf *m0, int hlen, u_char nextproto, - int mtu, uint32_t id) + int fraglen , uint32_t id) { struct mbuf *m, **mnext, *m_frgpart; struct ip6_hdr *ip6, *mhip6; @@ -226,13 +226,13 @@ ip6_fragment(struct ifnet *ifp, struct m int error; int tlen = m0->m_pkthdr.len; - KASSERT(( mtu % 8 == 0), ("Fragment length must be a multiple of 8")); + KASSERT((fraglen % 8 == 0), ("Fragment length must be a multiple of 8")); m = m0; ip6 = mtod(m, struct ip6_hdr *); mnext = &m->m_nextpkt; - for (off = hlen; off < tlen; off += mtu) { + for (off = hlen; off < tlen; off += fraglen) { m = m_gethdr(M_NOWAIT, MT_DATA); if (!m) { IP6STAT_INC(ip6s_odropped); @@ -251,18 +251,18 @@ ip6_fragment(struct ifnet *ifp, struct m return (error); } ip6f->ip6f_offlg = htons((u_short)((off - hlen) & ~7)); - if (off + mtu >= tlen) - mtu = tlen - off; + if (off + fraglen >= tlen) + fraglen = tlen - off; else ip6f->ip6f_offlg |= IP6F_MORE_FRAG; - mhip6->ip6_plen = htons((u_short)(mtu + hlen + + mhip6->ip6_plen = htons((u_short)(fraglen + hlen + sizeof(*ip6f) - sizeof(struct ip6_hdr))); - if ((m_frgpart = m_copym(m0, off, mtu, M_NOWAIT)) == NULL) { + if ((m_frgpart = m_copym(m0, off, fraglen, M_NOWAIT)) == NULL) { IP6STAT_INC(ip6s_odropped); return (ENOBUFS); } m_cat(m, m_frgpart); - m->m_pkthdr.len = mtu + hlen + sizeof(*ip6f); + m->m_pkthdr.len = fraglen + hlen + sizeof(*ip6f); m->m_pkthdr.fibnum = m0->m_pkthdr.fibnum; m->m_pkthdr.rcvif = NULL; ip6f->ip6f_reserved = 0; From owner-svn-src-head@freebsd.org Sat Apr 22 14:50:13 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7DC84D4A3E2; Sat, 22 Apr 2017 14:50:13 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 551ED3D8; Sat, 22 Apr 2017 14:50:13 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3MEoC9m033956; Sat, 22 Apr 2017 14:50:12 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3MEoC2I033952; Sat, 22 Apr 2017 14:50:12 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201704221450.v3MEoC2I033952@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sat, 22 Apr 2017 14:50:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317283 - head/sbin/fsck_ffs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 22 Apr 2017 14:50:13 -0000 Author: pfg Date: Sat Apr 22 14:50:11 2017 New Revision: 317283 URL: https://svnweb.freebsd.org/changeset/base/317283 Log: fsck_ffs: Unsign some variables and make use of reallocarray(3). Instead of casting listmax and numdirs to unsigned values just define them as unsigned and avoid the casts. Use reallocarray(3). While here, fs_ncg is already unsigned so the cast is unnecessary. Reviewed by: mckusick MFC after: 2 weeks Modified: head/sbin/fsck_ffs/fsck.h head/sbin/fsck_ffs/globs.c head/sbin/fsck_ffs/inode.c head/sbin/fsck_ffs/setup.c Modified: head/sbin/fsck_ffs/fsck.h ============================================================================== --- head/sbin/fsck_ffs/fsck.h Sat Apr 22 13:04:36 2017 (r317282) +++ head/sbin/fsck_ffs/fsck.h Sat Apr 22 14:50:11 2017 (r317283) @@ -282,7 +282,8 @@ struct inoinfo { u_int i_numblks; /* size of block array in bytes */ ufs2_daddr_t i_blks[1]; /* actually longer */ } **inphead, **inpsort; -extern long numdirs, dirhash, listmax, inplast; +extern long dirhash, inplast; +extern unsigned long numdirs, listmax; extern long countdirs; /* number of directories we actually found */ #define MIBSIZE 3 /* size of fsck sysctl MIBs */ Modified: head/sbin/fsck_ffs/globs.c ============================================================================== --- head/sbin/fsck_ffs/globs.c Sat Apr 22 13:04:36 2017 (r317282) +++ head/sbin/fsck_ffs/globs.c Sat Apr 22 14:50:11 2017 (r317283) @@ -56,7 +56,8 @@ struct bufarea sblk; /* file system sup struct bufarea *pdirbp; /* current directory contents */ struct bufarea *pbp; /* current inode block */ ino_t cursnapshot; -long numdirs, dirhash, listmax, inplast; +long dirhash, inplast; +unsigned long numdirs, listmax; long countdirs; /* number of directories we actually found */ int adjrefcnt[MIBSIZE]; /* MIB command to adjust inode reference cnt */ int adjblkcnt[MIBSIZE]; /* MIB command to adjust inode block count */ @@ -123,7 +124,7 @@ fsckinit(void) pdirbp = NULL; pbp = NULL; cursnapshot = 0; - numdirs = dirhash = listmax = inplast = 0; + listmax = numdirs = dirhash = inplast = 0; countdirs = 0; bzero(adjrefcnt, sizeof(int) * MIBSIZE); bzero(adjblkcnt, sizeof(int) * MIBSIZE); Modified: head/sbin/fsck_ffs/inode.c ============================================================================== --- head/sbin/fsck_ffs/inode.c Sat Apr 22 13:04:36 2017 (r317282) +++ head/sbin/fsck_ffs/inode.c Sat Apr 22 14:50:11 2017 (r317283) @@ -472,8 +472,8 @@ cacheino(union dinode *dp, ino_t inumber inp->i_blks[UFS_NDADDR + i] = DIP(dp, di_ib[i]); if (inplast == listmax) { listmax += 100; - inpsort = (struct inoinfo **)realloc((char *)inpsort, - (unsigned)listmax * sizeof(struct inoinfo *)); + inpsort = (struct inoinfo **)reallocarray((char *)inpsort, + listmax, sizeof(struct inoinfo *)); if (inpsort == NULL) errx(EEXIT, "cannot increase directory list"); } Modified: head/sbin/fsck_ffs/setup.c ============================================================================== --- head/sbin/fsck_ffs/setup.c Sat Apr 22 13:04:36 2017 (r317282) +++ head/sbin/fsck_ffs/setup.c Sat Apr 22 14:50:11 2017 (r317283) @@ -268,8 +268,7 @@ setup(char *dev) (unsigned)bmapsize); goto badsb; } - inostathead = Calloc((unsigned)(sblock.fs_ncg), - sizeof(struct inostatlist)); + inostathead = Calloc(sblock.fs_ncg, sizeof(struct inostatlist)); if (inostathead == NULL) { printf("cannot alloc %u bytes for inostathead\n", (unsigned)(sizeof(struct inostatlist) * (sblock.fs_ncg))); @@ -279,10 +278,8 @@ setup(char *dev) dirhash = numdirs; inplast = 0; listmax = numdirs + 10; - inpsort = (struct inoinfo **)Calloc((unsigned)listmax, - sizeof(struct inoinfo *)); - inphead = (struct inoinfo **)Calloc((unsigned)numdirs, - sizeof(struct inoinfo *)); + inpsort = (struct inoinfo **)Calloc(listmax, sizeof(struct inoinfo *)); + inphead = (struct inoinfo **)Calloc(numdirs, sizeof(struct inoinfo *)); if (inpsort == NULL || inphead == NULL) { printf("cannot alloc %ju bytes for inphead\n", (uintmax_t)numdirs * sizeof(struct inoinfo *)); From owner-svn-src-head@freebsd.org Sat Apr 22 16:02:42 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 08874D4BBB2; Sat, 22 Apr 2017 16:02:42 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D275AC1E; Sat, 22 Apr 2017 16:02:41 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3MG2eGg065980; Sat, 22 Apr 2017 16:02:40 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3MG2eC3065978; Sat, 22 Apr 2017 16:02:40 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201704221602.v3MG2eC3065978@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sat, 22 Apr 2017 16:02:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317284 - head/usr.sbin/pmcstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 22 Apr 2017 16:02:42 -0000 Author: pfg Date: Sat Apr 22 16:02:40 2017 New Revision: 317284 URL: https://svnweb.freebsd.org/changeset/base/317284 Log: pmcstat(8); unsign some allocation variables and use reallocarray(3). Use unsigned values in some internal variables that will be used during allocation. The variables are used in reduced scope and have no chance of becoming negative. Provide bounds checking through reallocarray(3). MFC after: 2 weeks Modified: head/usr.sbin/pmcstat/pmcpl_calltree.c head/usr.sbin/pmcstat/pmcstat_log.c Modified: head/usr.sbin/pmcstat/pmcpl_calltree.c ============================================================================== --- head/usr.sbin/pmcstat/pmcpl_calltree.c Sat Apr 22 14:50:11 2017 (r317283) +++ head/usr.sbin/pmcstat/pmcpl_calltree.c Sat Apr 22 16:02:40 2017 (r317284) @@ -185,7 +185,7 @@ pmcpl_ct_samples_free(struct pmcpl_ct_sa static void pmcpl_ct_samples_grow(struct pmcpl_ct_sample *samples) { - int npmcs; + unsigned int npmcs; /* Enough storage. */ if (pmcstat_npmcs <= samples->npmcs) @@ -193,7 +193,7 @@ pmcpl_ct_samples_grow(struct pmcpl_ct_sa npmcs = samples->npmcs + max(pmcstat_npmcs - samples->npmcs, PMCPL_CT_GROWSIZE); - samples->sb = realloc(samples->sb, npmcs * sizeof(unsigned)); + samples->sb = reallocarray(samples->sb, npmcs, sizeof(unsigned)); if (samples->sb == NULL) errx(EX_SOFTWARE, "ERROR: out of memory"); bzero((char *)samples->sb + samples->npmcs * sizeof(unsigned), @@ -226,13 +226,13 @@ pmcpl_ct_samples_root(struct pmcpl_ct_sa static void pmcpl_ct_arc_grow(int cursize, int *maxsize, struct pmcpl_ct_arc **items) { - int nmaxsize; + unsigned int nmaxsize; if (cursize < *maxsize) return; nmaxsize = *maxsize + max(cursize + 1 - *maxsize, PMCPL_CT_GROWSIZE); - *items = realloc(*items, nmaxsize * sizeof(struct pmcpl_ct_arc)); + *items = reallocarray(*items, nmaxsize, sizeof(struct pmcpl_ct_arc)); if (*items == NULL) errx(EX_SOFTWARE, "ERROR: out of memory"); bzero((char *)*items + *maxsize * sizeof(struct pmcpl_ct_arc), @@ -247,13 +247,13 @@ pmcpl_ct_arc_grow(int cursize, int *maxs static void pmcpl_ct_instr_grow(int cursize, int *maxsize, struct pmcpl_ct_instr **items) { - int nmaxsize; + unsigned int nmaxsize; if (cursize < *maxsize) return; nmaxsize = *maxsize + max(cursize + 1 - *maxsize, PMCPL_CT_GROWSIZE); - *items = realloc(*items, nmaxsize * sizeof(struct pmcpl_ct_instr)); + *items = reallocarray(*items, nmaxsize, sizeof(struct pmcpl_ct_instr)); if (*items == NULL) errx(EX_SOFTWARE, "ERROR: out of memory"); bzero((char *)*items + *maxsize * sizeof(struct pmcpl_ct_instr), Modified: head/usr.sbin/pmcstat/pmcstat_log.c ============================================================================== --- head/usr.sbin/pmcstat/pmcstat_log.c Sat Apr 22 14:50:11 2017 (r317283) +++ head/usr.sbin/pmcstat/pmcstat_log.c Sat Apr 22 16:02:40 2017 (r317284) @@ -535,8 +535,8 @@ pmcstat_image_add_symbols(struct pmcstat * Allocate space for the new entries. */ firsttime = image->pi_symbols == NULL; - symptr = realloc(image->pi_symbols, - sizeof(*symptr) * (image->pi_symcount + nfuncsyms)); + symptr = reallocarray(image->pi_symbols, + image->pi_symcount + nfuncsyms, sizeof(*symptr)); if (symptr == image->pi_symbols) /* realloc() failed. */ return; image->pi_symbols = symptr; @@ -587,8 +587,8 @@ pmcstat_image_add_symbols(struct pmcstat * Return space to the system if there were duplicates. */ if (newsyms < nfuncsyms) - image->pi_symbols = realloc(image->pi_symbols, - sizeof(*symptr) * image->pi_symcount); + image->pi_symbols = reallocarray(image->pi_symbols, + image->pi_symcount, sizeof(*symptr)); /* * Keep the list of symbols sorted. From owner-svn-src-head@freebsd.org Sat Apr 22 19:11:39 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 335ADD4BD5E; Sat, 22 Apr 2017 19:11:39 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DDFD7894; Sat, 22 Apr 2017 19:11:38 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3MJBcU3042737; Sat, 22 Apr 2017 19:11:38 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3MJBcZx042736; Sat, 22 Apr 2017 19:11:38 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201704221911.v3MJBcZx042736@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 22 Apr 2017 19:11:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317288 - head/lib/libgeom X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 22 Apr 2017 19:11:39 -0000 Author: ngie Date: Sat Apr 22 19:11:37 2017 New Revision: 317288 URL: https://svnweb.freebsd.org/changeset/base/317288 Log: libgeom(3): apply minor polish - Use .Dv when mentioning NULL per mdoc(7). - Reword `g_device_path`, `g_open_by_ident`, and `g_providername`'s descriptions so they're less wordy. - Fix a typo in `g_device_path` (can not -> cannot). MFC after: 5 weeks Tested with: igor, make manlint Sponsored by: Dell EMC Isilon Modified: head/lib/libgeom/libgeom.3 Modified: head/lib/libgeom/libgeom.3 ============================================================================== --- head/lib/libgeom/libgeom.3 Sat Apr 22 18:59:50 2017 (r317287) +++ head/lib/libgeom/libgeom.3 Sat Apr 22 19:11:37 2017 (r317288) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 4, 2010 +.Dd April 22, 2017 .Dt LIBGEOM 3 .Os .Sh NAME @@ -324,8 +324,8 @@ The .Fn g_device_path function returns the full path to a provider given a partial or full path to the device node. -If the device can not be found or is not a valid geom provider, NULL is -returned. +.Dv NULL +is returned if the device cannot be found or is not a valid geom provider. .Pp The .Fn g_get_ident @@ -344,20 +344,19 @@ string. .Pp The .Fn g_open_by_ident -function opens provider using its ident, unlike +function opens provider using its identification, unlike .Fn g_open -which uses provider's name. -If the +which uses the provider's name. +The function will store the provider's name in the .Fa name -argument is not -.Dv NULL , -the function will store provider's name there. +parameter if it is not +.Dv NULL . .Pp The .Fn g_providername function returns the provider name of an open file descriptor. -If the file descriptor does not point to a valid geom provider, NULL is -returned. +.Dv NULL +is returned the file descriptor does not point to a valid geom provider. .Pp All functions except .Fn g_providername From owner-svn-src-head@freebsd.org Sat Apr 22 19:32:24 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CB3DED4B7DF; Sat, 22 Apr 2017 19:32:24 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 97DB567D; Sat, 22 Apr 2017 19:32:24 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3MJWN3Q051637; Sat, 22 Apr 2017 19:32:23 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3MJWNpj051636; Sat, 22 Apr 2017 19:32:23 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201704221932.v3MJWNpj051636@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 22 Apr 2017 19:32:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317289 - head/lib/libgeom X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 22 Apr 2017 19:32:24 -0000 Author: ngie Date: Sat Apr 22 19:32:23 2017 New Revision: 317289 URL: https://svnweb.freebsd.org/changeset/base/317289 Log: libgeom(3): note that stdio.h is required when referencing gctl_dump(3) gctl_dump(3) is only exposed when stdio.h is #include'd first, per its addition in r112510. The reasoning noted for the conditional "exposure" of the function was to "limit #include pollution". This addresses an issue I found with the documentation when looking at bug 218809, which in turn addresses a -Wimplicit-function-declaration compiler warning in `tools/regression/geom_gpt/test.c` (it uses gctl_dump(3)). MFC after: 5 weeks Sponsored by: Dell EMC Isilon Modified: head/lib/libgeom/libgeom.3 Modified: head/lib/libgeom/libgeom.3 ============================================================================== --- head/lib/libgeom/libgeom.3 Sat Apr 22 19:11:37 2017 (r317288) +++ head/lib/libgeom/libgeom.3 Sat Apr 22 19:32:23 2017 (r317289) @@ -63,6 +63,10 @@ .Sh LIBRARY .Lb libgeom .Sh SYNOPSIS +.Bd -literal +/* stdio.h is only required for `gctl_dump` */ +.Ed +.In stdio.h .In libgeom.h .Ss "Statistics Functions" .Ft void From owner-svn-src-head@freebsd.org Sat Apr 22 20:00:53 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D5237D4BE12; Sat, 22 Apr 2017 20:00:53 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A54F01FA; Sat, 22 Apr 2017 20:00:53 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3MK0qA4060656; Sat, 22 Apr 2017 20:00:52 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3MK0qM2060655; Sat, 22 Apr 2017 20:00:52 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201704222000.v3MK0qM2060655@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 22 Apr 2017 20:00:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317290 - head/tools/regression/geom_gpt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 22 Apr 2017 20:00:53 -0000 Author: ngie Date: Sat Apr 22 20:00:52 2017 New Revision: 317290 URL: https://svnweb.freebsd.org/changeset/base/317290 Log: Fix -Wimplicit-function-declaration compilation warning by moving libgeom.h #include below the stdio.h #include. gctl_dump(3) needs stdio.h, per reasoning noted in r317289. MFC after: 5 weeks PR: 218809 Submitted by: Chang-Hsien Tsai Sponsored by: Dell EMC Isilon Modified: head/tools/regression/geom_gpt/test.c Modified: head/tools/regression/geom_gpt/test.c ============================================================================== --- head/tools/regression/geom_gpt/test.c Sat Apr 22 19:32:23 2017 (r317289) +++ head/tools/regression/geom_gpt/test.c Sat Apr 22 20:00:52 2017 (r317290) @@ -29,12 +29,12 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include #include #include +#include struct retval { struct retval *retval; From owner-svn-src-head@freebsd.org Sat Apr 22 20:06:12 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7DEAED4BFBB; Sat, 22 Apr 2017 20:06:12 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 31B1786D; Sat, 22 Apr 2017 20:06:12 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3MK6B1h064376; Sat, 22 Apr 2017 20:06:11 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3MK6Bfr064374; Sat, 22 Apr 2017 20:06:11 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201704222006.v3MK6Bfr064374@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 22 Apr 2017 20:06:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317291 - head/tools/regression/geom_gpt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 22 Apr 2017 20:06:12 -0000 Author: ngie Date: Sat Apr 22 20:06:11 2017 New Revision: 317291 URL: https://svnweb.freebsd.org/changeset/base/317291 Log: Rename gctl.t to gctl_test.t and test.c to gctl_test_helper.c This is being done to reduce ambiguity and to make the tests more portable in the future to other locations in the source tree. MFC after: 5 weeks Sponsored by: Dell EMC Isilon Added: head/tools/regression/geom_gpt/gctl_test.t - copied, changed from r317290, head/tools/regression/geom_gpt/gctl.t head/tools/regression/geom_gpt/gctl_test_helper.c - copied unchanged from r317290, head/tools/regression/geom_gpt/test.c Deleted: head/tools/regression/geom_gpt/gctl.t head/tools/regression/geom_gpt/test.c Copied and modified: head/tools/regression/geom_gpt/gctl_test.t (from r317290, head/tools/regression/geom_gpt/gctl.t) ============================================================================== --- head/tools/regression/geom_gpt/gctl.t Sat Apr 22 20:00:52 2017 (r317290, copy source) +++ head/tools/regression/geom_gpt/gctl_test.t Sat Apr 22 20:06:11 2017 (r317291) @@ -132,7 +132,7 @@ if (exists $ENV{'TEST_VERBOSE'}) { } # Compile the driver... -my $st = system("cc -o $cmd -g $srcdir/test.c -lgeom"); +my $st = system("cc -o $cmd -g $srcdir/gctl_test_helper.c -lgeom"); if ($st != 0) { print "1..0 # SKIP error compiling test.c\n"; exit 0; Copied: head/tools/regression/geom_gpt/gctl_test_helper.c (from r317290, head/tools/regression/geom_gpt/test.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/geom_gpt/gctl_test_helper.c Sat Apr 22 20:06:11 2017 (r317291, copy of r317290, head/tools/regression/geom_gpt/test.c) @@ -0,0 +1,165 @@ +/*- + * Copyright (c) 2005, 2006 Marcel Moolenaar + * 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 ``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. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include + +struct retval { + struct retval *retval; + const char *param; + char *value; +}; + +struct retval *retval; +int verbose; + +static void +usage() +{ + fprintf(stdout, "usage: %s [-v] param[:len][=value] ...\n", + getprogname()); + exit(1); +} + +static int +parse(char *arg, char **param, char **value, int *len) +{ + char *e, *colon, *equal; + + if (*arg == '\0') + return (EINVAL); + + colon = strchr(arg, ':'); + equal = strchr(arg, '='); + if (colon == NULL && equal == NULL) + return (EINVAL); + if (colon == arg || equal == arg) + return (EINVAL); + if (colon != NULL && equal != NULL && equal < colon) + return (EINVAL); + + if (colon != NULL) + *colon++ = '\0'; + if (equal != NULL) + *equal++ = '\0'; + + *param = arg; + if (colon != NULL) { + /* Length specification. This parameter is RW. */ + if (*colon == '\0') + return (EINVAL); + *len = strtol(colon, &e, 0); + if (*e != '\0') + return (EINVAL); + if (*len <= 0 || *len > PATH_MAX) + return (EINVAL); + *value = malloc(*len); + if (*value == NULL) + return (ENOMEM); + memset(*value, 0, *len); + if (equal != NULL) { + if (strlen(equal) >= PATH_MAX) + return (ENOMEM); + strcpy(*value, equal); + } + } else { + /* This parameter is RO. */ + *len = -1; + if (*equal == '\0') + return (EINVAL); + *value = equal; + } + + return (0); +} + +int main(int argc, char *argv[]) +{ + struct retval *rv; + struct gctl_req *req; + char *param, *value; + const char *s; + int c, len; + + req = gctl_get_handle(); + gctl_ro_param(req, "class", -1, "GPT"); + + while ((c = getopt(argc, argv, "v")) != -1) { + switch (c) { + case 'v': + verbose = 1; + break; + case '?': + default: + usage(); + /* NOTREACHED */ + break; + } + } + + while (optind < argc) { + if (!parse(argv[optind++], ¶m, &value, &len)) { + if (len > 0) { + rv = malloc(sizeof(struct retval)); + rv->param = param; + rv->value = value; + rv->retval = retval; + retval = rv; + gctl_rw_param(req, param, len, value); + } else + gctl_ro_param(req, param, -1, value); + } + } + + if (verbose) + gctl_dump(req, stdout); + + s = gctl_issue(req); + if (s == NULL) { + printf("PASS"); + while (retval != NULL) { + rv = retval->retval; + printf(" %s=%s", retval->param, retval->value); + free(retval->value); + free(retval); + retval = rv; + } + printf("\n"); + } else + printf("FAIL %s\n", s); + + gctl_free(req); + return (0); +} From owner-svn-src-head@freebsd.org Sat Apr 22 20:06:43 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 45A8CD4A01B; Sat, 22 Apr 2017 20:06:43 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1F0189AB; Sat, 22 Apr 2017 20:06:43 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id v3MK6foK047693; Sat, 22 Apr 2017 13:06:42 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id v3MK6fYX047692; Sat, 22 Apr 2017 13:06:41 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201704222006.v3MK6fYX047692@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r317290 - head/tools/regression/geom_gpt In-Reply-To: <201704222000.v3MK0qM2060655@repo.freebsd.org> To: Ngie Cooper Date: Sat, 22 Apr 2017 13:06:41 -0700 (PDT) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 22 Apr 2017 20:06:43 -0000 > Author: ngie > Date: Sat Apr 22 20:00:52 2017 > New Revision: 317290 > URL: https://svnweb.freebsd.org/changeset/base/317290 > > Log: > Fix -Wimplicit-function-declaration compilation warning by moving libgeom.h > #include below the stdio.h #include. > > gctl_dump(3) needs stdio.h, per reasoning noted in r317289. > > MFC after: 5 weeks > PR: 218809 > Submitted by: Chang-Hsien Tsai > Sponsored by: Dell EMC Isilon > > Modified: > head/tools/regression/geom_gpt/test.c > > Modified: head/tools/regression/geom_gpt/test.c > ============================================================================== > --- head/tools/regression/geom_gpt/test.c Sat Apr 22 19:32:23 2017 (r317289) > +++ head/tools/regression/geom_gpt/test.c Sat Apr 22 20:00:52 2017 (r317290) > @@ -29,12 +29,12 @@ __FBSDID("$FreeBSD$"); > > #include > #include > -#include > #include > #include > #include > #include > #include > +#include #include /* This is not in alphabetic order per r317289 */ > > struct retval { > struct retval *retval; Might it be a good idea to mark this in the test.c file as to why these are not sorted in order to prevent regressions of this in the future? -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Sat Apr 22 20:15:48 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C7ACDD4A24E; Sat, 22 Apr 2017 20:15:48 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8C8ADDD8; Sat, 22 Apr 2017 20:15:48 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3MKFlg5068456; Sat, 22 Apr 2017 20:15:47 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3MKFl4u068454; Sat, 22 Apr 2017 20:15:47 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201704222015.v3MKFl4u068454@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 22 Apr 2017 20:15:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317292 - head/tools/regression/geom_gpt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 22 Apr 2017 20:15:48 -0000 Author: ngie Date: Sat Apr 22 20:15:47 2017 New Revision: 317292 URL: https://svnweb.freebsd.org/changeset/base/317292 Log: gctl_test.t: use make to compile gctl_test_helper instead of calling cc directly MFC after: 5 weeks Sponsored by: Dell EMC Isilon Added: head/tools/regression/geom_gpt/Makefile (contents, props changed) Modified: head/tools/regression/geom_gpt/gctl_test.t Added: head/tools/regression/geom_gpt/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/geom_gpt/Makefile Sat Apr 22 20:15:47 2017 (r317292) @@ -0,0 +1,8 @@ +# $FreeBSD$ + +PROG= gctl_test_helper +MAN= + +LIBADD+= geom + +.include Modified: head/tools/regression/geom_gpt/gctl_test.t ============================================================================== --- head/tools/regression/geom_gpt/gctl_test.t Sat Apr 22 20:06:11 2017 (r317291) +++ head/tools/regression/geom_gpt/gctl_test.t Sat Apr 22 20:15:47 2017 (r317292) @@ -26,11 +26,6 @@ # # $FreeBSD$ -my $srcdir = `dirname $0`; -chomp $srcdir; - -my $cmd = "/tmp/gctl-$$"; -my $out = "$cmd.out"; my $disk = "/tmp/disk-$$"; my $mntpt = "/tmp/mount-$$"; @@ -132,11 +127,14 @@ if (exists $ENV{'TEST_VERBOSE'}) { } # Compile the driver... -my $st = system("cc -o $cmd -g $srcdir/gctl_test_helper.c -lgeom"); +my $st = system("make obj && make all"); if ($st != 0) { print "1..0 # SKIP error compiling test.c\n"; exit 0; } +chomp(my $cmd = `make '-V\${.OBJDIR}/\${PROG}'`); + +my $out = "/tmp/$cmd.out"; # Make sure we have permission to use gctl... if (`$cmd` =~ "^FAIL Permission denied") { From owner-svn-src-head@freebsd.org Sat Apr 22 20:27:47 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 692CCD4A502; Sat, 22 Apr 2017 20:27:47 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2D6C62FF; Sat, 22 Apr 2017 20:27:47 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3MKRkUQ072522; Sat, 22 Apr 2017 20:27:46 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3MKRkNI072521; Sat, 22 Apr 2017 20:27:46 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201704222027.v3MKRkNI072521@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 22 Apr 2017 20:27:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317293 - head/tools/regression/geom_gpt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 22 Apr 2017 20:27:47 -0000 Author: ngie Date: Sat Apr 22 20:27:46 2017 New Revision: 317293 URL: https://svnweb.freebsd.org/changeset/base/317293 Log: gctl_test_helper: apply polish - Staticize variables to fix warnings. - Sprinkle asserts around for calls that can fail - Apply style(9) for main(..) definition. - ANSIify usage(..) definition. MFC after: 5 weeks Sponsored by: Dell EMC Isilon Modified: head/tools/regression/geom_gpt/gctl_test_helper.c Modified: head/tools/regression/geom_gpt/gctl_test_helper.c ============================================================================== --- head/tools/regression/geom_gpt/gctl_test_helper.c Sat Apr 22 20:15:47 2017 (r317292) +++ head/tools/regression/geom_gpt/gctl_test_helper.c Sat Apr 22 20:27:46 2017 (r317293) @@ -28,6 +28,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include #include @@ -42,11 +43,11 @@ struct retval { char *value; }; -struct retval *retval; -int verbose; +static struct retval *retval; +static int verbose; static void -usage() +usage(void) { fprintf(stdout, "usage: %s [-v] param[:len][=value] ...\n", getprogname()); @@ -105,7 +106,8 @@ parse(char *arg, char **param, char **va return (0); } -int main(int argc, char *argv[]) +int +main(int argc, char *argv[]) { struct retval *rv; struct gctl_req *req; @@ -114,6 +116,7 @@ int main(int argc, char *argv[]) int c, len; req = gctl_get_handle(); + assert(req != NULL); gctl_ro_param(req, "class", -1, "GPT"); while ((c = getopt(argc, argv, "v")) != -1) { @@ -133,6 +136,7 @@ int main(int argc, char *argv[]) if (!parse(argv[optind++], ¶m, &value, &len)) { if (len > 0) { rv = malloc(sizeof(struct retval)); + assert(rv != NULL); rv->param = param; rv->value = value; rv->retval = retval; From owner-svn-src-head@freebsd.org Sat Apr 22 20:29:57 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 50CCAD4A5E9; Sat, 22 Apr 2017 20:29:57 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 207486B1; Sat, 22 Apr 2017 20:29:57 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3MKTucK072646; Sat, 22 Apr 2017 20:29:56 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3MKTuDG072645; Sat, 22 Apr 2017 20:29:56 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201704222029.v3MKTuDG072645@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 22 Apr 2017 20:29:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317294 - head/tools/regression/geom_gpt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 22 Apr 2017 20:29:57 -0000 Author: ngie Date: Sat Apr 22 20:29:56 2017 New Revision: 317294 URL: https://svnweb.freebsd.org/changeset/base/317294 Log: Bump WARNS to 6 per previous commits which fixed warnings MFC after: 5 weeks Tested with: clang (4.0), gcc (4.2.1, 6.3.0) Sponsored by: Dell EMC Isilon Modified: head/tools/regression/geom_gpt/Makefile Modified: head/tools/regression/geom_gpt/Makefile ============================================================================== --- head/tools/regression/geom_gpt/Makefile Sat Apr 22 20:27:46 2017 (r317293) +++ head/tools/regression/geom_gpt/Makefile Sat Apr 22 20:29:56 2017 (r317294) @@ -5,4 +5,6 @@ MAN= LIBADD+= geom +WARNS?= 6 + .include From owner-svn-src-head@freebsd.org Sat Apr 22 20:51:55 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8823CD4AD94; Sat, 22 Apr 2017 20:51:55 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 57A17223; Sat, 22 Apr 2017 20:51:55 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3MKpsY0083673; Sat, 22 Apr 2017 20:51:54 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3MKps6w083658; Sat, 22 Apr 2017 20:51:54 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201704222051.v3MKps6w083658@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 22 Apr 2017 20:51:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317295 - head/tools/regression/geom_gpt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 22 Apr 2017 20:51:55 -0000 Author: ngie Date: Sat Apr 22 20:51:54 2017 New Revision: 317295 URL: https://svnweb.freebsd.org/changeset/base/317295 Log: The GPT class no longer exists; use the PART class instead MFC after: 5 weeks Sponsored by: Dell EMC Isilon Modified: head/tools/regression/geom_gpt/gctl_test_helper.c Modified: head/tools/regression/geom_gpt/gctl_test_helper.c ============================================================================== --- head/tools/regression/geom_gpt/gctl_test_helper.c Sat Apr 22 20:29:56 2017 (r317294) +++ head/tools/regression/geom_gpt/gctl_test_helper.c Sat Apr 22 20:51:54 2017 (r317295) @@ -117,7 +117,7 @@ main(int argc, char *argv[]) req = gctl_get_handle(); assert(req != NULL); - gctl_ro_param(req, "class", -1, "GPT"); + gctl_ro_param(req, "class", -1, "PART"); while ((c = getopt(argc, argv, "v")) != -1) { switch (c) { From owner-svn-src-head@freebsd.org Sat Apr 22 20:55:41 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 372E1D4AFB5; Sat, 22 Apr 2017 20:55:41 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EE6786C1; Sat, 22 Apr 2017 20:55:40 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3MKteje084693; Sat, 22 Apr 2017 20:55:40 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3MKteHa084691; Sat, 22 Apr 2017 20:55:40 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201704222055.v3MKteHa084691@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Sat, 22 Apr 2017 20:55:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317296 - head/sys/fs/nfsclient X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 22 Apr 2017 20:55:41 -0000 Author: rmacklem Date: Sat Apr 22 20:55:39 2017 New Revision: 317296 URL: https://svnweb.freebsd.org/changeset/base/317296 Log: Fix some krpc leaks for the NFSv4.1/pNFS client. The NFSv4.1/pNFS client wasn't doing a newnfs_disconnect() call for the connection to the Data Server (DS) under some circumstances. The main effect of this was a leak of malloc'd structures in the krpc. This patch adds the newnfs_disconnect() calls to fix this. Detected during recent testing against the pNFS server under development. MFC after: 2 weeks Modified: head/sys/fs/nfsclient/nfs_clrpcops.c head/sys/fs/nfsclient/nfs_clvfsops.c Modified: head/sys/fs/nfsclient/nfs_clrpcops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clrpcops.c Sat Apr 22 20:51:54 2017 (r317295) +++ head/sys/fs/nfsclient/nfs_clrpcops.c Sat Apr 22 20:55:39 2017 (r317296) @@ -5399,10 +5399,13 @@ nfsrpc_fillsa(struct nfsmount *nmp, stru NFSCL_DEBUG(3, "DS connect=%d\n", error); /* Now, do the exchangeid and create session. */ - if (error == 0) + if (error == 0) { error = nfsrpc_exchangeid(nmp, clp, nrp, NFSV4EXCH_USEPNFSDS, &dsp, nrp->nr_cred, p); - NFSCL_DEBUG(3, "DS exchangeid=%d\n", error); + NFSCL_DEBUG(3, "DS exchangeid=%d\n", error); + if (error != 0) + newnfs_disconnect(nrp); + } if (error == 0) { dsp->nfsclds_sockp = nrp; NFSLOCKMNT(nmp); @@ -5445,8 +5448,10 @@ nfsrpc_fillsa(struct nfsmount *nmp, stru TAILQ_INSERT_TAIL(&nmp->nm_sess, dsp, nfsclds_list); NFSUNLOCKMNT(nmp); *dspp = dsp; - } else if (dsp != NULL) + } else if (dsp != NULL) { + newnfs_disconnect(nrp); nfscl_freenfsclds(dsp); + } return (error); } Modified: head/sys/fs/nfsclient/nfs_clvfsops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clvfsops.c Sat Apr 22 20:51:54 2017 (r317295) +++ head/sys/fs/nfsclient/nfs_clvfsops.c Sat Apr 22 20:55:39 2017 (r317296) @@ -1643,8 +1643,12 @@ bad: NFSUNLOCKCLSTATE(); free(nmp->nm_clp, M_NFSCLCLIENT); } - TAILQ_FOREACH_SAFE(dsp, &nmp->nm_sess, nfsclds_list, tdsp) + TAILQ_FOREACH_SAFE(dsp, &nmp->nm_sess, nfsclds_list, tdsp) { + if (dsp != TAILQ_FIRST(&nmp->nm_sess) && + dsp->nfsclds_sockp != NULL) + newnfs_disconnect(dsp->nfsclds_sockp); nfscl_freenfsclds(dsp); + } FREE(nmp, M_NEWNFSMNT); FREE(nam, M_SONAME); return (error); @@ -1709,8 +1713,12 @@ nfs_unmount(struct mount *mp, int mntfla AUTH_DESTROY(nmp->nm_sockreq.nr_auth); mtx_destroy(&nmp->nm_sockreq.nr_mtx); mtx_destroy(&nmp->nm_mtx); - TAILQ_FOREACH_SAFE(dsp, &nmp->nm_sess, nfsclds_list, tdsp) + TAILQ_FOREACH_SAFE(dsp, &nmp->nm_sess, nfsclds_list, tdsp) { + if (dsp != TAILQ_FIRST(&nmp->nm_sess) && + dsp->nfsclds_sockp != NULL) + newnfs_disconnect(dsp->nfsclds_sockp); nfscl_freenfsclds(dsp); + } FREE(nmp, M_NEWNFSMNT); out: return (error); From owner-svn-src-head@freebsd.org Sat Apr 22 20:59:32 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A5107D4B097; Sat, 22 Apr 2017 20:59:32 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-io0-x244.google.com (mail-io0-x244.google.com [IPv6:2607:f8b0:4001:c06::244]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6ED048FF; Sat, 22 Apr 2017 20:59:32 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-io0-x244.google.com with SMTP id k87so38461730ioi.0; Sat, 22 Apr 2017 13:59:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=lmao55jtrqoXc8UH4D+QZaWGXEwSz4cW2128BYAisjk=; b=G0BqOF9tzsj//cbwpo/S9LZasAlxusjKyeD9bY+dlHqgaI4X5/gYk0KCVxhR2YK8e1 GOF7ruGTIfkHJmgwYWcAPghL6geAG7n0phcPohLqZYu+UDW4TPKCiGmjWVlWxpHUctBv HhJrKA2+yxy3KbB6ifWEmW5M2SQ7IZBfb9YK883fOYw3kbkZ/kl8xtuL4ePzOE6q9NWk 7eEZMq8TCKuyRZg4VZbQ5wNkniK/Ikv+Thq4KWBPB8xjLcRj99Mk4Wby+T8U46Uo1gLj MvArFAMCeCZ0mXPCFhwTMn1xwIhEPny1Aye/nRcEhbPjXr9RPm4+IKN8qgvh3AcKZ2Lh htzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=lmao55jtrqoXc8UH4D+QZaWGXEwSz4cW2128BYAisjk=; b=iEElcI1SH3JrVy08WEzPKa84AzNk3gilqN3gY1SvPf6DSHlteJx3zssIHheGmdRl97 BkwbUfZj5EfNNfEZwnlsslRKYVXuNg9aZ9wacY+wF7Gc0DISMJcNCPh6l+jqiOs941zc QVkzYMxYfLXRR/n9CtkA7mWSKN9rKgPCijXTexpJTgpyJK7+rFyB3b575FlCNl2/LUtb f1CB/4jz6LDlbPor42cK6weOo9anpAj3rB6urpCuNU4t9D9nV9B9VF/8ApE73G4iCdQf AwwB1mnySrdDzK0VmikjnQeon2PEzYos7qsaOc/DtSQbrprNFJKV9GXkbMRRAg833X2W nZqA== X-Gm-Message-State: AN3rC/5TTOkfFS9HjphbaaZSAJtWv3ivUe1Js472k9fhlH8AGoJMXy3Y LpEMV4JdhjAUu9KlPlM= X-Received: by 10.98.100.75 with SMTP id y72mr17970903pfb.44.1492894771589; Sat, 22 Apr 2017 13:59:31 -0700 (PDT) Received: from pinklady.local (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id p2sm22907022pfj.93.2017.04.22.13.59.30 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 22 Apr 2017 13:59:30 -0700 (PDT) Subject: Re: svn commit: r317290 - head/tools/regression/geom_gpt Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_FE4CD735-896B-4905-8281-979374D404D9"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <201704222006.v3MK6fYX047692@pdx.rh.CN85.dnsmgr.net> Date: Sat, 22 Apr 2017 13:59:29 -0700 Cc: Ngie Cooper , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: <3238ED82-1FAA-4E7C-81B9-A9E9E417E860@gmail.com> References: <201704222006.v3MK6fYX047692@pdx.rh.CN85.dnsmgr.net> To: rgrimes@freebsd.org X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 22 Apr 2017 20:59:32 -0000 --Apple-Mail=_FE4CD735-896B-4905-8281-979374D404D9 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Apr 22, 2017, at 13:06, Rodney W. Grimes = wrote: >=20 >> Author: ngie >> Date: Sat Apr 22 20:00:52 2017 >> New Revision: 317290 >> URL: https://svnweb.freebsd.org/changeset/base/317290 >>=20 >> Log: >> Fix -Wimplicit-function-declaration compilation warning by moving = libgeom.h >> #include below the stdio.h #include. >>=20 >> gctl_dump(3) needs stdio.h, per reasoning noted in r317289. >>=20 >> MFC after: 5 weeks >> PR: 218809 >> Submitted by: Chang-Hsien Tsai >> Sponsored by: Dell EMC Isilon >>=20 >> Modified: >> head/tools/regression/geom_gpt/test.c >>=20 >> Modified: head/tools/regression/geom_gpt/test.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/tools/regression/geom_gpt/test.c Sat Apr 22 19:32:23 2017 = (r317289) >> +++ head/tools/regression/geom_gpt/test.c Sat Apr 22 20:00:52 2017 = (r317290) >> @@ -29,12 +29,12 @@ __FBSDID("$FreeBSD$"); >>=20 >> #include >> #include >> -#include >> #include >> #include >> #include >> #include >> #include >> +#include > #include /* This is not in alphabetic order per r317289 = */ >>=20 >> struct retval { >> struct retval *retval; >=20 > Might it be a good idea to mark this in the test.c file as to why > these are not sorted in order to prevent regressions of this in > the future? Please see r317289. There was an omission in the documentation that = allowed this to happen. This also won=E2=80=99t happen again given that the test is now being = compiled with WARNS?=3D 6 :). -Ngie --Apple-Mail=_FE4CD735-896B-4905-8281-979374D404D9 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJY+8QxAAoJEPWDqSZpMIYVg3oQAJXWvqhBMF2vVI9deaeRO1OR op1hutymdCABzoQBME+7sVHYZLxCPFBqShtEu5/1TPBaIBKlnVx2cFjKstAvyeaj 7j1+qiO+xh4x6FpknZUNf380A8P9R5zk5o9ZKx6SBAQvGZHHgs7JSXdWyhsMaAcq DHejMJp6nut/nuy5h2PSE4T97n3YgpdIOeiLVAGaYamdkvwht3I2uN6grB6GhDPy NjN9zUBVXA3Z0rNU+WoJQtVnTgtPUVXu++GJxKpg4zyHNwvJ1HqsISUcvD/QwXlB UFpLifVUUNM13rfC7q64tHNu7WVsDOlzI9c7MtlsEO2lqqCDHh49Ie6NaXVnRD5p E0tQjlTlU//Y0JO2AkIup+fgoFqEt0CrkVbvKe+RgmifeaVrHQd4v1KFNF9iz77U pvk8PKNFu/fNFmqUj1TulNl5yikuFsRj4tpD1iJSllrJgp35UfTDWZvU+4txT8kr 5+VldmKnsRWg/z4JUwYsE4whyyPfzSDVyh99xy/jJKmETxbocv7maDOvYYVZeWu1 b5tgfDXGU5AYZy1gLZxXTgNb+qf14USyOxB0cAkS5ygDOIFKDkYS3384N5V46+/Q MAleFCfz8sJzXMzoTIoxm6+EqSeM6jVxRS8e3nk1YnpvNPTsSaxSugottRgs7iNv /AvAB7IoJLNfgYo8yFvI =ltO5 -----END PGP SIGNATURE----- --Apple-Mail=_FE4CD735-896B-4905-8281-979374D404D9-- From owner-svn-src-head@freebsd.org Sat Apr 22 21:09:41 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 08CD0D4B35D; Sat, 22 Apr 2017 21:09:41 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B5E4CDBD; Sat, 22 Apr 2017 21:09:40 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id v3ML9aWB047900; Sat, 22 Apr 2017 14:09:36 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id v3ML9ahr047899; Sat, 22 Apr 2017 14:09:36 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201704222109.v3ML9ahr047899@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r317290 - head/tools/regression/geom_gpt In-Reply-To: <3238ED82-1FAA-4E7C-81B9-A9E9E417E860@gmail.com> To: "Ngie Cooper (yaneurabeya)" Date: Sat, 22 Apr 2017 14:09:36 -0700 (PDT) CC: rgrimes@freebsd.org, Ngie Cooper , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 22 Apr 2017 21:09:41 -0000 -- Start of PGP signed section. [ Charset UTF-8 unsupported, converting... ] > > > On Apr 22, 2017, at 13:06, Rodney W. Grimes wrote: > > > >> Author: ngie > >> Date: Sat Apr 22 20:00:52 2017 > >> New Revision: 317290 > >> URL: https://svnweb.freebsd.org/changeset/base/317290 > >> > >> Log: > >> Fix -Wimplicit-function-declaration compilation warning by moving libgeom.h > >> #include below the stdio.h #include. > >> > >> gctl_dump(3) needs stdio.h, per reasoning noted in r317289. > >> > >> MFC after: 5 weeks > >> PR: 218809 > >> Submitted by: Chang-Hsien Tsai > >> Sponsored by: Dell EMC Isilon > >> > >> Modified: > >> head/tools/regression/geom_gpt/test.c > >> > >> Modified: head/tools/regression/geom_gpt/test.c > >> ============================================================================== > >> --- head/tools/regression/geom_gpt/test.c Sat Apr 22 19:32:23 2017 (r317289) > >> +++ head/tools/regression/geom_gpt/test.c Sat Apr 22 20:00:52 2017 (r317290) > >> @@ -29,12 +29,12 @@ __FBSDID("$FreeBSD$"); > >> > >> #include > >> #include > >> -#include > >> #include > >> #include > >> #include > >> #include > >> #include > >> +#include > > #include /* This is not in alphabetic order per r317289 */ > >> > >> struct retval { > >> struct retval *retval; > > > > Might it be a good idea to mark this in the test.c file as to why > > these are not sorted in order to prevent regressions of this in > > the future? > > Please see r317289. There was an omission in the documentation that allowed this to happen. I had seen that already when I made my post, that docuement is not going to stop someone from going "Oh, these are out of order I am going to sort them since I am here" They well then probably have issues due to your next statement about WARNS and go hum, what is that all about. And either investigate and hopefully find the right thing, or do more wrong things. When #includes are out of order for good reason the source code file should be market as such and not dependend on the near 0 likelyhood someone is going to go read a man page to find out why. > > This also won?t happen again given that the test is now being compiled with WARNS?= 6 :). > > -Ngie -- End of PGP section, PGP failed! -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Sat Apr 22 21:19:51 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CF4AFD4B549; Sat, 22 Apr 2017 21:19:51 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-it0-x243.google.com (mail-it0-x243.google.com [IPv6:2607:f8b0:4001:c0b::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 93419210; Sat, 22 Apr 2017 21:19:51 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-it0-x243.google.com with SMTP id e132so6515117ite.2; Sat, 22 Apr 2017 14:19:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=ECcEhPwZup27ttw1zWq+ZYl4ckLCU8N3E93V5xsOQSs=; b=ToZQj4YTH+JHm45jEhXb6cZ6n8+mgC6iN47gPhWa1JVFr8PT2Xwb2NHUpXOtdKAhM5 SeiX2PHsJZmjiLgrbQod6RIbbb5TgedpAuawJGhqHu0QrW0w/S/oJQ/pZuNq60DKcnk8 TxAU6RVh1UYqi8BRnqtzdMZdrARO5357Px3ljdc1hABPhVcdu9n2gs07RzOmKNTC4D7I 7l4TBvO6LOoxLNiDa1D7Q4e6l+m0/e4DzkSSJcILKg0A+lspccH8EdgpR7sNfz9z3wcs Ju5UowEQo9Qbi8l9xKlhB6vVS1oC5/1eA0gsgVck3ZvAxaBPhGsnzUam/TRde6dQxl31 lI0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=ECcEhPwZup27ttw1zWq+ZYl4ckLCU8N3E93V5xsOQSs=; b=tMI9Uri3LJbgD7xVZtvjTP3+549u/9X6cZAcfp1A4tL3jkCZ98GF1Bpujz40DfkldA e/0rPiUQ6OnWV6KhPpqHn5JKBC63cw70kNAjjC2B5hgd6BhW4OO4rjqSYhtGt1JAPxXd QAGfTIb/np72qjyHv0NvDYlGrfuL/OrH+EdX2kbtVrEu1xQodB5wkfbevn+5UMShqPiJ HD7b6faAoq/L0Ljv5EBhv+sosJJ7R8OE00TfjvpQSDU01aUG1xnNmBbRCfuYBILBkCJ2 iBCw5AfCWkQdT0CM05+bh0JHSuYDD2B8o10Op9xGkNiwCv4jR0MlgeoiAcngQhVzFvN6 rB9w== X-Gm-Message-State: AN3rC/54dlSxvWn8ts3xAuLutEJcEHAy85gOXWP0RLvfCDoAuT1iGu1L yX0SpFibBijjqd9MbBY= X-Received: by 10.84.217.215 with SMTP id d23mr23301677plj.59.1492895990677; Sat, 22 Apr 2017 14:19:50 -0700 (PDT) Received: from pinklady.local (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id c83sm22897272pfd.113.2017.04.22.14.19.49 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 22 Apr 2017 14:19:49 -0700 (PDT) Subject: Re: svn commit: r317290 - head/tools/regression/geom_gpt Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_E8EF0A77-B3FC-48AE-914B-B14721A7887F"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <201704222109.v3ML9ahr047899@pdx.rh.CN85.dnsmgr.net> Date: Sat, 22 Apr 2017 14:19:48 -0700 Cc: Ngie Cooper , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: References: <201704222109.v3ML9ahr047899@pdx.rh.CN85.dnsmgr.net> To: rgrimes@freebsd.org X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 22 Apr 2017 21:19:51 -0000 --Apple-Mail=_E8EF0A77-B3FC-48AE-914B-B14721A7887F Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Apr 22, 2017, at 14:09, Rodney W. Grimes = wrote: =E2=80=A6 > I had seen that already when I made my post, that docuement is not = going > to stop someone from going "Oh, these are out of order I am going to = sort > them since I am here" They well then probably have issues due to your = next > statement about WARNS and go hum, what is that all about. And either > investigate and hopefully find the right thing, or do more wrong = things. >=20 > When #includes are out of order for good reason the source code file = should > be market as such and not dependend on the near 0 likelyhood someone > is going to go read a man page to find out why. The issue you=E2=80=99re noting is no different from someone = removing/shuffling around another header in the C file. If someone does = that, the least they need to do is build test their changes, and ideally = they should runtime test the changes as well. WARNS is insurance against someone sorting headers and things breaking = again, because gctl_dump will not be defined (per the compiler message = noted in the PR). At which point the party should do =E2=80=9Cman = gctl_dump=E2=80=9D and see the comment about stdio.h being required for = it: $ man gctl_dump ... SYNOPSIS /* stdio.h is only required for `gctl_dump` */ #include #include =E2=80=A6 Put differently, this is no different of an issue than anything else and = I really don=E2=80=99t see the value in adding a comment stating that = the order is such because of gctl_dump needing stdio.h to be = #include=E2=80=99d first. Thanks, -Ngie --Apple-Mail=_E8EF0A77-B3FC-48AE-914B-B14721A7887F Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJY+8j1AAoJEPWDqSZpMIYVSz8QAMyDE0nHWs6O3oe+3SyYovnJ Yhqz3/FxWeId4bImQIdwMJNM6CroYHY3DkGWfnO8l7RPeKQv5R1a3sA5UvB/rPUS oBZGWwEPAKlUL+TttI0rnNKCRSP6XyttknU2wiccpFAloBXD2aL5XTD8sbOdTgUo Pu7t8NEXCqtG5PmDKtc5a6vl+fNl0ev3srJDAecX9J9DdaeoNAcltWOBN80HcbVU wS3mGW3KjPAohl/cwKUyig3iVeuSZ0f0arSKVymPtFWN+4MiV5Rfifl98UrreDD5 +JpzuTMacCWZhCPlhOvohymOMFr28/VW2AOXXTJY+JEvN0yCmgNBsTYy00oZs5+I PO6a5n/and7eRx/UmcfnxcdG639930kilmV8x3oKDzYSSz8RDCXKQAC0z1EdfF09 lkk93jQOeSvxWqi1N9rupzYuATTHS0nUWIf1Lrht1aJa+Fz4EVMEMKx3ShVW3KGK L0v4dYGT5lveTFOQ6xjRKx2wjKLP3XhDx9d29lReOZE/iIxXi/EZdmLzQ2LsvMVr pyDAF3YGQSNtyYq+MEGpINaPNNYWb6B9TGVlqgBBneaIYOeB9Mj8fpilvJK5uT35 0A9I3gvzpGTZeypMbo10vg3y73TxrLh5hX9OWLLVJHxqFdoDhp+rLpCB3CEtJTRB kQ6E2RGZYnENvRkgmn4v =PXbU -----END PGP SIGNATURE----- --Apple-Mail=_E8EF0A77-B3FC-48AE-914B-B14721A7887F-- From owner-svn-src-head@freebsd.org Sat Apr 22 21:26:16 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 75D90D4B732; Sat, 22 Apr 2017 21:26:16 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 37ECF8EA; Sat, 22 Apr 2017 21:26:16 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3MLQF2o096851; Sat, 22 Apr 2017 21:26:15 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3MLQFgJ096850; Sat, 22 Apr 2017 21:26:15 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201704222126.v3MLQFgJ096850@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 22 Apr 2017 21:26:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317297 - head/contrib/netbsd-tests/usr.bin/grep X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 22 Apr 2017 21:26:16 -0000 Author: ngie Date: Sat Apr 22 21:26:15 2017 New Revision: 317297 URL: https://svnweb.freebsd.org/changeset/base/317297 Log: Remove the expected failures for :context and :context2 with bsdgrep(1) They're no longer needed after recent fixes made to bsdgrep(1). Submitted by: Kyle Evans (via a previous diff in D10433) Sponsored by: Dell EMC Isilon Modified: head/contrib/netbsd-tests/usr.bin/grep/t_grep.sh Modified: head/contrib/netbsd-tests/usr.bin/grep/t_grep.sh ============================================================================== --- head/contrib/netbsd-tests/usr.bin/grep/t_grep.sh Sat Apr 22 20:55:39 2017 (r317296) +++ head/contrib/netbsd-tests/usr.bin/grep/t_grep.sh Sat Apr 22 21:26:15 2017 (r317297) @@ -159,12 +159,6 @@ context_head() } context_body() { - # Begin FreeBSD - grep_type - if [ $? -eq $GREP_TYPE_BSD ]; then - atf_expect_fail "this test doesn't pass with BSD grep yet" - fi - # End FreeBSD cp $(atf_get_srcdir)/d_context_*.* . atf_check -o file:d_context_a.out grep -C2 bamboo d_context_a.in @@ -226,12 +220,6 @@ context2_head() } context2_body() { - # Begin FreeBSD - grep_type - if [ $? -eq $GREP_TYPE_BSD ]; then - atf_expect_fail "this test doesn't pass with BSD grep yet" - fi - # End FreeBSD printf "haddock\000cod\000plaice\000" > test1 printf "mackeral\000cod\000crab\000" > test2 From owner-svn-src-head@freebsd.org Sat Apr 22 21:31:38 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CC905D4B95F; Sat, 22 Apr 2017 21:31:38 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9E72EB54; Sat, 22 Apr 2017 21:31:38 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3MLVbX1097762; Sat, 22 Apr 2017 21:31:37 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3MLVb6k097759; Sat, 22 Apr 2017 21:31:37 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201704222131.v3MLVb6k097759@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Sat, 22 Apr 2017 21:31:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317298 - head/bin/sh X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 22 Apr 2017 21:31:38 -0000 Author: jilles Date: Sat Apr 22 21:31:37 2017 New Revision: 317298 URL: https://svnweb.freebsd.org/changeset/base/317298 Log: sh: Simplify setinteractive(). setsignal() does nothing if the signal disposition is already set correctly. Modified: head/bin/sh/options.c head/bin/sh/trap.c head/bin/sh/trap.h Modified: head/bin/sh/options.c ============================================================================== --- head/bin/sh/options.c Sat Apr 22 21:26:15 2017 (r317297) +++ head/bin/sh/options.c Sat Apr 22 21:31:37 2017 (r317298) @@ -131,7 +131,7 @@ procargs(int argc, char **argv) void optschanged(void) { - setinteractive(iflag); + setinteractive(); #ifndef NO_HISTORY histedit(); #endif Modified: head/bin/sh/trap.c ============================================================================== --- head/bin/sh/trap.c Sat Apr 22 21:26:15 2017 (r317297) +++ head/bin/sh/trap.c Sat Apr 22 21:31:37 2017 (r317298) @@ -478,19 +478,14 @@ dotrap(void) /* - * Controls whether the shell is interactive or not. + * Controls whether the shell is interactive or not based on iflag. */ void -setinteractive(int on) +setinteractive(void) { - static int is_interactive = -1; - - if (on == is_interactive) - return; setsignal(SIGINT); setsignal(SIGQUIT); setsignal(SIGTERM); - is_interactive = on; } Modified: head/bin/sh/trap.h ============================================================================== --- head/bin/sh/trap.h Sat Apr 22 21:26:15 2017 (r317297) +++ head/bin/sh/trap.h Sat Apr 22 21:31:37 2017 (r317298) @@ -43,6 +43,6 @@ void ignoresig(int); int issigchldtrapped(void); void onsig(int); void dotrap(void); -void setinteractive(int); +void setinteractive(void); void exitshell(int) __dead2; void exitshell_savedstatus(void) __dead2; From owner-svn-src-head@freebsd.org Sat Apr 22 21:40:11 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7ACDAD4BA3F; Sat, 22 Apr 2017 21:40:11 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3E0CFEF5; Sat, 22 Apr 2017 21:40:11 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3MLeAbT001110; Sat, 22 Apr 2017 21:40:10 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3MLeAik001109; Sat, 22 Apr 2017 21:40:10 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201704222140.v3MLeAik001109@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 22 Apr 2017 21:40:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317299 - head/contrib/netbsd-tests/usr.bin/grep X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 22 Apr 2017 21:40:11 -0000 Author: ngie Date: Sat Apr 22 21:40:10 2017 New Revision: 317299 URL: https://svnweb.freebsd.org/changeset/base/317299 Log: Add more sanity tests for grep, egrep, and fgrep The test suite currently lacks basic sanity checks to ensure that egrep, fgrep, and grep are actually matching the right expression types, i.e. passing the right flags to regcomp(3). Amend the test suite to make sure that not only are the individual versions doing the right thing, but also that we don't have some kind of frankenregex situation happening where egrep is accepting a BRE or grep an ERE. I've chosen to not expand the 'basic' test but to add the 'grep_sanity' checks to their own test case since this is testing for more than just 'grep matches things', but actual expression types. Differential Revision: D10444 Reviewed by: emaste, ngie Submitted by: Kyle Evans Tested with: bsdgrep, gnu grep (base, ports) Sponsored by: Dell EMC Isilon Modified: head/contrib/netbsd-tests/usr.bin/grep/t_grep.sh Modified: head/contrib/netbsd-tests/usr.bin/grep/t_grep.sh ============================================================================== --- head/contrib/netbsd-tests/usr.bin/grep/t_grep.sh Sat Apr 22 21:31:37 2017 (r317298) +++ head/contrib/netbsd-tests/usr.bin/grep/t_grep.sh Sat Apr 22 21:40:10 2017 (r317299) @@ -379,6 +379,66 @@ zerolen_body() atf_check -o inline:"Eggs\nCheese\n" grep -v -e "^$" test1 } + +atf_test_case fgrep_sanity +fgrep_sanity_head() +{ + atf_set "descr" "Check for fgrep sanity, literal expressions only" +} +fgrep_sanity_body() +{ + printf "Foo" > test1 + + atf_check -o inline:"Foo\n" fgrep -e "Foo" test1 + + atf_check -s exit:1 -o empty fgrep -e "Fo." test1 +} + +atf_test_case egrep_sanity +egrep_sanity_head() +{ + atf_set "descr" "Check for egrep sanity, EREs only" +} +egrep_sanity_body() +{ + printf "Foobar(ed)" > test1 + printf "M{1}" > test2 + + atf_check -o inline:"Foo\n" egrep -o -e "F.." test1 + + atf_check -o inline:"Foobar\n" egrep -o -e "F[a-z]*" test1 + + atf_check -o inline:"Fo\n" egrep -o -e "F(o|p)" test1 + + atf_check -o inline:"(ed)\n" egrep -o -e "\(ed\)" test1 + + atf_check -o inline:"M\n" egrep -o -e "M{1}" test2 + + atf_check -o inline:"M{1}\n" egrep -o -e "M\{1\}" test2 +} + +atf_test_case grep_sanity +grep_sanity_head() +{ + atf_set "descr" "Check for basic grep sanity, BREs only" +} +grep_sanity_body() +{ + printf "Foobar(ed)" > test1 + printf "M{1}" > test2 + + atf_check -o inline:"Foo\n" grep -o -e "F.." test1 + + atf_check -o inline:"Foobar\n" grep -o -e "F[a-z]*" test1 + + atf_check -o inline:"Fo\n" grep -o -e "F\(o\)" test1 + + atf_check -o inline:"(ed)\n" grep -o -e "(ed)" test1 + + atf_check -o inline:"M{1}\n" grep -o -e "M{1}" test2 + + atf_check -o inline:"M\n" grep -o -e "M\{1\}" test2 +} # End FreeBSD atf_init_test_cases() @@ -407,5 +467,8 @@ atf_init_test_cases() atf_add_test_case escmap atf_add_test_case egrep_empty_invalid atf_add_test_case zerolen + atf_add_test_case fgrep_sanity + atf_add_test_case egrep_sanity + atf_add_test_case grep_sanity # End FreeBSD } From owner-svn-src-head@freebsd.org Sat Apr 22 21:40:33 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 073FED4BAA2; Sat, 22 Apr 2017 21:40:33 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CBC31A2; Sat, 22 Apr 2017 21:40:32 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3MLeVep001168; Sat, 22 Apr 2017 21:40:31 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3MLeV1D001167; Sat, 22 Apr 2017 21:40:31 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201704222140.v3MLeV1D001167@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 22 Apr 2017 21:40:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317300 - head/usr.bin/grep/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 22 Apr 2017 21:40:33 -0000 Author: ngie Date: Sat Apr 22 21:40:31 2017 New Revision: 317300 URL: https://svnweb.freebsd.org/changeset/base/317300 Log: Only expect :grep_r_implied to pass with bsdgrep(1) The test fails with gnu grep from base and ports. Sponsored by: Dell EMC Isilon Modified: head/usr.bin/grep/tests/grep_freebsd_test.sh Modified: head/usr.bin/grep/tests/grep_freebsd_test.sh ============================================================================== --- head/usr.bin/grep/tests/grep_freebsd_test.sh Sat Apr 22 21:40:10 2017 (r317299) +++ head/usr.bin/grep/tests/grep_freebsd_test.sh Sat Apr 22 21:40:31 2017 (r317300) @@ -25,11 +25,45 @@ # # $FreeBSD$ +# What grep(1) are we working with? +# - 0 : bsdgrep +# - 1 : gnu grep 2.51 (base) +# - 2 : gnu grep (ports) +GREP_TYPE_BSD=0 +GREP_TYPE_GNU_FREEBSD=1 +GREP_TYPE_GNU=2 +GREP_TYPE_UNKNOWN=3 + +grep_type() +{ + local grep_version=$(grep --version) + + case "$grep_version" in + *"BSD grep"*) + return $GREP_TYPE_BSD + ;; + *"GNU grep"*) + case "$grep_version" in + *2.5.1-FreeBSD*) + return $GREP_TYPE_GNU_FREEBSD + ;; + *) + return $GREP_TYPE_GNU + ;; + esac + ;; + esac + atf_fail "unknown grep type: $grep_version" +} + atf_test_case grep_r_implied grep_r_implied_body() { - (cd "$(atf_get_srcdir)" && grep -r -e "test" < /dev/null) || - atf_skip "Implied working directory is not supported with your version of grep(1)" + grep_type + if [ $? -ne $GREP_TYPE_BSD ]; then + atf_skip "this test only works with bsdgrep(1)" + fi + (cd "$(atf_get_srcdir)" && grep -r --exclude="*.out" -e "test" .) > d_grep_r_implied.out atf_check -s exit:0 -x \ From owner-svn-src-head@freebsd.org Sat Apr 22 22:05:43 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5E872D4B210 for ; Sat, 22 Apr 2017 22:05:43 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1a.eu.mailhop.org (outbound1a.eu.mailhop.org [52.58.109.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E7393199 for ; Sat, 22 Apr 2017 22:05:42 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: cd73eff9-27a7-11e7-b96e-2378c10e3beb X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 73.78.92.27 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [73.78.92.27]) by outbound1.eu.mailhop.org (Halon) with ESMTPSA id cd73eff9-27a7-11e7-b96e-2378c10e3beb; Sat, 22 Apr 2017 22:05:33 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id v3MM5S64006736; Sat, 22 Apr 2017 16:05:28 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1492898728.56859.13.camel@freebsd.org> Subject: Re: svn commit: r316978 - in head: contrib/zstd etc/mtree lib lib/libzstd share/mk usr.bin usr.bin/zstd From: Ian Lepore To: Baptiste Daroussin , rgrimes@freebsd.org Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Sat, 22 Apr 2017 16:05:28 -0600 In-Reply-To: <20170416073551.557czdcksdmmuz24@ivaldir.net> References: <201704152005.v3FK5M2j002459@repo.freebsd.org> <201704152337.v3FNb2m1014053@pdx.rh.CN85.dnsmgr.net> <20170416073551.557czdcksdmmuz24@ivaldir.net> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 22 Apr 2017 22:05:43 -0000 On Sun, 2017-04-16 at 09:35 +0200, Baptiste Daroussin wrote: > On Sat, Apr 15, 2017 at 04:37:02PM -0700, Rodney W. Grimes wrote: > > > > And we need this in base for what great purpose??? > > > zstandard is the successor to lz4, there are attempts to integrate > zstandard in > ZFS, Allan Jude is working on that, I am working on integrating in > libstand to > allow to boot a kernel compressed with zstandard or a mfsroot with > zstandard, > which would benefit lots of pxe users. > > I have also added it to newsyslog(8) so users can benefit zstandard > compression > for the log files, which will consume less CPUs for greater > compression that > bzip2. On low ended boxes with low storage this is actually very > useful as well. > > I haven't checked yet the performances on my armv6 boxes, but on the > low ended > recent atom laptops I can tell this is already very useful. > > Bapt Does it also need to be added to the toolkit in /rescue?  The other major compression tools in base are there. -- Ian From owner-svn-src-head@freebsd.org Sat Apr 22 22:34:46 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3C72FD4B83F; Sat, 22 Apr 2017 22:34:46 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0E6AC10C0; Sat, 22 Apr 2017 22:34:45 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3MMYjlm025413; Sat, 22 Apr 2017 22:34:45 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3MMYjSj025412; Sat, 22 Apr 2017 22:34:45 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201704222234.v3MMYjSj025412@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 22 Apr 2017 22:34:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317304 - head/tools/regression/geom_gpt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 22 Apr 2017 22:34:46 -0000 Author: ngie Date: Sat Apr 22 22:34:45 2017 New Revision: 317304 URL: https://svnweb.freebsd.org/changeset/base/317304 Log: gctl_test_helper: add diagnostic output for parse_retval(..) This will help end-users better diagnose issues with the function. MFC after: 5 weeks Sponsored by: Dell EMC Isilon Modified: head/tools/regression/geom_gpt/gctl_test_helper.c Modified: head/tools/regression/geom_gpt/gctl_test_helper.c ============================================================================== --- head/tools/regression/geom_gpt/gctl_test_helper.c Sat Apr 22 22:05:23 2017 (r317303) +++ head/tools/regression/geom_gpt/gctl_test_helper.c Sat Apr 22 22:34:45 2017 (r317304) @@ -29,6 +29,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -113,7 +114,7 @@ main(int argc, char *argv[]) struct gctl_req *req; char *param, *value; const char *s; - int c, len; + int c, len, parse_retval; req = gctl_get_handle(); assert(req != NULL); @@ -132,8 +133,9 @@ main(int argc, char *argv[]) } } - while (optind < argc) { - if (!parse(argv[optind++], ¶m, &value, &len)) { + for (; optind < argc; optind++) { + parse_retval = parse(argv[optind], ¶m, &value, &len); + if (parse_retval == 0) { if (len > 0) { rv = malloc(sizeof(struct retval)); assert(rv != NULL); @@ -144,7 +146,9 @@ main(int argc, char *argv[]) gctl_rw_param(req, param, len, value); } else gctl_ro_param(req, param, -1, value); - } + } else + warnc(parse_retval, "failed to parse argument (%s)", + argv[optind]); } if (verbose) From owner-svn-src-head@freebsd.org Sat Apr 22 22:37:46 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3FDF5D4B96D; Sat, 22 Apr 2017 22:37:46 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 02B1C136C; Sat, 22 Apr 2017 22:37:45 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3MMbjiX025732; Sat, 22 Apr 2017 22:37:45 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3MMbjcL025731; Sat, 22 Apr 2017 22:37:45 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201704222237.v3MMbjcL025731@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Sat, 22 Apr 2017 22:37:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317305 - head/sys/fs/nfsclient X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 22 Apr 2017 22:37:46 -0000 Author: rmacklem Date: Sat Apr 22 22:37:44 2017 New Revision: 317305 URL: https://svnweb.freebsd.org/changeset/base/317305 Log: Fix the NFSv4.1/pNFS client return layout on close. The "return layout on close" case in the pNFS client was badly broken. Fortunately, extant pNFS servers that I have tested against do not do this. This patch fixes it. It also changes the way the layout stateid.seqid is set for LayoutReturn. I think this change is correct w.r.t. the RFC, but I am not 100% sure. This was found during recent testing of the pNFS server under development. MFC after: 2 weeks Modified: head/sys/fs/nfsclient/nfs_clstate.c Modified: head/sys/fs/nfsclient/nfs_clstate.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clstate.c Sat Apr 22 22:34:45 2017 (r317304) +++ head/sys/fs/nfsclient/nfs_clstate.c Sat Apr 22 22:37:44 2017 (r317305) @@ -88,6 +88,8 @@ extern struct nfsstatsv1 nfsstatsv1; extern struct nfsreqhead nfsd_reqq; extern u_int32_t newnfs_false, newnfs_true; extern int nfscl_debuglevel; +extern int nfscl_enablecallb; +extern int nfs_numnfscbd; NFSREQSPINLOCK; NFSCLSTATEMUTEX; int nfscl_inited = 0; @@ -118,7 +120,8 @@ static struct nfsclclient *nfscl_getclnt static struct nfsclclient *nfscl_getclntsess(uint8_t *); static struct nfscldeleg *nfscl_finddeleg(struct nfsclclient *, u_int8_t *, int); -static void nfscl_retoncloselayout(struct nfsclclient *, uint8_t *, int); +static void nfscl_retoncloselayout(vnode_t, struct nfsclclient *, uint8_t *, + int, struct nfsclrecalllayout **); static void nfscl_reldevinfo_locked(struct nfscldevinfo *); static struct nfscllayout *nfscl_findlayout(struct nfsclclient *, u_int8_t *, int); @@ -3121,6 +3124,7 @@ nfscl_doclose(vnode_t vp, struct nfsclcl struct nfsclopen *op; struct nfscldeleg *dp; struct nfsfh *nfhp; + struct nfsclrecalllayout *recallp; int error; error = nfscl_getcl(vnode_mount(vp), NULL, NULL, 1, &clp); @@ -3129,6 +3133,7 @@ nfscl_doclose(vnode_t vp, struct nfsclcl *clpp = clp; nfhp = VTONFS(vp)->n_fhp; + recallp = malloc(sizeof(*recallp), M_NFSLAYRECALL, M_WAITOK); NFSLOCKCLSTATE(); /* * First get rid of the local Open structures, which should be no @@ -3148,7 +3153,7 @@ nfscl_doclose(vnode_t vp, struct nfsclcl } /* Return any layouts marked return on close. */ - nfscl_retoncloselayout(clp, nfhp->nfh_fh, nfhp->nfh_len); + nfscl_retoncloselayout(vp, clp, nfhp->nfh_fh, nfhp->nfh_len, &recallp); /* Now process the opens against the server. */ lookformore: @@ -3171,6 +3176,11 @@ lookformore: } } NFSUNLOCKCLSTATE(); + /* + * recallp has been set NULL by nfscl_retoncloselayout() if it was + * used by the function, but calling free() with a NULL pointer is ok. + */ + free(recallp, M_NFSLAYRECALL); return (0); } @@ -4890,28 +4900,32 @@ nfscl_getlayout(struct nfsclclient *clp, } /* - * Search for a layout by MDS file handle. If one is found that is marked - * "return on close", delete it, since it should now be forgotten. + * Search for a layout by MDS file handle. If one is found, mark in to be + * recalled, if it already marked "return on close". */ static void -nfscl_retoncloselayout(struct nfsclclient *clp, uint8_t *fhp, int fhlen) +nfscl_retoncloselayout(vnode_t vp, struct nfsclclient *clp, uint8_t *fhp, + int fhlen, struct nfsclrecalllayout **recallpp) { struct nfscllayout *lyp; + uint32_t iomode; -tryagain: + if (vp->v_type != VREG || !NFSHASPNFS(VFSTONFS(vnode_mount(vp))) || + nfscl_enablecallb == 0 || nfs_numnfscbd == 0 || + (VTONFS(vp)->n_flag & NNOLAYOUT) != 0) + return; lyp = nfscl_findlayout(clp, fhp, fhlen); - if (lyp != NULL && (lyp->nfsly_flags & NFSLY_RETONCLOSE) != 0) { - /* - * Wait for outstanding I/O ops to be done. - */ - if (lyp->nfsly_lock.nfslock_usecnt != 0 || - lyp->nfsly_lock.nfslock_lock != 0) { - lyp->nfsly_lock.nfslock_lock |= NFSV4LOCK_WANTED; - (void)mtx_sleep(&lyp->nfsly_lock, - NFSCLSTATEMUTEXPTR, PZERO, "nfslyc", 0); - goto tryagain; - } - nfscl_freelayout(lyp); + if (lyp != NULL && (lyp->nfsly_flags & (NFSLY_RETONCLOSE | + NFSLY_RECALL)) == NFSLY_RETONCLOSE) { + iomode = 0; + if (!LIST_EMPTY(&lyp->nfsly_flayread)) + iomode |= NFSLAYOUTIOMODE_READ; + if (!LIST_EMPTY(&lyp->nfsly_flayrw)) + iomode |= NFSLAYOUTIOMODE_RW; + (void)nfscl_layoutrecall(NFSLAYOUTRETURN_FILE, lyp, iomode, + 0, UINT64_MAX, lyp->nfsly_stateid.seqid, *recallpp); + NFSCL_DEBUG(4, "retoncls recall iomode=%d\n", iomode); + *recallpp = NULL; } } @@ -5195,8 +5209,8 @@ nfscl_layoutreturn(struct nfsmount *nmp, nfsv4stateid_t stateid; NFSBCOPY(lyp->nfsly_stateid.other, stateid.other, NFSX_STATEIDOTHER); + stateid.seqid = lyp->nfsly_stateid.seqid; LIST_FOREACH(rp, &lyp->nfsly_recall, nfsrecly_list) { - stateid.seqid = rp->nfsrecly_stateseqid; (void)nfsrpc_layoutreturn(nmp, lyp->nfsly_fh, lyp->nfsly_fhlen, 0, NFSLAYOUT_NFSV4_1_FILES, rp->nfsrecly_iomode, rp->nfsrecly_recalltype, From owner-svn-src-head@freebsd.org Sat Apr 22 22:40:41 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1B373D4BA54; Sat, 22 Apr 2017 22:40:41 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DF3B41576; Sat, 22 Apr 2017 22:40:40 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3MMeeTr025902; Sat, 22 Apr 2017 22:40:40 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3MMeevR025901; Sat, 22 Apr 2017 22:40:40 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201704222240.v3MMeevR025901@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 22 Apr 2017 22:40:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317306 - head/tools/regression/geom_gpt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 22 Apr 2017 22:40:41 -0000 Author: ngie Date: Sat Apr 22 22:40:39 2017 New Revision: 317306 URL: https://svnweb.freebsd.org/changeset/base/317306 Log: gctl_test.t: minor tweaks - Declare $count with the `my` scope operator to permit `use strict`. - Add `use strict`. - Use `use warnings` instead of using `-w` in the shebang. - Don't unlink $cmd when done (prevents unnecessary rebuilding). - Improve the error message when running with insufficient permissions, e.g., non-root. MFC after: 5 weeks Sponsored by: Dell EMC Isilon Modified: head/tools/regression/geom_gpt/gctl_test.t Modified: head/tools/regression/geom_gpt/gctl_test.t ============================================================================== --- head/tools/regression/geom_gpt/gctl_test.t Sat Apr 22 22:37:44 2017 (r317305) +++ head/tools/regression/geom_gpt/gctl_test.t Sat Apr 22 22:40:39 2017 (r317306) @@ -1,4 +1,4 @@ -#!/usr/bin/env perl -w +#!/usr/bin/env perl # # Copyright (c) 2005, 2006 Marcel Moolenaar # All rights reserved. @@ -26,6 +26,9 @@ # # $FreeBSD$ +use strict; +use warnings; + my $disk = "/tmp/disk-$$"; my $mntpt = "/tmp/mount-$$"; @@ -138,12 +141,12 @@ my $out = "/tmp/$cmd.out"; # Make sure we have permission to use gctl... if (`$cmd` =~ "^FAIL Permission denied") { - print "1..0 # SKIP not enough permission\n"; + print "1..0 # SKIP insufficient permissions\n"; unlink $cmd; exit 0; } -$count = keys (%steps); +my $count = keys (%steps); print "1..$count\n"; my $nr = 1; @@ -200,6 +203,4 @@ foreach my $key (sort keys %steps) { } $nr += 1; } - -unlink $cmd; exit 0; From owner-svn-src-head@freebsd.org Sat Apr 22 23:06:55 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2CC5ED4B22C; Sat, 22 Apr 2017 23:06:55 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F276A23B; Sat, 22 Apr 2017 23:06:54 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3MN6sXQ038112; Sat, 22 Apr 2017 23:06:54 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3MN6sZd038111; Sat, 22 Apr 2017 23:06:54 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201704222306.v3MN6sZd038111@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 22 Apr 2017 23:06:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317307 - head/tools/regression/geom_gpt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 22 Apr 2017 23:06:55 -0000 Author: ngie Date: Sat Apr 22 23:06:53 2017 New Revision: 317307 URL: https://svnweb.freebsd.org/changeset/base/317307 Log: Use verb=delete not verb=remove The `remove` verb hasn't been present in geom_part*(4) for well over a decade, if ever. I couldn't find any references to it in ^/stable/5 at least, which is around the timeframe that this test was written. MFC after: 5 weeks Sponsored by: Dell EMC Isilon Modified: head/tools/regression/geom_gpt/gctl_test.t Modified: head/tools/regression/geom_gpt/gctl_test.t ============================================================================== --- head/tools/regression/geom_gpt/gctl_test.t Sat Apr 22 22:40:39 2017 (r317306) +++ head/tools/regression/geom_gpt/gctl_test.t Sat Apr 22 23:06:53 2017 (r317307) @@ -68,9 +68,9 @@ my %steps = ( "054" => "conf", "060" => "gctl verb=add geom=%dev% type=516e7cb6-6ecf-11d6-8ff8-00022d09712b start=34 end=546 entry:8=1", "061" => "mount %dev%p1", - "062" => "gctl verb=remove geom=%dev% entry=1", + "062" => "gctl verb=delete geom=%dev% entry=1", "063" => "umount %dev%p1", - "064" => "gctl verb=remove geom=%dev% entry=1", + "064" => "gctl verb=delete geom=%dev% entry=1", "065" => "conf", "100" => "mdcfg destroy", "110" => "mdcfg create corrupted", From owner-svn-src-head@freebsd.org Sat Apr 22 23:27:08 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AC8FBD4B6D6; Sat, 22 Apr 2017 23:27:08 +0000 (UTC) (envelope-from bapt@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8B78ED20; Sat, 22 Apr 2017 23:27:08 +0000 (UTC) (envelope-from bapt@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1235) id AD2A8145; Sat, 22 Apr 2017 23:27:07 +0000 (UTC) Date: Sun, 23 Apr 2017 01:27:07 +0200 From: Baptiste Daroussin To: Ian Lepore Cc: rgrimes@freebsd.org, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r316978 - in head: contrib/zstd etc/mtree lib lib/libzstd share/mk usr.bin usr.bin/zstd Message-ID: <20170422232707.uds2qkumtxm4ex54@ivaldir.net> References: <201704152005.v3FK5M2j002459@repo.freebsd.org> <201704152337.v3FNb2m1014053@pdx.rh.CN85.dnsmgr.net> <20170416073551.557czdcksdmmuz24@ivaldir.net> <1492898728.56859.13.camel@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="kvzbyrcxqyfoous5" Content-Disposition: inline In-Reply-To: <1492898728.56859.13.camel@freebsd.org> User-Agent: NeoMutt/20170306 (1.8.0) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 22 Apr 2017 23:27:08 -0000 --kvzbyrcxqyfoous5 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Apr 22, 2017 at 04:05:28PM -0600, Ian Lepore wrote: > On Sun, 2017-04-16 at 09:35 +0200, Baptiste Daroussin wrote: > > On Sat, Apr 15, 2017 at 04:37:02PM -0700, Rodney W. Grimes wrote: > > >=20 > > > And we need this in base for what great purpose??? > > >=20 > > zstandard is the successor to lz4, there are attempts to integrate > > zstandard in > > ZFS, Allan Jude is working on that, I am working on integrating in > > libstand to > > allow to boot a kernel compressed with zstandard or a mfsroot with > > zstandard, > > which would benefit lots of pxe users. > >=20 > > I have also added it to newsyslog(8) so users can benefit zstandard > > compression > > for the log files, which will consume less CPUs for greater > > compression that > > bzip2. On low ended boxes with low storage this is actually very > > useful as well. > >=20 > > I haven't checked yet the performances on my armv6 boxes, but on the > > low ended > > recent atom laptops I can tell this is already very useful. > >=20 > > Bapt >=20 > Does it also need to be added to the toolkit in /rescue? =A0The other > major compression tools in base are there. I'm not sure it is worth it, is it? Bapt --kvzbyrcxqyfoous5 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEgOTj3suS2urGXVU3Y4mL3PG3PloFAlj75sgACgkQY4mL3PG3 Plo96w/9FU09MoVXEIOAkQGxuwi5higqNBvDtzoKu0Xg8khTQ0QpuQDPJU8+HrCC kZNPsK4/kpyI5ek/gt6not5oy0YL/Uk/je5eYsYBvcKFAliCrB8bzLLc53wZsIWz ruXTRXQC6bDubWzUhki6fa5r0Zav0/kAssyjDBTCGG7qo35CAiFiqMYGvBdkNvtq daah4CRKwQbMXJ7+RJVERmU8Yzp65FXpGsgQgCOQrayCDt2xYTqNjLey3axOezou AgDV1I6d9JRFu6pJKIhj3YwQydFZh/UavEY9Inj9I48gtZ6Yji0OKm9PMGuFpWPe Nj41ke+/Z02u1rgFa5YtA3MFWAw0bjsBiw+xZuX//lZF6X+HN1t/0AfbB0hMjBH3 FznAuBdx9y/RdnD2DaVFY3HqpI2lDZ5bxBLG3c2OTdux2OjnCeBFspoeONP+lPcG q5i9V91jKLlrJJs3XBqhHcJt2Syurhybq2uBy/ATM0jb4BwZM5Nw4EfLAoy9xEA1 URpio346m+dpcI19z/AE0euuZnZpmibQqvGlq+1ph818s9MG5MMeQ/3p4Twjnd+i Kd16mEfQ+7cbE/hVr9XRKEphDiUSvgudTifhVQJvYIAWQ+DrPwmEPBRmIZgojJm2 N5I299wUA8qZQoxfyNp4Qi5xdqfm/1Rxe9xeCg2dDgZtt8N5Sdg= =qkp8 -----END PGP SIGNATURE----- --kvzbyrcxqyfoous5-- From owner-svn-src-head@freebsd.org Sat Apr 22 23:27:41 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D9D46D4B74B; Sat, 22 Apr 2017 23:27:41 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 91F6EE6E; Sat, 22 Apr 2017 23:27:41 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3MNReBK046134; Sat, 22 Apr 2017 23:27:40 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3MNRemm046133; Sat, 22 Apr 2017 23:27:40 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201704222327.v3MNRemm046133@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 22 Apr 2017 23:27:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317308 - head/tools/regression/geom_gpt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 22 Apr 2017 23:27:42 -0000 Author: ngie Date: Sat Apr 22 23:27:40 2017 New Revision: 317308 URL: https://svnweb.freebsd.org/changeset/base/317308 Log: gctl_test.t: more tweaks to try and update the code and get it functional (again?) - Make the logfile for $out be built off the basename for $cmd, instead of $cmd. (r317292 broke this assumption). - Rename $mntpt to $mntpt_prefix for clarity, as this variable is a prefix for mountpoints. - Reindent the umount directive block while here to match the rest of the code. MFC after: 5 weeks Sponsored by: Dell EMC Isilon Modified: head/tools/regression/geom_gpt/gctl_test.t Modified: head/tools/regression/geom_gpt/gctl_test.t ============================================================================== --- head/tools/regression/geom_gpt/gctl_test.t Sat Apr 22 23:06:53 2017 (r317307) +++ head/tools/regression/geom_gpt/gctl_test.t Sat Apr 22 23:27:40 2017 (r317308) @@ -29,8 +29,10 @@ use strict; use warnings; +use File::Basename; + my $disk = "/tmp/disk-$$"; -my $mntpt = "/tmp/mount-$$"; +my $mntpt_prefix = "/tmp/mount-$$"; my %steps = ( "000" => "gctl", @@ -137,7 +139,7 @@ if ($st != 0) { } chomp(my $cmd = `make '-V\${.OBJDIR}/\${PROG}'`); -my $out = "/tmp/$cmd.out"; +my $out = basename($cmd) . ".out"; # Make sure we have permission to use gctl... if (`$cmd` =~ "^FAIL Permission denied") { @@ -192,14 +194,14 @@ foreach my $key (sort keys %steps) { } unlink $out; } elsif ($action =~ "^mount") { - system("mkdir $mntpt-$args"); + system("mkdir $mntpt_prefix-$args"); system("newfs $args"); - system("mount -t ufs /dev/$args $mntpt-$args"); + system("mount -t ufs /dev/$args $mntpt_prefix-$args"); print "ok $nr \# mount($key)\n"; } elsif ($action =~ "^umount") { - system("umount $mntpt-$args"); - system("rmdir $mntpt-$args"); - print "ok $nr \# umount($key)\n"; + system("umount $mntpt_prefix-$args"); + system("rmdir $mntpt_prefix-$args"); + print "ok $nr \# umount($key)\n"; } $nr += 1; } From owner-svn-src-head@freebsd.org Sat Apr 22 23:30:04 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2D242D4B7F3; Sat, 22 Apr 2017 23:30:04 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D97F1FD9; Sat, 22 Apr 2017 23:30:03 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3MNU34D046281; Sat, 22 Apr 2017 23:30:03 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3MNU3el046280; Sat, 22 Apr 2017 23:30:03 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201704222330.v3MNU3el046280@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 22 Apr 2017 23:30:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317309 - head/tools/regression/geom_gpt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 22 Apr 2017 23:30:04 -0000 Author: ngie Date: Sat Apr 22 23:30:02 2017 New Revision: 317309 URL: https://svnweb.freebsd.org/changeset/base/317309 Log: gctl_test.t: improve error reporting with mdcfg and mount directives If the commands had failed previously, it would press on and result in a series of cascading failures. Fail early and continue on to the next case instead of executing additional commands after a previously failed series of steps. MFC after: 5 weeks Sponsored by: Dell EMC Isilon Modified: head/tools/regression/geom_gpt/gctl_test.t Modified: head/tools/regression/geom_gpt/gctl_test.t ============================================================================== --- head/tools/regression/geom_gpt/gctl_test.t Sat Apr 22 23:27:40 2017 (r317308) +++ head/tools/regression/geom_gpt/gctl_test.t Sat Apr 22 23:30:02 2017 (r317309) @@ -161,13 +161,15 @@ foreach my $key (sort keys %steps) { $res =~ s/%dev%/$dev/g; if ($action =~ "^gctl") { + my $errmsg = ""; system("$cmd $verbose $args | tee $out 2>&1"); - $st = `tail -1 $out`; - if ($st =~ "^$res") { - print "ok $nr \# gctl($key)\n"; - } else { - print "not ok $nr \# gctl($key) - $st\n"; + chomp($st = `tail -1 $out`); + if ($st ne $res) { + $errmsg = "\"$st\" (actual) != \"$res\" (expected)\n"; } + printf("%sok $nr \# gctl($key)%s\n", + ($errmsg eq "" ? "" : "not "), + ($errmsg eq "" ? "" : " - $errmsg")); unlink $out; } elsif ($action =~ "^mdcfg") { if ($args =~ "^create") { @@ -194,10 +196,18 @@ foreach my $key (sort keys %steps) { } unlink $out; } elsif ($action =~ "^mount") { - system("mkdir $mntpt_prefix-$args"); - system("newfs $args"); - system("mount -t ufs /dev/$args $mntpt_prefix-$args"); - print "ok $nr \# mount($key)\n"; + my $errmsg = ""; + mkdir("$mntpt_prefix-$args"); + if (system("newfs /dev/$args") == 0) { + if (system("mount /dev/$args $mntpt_prefix-$args") != 0) { + $errmsg = "mount failed"; + } + } else { + $errmsg = "newfs failed"; + } + printf("%sok $nr # mount($key)%s\n", + ($errmsg eq "" ? "" : "not "), + ($errmsg eq "" ? "" : " - $errmsg")); } elsif ($action =~ "^umount") { system("umount $mntpt_prefix-$args"); system("rmdir $mntpt_prefix-$args"); From owner-svn-src-head@freebsd.org Sat Apr 22 23:32:03 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DDA70D4BA3F for ; Sat, 22 Apr 2017 23:32:03 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1a.eu.mailhop.org (outbound1a.eu.mailhop.org [52.58.109.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7A3ED13B7 for ; Sat, 22 Apr 2017 23:32:02 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: e06389ce-27b3-11e7-b96e-2378c10e3beb X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 73.78.92.27 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [73.78.92.27]) by outbound1.eu.mailhop.org (Halon) with ESMTPSA id e06389ce-27b3-11e7-b96e-2378c10e3beb; Sat, 22 Apr 2017 23:31:59 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id v3MNVsEr006858; Sat, 22 Apr 2017 17:31:54 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1492903914.56859.31.camel@freebsd.org> Subject: Re: svn commit: r316978 - in head: contrib/zstd etc/mtree lib lib/libzstd share/mk usr.bin usr.bin/zstd From: Ian Lepore To: Baptiste Daroussin Cc: rgrimes@freebsd.org, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Sat, 22 Apr 2017 17:31:54 -0600 In-Reply-To: <20170422232707.uds2qkumtxm4ex54@ivaldir.net> References: <201704152005.v3FK5M2j002459@repo.freebsd.org> <201704152337.v3FNb2m1014053@pdx.rh.CN85.dnsmgr.net> <20170416073551.557czdcksdmmuz24@ivaldir.net> <1492898728.56859.13.camel@freebsd.org> <20170422232707.uds2qkumtxm4ex54@ivaldir.net> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: 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, 22 Apr 2017 23:32:04 -0000 On Sun, 2017-04-23 at 01:27 +0200, Baptiste Daroussin wrote: > On Sat, Apr 22, 2017 at 04:05:28PM -0600, Ian Lepore wrote: > > > > On Sun, 2017-04-16 at 09:35 +0200, Baptiste Daroussin wrote: > > > > > > On Sat, Apr 15, 2017 at 04:37:02PM -0700, Rodney W. Grimes wrote: > > > > > > > > > > > > And we need this in base for what great purpose??? > > > > > > > zstandard is the successor to lz4, there are attempts to > > > integrate > > > zstandard in > > > ZFS, Allan Jude is working on that, I am working on integrating > > > in > > > libstand to > > > allow to boot a kernel compressed with zstandard or a mfsroot > > > with > > > zstandard, > > > which would benefit lots of pxe users. > > > > > > I have also added it to newsyslog(8) so users can benefit > > > zstandard > > > compression > > > for the log files, which will consume less CPUs for greater > > > compression that > > > bzip2. On low ended boxes with low storage this is actually very > > > useful as well. > > > > > > I haven't checked yet the performances on my armv6 boxes, but on > > > the > > > low ended > > > recent atom laptops I can tell this is already very useful. > > > > > > Bapt > > Does it also need to be added to the toolkit in /rescue?  The other > > major compression tools in base are there. > I'm not sure it is worth it, is it? > > Bapt I'm not sure what "worth it" means.  The other compression tools are in there, I assume because there are recovery scenarios that require them.  If this new compression gets used in the base system, then perhaps it also would need to be in there. For example, if logs are compressed this new way, and you get into a recovery situation, then you might need to view the logs to figure out how to recover the system. -- Ian